-
Notifications
You must be signed in to change notification settings - Fork 0
/
codebuild-vpc-endpoints.yaml
115 lines (115 loc) · 3.66 KB
/
codebuild-vpc-endpoints.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
AWSTemplateFormatVersion: 2010-09-09
Parameters:
PrivateVpc:
Type: 'AWS::EC2::VPC::Id'
Description: Private VPC Id to use for RDS Custom DB Instances
PrivateSubnets:
Type: 'List<AWS::EC2::Subnet::Id>'
Description: Private Subnets to use for RDS Custom DB Instances
RouteTable:
Type: String
Description: >-
Route Table that must be associated with the PrivateSubnets and used by the Endpoints
VPC Endpoint
AllowedPattern: 'rtb-[0-9a-z]+'
SecurityGroupId:
Type: String
Description: >-
Security Group ID that must be associated with the PrivateSubnets and used by the Endpoints
VPC Endpoint
AllowedPattern: 'sg-[0-9a-z]+'
Resources:
DBSubnetGroup:
Type: 'AWS::RDS::DBSubnetGroup'
Properties:
DBSubnetGroupName: rds-custom-private
DBSubnetGroupDescription: RDS Custom Private Network
SubnetIds: !Ref PrivateSubnets
vpceS3:
Type: 'AWS::EC2::VPCEndpoint'
Properties:
RouteTableIds:
- !Ref RouteTable
ServiceName: !Sub 'com.amazonaws.${AWS::Region}.s3'
VpcId: !Ref PrivateVpc
vpceEC2:
Type: 'AWS::EC2::VPCEndpoint'
Properties:
VpcEndpointType: Interface
PrivateDnsEnabled: true
SubnetIds: !Ref PrivateSubnets
ServiceName: !Sub 'com.amazonaws.${AWS::Region}.ec2'
VpcId: !Ref PrivateVpc
SecurityGroupIds:
- !Ref SecurityGroupId
vpceEC2Messages:
Type: 'AWS::EC2::VPCEndpoint'
Properties:
VpcEndpointType: Interface
PrivateDnsEnabled: true
SubnetIds: !Ref PrivateSubnets
ServiceName: !Sub 'com.amazonaws.${AWS::Region}.ec2messages'
VpcId: !Ref PrivateVpc
SecurityGroupIds:
- !Ref SecurityGroupId
vpceMonitoring:
Type: 'AWS::EC2::VPCEndpoint'
Properties:
VpcEndpointType: Interface
PrivateDnsEnabled: true
SubnetIds: !Ref PrivateSubnets
ServiceName: !Sub 'com.amazonaws.${AWS::Region}.monitoring'
VpcId: !Ref PrivateVpc
SecurityGroupIds:
- !Ref SecurityGroupId
vpceSSM:
Type: 'AWS::EC2::VPCEndpoint'
Properties:
VpcEndpointType: Interface
PrivateDnsEnabled: true
SubnetIds: !Ref PrivateSubnets
ServiceName: !Sub 'com.amazonaws.${AWS::Region}.ssm'
VpcId: !Ref PrivateVpc
SecurityGroupIds:
- !Ref SecurityGroupId
vpceSSMMessages:
Type: 'AWS::EC2::VPCEndpoint'
Properties:
VpcEndpointType: Interface
PrivateDnsEnabled: true
SubnetIds: !Ref PrivateSubnets
ServiceName: !Sub 'com.amazonaws.${AWS::Region}.ssmmessages'
VpcId: !Ref PrivateVpc
SecurityGroupIds:
- !Ref SecurityGroupId
vpceLogs:
Type: 'AWS::EC2::VPCEndpoint'
Properties:
VpcEndpointType: Interface
PrivateDnsEnabled: true
SubnetIds: !Ref PrivateSubnets
ServiceName: !Sub 'com.amazonaws.${AWS::Region}.logs'
VpcId: !Ref PrivateVpc
SecurityGroupIds:
- !Ref SecurityGroupId
vpceEvents:
Type: 'AWS::EC2::VPCEndpoint'
Properties:
VpcEndpointType: Interface
PrivateDnsEnabled: true
SubnetIds: !Ref PrivateSubnets
ServiceName: !Sub 'com.amazonaws.${AWS::Region}.events'
VpcId: !Ref PrivateVpc
SecurityGroupIds:
- !Ref SecurityGroupId
vpceSecretsManager:
Type: 'AWS::EC2::VPCEndpoint'
Properties:
VpcEndpointType: Interface
PrivateDnsEnabled: true
SubnetIds: !Ref PrivateSubnets
ServiceName: !Sub 'com.amazonaws.${AWS::Region}.secretsmanager'
VpcId: !Ref PrivateVpc
SecurityGroupIds:
- !Ref SecurityGroupId
Outputs: {}