Hi,
I've been needing to pass in a variable to CodePipeline when my EventBridge rule picks up when a specific tag is pushed in my CodeCommit repo. My EventBridge event pattern is below
{
"source": ["aws.codecommit"],
"detail-type": ["CodeCommit Repository State Change"],
"resources": ["arn:aws:codecommit:<region>:<id>:<repo>"],
"detail": {
"event": ["referenceCreated", "referenceUpdated"],
"repositoryName": ["<repo>"],
"referenceType": ["tag"],
"referenceName": [{
"prefix": "abc"
}]
}
}
I have one target, which is pointing at my CodePipeline. I have defined an input transformer where the input path is
{
"tag": "$.detail.referenceName"
}
and the input template is
{"variables":
[{
"defaultValue": "<tag>",
"description": "variable passed by eventbridge trigger",
"name": "IMAGETAG"
}]
I defined the input template using this link, I want it to update the pipeline with a pipeline level variable based off the reference name matched in the event pattern.
In my pipeline's build phase, I have defined the environment variable to be used in my buildspec file:
name: IMAGETAG, value: #{variables.IMAGETAG}, type:PLAINTEXT
This isn't working because the pipeline hasn't been updated with the variable set by EventBridge. I haven't seen many examples of this specifically. Any help is appreciated. Thanks!
Hi, That article is only for using a Github source; I am using a CodePipeline source, pointing to a CodeCommit repo.