3

I want to output public IP of my instance in cloud formation. This is the relevant part of my yaml file.

What attribute do I have to specify to get public IP. (Here myec2 is where I described my instance)

 <code>
 .
 .
 Outputs:
  instancedetails:
    Description: ec2 details
    Value: !GetAtt Myec2.instance
Dave M
  • 4,494
  • 21
  • 30
  • 30
aroN
  • 75
  • 1
  • 8

1 Answers1

3

Here are all the possible return values: AWS::EC2::Instance

I.e. in your case it will be !GetAtt Myec2.PublicIp

Unless of course you create ElasticIP in the stack in which case it would be !Ref MyEip (see Return Values section for AWS::EC2::EIP).

Hope that helps :)

MLu
  • 23,798
  • 5
  • 54
  • 81