4

I Have a CodeCommit repository which needs to be built only when a tag is pushed to the remote. I have used a CloudWatch event to successfully trigger the CodePipeline using the following rule. I am following this document (referenceCreated event subsection).

{
  "source": [
    "aws.codecommit"
  ],
  "detail-type": [
    "CodeCommit Repository State Change"
  ],
  "resources": [
    "arn:aws:codecommit:xxx-repository"
  ],
  "detail": {
    "event": "referenceCreated",
    "repositoryName": "xxx-repository",
    "referenceName": "<Tag Name>",
    "referenceType": "tag"
  }
}

Following are my problems,

  1. How to access the name of the tag, which triggered the event, from this rule and passes it as a parameter (assuming I can use Input Transformer) to the CodePipeline?
  2. If that is possible, how can I make sure that the CodePipeline build the particular tag/changeset instead of the latest from the branch?
mumbo_s5
  • 161
  • 1
  • 14

0 Answers0