1 Answer
- Newest
- Most votes
- Most comments
0
Hi,
As said in my answer to your initiai question, you must use Fn:Sub if you want to have ${Instance1.PrivateIp} properly substituted with its real value.
See examples on https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html
The following is closest to your use case is this one if you replace UserData with your SSM doc
UserData:
Fn::Base64:
!Sub |
#!/bin/bash -xe
yum update -y aws-cfn-bootstrap
/opt/aws/bin/cfn-init -v --stack ${AWS::StackName} --resource LaunchConfig --configsets wordpress_install --region ${AWS::Region}
/opt/aws/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource WebServerGroup --region ${AWS::Region}
If you don't use !Sub, you will remain with your variable name
Best,
Didier
Relevant content
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
Are quotes in !Ref MyRegiin necessary?
hi @Antonio_Lagrotteria, I tried without quotes as well but no luck.