Skip to content

Commit

Permalink
feat(lambda-layer-kubectl): depend on @awscdk/asset-kubectl-v20 and r…
Browse files Browse the repository at this point in the history
…educe aws-cdk-lib size (#22677)

This PR reduces the size of aws-cdk-lib by 25.6 MB, by extracting the `lambda-layer-kubectl/lib/layer.zip` file to a separate package that `aws-cdk-lib` will directly depend on. 

This change also reduce the complexity of the build in the aws-cdk repo because the process of building the layer.zip inside of a Docker container has also been extracted to the separate package. See https://github.com/cdklabs/awscdk-asset-kubectl/tree/kubectl-v20/main 

----

### All Submissions:

* [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
kaizencc authored Nov 7, 2022
1 parent b1a43a2 commit 6c606d0
Show file tree
Hide file tree
Showing 63 changed files with 2,081 additions and 147 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@
}
}
},
"c6964dbf0c556ec82ce09622e99ad6f6d4e488cdaac0ef9e8492e078ec61ffed": {
"7e5f48d1e79c915595d938c932b6f0101715a162780d01a55845367e014fbcda": {
"source": {
"path": "asset.c6964dbf0c556ec82ce09622e99ad6f6d4e488cdaac0ef9e8492e078ec61ffed.zip",
"path": "asset.7e5f48d1e79c915595d938c932b6f0101715a162780d01a55845367e014fbcda.zip",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "c6964dbf0c556ec82ce09622e99ad6f6d4e488cdaac0ef9e8492e078ec61ffed.zip",
"objectKey": "7e5f48d1e79c915595d938c932b6f0101715a162780d01a55845367e014fbcda.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down Expand Up @@ -131,28 +131,28 @@
}
}
},
"43282bb612fbe7b4fd592a9a5265e33f7e3a9f258887baf499c13a55aca0d383": {
"b3e65c41f231428470bf97fa0481879d4b67dacf1623f4eab05231e48bd14690": {
"source": {
"path": "awseksserviceaccountsdkcallstestawscdkawseksKubectlProvider62B779F7.nested.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "43282bb612fbe7b4fd592a9a5265e33f7e3a9f258887baf499c13a55aca0d383.json",
"objectKey": "b3e65c41f231428470bf97fa0481879d4b67dacf1623f4eab05231e48bd14690.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"d263340aa5fe5d22093e50ee4d716318129c29970cdfd19fd44a053c4fd9893f": {
"1720c2971f135205567b7d52dab0400a8fe2d0760d4601e4f7248fa458223637": {
"source": {
"path": "aws-eks-service-account-sdk-calls-test.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "d263340aa5fe5d22093e50ee4d716318129c29970cdfd19fd44a053c4fd9893f.json",
"objectKey": "1720c2971f135205567b7d52dab0400a8fe2d0760d4601e4f7248fa458223637.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
Expand Up @@ -1111,7 +1111,7 @@
{
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"/43282bb612fbe7b4fd592a9a5265e33f7e3a9f258887baf499c13a55aca0d383.json"
"/b3e65c41f231428470bf97fa0481879d4b67dacf1623f4eab05231e48bd14690.json"
]
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "c6964dbf0c556ec82ce09622e99ad6f6d4e488cdaac0ef9e8492e078ec61ffed.zip"
"S3Key": "7e5f48d1e79c915595d938c932b6f0101715a162780d01a55845367e014fbcda.zip"
},
"Description": "/opt/kubectl/kubectl and /opt/helm/helm"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{
"version": "21.0.0",
"artifacts": {
"Tree": {
"type": "cdk:tree",
"properties": {
"file": "tree.json"
}
},
"aws-eks-service-account-sdk-calls-test.assets": {
"type": "cdk:asset-manifest",
"properties": {
Expand All @@ -23,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}/d263340aa5fe5d22093e50ee4d716318129c29970cdfd19fd44a053c4fd9893f.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/1720c2971f135205567b7d52dab0400a8fe2d0760d4601e4f7248fa458223637.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand Down Expand Up @@ -640,6 +634,12 @@
]
},
"displayName": "aws-cdk-eks-service-account-sdk-call/DefaultTest/DeployAssert"
},
"Tree": {
"type": "cdk:tree",
"properties": {
"file": "tree.json"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@
"id": "App",
"path": "",
"children": {
"Tree": {
"id": "Tree",
"path": "Tree",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.140"
}
},
"aws-eks-service-account-sdk-calls-test": {
"id": "aws-eks-service-account-sdk-calls-test",
"path": "aws-eks-service-account-sdk-calls-test",
Expand Down Expand Up @@ -2952,7 +2944,7 @@
"s3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"s3Key": "c6964dbf0c556ec82ce09622e99ad6f6d4e488cdaac0ef9e8492e078ec61ffed.zip"
"s3Key": "7e5f48d1e79c915595d938c932b6f0101715a162780d01a55845367e014fbcda.zip"
},
"description": "/opt/kubectl/kubectl and /opt/helm/helm"
}
Expand Down Expand Up @@ -3269,7 +3261,7 @@
{
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"/43282bb612fbe7b4fd592a9a5265e33f7e3a9f258887baf499c13a55aca0d383.json"
"/b3e65c41f231428470bf97fa0481879d4b67dacf1623f4eab05231e48bd14690.json"
]
]
},
Expand Down Expand Up @@ -3828,6 +3820,22 @@
"fqn": "@aws-cdk/core.CfnOutput",
"version": "0.0.0"
}
},
"BootstrapVersion": {
"id": "BootstrapVersion",
"path": "aws-eks-service-account-sdk-calls-test/BootstrapVersion",
"constructInfo": {
"fqn": "@aws-cdk/core.CfnParameter",
"version": "0.0.0"
}
},
"CheckBootstrapVersion": {
"id": "CheckBootstrapVersion",
"path": "aws-eks-service-account-sdk-calls-test/CheckBootstrapVersion",
"constructInfo": {
"fqn": "@aws-cdk/core.CfnRule",
"version": "0.0.0"
}
}
},
"constructInfo": {
Expand All @@ -3854,6 +3862,24 @@
"DeployAssert": {
"id": "DeployAssert",
"path": "aws-cdk-eks-service-account-sdk-call/DefaultTest/DeployAssert",
"children": {
"BootstrapVersion": {
"id": "BootstrapVersion",
"path": "aws-cdk-eks-service-account-sdk-call/DefaultTest/DeployAssert/BootstrapVersion",
"constructInfo": {
"fqn": "@aws-cdk/core.CfnParameter",
"version": "0.0.0"
}
},
"CheckBootstrapVersion": {
"id": "CheckBootstrapVersion",
"path": "aws-cdk-eks-service-account-sdk-call/DefaultTest/DeployAssert/CheckBootstrapVersion",
"constructInfo": {
"fqn": "@aws-cdk/core.CfnRule",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "@aws-cdk/core.Stack",
"version": "0.0.0"
Expand All @@ -3870,6 +3896,14 @@
"fqn": "@aws-cdk/integ-tests.IntegTest",
"version": "0.0.0"
}
},
"Tree": {
"id": "Tree",
"path": "Tree",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.140"
}
}
},
"constructInfo": {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@
}
}
},
"c6964dbf0c556ec82ce09622e99ad6f6d4e488cdaac0ef9e8492e078ec61ffed": {
"7e5f48d1e79c915595d938c932b6f0101715a162780d01a55845367e014fbcda": {
"source": {
"path": "asset.c6964dbf0c556ec82ce09622e99ad6f6d4e488cdaac0ef9e8492e078ec61ffed.zip",
"path": "asset.7e5f48d1e79c915595d938c932b6f0101715a162780d01a55845367e014fbcda.zip",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "c6964dbf0c556ec82ce09622e99ad6f6d4e488cdaac0ef9e8492e078ec61ffed.zip",
"objectKey": "7e5f48d1e79c915595d938c932b6f0101715a162780d01a55845367e014fbcda.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand All @@ -92,28 +92,28 @@
}
}
},
"d883f4a670bf58f289b85046d0250ec60832d3e8cc91b9c36ea0cea845215867": {
"d107b4f5405dbf1b77dcc8edf350078b598fa865cc77542754d2a67303593d80": {
"source": {
"path": "awsstepfunctionstasksekscallintegtestawscdkawseksKubectlProvider65D285A0.nested.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "d883f4a670bf58f289b85046d0250ec60832d3e8cc91b9c36ea0cea845215867.json",
"objectKey": "d107b4f5405dbf1b77dcc8edf350078b598fa865cc77542754d2a67303593d80.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"97f1f99f37a62e840eac6ac4f9a5939345b9d48c13262149c76b28bc397e67d4": {
"18e6be3069f37cb423cee5d63ad7f49656386f4ff4da72f0ccca8db10b667702": {
"source": {
"path": "aws-stepfunctions-tasks-eks-call-integ-test.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "97f1f99f37a62e840eac6ac4f9a5939345b9d48c13262149c76b28bc397e67d4.json",
"objectKey": "18e6be3069f37cb423cee5d63ad7f49656386f4ff4da72f0ccca8db10b667702.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
Expand Up @@ -1031,7 +1031,7 @@
{
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"/d883f4a670bf58f289b85046d0250ec60832d3e8cc91b9c36ea0cea845215867.json"
"/d107b4f5405dbf1b77dcc8edf350078b598fa865cc77542754d2a67303593d80.json"
]
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "c6964dbf0c556ec82ce09622e99ad6f6d4e488cdaac0ef9e8492e078ec61ffed.zip"
"S3Key": "7e5f48d1e79c915595d938c932b6f0101715a162780d01a55845367e014fbcda.zip"
},
"Description": "/opt/kubectl/kubectl and /opt/helm/helm"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
"stacks": [
"aws-stepfunctions-tasks-eks-call-integ-test"
],
"cdkCommandOptions": {
"deploy": {
"args": {
"rollback": true
}
}
},
"assertionStack": "aws-stepfunctions-tasks-eks-call-integ/DefaultTest/DeployAssert",
"assertionStackName": "awsstepfunctionstasksekscallintegDefaultTestDeployAssert2DF4AD1E"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,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}/97f1f99f37a62e840eac6ac4f9a5939345b9d48c13262149c76b28bc397e67d4.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/18e6be3069f37cb423cee5d63ad7f49656386f4ff4da72f0ccca8db10b667702.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2836,7 +2836,7 @@
"s3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"s3Key": "c6964dbf0c556ec82ce09622e99ad6f6d4e488cdaac0ef9e8492e078ec61ffed.zip"
"s3Key": "7e5f48d1e79c915595d938c932b6f0101715a162780d01a55845367e014fbcda.zip"
},
"description": "/opt/kubectl/kubectl and /opt/helm/helm"
}
Expand Down Expand Up @@ -3153,7 +3153,7 @@
{
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"/d883f4a670bf58f289b85046d0250ec60832d3e8cc91b9c36ea0cea845215867.json"
"/d107b4f5405dbf1b77dcc8edf350078b598fa865cc77542754d2a67303593d80.json"
]
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ new cdk.CfnOutput(stack, 'stateMachineArn', {

new integ.IntegTest(app, 'aws-stepfunctions-tasks-eks-call-integ', {
testCases: [stack],
cdkCommandOptions: {
deploy: {
args: {
rollback: true,
},
},
},
});

app.synth();
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@
}
}
},
"c6964dbf0c556ec82ce09622e99ad6f6d4e488cdaac0ef9e8492e078ec61ffed": {
"7e5f48d1e79c915595d938c932b6f0101715a162780d01a55845367e014fbcda": {
"source": {
"path": "asset.c6964dbf0c556ec82ce09622e99ad6f6d4e488cdaac0ef9e8492e078ec61ffed.zip",
"path": "asset.7e5f48d1e79c915595d938c932b6f0101715a162780d01a55845367e014fbcda.zip",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "c6964dbf0c556ec82ce09622e99ad6f6d4e488cdaac0ef9e8492e078ec61ffed.zip",
"objectKey": "7e5f48d1e79c915595d938c932b6f0101715a162780d01a55845367e014fbcda.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand All @@ -92,28 +92,28 @@
}
}
},
"09cb2a8f4caee55702274de89ee12759f098f9a4ccbe7a8d1d757e19e82163a1": {
"d5de0186020b7246d51d8be7bade7032625e777f361eb1f8d027c94e53f1fb74": {
"source": {
"path": "awsstepfunctionstasksemrcontainersallservicestestawscdkawseksKubectlProviderD9DFA1E3.nested.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "09cb2a8f4caee55702274de89ee12759f098f9a4ccbe7a8d1d757e19e82163a1.json",
"objectKey": "d5de0186020b7246d51d8be7bade7032625e777f361eb1f8d027c94e53f1fb74.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"fdd1aaed8d5ba30f4a33009f3961191781afb3e55affc7f217c89b72d150c447": {
"d23a5ca748a8a6f0c768d89b4fd3069fac35fda4a25da81024e60798fa1642a0": {
"source": {
"path": "aws-stepfunctions-tasks-emr-containers-all-services-test.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "fdd1aaed8d5ba30f4a33009f3961191781afb3e55affc7f217c89b72d150c447.json",
"objectKey": "d23a5ca748a8a6f0c768d89b4fd3069fac35fda4a25da81024e60798fa1642a0.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
Expand Up @@ -956,7 +956,7 @@
{
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"/09cb2a8f4caee55702274de89ee12759f098f9a4ccbe7a8d1d757e19e82163a1.json"
"/d5de0186020b7246d51d8be7bade7032625e777f361eb1f8d027c94e53f1fb74.json"
]
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "c6964dbf0c556ec82ce09622e99ad6f6d4e488cdaac0ef9e8492e078ec61ffed.zip"
"S3Key": "7e5f48d1e79c915595d938c932b6f0101715a162780d01a55845367e014fbcda.zip"
},
"Description": "/opt/kubectl/kubectl and /opt/helm/helm"
}
Expand Down
Loading

0 comments on commit 6c606d0

Please sign in to comment.