Skip to content

Instantly share code, notes, and snippets.

@thecraftman
Last active July 16, 2021 20:30
Show Gist options
  • Save thecraftman/2f7b4126f148a0674fa372563d3a947f to your computer and use it in GitHub Desktop.
Save thecraftman/2f7b4126f148a0674fa372563d3a947f to your computer and use it in GitHub Desktop.
GetAtt intrinsic function
Parameters:
NameOfService:
Description: "The name of the service this stack is to be used for."
Type: String
KeyName:
Description: "Name of existing EC2 KeyPar to enable SSH access into the server"
Type: AWS::EC2::KeyPair::KeyName
Outputs:
WebsiteURL:
Description: Website URL for EC2 Instance
Value: !Sub 'http://${MyInstance.PublicDnsName}'
ServerDNS:
Value: !GetAtt
- MyInstance
- PublicDnsName
Mappings:
RegionMap:
us-east-1:
AMI: ami-1853ac65
us-west-1:
AMI: ami-bf5540df
eu-west-1:
AMI: ami-3bfab942
Resources:
MyInstance:
Type: "AWS::EC2::Instance"
Metadata:
AWS::CloudFormation::Init:
config:
packages:
yum:
httpd: []
php: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment