In your AWS CloudFormation template, replace intrinsic functions with the imported values for every stack that references the exported output value of your stack.
For example, the imported value arn:aws:s3:::sample replaces the intrinsic functions Fn::ImportValue and !ImportValue in the following JSON and YAML templates.
JSON template with intrinsic function:
{
"Parameters": {
"parameterName": {
"Type": "String"
}
},
"Resources": {
"testParameter": {
"Type": "AWS::SSM::Parameter",
"Properties": {
"Description": "Test SSM Parameter",
"Name": {
"Ref": "parameterName"
},
"Type": "String",
"Value": {
"Fn::ImportValue": "sample-s3-bucket:Bucket-arn"
}
}
}
}
}
JSON template with imported value:
{
"Parameters": {
"parameterName": {
"Type": "String"
}
},
"Resources": {
"testParameter": {
"Type": "AWS::SSM::Parameter",
"Properties": {
"Description": "Test SSM Parameter",
"Name": { "Ref": "parameterName" },
"Type": "String",
"Value": "arn:aws:s3:::sample"
}
}
}
}
YAML template with intrinsic function:
Parameters:
parameterName:
Type: String
Resources:
testParameter:
Type: AWS::SSM::Parameter
Properties:
Description: Test SSM Parameter
Name: !Ref parameterName
Type: String
Value: !ImportValue sample-s3-bucket:Bucket-arn
YAML template with imported value:
Parameters:
parameterName:
Type: String
Resources:
testParameter:
Type: AWS::SSM::Parameter
Properties:
Description: Test SSM Parameter
Name: !Ref parameterName
Type: String
Value: arn:aws:s3:::sample