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,
- 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?
- If that is possible, how can I make sure that the CodePipeline build the particular tag/changeset instead of the latest from the branch?