Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(codepipeline-actions): add KMSEncryptionKeyARN for S3DeployAction #24536

Merged
merged 68 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
3260703
Add KMSEncryptionKeyARN
hussainak Mar 9, 2023
6529ff3
Merge branch 'main' into main
hussainak Mar 9, 2023
464021a
Added KMSEncryptionKeyARN info for S3DeployAction
hussainak Mar 9, 2023
c9d3e02
Add KMSEncryptionKeyARN for S3DeployAction
hussainak Mar 9, 2023
24490b5
S3 Deploy Action KMS Encryption ARN
Mar 9, 2023
9ea81e0
Merge branch 'main' of https://github.com/hussainak/aws-cdk
Mar 9, 2023
b384c45
Add integration test
Mar 9, 2023
53c33b1
KMSEncryptionKeyARN inclusion in integration tests
Mar 9, 2023
38aec24
Merge branch 'main' into main
hussainak Mar 9, 2023
e49cf2c
Not doing integ tests
Mar 9, 2023
beef056
Merge branch 'main' into main
hussainak Mar 9, 2023
fb2115e
Add IKey instead of string to encryptionKey param
Mar 10, 2023
d795b43
Merge branch 'main' of https://github.com/hussainak/aws-cdk
Mar 10, 2023
6c121fb
Add bucket encryption and key to the pipeline
Mar 10, 2023
95ec3ac
Rollback root level readme
Mar 13, 2023
f1251fb
Merge branch 'main' into main
hussainak Mar 13, 2023
7f17b89
Merge branch 'main' into main
hussainak Mar 14, 2023
b149706
Merge branch 'main' into main
hussainak Mar 14, 2023
a2db654
Merge branch 'main' into main
hussainak Mar 15, 2023
653d313
Merge branch 'main' into main
hussainak Mar 15, 2023
877715e
Merge branch 'main' into main
hussainak Mar 16, 2023
f04277a
Merge branch 'main' into main
hussainak Mar 19, 2023
9bf869e
Merge branch 'main' into main
hussainak Mar 27, 2023
34da951
Added expected KMS key value
Mar 30, 2023
b6a5cc6
Merge
Apr 3, 2023
07bd564
Merge
Apr 3, 2023
61af06b
Merge branch 'aws-main'
Apr 3, 2023
50ad669
Merge branch 'main' of https://github.com/aws/aws-cdk into aws-main
Apr 3, 2023
43d5690
Revert "Merge branch 'main' of https://github.com/aws/aws-cdk into aw…
Apr 3, 2023
19087b2
Merge from aws-cdk
Apr 3, 2023
7a1fac5
Merge branch 'main' into main
hussainak Apr 3, 2023
93808a7
Merge branch 'main' into main
hussainak Apr 3, 2023
fc11079
Merge branch 'main' into main
hussainak Apr 5, 2023
20bcd5d
Merge branch 'main' into main
hussainak Apr 5, 2023
ebba46b
Merge branch 'main' into main
hussainak Apr 6, 2023
a51d6a7
Merge branch 'main' into main
hussainak Apr 11, 2023
b86edee
Merge branch 'main' into main
hussainak Apr 13, 2023
15cbd4b
Merge branch 'main' into main
hussainak Apr 14, 2023
1fb978a
Merge branch 'main' into main
hussainak Apr 17, 2023
e881279
Merge branch 'main' into main
hussainak Apr 18, 2023
706e00d
Merge branch 'main' into main
hussainak Apr 19, 2023
d3ce634
Merge branch 'main' into main
hussainak Apr 19, 2023
a691732
Merge branch 'main' into main
hussainak Apr 20, 2023
bd7ea13
Merge branch 'main' into main
hussainak Apr 20, 2023
0b774ce
Merge branch 'main' into main
hussainak Apr 21, 2023
23b7c19
Add encryptionKey for S3DeployAction
hussainak Apr 21, 2023
7d36aa7
Merge branch 'main' into main
hussainak Apr 24, 2023
caea320
Merge branch 'main' into main
hussainak Apr 25, 2023
6016657
Merge branch 'main' into main
hussainak Apr 27, 2023
50bcffd
Merge branch 'main' into main
hussainak Apr 27, 2023
70dcf17
Merge branch 'main' into main
hussainak Apr 28, 2023
c0b702b
Merge branch 'main' into main
hussainak May 4, 2023
c78098a
Merge branch 'main' into main
hussainak May 5, 2023
6d9ba1a
Merge branch 'main' into main
hussainak May 5, 2023
a4bcf86
Merge branch 'main' into main
hussainak May 8, 2023
deb6217
Merge branch 'main' into main
hussainak May 9, 2023
ae5de37
Merge branch 'main' into main
hussainak May 10, 2023
b6f2c01
Merge branch 'main' into main
hussainak May 10, 2023
28ebf2a
Merge branch 'main' into main
hussainak May 10, 2023
ed84b2b
Merge branch 'main' into main
hussainak May 11, 2023
15be46c
Merge branch 'main' into main
hussainak May 12, 2023
429b97b
Merge branch 'main' into main
hussainak May 15, 2023
b63c481
Merge branch 'main' into main
hussainak May 16, 2023
db65e51
Merge branch 'main' into main
hussainak May 17, 2023
e324820
Merge branch 'main' into main
hussainak May 18, 2023
7844db7
Fixed integ tests
otaviomacedo May 18, 2023
efc0680
Replaced anyValue() with a more strict check
otaviomacedo May 18, 2023
3835769
Merge branch 'main' into main
mergify[bot] May 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
}
}
},
"c77c225bf996813c66f962ac8da785aa5fa677d3c2a632c3743e4075e07a194e": {
"0e8ab65ec77f46df122d00ad20da666bb3461c6aee65675b4a7a64b8b284c5a9": {
"source": {
"path": "aws-cdk-codepipeline-s3-deploy.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "c77c225bf996813c66f962ac8da785aa5fa677d3c2a632c3743e4075e07a194e.json",
"objectKey": "0e8ab65ec77f46df122d00ad20da666bb3461c6aee65675b4a7a64b8b284c5a9.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,59 @@
{
"Resources": {
"EnvVarEncryptKey1A7CABDB": {
"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": "*"
}
],
"Version": "2012-10-17"
},
"Description": "sample key"
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
},
"PipelineBucketB967BD35": {
"Type": "AWS::S3::Bucket",
"Properties": {
"BucketEncryption": {
"ServerSideEncryptionConfiguration": [
{
"ServerSideEncryptionByDefault": {
"KMSMasterKeyID": {
"Fn::GetAtt": [
"EnvVarEncryptKey1A7CABDB",
"Arn"
]
},
"SSEAlgorithm": "aws:kms"
}
}
]
},
"Tags": [
{
"Key": "aws-cdk:auto-delete-objects",
Expand Down Expand Up @@ -369,6 +420,22 @@
}
]
},
{
"Action": [
"kms:Decrypt",
"kms:DescribeKey",
"kms:Encrypt",
"kms:GenerateDataKey*",
"kms:ReEncrypt*"
],
"Effect": "Allow",
"Resource": {
"Fn::GetAtt": [
"EnvVarEncryptKey1A7CABDB",
"Arn"
]
}
},
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
Expand Down Expand Up @@ -462,7 +529,13 @@
"Extract": "false",
"ObjectKey": "key",
"CannedACL": "private",
"CacheControl": "public, max-age=43200"
"CacheControl": "public, max-age=43200",
"KMSEncryptionKeyARN": {
"Fn::GetAtt": [
"EnvVarEncryptKey1A7CABDB",
"Arn"
]
}
},
"InputArtifacts": [
{
Expand Down Expand Up @@ -515,6 +588,15 @@
}
],
"ArtifactStore": {
"EncryptionKey": {
"Id": {
"Fn::GetAtt": [
"EnvVarEncryptKey1A7CABDB",
"Arn"
]
},
"Type": "KMS"
},
"Location": {
"Ref": "PipelineBucketB967BD35"
},
Expand Down Expand Up @@ -599,6 +681,22 @@
}
]
},
{
"Action": [
"kms:Decrypt",
"kms:DescribeKey",
"kms:Encrypt",
"kms:GenerateDataKey*",
"kms:ReEncrypt*"
],
"Effect": "Allow",
"Resource": {
"Fn::GetAtt": [
"EnvVarEncryptKey1A7CABDB",
"Arn"
]
}
},
{
"Action": [
"s3:Abort*",
Expand Down Expand Up @@ -765,6 +863,22 @@
]
}
]
},
{
"Action": [
"kms:Decrypt",
"kms:DescribeKey",
"kms:Encrypt",
"kms:GenerateDataKey*",
"kms:ReEncrypt*"
],
"Effect": "Allow",
"Resource": {
"Fn::GetAtt": [
"EnvVarEncryptKey1A7CABDB",
"Arn"
]
}
}
],
"Version": "2012-10-17"
Expand Down Expand Up @@ -877,6 +991,19 @@
]
}
]
},
{
"Action": [
"kms:Decrypt",
"kms:DescribeKey"
],
"Effect": "Allow",
"Resource": {
"Fn::GetAtt": [
"EnvVarEncryptKey1A7CABDB",
"Arn"
]
}
}
],
"Version": "2012-10-17"
Expand Down Expand Up @@ -994,6 +1121,14 @@
}
},
"Outputs": {
"ExportsOutputRefDeployBucket67E2C076D8DEC04D": {
"Value": {
"Ref": "DeployBucket67E2C076"
},
"Export": {
"Name": "aws-cdk-codepipeline-s3-deploy:ExportsOutputRefDeployBucket67E2C076D8DEC04D"
}
},
"ExportsOutputRefPipelineBucketB967BD35BAE6E881": {
"Value": {
"Ref": "PipelineBucketB967BD35"
Expand All @@ -1009,14 +1144,6 @@
"Export": {
"Name": "aws-cdk-codepipeline-s3-deploy:ExportsOutputRefPipelineC660917DEB540586"
}
},
"ExportsOutputRefDeployBucket67E2C076D8DEC04D": {
"Value": {
"Ref": "DeployBucket67E2C076"
},
"Export": {
"Name": "aws-cdk-codepipeline-s3-deploy:ExportsOutputRefDeployBucket67E2C076D8DEC04D"
}
}
},
"Parameters": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/c77c225bf996813c66f962ac8da785aa5fa677d3c2a632c3743e4075e07a194e.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/0e8ab65ec77f46df122d00ad20da666bb3461c6aee65675b4a7a64b8b284c5a9.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand All @@ -33,6 +33,12 @@
"aws-cdk-codepipeline-s3-deploy.assets"
],
"metadata": {
"/aws-cdk-codepipeline-s3-deploy/EnvVarEncryptKey/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "EnvVarEncryptKey1A7CABDB"
}
],
"/aws-cdk-codepipeline-s3-deploy/PipelineBucket/Resource": [
{
"type": "aws:cdk:logicalId",
Expand Down Expand Up @@ -159,22 +165,22 @@
"data": "PipelineDisabledDisabledDeployActionCodePipelineActionRoleDefaultPolicyB1AF629C"
}
],
"/aws-cdk-codepipeline-s3-deploy/Exports/Output{\"Ref\":\"PipelineBucketB967BD35\"}": [
"/aws-cdk-codepipeline-s3-deploy/Exports/Output{\"Ref\":\"DeployBucket67E2C076\"}": [
{
"type": "aws:cdk:logicalId",
"data": "ExportsOutputRefPipelineBucketB967BD35BAE6E881"
"data": "ExportsOutputRefDeployBucket67E2C076D8DEC04D"
}
],
"/aws-cdk-codepipeline-s3-deploy/Exports/Output{\"Ref\":\"PipelineC660917D\"}": [
"/aws-cdk-codepipeline-s3-deploy/Exports/Output{\"Ref\":\"PipelineBucketB967BD35\"}": [
{
"type": "aws:cdk:logicalId",
"data": "ExportsOutputRefPipelineC660917DEB540586"
"data": "ExportsOutputRefPipelineBucketB967BD35BAE6E881"
}
],
"/aws-cdk-codepipeline-s3-deploy/Exports/Output{\"Ref\":\"DeployBucket67E2C076\"}": [
"/aws-cdk-codepipeline-s3-deploy/Exports/Output{\"Ref\":\"PipelineC660917D\"}": [
{
"type": "aws:cdk:logicalId",
"data": "ExportsOutputRefDeployBucket67E2C076D8DEC04D"
"data": "ExportsOutputRefPipelineC660917DEB540586"
}
],
"/aws-cdk-codepipeline-s3-deploy/BootstrapVersion": [
Expand Down Expand Up @@ -208,7 +214,7 @@
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2a0db37afe84ae5c439012506dfdee1493ab05d9cc40f507fa44ff0ed8d2dfab.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a5e87b4a3b1576f59ec7c5aeb8238a7899b624959515db8b64d69c9b7111fb75.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand All @@ -225,10 +231,10 @@
"s3deploytestDefaultTestDeployAssert6BC61647.assets"
],
"metadata": {
"/s3-deploy-test/DefaultTest/DeployAssert/AwsApiCallS3putObject/Default/Default": [
"/s3-deploy-test/DefaultTest/DeployAssert/AwsApiCallS3getObject132afe15f6b0866b1b0b18d4081f0330/Default/Default": [
{
"type": "aws:cdk:logicalId",
"data": "AwsApiCallS3putObject"
"data": "AwsApiCallS3getObject132afe15f6b0866b1b0b18d4081f0330"
}
],
"/s3-deploy-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role": [
Expand All @@ -243,40 +249,46 @@
"data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F"
}
],
"/s3-deploy-test/DefaultTest/DeployAssert/AwsApiCallCodePipelinegetPipelineState/Default/Default": [
"/s3-deploy-test/DefaultTest/DeployAssert/AwsApiCallS3putObjecte1b51fae535275287a7fd0b537ad2b3d/Default/Default": [
{
"type": "aws:cdk:logicalId",
"data": "AwsApiCallS3putObjecte1b51fae535275287a7fd0b537ad2b3d"
}
],
"/s3-deploy-test/DefaultTest/DeployAssert/AwsApiCallCodePipelinegetPipelineState57ac6eaf015feec14cf48d22e7e8225e/Default/Default": [
{
"type": "aws:cdk:logicalId",
"data": "AwsApiCallCodePipelinegetPipelineState"
"data": "AwsApiCallCodePipelinegetPipelineState57ac6eaf015feec14cf48d22e7e8225e"
}
],
"/s3-deploy-test/DefaultTest/DeployAssert/AwsApiCallCodePipelinegetPipelineState/WaitFor/IsCompleteProvider/Invoke": [
"/s3-deploy-test/DefaultTest/DeployAssert/AwsApiCallCodePipelinegetPipelineState57ac6eaf015feec14cf48d22e7e8225e/WaitFor/IsCompleteProvider/Invoke": [
{
"type": "aws:cdk:logicalId",
"data": "AwsApiCallCodePipelinegetPipelineStateWaitForIsCompleteProviderInvokeB83E9F2C"
"data": "AwsApiCallCodePipelinegetPipelineState57ac6eaf015feec14cf48d22e7e8225eWaitForIsCompleteProviderInvoke821ABA06"
}
],
"/s3-deploy-test/DefaultTest/DeployAssert/AwsApiCallCodePipelinegetPipelineState/WaitFor/TimeoutProvider/Invoke": [
"/s3-deploy-test/DefaultTest/DeployAssert/AwsApiCallCodePipelinegetPipelineState57ac6eaf015feec14cf48d22e7e8225e/WaitFor/TimeoutProvider/Invoke": [
{
"type": "aws:cdk:logicalId",
"data": "AwsApiCallCodePipelinegetPipelineStateWaitForTimeoutProviderInvoke96D2C126"
"data": "AwsApiCallCodePipelinegetPipelineState57ac6eaf015feec14cf48d22e7e8225eWaitForTimeoutProviderInvoke2F043504"
}
],
"/s3-deploy-test/DefaultTest/DeployAssert/AwsApiCallCodePipelinegetPipelineState/WaitFor/Role": [
"/s3-deploy-test/DefaultTest/DeployAssert/AwsApiCallCodePipelinegetPipelineState57ac6eaf015feec14cf48d22e7e8225e/WaitFor/Role": [
{
"type": "aws:cdk:logicalId",
"data": "AwsApiCallCodePipelinegetPipelineStateWaitForRoleDF2D0D47"
"data": "AwsApiCallCodePipelinegetPipelineState57ac6eaf015feec14cf48d22e7e8225eWaitForRole44AD3905"
}
],
"/s3-deploy-test/DefaultTest/DeployAssert/AwsApiCallCodePipelinegetPipelineState/WaitFor/Resource": [
"/s3-deploy-test/DefaultTest/DeployAssert/AwsApiCallCodePipelinegetPipelineState57ac6eaf015feec14cf48d22e7e8225e/WaitFor/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "AwsApiCallCodePipelinegetPipelineStateWaitFor68BABF78"
"data": "AwsApiCallCodePipelinegetPipelineState57ac6eaf015feec14cf48d22e7e8225eWaitForC3FB32C5"
}
],
"/s3-deploy-test/DefaultTest/DeployAssert/AwsApiCallCodePipelinegetPipelineState/AssertionResults": [
"/s3-deploy-test/DefaultTest/DeployAssert/AwsApiCallCodePipelinegetPipelineState57ac6eaf015feec14cf48d22e7e8225e/AssertionResults": [
{
"type": "aws:cdk:logicalId",
"data": "AssertionResultsAwsApiCallCodePipelinegetPipelineState"
"data": "AssertionResultsAwsApiCallCodePipelinegetPipelineState57ac6eaf015feec14cf48d22e7e8225e"
}
],
"/s3-deploy-test/DefaultTest/DeployAssert/SingletonFunction76b3e830a873425f8453eddd85c86925/Role": [
Expand All @@ -303,12 +315,6 @@
"data": "SingletonFunction5c1898e096fb4e3e95d5f6c67f3ce41aHandlerADF3E6EA"
}
],
"/s3-deploy-test/DefaultTest/DeployAssert/AwsApiCallS3getObject/Default/Default": [
{
"type": "aws:cdk:logicalId",
"data": "AwsApiCallS3getObject"
}
],
"/s3-deploy-test/DefaultTest/DeployAssert/BootstrapVersion": [
{
"type": "aws:cdk:logicalId",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
}
}
},
"2a0db37afe84ae5c439012506dfdee1493ab05d9cc40f507fa44ff0ed8d2dfab": {
"a5e87b4a3b1576f59ec7c5aeb8238a7899b624959515db8b64d69c9b7111fb75": {
"source": {
"path": "s3deploytestDefaultTestDeployAssert6BC61647.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "2a0db37afe84ae5c439012506dfdee1493ab05d9cc40f507fa44ff0ed8d2dfab.json",
"objectKey": "a5e87b4a3b1576f59ec7c5aeb8238a7899b624959515db8b64d69c9b7111fb75.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Loading