forked from cloudtools/troposphere
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathS3_Bucket.py
More file actions
25 lines (18 loc) · 764 Bytes
/
Copy pathS3_Bucket.py
File metadata and controls
25 lines (18 loc) · 764 Bytes
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
# Converted from S3_Bucket.template located at:
# http://aws.amazon.com/cloudformation/aws-cloudformation-templates/
from troposphere import Output, Ref, Template
from troposphere.s3 import Bucket, PublicRead
t = Template()
t.add_description(
"AWS CloudFormation Sample Template S3_Bucket: Sample template showing "
"how to create a publicly accessible S3 bucket. "
"**WARNING** This template creates an Amazon S3 Bucket. "
"You will be billed for the AWS resources used if you create "
"a stack from this template.")
s3bucket = t.add_resource(Bucket("S3Bucket", AccessControl=PublicRead,))
t.add_output(Output(
"BucketName",
Value=Ref(s3bucket),
Description="Name of S3 bucket to hold website content"
))
print(t.to_json())