Skip to content

Commit

Permalink
Adding support for KMS in StateMachine and Activity resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaid Saraswat committed Aug 8, 2024
1 parent f9b5d7a commit 971290d
Show file tree
Hide file tree
Showing 16 changed files with 1,179 additions and 344 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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."
}
]
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 971290d

Please sign in to comment.