-
Notifications
You must be signed in to change notification settings - Fork 3
/
10-s3.yaml
79 lines (74 loc) · 2.38 KB
/
10-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
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
AWSTemplateFormatVersion: '2010-09-09'
Description: >
Create standard bucket for patching and maintenance logging
Parameters:
LoggingBucketNamePrefixParam:
Default: patching-logs
Description: S3 Logging bucket will be named `${LoggingBucketNamePrefixParam}-${AWS::AccountId}-${AWS::Region}`
Type: String
Resources:
LoggingS3Bucket:
Type: "AWS::S3::Bucket"
DeletionPolicy: Retain
Properties:
# AccessControl: String
BucketName: !Sub "${LoggingBucketNamePrefixParam}-${AWS::AccountId}-${AWS::Region}"
# CorsConfiguration:
# CORS Configuration
LifecycleConfiguration:
Rules:
-
# ExpirationDate: String
ExpirationInDays: 30
Id: Expire30Days
# NoncurrentVersionExpirationInDays: Integer
# NoncurrentVersionTransition (deprecated):
# NoncurrentVersionTransition type
# NoncurrentVersionTransitions:
# - NoncurrentVersionTransition type
# Prefix: String
Status: Enabled
# Transition (deprecated):
# Transition type
# Transitions:
# -
# StorageClass: GLACIER
# TransitionDate: String
# TransitionInDays: 30
# LoggingConfiguration:
# Logging Configuration
# NotificationConfiguration:
# Notification Configuration
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
# ReplicationConfiguration:
# Replication Configuration
Tags:
-
Key: Application
Value: infrastructure
# VersioningConfiguration:
# Versioning Configuration
# WebsiteConfiguration:
# Website Configuration Type
LoggingS3BucketPolicy:
Type: "AWS::S3::BucketPolicy"
DeletionPolicy: Retain
Properties:
Bucket: !Ref LoggingS3Bucket
PolicyDocument:
Version: '2012-10-17'
Statement:
- Sid: DenyInsecureTransport
Effect: Deny
Principal: '*'
Action: 's3:*'
Resource:
- !Sub 'arn:aws:s3:::${LoggingS3Bucket}/*'
- !Sub 'arn:aws:s3:::${LoggingS3Bucket}'
Condition:
Bool:
aws:SecureTransport: 'false'