-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAWS-STL-Meetup-06.yaml
74 lines (61 loc) · 1.46 KB
/
AWS-STL-Meetup-06.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Add and attach an Internet Gateway
Parameters:
VpcCidr:
Default: 10.10.0.0/16
Type: String
PublicSubnetCidr:
Default: 10.10.0.0/24
Type: String
ImageId:
Default: ami-0d8f6eb4f641ef691
Type: String
InstanceType:
Default: t3.micro
Type: String
KeyName:
Default: AWS-STL-Meetup
Type: String
WebInstanceIp:
Default: 10.10.0.10
Type: String
Resources:
Vpc:
Type: "AWS::EC2::VPC"
Properties:
CidrBlock: !Ref VpcCidr
PublicSubnet:
Type: "AWS::EC2::Subnet"
Properties:
CidrBlock: !Ref PublicSubnetCidr
VpcId: !Ref Vpc
WebSecurityGroup:
Type: "AWS::EC2::SecurityGroup"
Properties:
GroupDescription: Web Security Group
SecurityGroupIngress:
- CidrIp: 0.0.0.0/0
FromPort: 80
IpProtocol: tcp
ToPort: 80
VpcId: !Ref Vpc
WebInstance:
Type: "AWS::EC2::Instance"
Properties:
ImageId: !Ref ImageId
InstanceType: !Ref InstanceType
KeyName: !Ref KeyName
SecurityGroupIds:
- !Ref WebSecurityGroup
SubnetId: !Ref PublicSubnet
PrivateIpAddress: !Ref WebInstanceIp
WebInstanceElasticIp:
Type: "AWS::EC2::EIP"
Properties:
InstanceId: !Ref WebInstance
InternetGateway:
Type: "AWS::EC2::InternetGateway"
InternetGatewayAttachment:
Type: "AWS::EC2::VPCGatewayAttachment"
Properties:
InternetGatewayId: !Ref InternetGateway
VpcId: !Ref Vpc