-
Notifications
You must be signed in to change notification settings - Fork 7
/
cfn.yaml
69 lines (67 loc) · 1.69 KB
/
cfn.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
AWSTemplateFormatVersion: '2010-09-09'
Description: AWS CloudFormation Template to deploy insecure infrastructure
Parameters:
CompanyName:
Description: Company Name
Type: String
Default: acme
Environment:
Description: Environment
Type: String
Default: dev
DBName:
Description: Name of the Database
Type: String
Default: db1
Password:
Description: Database Password
Type: String
NoEcho: True
MinLength: 1
MaxLength: 41
AllowedPattern: ^[a-zA-Z0-9]*$
LatestAmiId:
Type: AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>
Default: /aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2
Resources:
####################
### EC2 in VPC ###
####################
EC2Instance:
Type: AWS::EC2::Instance
Properties:
AvailabilityZone:
Fn::Select:
- 0
- Fn::GetAZs: ""
InstanceType: t2.nano
SecurityGroupIds:
- !Ref WebNodeSG
ImageId: !Ref LatestAmiId
SubnetId: !Ref WebSubnet
Tags:
- Key: Name
Value: !Sub "${AWS::AccountId}-${CompanyName}-${Environment}-ec2"
WebHostStorage:
# Unencrypted Volume
Type: AWS::EC2::Volume
Properties:
AvailabilityZone: !Select
- 0
- Fn::GetAZs: ""
#Encrypted: False
Size: 1
Tags:
- Key: Name
Value: !Sub "${AWS::AccountId}-${CompanyName}-${Environment}-ebs"
SomethingElse:
Type: AWS::EC2::Something
Properties:
AvailabilityZone: !Select
- 0
- Fn::GetAZs: ""
#Encrypted: False
Size: 1
Tags:
- Key: Name
Value: !Sub "${AWS::AccountId}-${CompanyName}-${Environment}-ebs"