-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding support for KMS in StateMachine and Activity resources
- Loading branch information
Vaid Saraswat
committed
Aug 7, 2024
1 parent
f9b5d7a
commit 09350fd
Showing
16 changed files
with
1,136 additions
and
322 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...chineAndActivityWithCMKEncryptionConfigurationDefaultTestDeployAssert11207853.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
...ineAndActivityWithCMKEncryptionConfigurationDefaultTestDeployAssert11207853.template.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
...napshot/aws-stepfunctions-statemachine-and-activity-with-cmk-encryptionconfig.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
194 changes: 194 additions & 0 deletions
194
...pshot/aws-stepfunctions-statemachine-and-activity-with-cmk-encryptionconfig.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,194 @@ | ||
{ | ||
"Resources": { | ||
"Key961B73FD": { | ||
"Type": "AWS::KMS::Key", | ||
"Properties": { | ||
"KeyPolicy": { | ||
"Statement": [ | ||
{ | ||
"Action": "kms:*", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"AWS": { | ||
"Fn::Join": [ | ||
"", | ||
[ | ||
"arn:", | ||
{ | ||
"Ref": "AWS::Partition" | ||
}, | ||
":iam::", | ||
{ | ||
"Ref": "AWS::AccountId" | ||
}, | ||
":root" | ||
] | ||
] | ||
} | ||
}, | ||
"Resource": "*" | ||
}, | ||
{ | ||
"Action": [ | ||
"kms:Decrypt", | ||
"kms:DescribeKey", | ||
"kms:GenerateDataKey" | ||
], | ||
"Condition": { | ||
"StringEquals": { | ||
"aws:SourceAccount": { | ||
"Ref": "AWS::AccountId" | ||
}, | ||
"aws:SourceArn": { | ||
"Fn::Join": [ | ||
"", | ||
[ | ||
"arn:", | ||
{ | ||
"Ref": "AWS::Partition" | ||
}, | ||
":states:", | ||
{ | ||
"Ref": "AWS::Region" | ||
}, | ||
":", | ||
{ | ||
"Ref": "AWS::AccountId" | ||
}, | ||
":stateMachine/StateMachineWithCMKEncryptionConfiguration" | ||
] | ||
] | ||
}, | ||
"kms:EncryptionContext:aws:states:stateMachineArn": { | ||
"Fn::Join": [ | ||
"", | ||
[ | ||
"arn:", | ||
{ | ||
"Ref": "AWS::Partition" | ||
}, | ||
":states:", | ||
{ | ||
"Ref": "AWS::Region" | ||
}, | ||
":", | ||
{ | ||
"Ref": "AWS::AccountId" | ||
}, | ||
":stateMachine/StateMachineWithCMKEncryptionConfiguration" | ||
] | ||
] | ||
} | ||
} | ||
}, | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": "states.amazonaws.com" | ||
}, | ||
"Resource": "*" | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
} | ||
}, | ||
"UpdateReplacePolicy": "Retain", | ||
"DeletionPolicy": "Retain" | ||
}, | ||
"StateMachineWithCMKEncryptionConfigurationRoleA49EBB18": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": "sts:AssumeRole", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": "states.amazonaws.com" | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
} | ||
} | ||
}, | ||
"StateMachineWithCMKEncryptionConfiguration10773462": { | ||
"Type": "AWS::StepFunctions::StateMachine", | ||
"Properties": { | ||
"DefinitionString": "{\"StartAt\":\"Pass\",\"States\":{\"Pass\":{\"Type\":\"Pass\",\"End\":true}}}", | ||
"EncryptionConfiguration": { | ||
"KmsDataKeyReusePeriodSeconds": 75, | ||
"KmsKeyId": { | ||
"Fn::GetAtt": [ | ||
"Key961B73FD", | ||
"Arn" | ||
] | ||
}, | ||
"Type": "CUSTOMER_MANAGED_KMS_KEY" | ||
}, | ||
"RoleArn": { | ||
"Fn::GetAtt": [ | ||
"StateMachineWithCMKEncryptionConfigurationRoleA49EBB18", | ||
"Arn" | ||
] | ||
}, | ||
"StateMachineName": "StateMachineWithCMKEncryptionConfiguration", | ||
"StateMachineType": "STANDARD" | ||
}, | ||
"DependsOn": [ | ||
"StateMachineWithCMKEncryptionConfigurationRoleA49EBB18" | ||
], | ||
"UpdateReplacePolicy": "Delete", | ||
"DeletionPolicy": "Delete" | ||
}, | ||
"ActivityWithCMKEncryptionConfiguration3D01813A": { | ||
"Type": "AWS::StepFunctions::Activity", | ||
"Properties": { | ||
"EncryptionConfiguration": { | ||
"KmsDataKeyReusePeriodSeconds": 75, | ||
"KmsKeyId": { | ||
"Fn::GetAtt": [ | ||
"Key961B73FD", | ||
"Arn" | ||
] | ||
}, | ||
"Type": "CUSTOMER_MANAGED_KMS_KEY" | ||
}, | ||
"Name": "ActivityWithCMKEncryptionConfiguration" | ||
} | ||
} | ||
}, | ||
"Parameters": { | ||
"BootstrapVersion": { | ||
"Type": "AWS::SSM::Parameter::Value<String>", | ||
"Default": "/cdk-bootstrap/hnb659fds/version", | ||
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" | ||
} | ||
}, | ||
"Rules": { | ||
"CheckBootstrapVersion": { | ||
"Assertions": [ | ||
{ | ||
"Assert": { | ||
"Fn::Not": [ | ||
{ | ||
"Fn::Contains": [ | ||
[ | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5" | ||
], | ||
{ | ||
"Ref": "BootstrapVersion" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." | ||
} | ||
] | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...nteg/test/aws-stepfunctions/test/integ.state-machine-and-activity-cmk.js.snapshot/cdk.out
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
...g/test/aws-stepfunctions/test/integ.state-machine-and-activity-cmk.js.snapshot/integ.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.