daily pastebin goal
60%
SHARE
TWEET

Untitled

a guest Jan 20th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. AWSTemplateFormatVersion: '2010-09-09'
  2. Description: 'AWS CloudFormation Sample Template'
  3.  
  4.  
  5.  
  6. Parameters:
  7.   KeyName:
  8.     Type: AWS::EC2::KeyPair::KeyName
  9.     Default: keypair
  10.   InstanceType:
  11.     Type: String
  12.     Default: t2.micro
  13.   ImageId:
  14.     Type: String
  15.     Default: ami-08935252a36e25f85
  16.  
  17.  
  18. Resources:
  19.   EC2Instance:
  20.     Type: AWS::EC2::Instance
  21.     Properties:
  22.       InstanceType: !Ref InstanceType
  23.       SecurityGroups:
  24.         - Ref: InstanceSecurityGroup
  25.       KeyName: !Ref KeyName
  26.       ImageId: !Ref  ImageId
  27.   InstanceSecurityGroup:
  28.     Type: AWS::EC2::SecurityGroup
  29.     Properties:
  30.       GroupDescription: Enable SSH access via port 22
  31.       SecurityGroupIngress:
  32.       - IpProtocol: tcp
  33.         FromPort: '22'
  34.         ToPort: '22'
  35.  
  36.  
  37. Outputs:
  38.   InstanceId:
  39.     Description: InstanceId of the newly created EC2 instance
  40.     Value:
  41.       Ref: EC2Instance
  42.   AZ:
  43.     Description: Availability Zone of the newly created EC2 instance
  44.     Value:
  45.       Fn::GetAtt:
  46.       - EC2Instance
  47.       - AvailabilityZone
  48.   PublicDNS:
  49.     Description: Public DNSName of the newly created EC2 instance
  50.     Value:
  51.       Fn::GetAtt:
  52.       - EC2Instance
  53.       - PublicDnsName
  54.   PublicIP:
  55.     Description: Public IP address of the newly created EC2 instance
  56.     Value:
  57.       Fn::GetAtt:
  58.       - EC2Instance
  59.       - PublicIp
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top