[aws-codepipeline] Parameter overrides cannot use Fn::If
Describe the bug I'm trying to create optional parameter overrides for my CodePipeline but it's failing with:
Template Error: Encountered unsupported function: Fn::GetParam Supported functions are: [Fn::Base64, Fn::GetAtt, Fn::GetAZs, Fn::ImportValue, Fn::Join, Fn::Split, Fn::FindInMap, Fn::Select, Ref, Fn::Equals, Fn::If, Fn::Not, Condition, Fn::And, Fn::Or, Fn::Contains, Fn::EachMemberEquals, Fn::EachMemberIn, Fn::ValueOf, Fn::ValueOfAll, Fn::RefAll, Fn::Sub, Fn::Cidr]
To Reproduce
ParameterOverrides:
Fn::If: [
IsECS,
{
"ImageVersion" : { "Fn::GetParam" : ["BuildArtifact", "version.json", "version"]}
},
!Ref "AWS::NoValue"
]
Expected behavior When IsECS is evaluated as True ImageVersion should be set to the value defined in version.js in the BuildArtifact. When IsECS is evaluated as False no ParameterOverrides are set.
Version:
- OS - MacOS
- Programming Language - Python/AWS CLI
- CDK Version - NA
Hello -
To help us reproduce and debug this, can you provide us with more information -
- A more complete CDK app code that causes this error, so we can the rest of the pieces.
- The command that generates this error. Ex: is it
cdk synthorcdk deploy
Thanks.
Hi @kjenney, checking to see if you saw the above comment. If you still want us to investigate this, please do provide us more information as noted above, otherwise I will be closing this issue shortly.
Closing this issue since there hasn't been any activity on it in a while. Feel free to reopen.
@SomayaB, this seems to still be a bug on 1.68.0 (build a6a3f46). See below:
S3DeployAction.Builder.create()
.actionName("Deploy")
.extract(true)
.input(cdktfBuildOutput)
.bucket(deployBucket)
.objectKey(buildOutput.getParam("config.json", "commitID")))
.build()
results in "Encountered unsupported function: Fn::GetParam" due to the getParam method on the Artifact.
Not sure what you mean @lukepopp - the problem is you can't use Fn::GetParam in S3 Deploy action. You can only use Fn::GetParam in CloudFormation deployment actions, in the parameterOverrides property.