-
Notifications
You must be signed in to change notification settings - Fork 1
/
Section 5 Parameters.yml
47 lines (44 loc) · 1.12 KB
/
Section 5 Parameters.yml
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
AWSTemplateFormatVersion: "2010-09-09"
Description: A sample template
Parameters:
MyKeyName:
Type: AWS::EC2::KeyPair::KeyName
Description: choose key name
MyInstanceType:
Type: AWS::SSM::Parameter::Value<String>
Description: choose instance type from the list
MyAZ:
Type: String
Description: choose A.Z from the list
Default: us-east-2a
AllowedValues:
- us-east-2a
- us-east-2b
- us-east-2c
Resources:
MyEC2Instance:
Type: "AWS::EC2::Instance"
Properties:
ImageId: "ami-0a0ad6b70e61be944"
InstanceType: !Ref MyInstanceType
KeyName: !Ref MyKeyName
SecurityGroups:
- !Ref MyFirstSG
AvailabilityZone: !Ref MyAZ
MyFirstSG:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: opening port 22 & 80
SecurityGroupIngress:
- IpProtocol: 'tcp'
ToPort: 22
FromPort: 22
CidrIp: 0.0.0.0/0
- IpProtocol: 'tcp'
ToPort: 80
FromPort: 80
CidrIp: 0.0.0.0/0
MyEIP:
Type: AWS::EC2::EIP
Properties:
InstanceId: !Ref MyEC2Instance