-
Notifications
You must be signed in to change notification settings - Fork 3
/
ec2instance-example1.yaml
58 lines (57 loc) · 1.26 KB
/
ec2instance-example1.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
AWSTemplateFormatVersion: 2010-09-09
# Define Parameters
Parameters:
# AMI ID
AMIid:
Type: String
# EC2 Type
EC2Type:
Type: String
# Subnet ID
SubnetID:
Type: String
# RootVolumeSize
RootVolumeSize:
Type: String
# Name Tag
EC2Name:
Type: String
# Name Tag
TeamTag:
Type: String
# Name Tag
EnvTag:
Type: String
# Key Name
KeyName:
Type: String
# Resource Definition
Resources:
MyEC2Instance:
Type: AWS::EC2::Instance
Properties:
ImageId:
Ref: AMIid # Reference to AMIid parameter
InstanceType:
Ref: EC2Type # Reference to EC2Type parameter
SubnetId:
Ref: SubnetID # Reference to SubnetId parameter
BlockDeviceMappings:
- DeviceName: /dev/xvda
Ebs:
VolumeType: gp2
VolumeSize:
Ref: RootVolumeSize # Reference to RootVolumeSize parameter
Encrypted: "true"
Tags:
- Key: "Name"
Value:
Ref: EC2Name # Reference to EC2Name parameter
- Key: "Team"
Value:
Ref: TeamTag # Reference to TeamTag parameter
- Key: "Env"
Value:
Ref: EnvTag # Reference to EnvTag parameter
KeyName:
Ref: KeyName # Reference to KeyName parameter