This repository was archived by the owner on Nov 7, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +70
-1
lines changed Expand file tree Collapse file tree 3 files changed +70
-1
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,21 @@ Parameters:
73
73
- BucketOwnerFullControl
74
74
- AwsExecRead
75
75
Default : " Private"
76
+ EnableStaticSite :
77
+ Description : enable static site
78
+ Type : String
79
+ AllowedValues :
80
+ - ' true'
81
+ - ' false'
82
+ Default : ' false'
83
+ StaticSiteIndex :
84
+ Description : Index document for the S3 bucket static site
85
+ Type : String
86
+ Default : ' index.html'
87
+ StaticSiteError :
88
+ Description : Error document for the S3 bucket static site
89
+ Type : String
90
+ Default : " 500.html"
76
91
Mappings : {}
77
92
Conditions :
78
93
UseLogging : !Equals
@@ -84,12 +99,20 @@ Conditions:
84
99
UseVersioning : !Equals
85
100
- !Ref EnableVersioning
86
101
- ' true'
102
+ UseAsStaticSite : !Equals
103
+ - !Ref EnableStaticSite
104
+ - ' true'
87
105
Resources :
88
106
S3bucket :
89
107
Type : ' AWS::S3::Bucket'
90
108
Properties :
91
109
BucketName : !Ref BucketName
92
110
AccessControl : !Ref BucketAccessControl
111
+ WebsiteConfiguration : !If
112
+ - UseAsStaticSite
113
+ - IndexDocument : !Ref StaticSiteIndex
114
+ ErrorDocument : !Ref StaticSiteError
115
+ - !Ref ' AWS::NoValue'
93
116
LifecycleConfiguration :
94
117
Rules :
95
118
- Id : GlacierRule
@@ -139,3 +162,8 @@ Outputs:
139
162
- S3bucket
140
163
- Arn
141
164
Description : Name of the Amazon S3 bucket
165
+ WebsiteURL :
166
+ Value : !GetAtt
167
+ - S3bucket
168
+ - WebsiteURL
169
+ Description : URL of the bucket that was created
Original file line number Diff line number Diff line change @@ -4,7 +4,11 @@ metadata:
4
4
name : s3bucket.aws-operator.com
5
5
spec :
6
6
versioning : true
7
- accessControl : Private
7
+ accessControl : PublicRead
8
+ website :
9
+ enabled : true
10
+ indexPage : index.html
11
+ errorPage : 500.html
8
12
logging :
9
13
enabled : false
10
14
prefix : " archive"
Original file line number Diff line number Diff line change 59
59
Logging prefix to attach to all logs in the bucket.
60
60
structKey : Prefix
61
61
templateKey : LoggingPrefix
62
+ - key : website
63
+ type : object
64
+ description : |
65
+ Defines the options for creating a static website
66
+ structKey : Website
67
+ templateKey : Website
68
+ properties :
69
+ - key : enabled
70
+ type : bool
71
+ false : true
72
+ description : |
73
+ Website Enabled configures the S3 Bucket as a static site
74
+ structKey : Enabled
75
+ templateKey : EnableStaticSite
76
+ - key : indexPage
77
+ type : string
78
+ default : " index.html"
79
+ description : |
80
+ Index document for the S3 bucket
81
+ structKey : IndexPage
82
+ templateKey : StaticSiteIndex
83
+ - key : errorPage
84
+ type : string
85
+ default : " 500.html"
86
+ description : |
87
+ Error document for the S3 bucket
88
+ structKey : ErrorPage
89
+ templateKey : StaticSiteError
62
90
output :
63
91
schema :
64
92
type : object
@@ -75,6 +103,13 @@ spec:
75
103
BucketARN is the full Amazon ARN for the bucket created
76
104
structKey : BucketARN
77
105
templateKey : BucketArn
106
+ - key : websiteURL
107
+ type : string
108
+ description : |
109
+ WebsiteURL is the DNS record for the static site
110
+ structKey : WebsiteURL
111
+ templateKey : WebsiteURL
112
+
78
113
additionalResources :
79
114
services :
80
115
- name : s3BucketSvc
95
130
value : " {{.Config.Region}}"
96
131
- key : bucketURL
97
132
value : " {{.Obj.Name}}.s3-{{.Config.Region}}.amazonaws.com"
133
+ - key : websiteURL
134
+ value : " {{.Obj.Output.WebsiteURL}}"
98
135
You can’t perform that action at this time.
0 commit comments