-
Notifications
You must be signed in to change notification settings - Fork 2
/
stack.template
58 lines (55 loc) · 1.46 KB
/
stack.template
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
AWSTemplateFormatVersion: 2010-09-09
Description: Terraform remote state stack
Parameters:
StateBucketNamePrefix:
Description: Name prefix of the state bucket
Type: String
Default: terraform-state
LockTableName:
Description: Name of the lock table
Type: String
Default: terraform-state
Resources:
StateBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Sub "${StateBucketNamePrefix}-${AWS::AccountId}"
VersioningConfiguration:
Status: Enabled
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: aws:kms
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
LockTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: !Ref LockTableName
AttributeDefinitions:
- AttributeName: LockID
AttributeType: S
KeySchema:
- AttributeName: LockID
KeyType: HASH
BillingMode: PROVISIONED
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
Outputs:
StateBucket:
Description: Name of the state bucket
Value: !Ref StateBucket
StateBucketArn:
Description: ARN of the state bucket
Value: !GetAtt
- StateBucket
- Arn
DynamoDbArn:
Description: ARN of the Dynamo Table
Value: !GetAtt
- LockTable
- Arn