Skip to content

Commit

Permalink
Enabling S3 Bucket Keys (widdix#531)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Wittig <[email protected]>
  • Loading branch information
andreaswittig and michaelwittig committed Feb 22, 2021
1 parent 93d18d5 commit 357a5ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion operations/terraform-state.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ Resources:
Properties:
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
- BucketKeyEnabled: true
ServerSideEncryptionByDefault:
KMSMasterKeyID: {'Fn::ImportValue': !Sub '${ParentKmsKeyStack}-KeyArn'}
SSEAlgorithm: 'aws:kms'
BucketName: !Ref TerraformStateIdentifier
Expand Down
2 changes: 1 addition & 1 deletion state/s3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Resources:
QueueConfigurations:
- !If [HasS3VirusScan, {Event: 's3:ObjectCreated:*', Queue: {'Fn::ImportValue': !Sub '${ParentS3VirusScanStack}-ScanQueueArn'}}, !Ref 'AWS::NoValue']
VersioningConfiguration: !If [HasVersioning, {Status: Enabled}, !If [HadVersioning, {Status: Suspended}, !Ref 'AWS::NoValue']]
BucketEncryption: !If [HasKmsKey, {ServerSideEncryptionConfiguration: [{ServerSideEncryptionByDefault: {KMSMasterKeyID: {'Fn::ImportValue': !Sub '${ParentKmsKeyStack}-KeyArn'}, SSEAlgorithm: 'aws:kms'}}]}, !Ref 'AWS::NoValue']
BucketEncryption: !If [HasKmsKey, {ServerSideEncryptionConfiguration: [{BucketKeyEnabled: true, ServerSideEncryptionByDefault: {KMSMasterKeyID: {'Fn::ImportValue': !Sub '${ParentKmsKeyStack}-KeyArn'}, SSEAlgorithm: 'aws:kms'}}]}, !Ref 'AWS::NoValue']
BucketPolicy:
Type: 'AWS::S3::BucketPolicy'
Properties:
Expand Down

0 comments on commit 357a5ec

Please sign in to comment.