- Newest
- Most votes
- Most comments
The issue is caused by the use of Fn::GetParam inside the CloudFormation template itself, which is not a supported function within the template syntax. The CloudFormation console throws an error because it only accepts specific intrinsic functions like Ref, Fn::Sub, Fn::Join, etc., and Fn::GetParam isn't one of them. This function is only meant to be used within AWS CodePipeline to pull values from artifacts, such as imagedefinitions.json, during the deploy stage — not within the template file.
In your pipeline configuration, the use of Fn::GetParam under the ParameterOverrides section is correct. This tells CodePipeline to extract the imageUri value from the specified file in the build artifact and pass it as a parameter when executing the CloudFormation stack update. What needs to be adjusted is the corresponding CloudFormation template (cloudformation-template.json) — it should have a declared parameter like ImageUri, and wherever you need to use that value (for example, in an ECS task definition), reference it using Ref or Fn::Sub.
To fix this, go into your template and remove any Fn::GetParam entries. Instead, define parameters for the values you're passing through the pipeline. For example, define ImageUri as a parameter and use "Ref": "ImageUri" where needed. This keeps the separation of concerns clear: CodePipeline handles the dynamic parameter injection, while the CloudFormation template sticks to standard functions. Once you’ve made this change, the error should disappear, and the pipeline will deploy your stack as expected.
Relevant content
- asked 3 years ago
