My code currently is working like this
DefinitionBody:
'Fn::Transform':
Name: AWS::Include
Parameters:
Location:
Fn::Sub: s3://${Bucket}/${AWS::StackName}/${File}
# Note: Bucket and File comes from Parameters in this case
Now I try to get {$File} dynamically using FindInMap
'Fn::Transform':
Name: AWS::Include
Parameters:
Location: !Sub
- s3://${value-from-parameters-section}/${AWS::StackName}/${spec}
- { spec: !FindInMap [ "Config", "type", "file"]}
But is throwing me this error:
Failed to digest functions within transform parameters, intrinsic functions in transform block must only contain parameter values or stack metadata
So, How I can achieve to dynamically change the File name inside the DefinitonBody?