Reputation: 366
My template creates a windows stack. Template's useddata creates a machine object (say computer name) and windows instance in ASG creates successfully. I'm trying to output private IP Address and FQDN - Hostname in cfn outputs. Do you guys have any suggestions or any sample template which does the similar trick?
Upvotes: 0
Views: 748
Reputation: 2970
If you are creating an autoscaling group, your CloudFormation object does not include the resulting server instance, thus you cannot interact with it.
If you create EC2 individual instances, the right way to get this data would be Fn::GetAtt.
In your case your output block should look like (given EC2 object called MyInstance):
"Outputs" : {
"PrivateIp" : {
"Description" : "MyInstance Private IP Address",
"Value" : { "Fn::GetAtt" : [ "MyInstance", "PrivateIp" ] }
}
}
For FQDN you can use:
{ "Fn::GetAtt" : [ "MyInstance", "PublicDnsName" ] }
Upvotes: 2