-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsupport.yaml
More file actions
111 lines (105 loc) · 2.8 KB
/
support.yaml
File metadata and controls
111 lines (105 loc) · 2.8 KB
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
AWSTemplateFormatVersion: 2010-09-09
Description: Template for expense app support resources
Parameters:
Stage:
Type: String
Description: Deployment environment (e.g., dev, test, or prod)
AllowedValues:
- dev
- test
- prod
Conditions:
ProdDeployment: !Equals
- !Ref Stage
- prod
Resources:
s3Resources:
DependsOn: s3Logs
Type: 'AWS::S3::Bucket'
UpdateReplacePolicy: Retain
DeletionPolicy: Retain
Properties:
AccessControl: Private
BucketName: !If
- ProdDeployment
- case-consulting-expense-app-resources-prod
- !Join
- ''
- - case-expense-app-resources-
- !Ref Stage
VersioningConfiguration:
Status: Enabled
LoggingConfiguration:
DestinationBucketName: !Ref s3Logs
LogFilePrefix: s3-logs/resources/
Tags:
- Key: Application
Value: expense-app
- Key: Stage
Value: !Ref Stage
deployments:
Type: 'AWS::S3::Bucket'
Properties:
BucketName: !If
- ProdDeployment
- case-consulting-expense-app-deployments-prod
- !Join
- ''
- - case-expense-app-deployments-
- !Ref Stage
LifecycleConfiguration:
Rules:
- Id: Remove previous deployment versions
ExpirationInDays: 60
Status: Enabled
LoggingConfiguration:
DestinationBucketName: !If
- ProdDeployment
- case-consulting-expense-app-logs-prod
- !Join
- ''
- - case-expense-app-logs-
- !Ref Stage
LogFilePrefix: s3-logs/deployments/
Tags:
- Key: Application
Value: expense-app
- Key: Stage
Value: !Ref Stage
s3Logs:
Type: 'AWS::S3::Bucket'
UpdateReplacePolicy: Retain
DeletionPolicy: Retain
Properties:
AccessControl: LogDeliveryWrite
OwnershipControls:
Rules:
- ObjectOwnership: ObjectWriter
BucketName: !If
- ProdDeployment
- case-consulting-expense-app-logs-prod
- !Join
- ''
- - case-expense-app-logs-
- !Ref Stage
LifecycleConfiguration:
Rules:
- Id: Purge old log files
ExpirationInDays: 30
Status: Enabled
Tags:
- Key: Application
Value: expense-app
- Key: Stage
Value: !Ref Stage
Outputs:
s3LogsBucketName:
Description: Name of the logging bucket
Value: !Ref s3Logs
Export:
Name: !Join ["-", [!Ref Stage, expense-app-logging-bucket-name]]
s3LogsDomainName:
Description: Domain name of the logging bucket
Value: !GetAtt s3Logs.DomainName
Export:
Name: !Join ["-", [!Ref Stage, expense-app-logging-bucket-domain-name]]