-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathasg-big.yaml
52 lines (48 loc) · 1.44 KB
/
asg-big.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
---
AWSTemplateFormatVersion: "2010-09-09"
Description: "Create an EC2 Instance and Security Group"
Parameters:
KeyName:
Description: "Existing Key Pair Name"
Type: AWS::EC2::KeyPair::KeyName
ConstraintDescription: "Must be the name of an existing Key Pair"
InstanceType:
Description: "Instance Type"
Type: String
Default: "t3.nano"
AllowedValues: [t3.nano, t3.micro, t3.small, t3.medium]
LatestAmiId:
Type: AWS::EC2::Image::Id
Default: "ami-00a845a11b3d1f308"
Resources:
InstanceSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: "Enable SSH Access"
GroupName: "CFN ASG SSH"
VpcId: "vpc-0fb7fa6c01ca01f82"
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: 22
ToPort: 22
CidrIp: "0.0.0.0/0"
LaunchConfiguration:
Type: AWS::AutoScaling::LaunchConfiguration
Properties:
InstanceType:
Ref: "InstanceType"
SecurityGroups:
-
Ref: "InstanceSecurityGroup"
KeyName:
Ref: "KeyName"
ImageId:
Ref: "LatestAmiId"
AutoScalingGroup:
Type: AWS::AutoScaling::AutoScalingGroup
Properties:
LaunchConfigurationName:
Ref: LaunchConfiguration
MinSize: '27'
MaxSize: '27'
VPCZoneIdentifier: ["subnet-0ddd5c04486825854", "subnet-03c1e81a45ba28028"]