forked from aws-cloudformation/cfn-lint
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproperties_ec2_vpc.yaml
More file actions
66 lines (66 loc) · 1.78 KB
/
properties_ec2_vpc.yaml
File metadata and controls
66 lines (66 loc) · 1.78 KB
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
---
AWSTemplateFormatVersion: "2010-09-09"
Description: >
AWS EC2 Good Template
Parameters:
cidrBlockAllowedPattern:
Type: String
AllowedPattern: '^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$'
cidrBlockAllowedValues:
Type: String
AllowedValues:
- '127.0.0.1/32'
- '8.8.8.8/32'
cidrBlockAllowedPatternValues:
Type: String
AllowedPattern: '^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$'
AllowedValues:
- '127.0.0.1/32'
- '8.8.8.8/32'
cidrBlockSsm:
Type: AWS::SSM::Parameter::Value<String>
Default: /Infra/VpcCidr
vpcTenancy:
Type: String
AllowedValues:
- default
- dedicated
Resources:
myVpc1:
Type: AWS::EC2::VPC
Properties:
CidrBlock: !Ref cidrBlockAllowedPattern
InstanceTenancy: default
myVpc2:
Type: AWS::EC2::VPC
Properties:
InstanceTenancy: !Ref vpcTenancy
CidrBlock: !Ref cidrBlockAllowedPattern
myVpc3:
Type: AWS::EC2::VPC
Properties:
InstanceTenancy: !Ref vpcTenancy
CidrBlock: !Ref cidrBlockAllowedValues
myVpc4:
Type: AWS::EC2::VPC
Properties:
InstanceTenancy: !Ref vpcTenancy
CidrBlock: !Ref cidrBlockAllowedPatternValues
myVpc5:
Type: AWS::EC2::VPC
Properties:
InstanceTenancy: dedicated
CidrBlock: !Ref cidrBlockSsm
mySubnet21:
Type: AWS::EC2::Subnet
Properties:
CidrBlock:
Fn::Select:
- 0
- !Cidr [!Ref cidrBlockAllowedPattern, 3, 16]
VpcId: vpc-1234567
mySubnet22:
Type: AWS::EC2::Subnet
Properties:
CidrBlock: !Ref cidrBlockAllowedPattern
VpcId: vpc-1234567