-
Notifications
You must be signed in to change notification settings - Fork 0
/
single-ec2-instance-simple.yaml
52 lines (49 loc) · 1.71 KB
/
single-ec2-instance-simple.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
Metadata:
# Control the UI display when running this template from the AWS Management Console:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: "EC2 Configuration"
Parameters:
- VM-SecurityGroup
#Parameters:
# VM-SecurityGroup:
# Type: String
#Parameters:
#SubnetId: !stack_output vpc-multiple-az.yml::PrivateSubnetA
# SubnetId: !stack_output "vpc/vpc-multiple-az::PrivateSubnetA"
#SubnetId: !stack_output "vpc-multiple-az.yaml::PrivateSubnetA"
sceptre_user_data:
SubnetId: !stack_output vpc/vpc-multiple-az.yaml::PrivateSubnetA
Resources:
DefEc2SecGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Enable SSH access via port 22
VpcId: "vpc-0f6bc83de066c878c"
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: '22'
ToPort: '22'
CidrIp: '0.0.0.0/0'
EC2Instance:
Type: AWS::EC2::Instance
Properties:
InstanceType: 't2.small'
# Ref: InstanceType
#SecurityGroups:
#- !Ref DefEc2SecGroup
# - !Ref DefEc2SecGroup
# - Ref: DefEc2SecGroup
SecurityGroupIds:
- !GetAtt DefEc2SecGroup.GroupId
KeyName: '2019'
ImageId: 'ami-ea26ce85'
# SubnetId: 'subnet-0bb97fdbf1e019f7c'
#SubnetId: !stack_output vpc-multiple-az::PrivateSubnetA
#SubnetId: !stack_output "vpc-multiple-az.yaml::PrivateSubnetA"
# SubnetId: !stack_output "vpc/vpc-multiple-az.yaml::PrivateSubnetA"
#SubnetId: "!stack_output vpc/vpc-multiple-az.yaml::PrivateSubnetA"
#SubnetId: !stack_output vpc/vpc-multiple-az.yaml::PrivateSubnetA
#SubnetId: !Ref PublicSubnetA