0

I am trying to trigger the code pipeline from Amazon EventBridge when a tag push is made into codecommit.

what I am trying to achieve is

git tag v0.0.0-dev >> triggering development event rule and running development pipeline

git tag v0.0.0-stage >> triggering staging event rule and running staging pipeline

git tag v0.0.0-prod >> triggering production event rule and running production pipeline

with the following rule I was able to trigger the individual pipeline with matching string at prefix

{
  "source": [
    "aws.codecommit"
  ],
  "detail-type": [
    "CodeCommit Repository State Change"
  ],
  "resources": [
    "arn:aws:codecommit:ap-southeast-2:12345678910:reponame"
  ],
  "detail": {
    "event": [
      "referenceCreated",
      "referenceUpdated"
    ],
    "referenceType": [
      "tag"
    ],
    "referenceName": [
      {
        "prefix": "stage"
      }
    ]
  }
}

ie instead of v0.0.0-stage I need to use stage-v0.0.0

Is there any event pattern we can use such that the required triggering string comes anywhere in the tag or at least at the end.

sandeep krishna
  • 415
  • 2
  • 9
  • 28

2 Answers2

0

I do not see any option for suffix or endsWith in the event bridge documentation. You can check all the filtering pattern in the link.

nirvana124
  • 903
  • 1
  • 9
  • 12
0

You can hook it up with a Lambda function where you define which tag should be used with regular expressions.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 30 '21 at 19:54