-
Notifications
You must be signed in to change notification settings - Fork 0
/
remote-state.yaml
50 lines (46 loc) · 1.3 KB
/
remote-state.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
Outputs:
RemoteStateBucketName:
Value: !Ref RemoteStateBucket
RemoteStateTableName:
Value: !Ref RemoteStateDynamoDB
Resources:
LoggingBucket:
Type: AWS::S3::Bucket
# DeletionPolicy: Retain
Properties:
BucketName: !Sub '${AWS::StackName}-tf-state-logging'
AccessControl: LogDeliveryWrite
VersioningConfiguration:
Status: Suspended
Tags:
- Key: "cost-center"
Value: "remote-state"
RemoteStateBucket:
Type: AWS::S3::Bucket
# DeletionPolicy: Retain
Properties:
BucketName: !Sub '${AWS::StackName}-tf-state'
AccessControl: Private
LoggingConfiguration:
DestinationBucketName: !Ref LoggingBucket
LogFilePrefix: !Sub '${AWS::StackName}-tf-state'
VersioningConfiguration:
Status: Enabled
Tags:
- Key: "cost-center"
Value: "remote-state"
RemoteStateDynamoDB:
Type: AWS::DynamoDB::Table
# DeletionPolicy: Retain
Properties:
AttributeDefinitions:
- AttributeName: "LockID"
AttributeType: "S"
BillingMode: PAY_PER_REQUEST
KeySchema:
- AttributeName: "LockID"
KeyType: "HASH"
TableName: !Sub '${AWS::StackName}-tf-state-locking'
Tags:
- Key: "cost-center"
Value: "remote-state"