-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtest.json
168 lines (164 loc) · 4.41 KB
/
test.json
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "S3 Enforce Server Side Encryption Stack",
"Parameters": {
"AccessControl": {
"Default": "Private",
"Type": "String",
"Description": "The ACL to apply to this S3 bucket.",
"AllowedValues": [ "Private",
"PublicRead",
"PublicReadWrite",
"AuthenticatedRead",
"LogDeliveryWrite",
"BucketOwnerRead",
"BucketOwnerFullControl"
]
},
"VersioningConfigurationStatus": {
"Type": "String",
"Default": "Enabled",
"Description": "Whether or not to enable versioning on this bucket",
"AllowedValues": [
"Enabled",
"Suspended"
]
},
"LifecycleConfigurationStatus": {
"Type": "String",
"Default": "Enabled",
"Description": "Enables or disables lifecycle configuration",
"AllowedValues": [
"Enabled",
"Disabled"
]
},
"SubnetIDs" : {
"Description" : "Subnet IDs",
"Type" : "List<AWS::EC2::Subnet::Id>"
},
"NoncurrentVersionExpirationInDays": {
"Type": "Number",
"Description": "For buckets with versioning enabled (or suspended), specifies the time, in days, between when a new version of the object is uploaded to the bucket and when old versions of the object expire. When object versions expire, Amazon S3 permanently deletes them. If you specify a transition and expiration time, the expiration time must be later than the transition time.",
"Default": 30
},
"ApplicationName": {
"Type": "String",
"Description": "The name of this application"
},
"Environment": {
"Type": "String",
"Description": "The deployment environment for this application",
"Default": "dev",
"AllowedValues": [
"dev",
"test",
"int",
"stage",
"prod",
"prod1",
"prod2"
]
},
"AssetID": {
"Type": "String",
"Description": "The HUIT asset ID for this application"
}
},
"Resources" : {
"S3Bucket": { "Type" : "AWS::S3::Bucket",
"Properties" : {
"AccessControl" : {"Ref": "AccessControl"},
"BucketName" : {
"Fn::Join": [
"",
[
{
"Ref": "ApplicationName"
},
"-",
{
"Ref": "Environment"
},
"-bucket"
]
]},
"LifecycleConfiguration" : {
"Rules": [
{"NoncurrentVersionExpirationInDays": {"Ref": "NoncurrentVersionExpirationInDays"},
"Status": {"Ref": "LifecycleConfigurationStatus"}
}
]
},
"Tags": [
{
"Key": "Name",
"Value": {
"Fn::Join": [
"",
[
{
"Ref": "ApplicationName"
},
"-",
{
"Ref": "Environment"
},
"-bucket"
]
]
}
},
{
"Key": "environment",
"Value": {"Ref": "Environment"}
},
{
"Key": "product",
"Value": {"Ref": "ApplicationName"}
},
{
"Key": "huit_assetid",
"Value": {"Ref": "AssetID"}
}
],
"VersioningConfiguration" : {
"Status": {"Ref": "VersioningConfigurationStatus"}
}
}
},
"BucketPolicy": {
"Type": "AWS::S3::BucketPolicy",
"Properties": {
"Bucket": { "Ref": "S3Bucket" },
"PolicyDocument": {
"Version":"2012-10-17",
"Id":"PutObjPolicy",
"Statement": [
{
"Sid": "DenyUnEncryptedObjectUploads",
"Action": ["s3:PutObject"],
"Effect": "Deny",
"Resource": {
"Fn::Join": [
"",
[
"arn:aws:s3:::",
{"Ref": "S3Bucket"},
"/*"
]
]
},
"Condition": {
"StringNotEquals": {
"s3:x-amz-server-side-encryption": "aws:kms"
}
},
"Principal": "*"
}
]
}
}
}
}
}