forked from widdix/aws-cf-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvpc-endpoint-s3.yaml
32 lines (32 loc) · 990 Bytes
/
vpc-endpoint-s3.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
---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'VPC: Endpoint to S3 for private subnets, a cloudonaut.io template, contributed by https://github.com/btsuhako'
Metadata:
'AWS::CloudFormation::Interface':
ParameterGroups:
- Label:
default: 'Parent Stacks'
Parameters:
- ParentVPCStack
Parameters:
ParentVPCStack:
Description: Stack name of parent VPC stack based on vpc/vpc-*azs.yaml template.
Type: String
Resources:
EndpointS3:
Type: 'AWS::EC2::VPCEndpoint'
Properties:
RouteTableIds:
- 'Fn::ImportValue': !Sub '${ParentVPCStack}-RouteTablePrivate'
ServiceName: !Sub 'com.amazonaws.${AWS::Region}.s3'
VpcId:
'Fn::ImportValue': !Sub '${ParentVPCStack}-VPC'
Outputs:
TemplateID:
Description: 'cloudonaut.io template id'
Value: 'vpc/vpc-endpoint-s3'
Endpoint:
Description: 'The VPC endpoint to S3.'
Value: !Ref EndpointS3
Export:
Name: !Sub '${AWS::StackName}-EndpointS3'