diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 16599d86..b89fddd3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: 14.x + node-version: 16.x - name: Checkout uses: actions/checkout@v4 with: diff --git a/.github/workflows/release-kubectl-v29.yml b/.github/workflows/release-kubectl-v29.yml index 5569d456..69eb2106 100644 --- a/.github/workflows/release-kubectl-v29.yml +++ b/.github/workflows/release-kubectl-v29.yml @@ -20,7 +20,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: 14.x + node-version: 16.x - name: Checkout uses: actions/checkout@v4 with: diff --git a/.projen/deps.json b/.projen/deps.json index 33eba2a7..787c8593 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -104,7 +104,7 @@ }, { "name": "aws-cdk-lib", - "version": "^2.28.0", + "version": "^2.94.0", "type": "peer" }, { diff --git a/.projenrc.ts b/.projenrc.ts index e5ba5ceb..651f8991 100644 --- a/.projenrc.ts +++ b/.projenrc.ts @@ -11,7 +11,7 @@ const project = new awscdk.AwsCdkConstructLibrary({ projenrcTs: true, author: 'Amazon Web Services', authorAddress: 'aws-cdk-dev@amazon.com', - cdkVersion: '2.28.0', + cdkVersion: '2.94.0', name: `@aws-cdk/lambda-layer-kubectl-v${SPEC_VERSION}`, description: `A Lambda Layer that contains kubectl v1.${SPEC_VERSION}`, repositoryUrl: 'https://github.com/cdklabs/awscdk-asset-kubectl.git', diff --git a/API.md b/API.md index 44f65749..560ebf38 100644 --- a/API.md +++ b/API.md @@ -13,8 +13,8 @@ This module exports a single class called `KubectlV29Layer` which is a `lambda.L bundles the [`kubectl`](https://kubernetes.io/docs/reference/kubectl/kubectl/) and the [`helm`](https://helm.sh/) command line. -> - Helm Version: 3.14.0 -> - Kubectl Version: 1.29.1 +> - Helm Version: 3.14.4 +> - Kubectl Version: 1.29.4 > Usage: @@ -138,6 +138,7 @@ permission on the layer version. | **Name** | **Description** | | --- | --- | | isConstruct | Checks if `x` is a construct. | +| isOwnedResource | Returns true if the construct was created by CDK, and false otherwise. | | isResource | Check whether the given construct is a Resource. | | fromLayerVersionArn | Imports a layer version by ARN. | | fromLayerVersionAttributes | Imports a Layer that has been defined externally. | @@ -162,6 +163,22 @@ Any object. --- +##### `isOwnedResource` + +```typescript +import { KubectlV29Layer } from '@aws-cdk/lambda-layer-kubectl-v29' + +KubectlV29Layer.isOwnedResource(construct: IConstruct) +``` + +Returns true if the construct was created by CDK, and false otherwise. + +###### `construct`Required + +- *Type:* constructs.IConstruct + +--- + ##### `isResource` ```typescript diff --git a/README.md b/README.md index bf0e1977..acdded97 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ This module exports a single class called `KubectlV29Layer` which is a `lambda.L bundles the [`kubectl`](https://kubernetes.io/docs/reference/kubectl/kubectl/) and the [`helm`](https://helm.sh/) command line. -> - Helm Version: 3.14.0 -> - Kubectl Version: 1.29.1 +> - Helm Version: 3.14.4 +> - Kubectl Version: 1.29.4 > Usage: diff --git a/layer/Dockerfile b/layer/Dockerfile index 07d080bd..6322be83 100644 --- a/layer/Dockerfile +++ b/layer/Dockerfile @@ -5,8 +5,8 @@ FROM public.ecr.aws/lambda/provided:latest # versions # -ARG KUBECTL_VERSION=1.29.1 -ARG HELM_VERSION=3.14.0 +ARG KUBECTL_VERSION=1.29.4 +ARG HELM_VERSION=3.14.4 USER root RUN mkdir -p /opt diff --git a/package.json b/package.json index 54196dfa..4660bacf 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", "aws-cdk": "^2", - "aws-cdk-lib": "2.28.0", + "aws-cdk-lib": "2.94.0", "constructs": "10.0.5", "eslint": "^8", "eslint-import-resolver-typescript": "^3.6.1", @@ -69,7 +69,7 @@ "typescript": "^4.9.5" }, "peerDependencies": { - "aws-cdk-lib": "^2.28.0", + "aws-cdk-lib": "^2.94.0", "constructs": "^10.0.5" }, "resolutions": { diff --git a/projenrc/workflow-no-docker-patch.ts b/projenrc/workflow-no-docker-patch.ts index cd98d4f0..4fe6b69c 100644 --- a/projenrc/workflow-no-docker-patch.ts +++ b/projenrc/workflow-no-docker-patch.ts @@ -22,7 +22,7 @@ export class WorkflowNoDockerPatch { JsonPatch.add(`/jobs/${workflow}/steps/`, { name: 'Setup Node.js', uses: 'actions/setup-node@v3', - with: { 'node-version': project.minNodeVersion ?? '14.x' }, + with: { 'node-version': project.minNodeVersion ?? '16.x' }, }), JsonPatch.remove(`/jobs/${workflow}/container`), ); diff --git a/src/kubectl-layer.ts b/src/kubectl-layer.ts index 7f40aa31..666bf3c4 100644 --- a/src/kubectl-layer.ts +++ b/src/kubectl-layer.ts @@ -11,7 +11,7 @@ export class KubectlV29Layer extends lambda.LayerVersion { code: lambda.Code.fromAsset(ASSET_FILE, { assetHash: assetHash(), }), - description: '/opt/kubectl/kubectl 1.29; /opt/helm/helm 3.14', + description: '/opt/kubectl/kubectl 1.29.4; /opt/helm/helm 3.14.4', license: 'Apache-2.0', }); } diff --git a/test/kubectl-layer.integ.snapshot/lambda-layer-kubectl-integ-stack.assets.json b/test/kubectl-layer.integ.snapshot/lambda-layer-kubectl-integ-stack.assets.json index 7b45e7d1..2f24f2cf 100644 --- a/test/kubectl-layer.integ.snapshot/lambda-layer-kubectl-integ-stack.assets.json +++ b/test/kubectl-layer.integ.snapshot/lambda-layer-kubectl-integ-stack.assets.json @@ -1,15 +1,15 @@ { - "version": "20.0.0", + "version": "34.0.0", "files": { - "b5925bba477fd1ac27c3a695a9f6ece293bd0ae6940bc65a5b99008ab54f60f7": { + "2266ac05f7e1f3dbecd7349c1f994abb28703d561d08d58f559927e0d31817d4": { "source": { - "path": "asset.b5925bba477fd1ac27c3a695a9f6ece293bd0ae6940bc65a5b99008ab54f60f7.zip", + "path": "asset.2266ac05f7e1f3dbecd7349c1f994abb28703d561d08d58f559927e0d31817d4.zip", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "b5925bba477fd1ac27c3a695a9f6ece293bd0ae6940bc65a5b99008ab54f60f7.zip", + "objectKey": "2266ac05f7e1f3dbecd7349c1f994abb28703d561d08d58f559927e0d31817d4.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -27,20 +27,20 @@ } } }, - "eaeb69bc290b516fe3b049f89d6118b22249df682fbabf56af300cf345198574": { + "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf": { "source": { - "path": "asset.eaeb69bc290b516fe3b049f89d6118b22249df682fbabf56af300cf345198574", + "path": "asset.f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "eaeb69bc290b516fe3b049f89d6118b22249df682fbabf56af300cf345198574.zip", + "objectKey": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "7793bea638b52e9d8f5e0c5a129f4337959bf7bdf7408d2035cc2ddfdf4f7d56": { + "11baabd2ea39a92e958855fe9d0e2c549a83bc8710379d8695623383d256922f": { "source": { "path": "lambda-layer-kubectl-integ-stack.template.json", "packaging": "file" @@ -48,7 +48,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "7793bea638b52e9d8f5e0c5a129f4337959bf7bdf7408d2035cc2ddfdf4f7d56.json", + "objectKey": "11baabd2ea39a92e958855fe9d0e2c549a83bc8710379d8695623383d256922f.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/test/kubectl-layer.integ.snapshot/lambda-layer-kubectl-integ-stack.template.json b/test/kubectl-layer.integ.snapshot/lambda-layer-kubectl-integ-stack.template.json index 825c2c05..47556880 100644 --- a/test/kubectl-layer.integ.snapshot/lambda-layer-kubectl-integ-stack.template.json +++ b/test/kubectl-layer.integ.snapshot/lambda-layer-kubectl-integ-stack.template.json @@ -7,13 +7,13 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "b5925bba477fd1ac27c3a695a9f6ece293bd0ae6940bc65a5b99008ab54f60f7.zip" + "S3Key": "2266ac05f7e1f3dbecd7349c1f994abb28703d561d08d58f559927e0d31817d4.zip" }, - "Description": "/opt/kubectl/kubectl 1.29; /opt/helm/helm 3.14", + "Description": "/opt/kubectl/kubectl 1.29.4; /opt/helm/helm 3.14.4", "LicenseInfo": "Apache-2.0" } }, - "Lambdapython37ServiceRoleB5A704D4": { + "Lambdapython38ServiceRoleCF609288": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -44,7 +44,7 @@ ] } }, - "Lambdapython3780349E0A": { + "Lambdapython38588938B9": { "Type": "AWS::Lambda::Function", "Properties": { "Code": { @@ -53,12 +53,6 @@ }, "S3Key": "134b81dc12f7bd57e63ba8a0ab049586c8a5e07e7afce1e400dc6e1319e9abfb.zip" }, - "Role": { - "Fn::GetAtt": [ - "Lambdapython37ServiceRoleB5A704D4", - "Arn" - ] - }, "Handler": "index.handler", "Layers": [ { @@ -66,14 +60,20 @@ } ], "MemorySize": 512, - "Runtime": "python3.7", + "Role": { + "Fn::GetAtt": [ + "Lambdapython38ServiceRoleCF609288", + "Arn" + ] + }, + "Runtime": "python3.8", "Timeout": 30 }, "DependsOn": [ - "Lambdapython37ServiceRoleB5A704D4" + "Lambdapython38ServiceRoleCF609288" ] }, - "Providerpython37frameworkonEventServiceRole9EA6B2B0": { + "Providerpython38frameworkonEventServiceRole59CE2CA7": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -104,7 +104,7 @@ ] } }, - "Providerpython37frameworkonEventServiceRoleDefaultPolicyA9099DC2": { + "Providerpython38frameworkonEventServiceRoleDefaultPolicy1666A4D6": { "Type": "AWS::IAM::Policy", "Properties": { "PolicyDocument": { @@ -115,7 +115,7 @@ "Resource": [ { "Fn::GetAtt": [ - "Lambdapython3780349E0A", + "Lambdapython38588938B9", "Arn" ] }, @@ -125,7 +125,7 @@ [ { "Fn::GetAtt": [ - "Lambdapython3780349E0A", + "Lambdapython38588938B9", "Arn" ] }, @@ -138,55 +138,55 @@ ], "Version": "2012-10-17" }, - "PolicyName": "Providerpython37frameworkonEventServiceRoleDefaultPolicyA9099DC2", + "PolicyName": "Providerpython38frameworkonEventServiceRoleDefaultPolicy1666A4D6", "Roles": [ { - "Ref": "Providerpython37frameworkonEventServiceRole9EA6B2B0" + "Ref": "Providerpython38frameworkonEventServiceRole59CE2CA7" } ] } }, - "Providerpython37frameworkonEvent3AA4F69E": { + "Providerpython38frameworkonEvent3059CDF1": { "Type": "AWS::Lambda::Function", "Properties": { "Code": { "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "eaeb69bc290b516fe3b049f89d6118b22249df682fbabf56af300cf345198574.zip" + "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip" }, - "Role": { - "Fn::GetAtt": [ - "Providerpython37frameworkonEventServiceRole9EA6B2B0", - "Arn" - ] - }, - "Description": "AWS CDK resource provider framework - onEvent (lambda-layer-kubectl-integ-stack/Providerpython3.7)", + "Description": "AWS CDK resource provider framework - onEvent (lambda-layer-kubectl-integ-stack/Providerpython3.8)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { "Fn::GetAtt": [ - "Lambdapython3780349E0A", + "Lambdapython38588938B9", "Arn" ] } } }, "Handler": "framework.onEvent", - "Runtime": "nodejs14.x", + "Role": { + "Fn::GetAtt": [ + "Providerpython38frameworkonEventServiceRole59CE2CA7", + "Arn" + ] + }, + "Runtime": "nodejs18.x", "Timeout": 900 }, "DependsOn": [ - "Providerpython37frameworkonEventServiceRoleDefaultPolicyA9099DC2", - "Providerpython37frameworkonEventServiceRole9EA6B2B0" + "Providerpython38frameworkonEventServiceRoleDefaultPolicy1666A4D6", + "Providerpython38frameworkonEventServiceRole59CE2CA7" ] }, - "CustomResourcepython37": { + "CustomResourcepython38": { "Type": "AWS::CloudFormation::CustomResource", "Properties": { "ServiceToken": { "Fn::GetAtt": [ - "Providerpython37frameworkonEvent3AA4F69E", + "Providerpython38frameworkonEvent3059CDF1", "Arn" ] } @@ -234,12 +234,6 @@ }, "S3Key": "134b81dc12f7bd57e63ba8a0ab049586c8a5e07e7afce1e400dc6e1319e9abfb.zip" }, - "Role": { - "Fn::GetAtt": [ - "Lambdapython39ServiceRoleE2CFED77", - "Arn" - ] - }, "Handler": "index.handler", "Layers": [ { @@ -247,6 +241,12 @@ } ], "MemorySize": 512, + "Role": { + "Fn::GetAtt": [ + "Lambdapython39ServiceRoleE2CFED77", + "Arn" + ] + }, "Runtime": "python3.9", "Timeout": 30 }, @@ -334,13 +334,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "eaeb69bc290b516fe3b049f89d6118b22249df682fbabf56af300cf345198574.zip" - }, - "Role": { - "Fn::GetAtt": [ - "Providerpython39frameworkonEventServiceRoleA299F5C1", - "Arn" - ] + "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip" }, "Description": "AWS CDK resource provider framework - onEvent (lambda-layer-kubectl-integ-stack/Providerpython3.9)", "Environment": { @@ -354,7 +348,13 @@ } }, "Handler": "framework.onEvent", - "Runtime": "nodejs14.x", + "Role": { + "Fn::GetAtt": [ + "Providerpython39frameworkonEventServiceRoleA299F5C1", + "Arn" + ] + }, + "Runtime": "nodejs18.x", "Timeout": 900 }, "DependsOn": [ @@ -374,6 +374,368 @@ }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" + }, + "Lambdapython310ServiceRoleD185E0B6": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "Lambdapython310815BD7E9": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "134b81dc12f7bd57e63ba8a0ab049586c8a5e07e7afce1e400dc6e1319e9abfb.zip" + }, + "Handler": "index.handler", + "Layers": [ + { + "Ref": "KubectlLayer600207B5" + } + ], + "MemorySize": 512, + "Role": { + "Fn::GetAtt": [ + "Lambdapython310ServiceRoleD185E0B6", + "Arn" + ] + }, + "Runtime": "python3.10", + "Timeout": 30 + }, + "DependsOn": [ + "Lambdapython310ServiceRoleD185E0B6" + ] + }, + "Providerpython310frameworkonEventServiceRoleB6DF2879": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "Providerpython310frameworkonEventServiceRoleDefaultPolicyC0E8697B": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "Lambdapython310815BD7E9", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "Lambdapython310815BD7E9", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "Providerpython310frameworkonEventServiceRoleDefaultPolicyC0E8697B", + "Roles": [ + { + "Ref": "Providerpython310frameworkonEventServiceRoleB6DF2879" + } + ] + } + }, + "Providerpython310frameworkonEvent7294D715": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip" + }, + "Description": "AWS CDK resource provider framework - onEvent (lambda-layer-kubectl-integ-stack/Providerpython3.10)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "Lambdapython310815BD7E9", + "Arn" + ] + } + } + }, + "Handler": "framework.onEvent", + "Role": { + "Fn::GetAtt": [ + "Providerpython310frameworkonEventServiceRoleB6DF2879", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "Providerpython310frameworkonEventServiceRoleDefaultPolicyC0E8697B", + "Providerpython310frameworkonEventServiceRoleB6DF2879" + ] + }, + "CustomResourcepython310": { + "Type": "AWS::CloudFormation::CustomResource", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "Providerpython310frameworkonEvent7294D715", + "Arn" + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "Lambdapython311ServiceRoleB063EF97": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "Lambdapython311020B8AC7": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "134b81dc12f7bd57e63ba8a0ab049586c8a5e07e7afce1e400dc6e1319e9abfb.zip" + }, + "Handler": "index.handler", + "Layers": [ + { + "Ref": "KubectlLayer600207B5" + } + ], + "MemorySize": 512, + "Role": { + "Fn::GetAtt": [ + "Lambdapython311ServiceRoleB063EF97", + "Arn" + ] + }, + "Runtime": "python3.11", + "Timeout": 30 + }, + "DependsOn": [ + "Lambdapython311ServiceRoleB063EF97" + ] + }, + "Providerpython311frameworkonEventServiceRoleAEC610C5": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "Providerpython311frameworkonEventServiceRoleDefaultPolicyF13D93DB": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "Lambdapython311020B8AC7", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "Lambdapython311020B8AC7", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "Providerpython311frameworkonEventServiceRoleDefaultPolicyF13D93DB", + "Roles": [ + { + "Ref": "Providerpython311frameworkonEventServiceRoleAEC610C5" + } + ] + } + }, + "Providerpython311frameworkonEvent29915103": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip" + }, + "Description": "AWS CDK resource provider framework - onEvent (lambda-layer-kubectl-integ-stack/Providerpython3.11)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "Lambdapython311020B8AC7", + "Arn" + ] + } + } + }, + "Handler": "framework.onEvent", + "Role": { + "Fn::GetAtt": [ + "Providerpython311frameworkonEventServiceRoleAEC610C5", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "Providerpython311frameworkonEventServiceRoleDefaultPolicyF13D93DB", + "Providerpython311frameworkonEventServiceRoleAEC610C5" + ] + }, + "CustomResourcepython311": { + "Type": "AWS::CloudFormation::CustomResource", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "Providerpython311frameworkonEvent29915103", + "Arn" + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Parameters": { diff --git a/test/kubectl-layer.integ.ts b/test/kubectl-layer.integ.ts index 5076b794..2a608889 100644 --- a/test/kubectl-layer.integ.ts +++ b/test/kubectl-layer.integ.ts @@ -14,8 +14,10 @@ const stack = new cdk.Stack(app, 'lambda-layer-kubectl-integ-stack'); const layer = new KubectlV29Layer(stack, 'KubectlLayer'); const runtimes = [ - lambda.Runtime.PYTHON_3_7, + lambda.Runtime.PYTHON_3_8, lambda.Runtime.PYTHON_3_9, + lambda.Runtime.PYTHON_3_10, + lambda.Runtime.PYTHON_3_11, ]; for (const runtime of runtimes) { diff --git a/test/kubectl-layer.test.ts b/test/kubectl-layer.test.ts index 01e4b15e..08960367 100644 --- a/test/kubectl-layer.test.ts +++ b/test/kubectl-layer.test.ts @@ -11,7 +11,7 @@ test('synthesized to a layer version', () => { // THEN Template.fromStack(stack).hasResourceProperties('AWS::Lambda::LayerVersion', { - Description: '/opt/kubectl/kubectl 1.29; /opt/helm/helm 3.14', + Description: '/opt/kubectl/kubectl 1.29.4; /opt/helm/helm 3.14.4', }); }); diff --git a/yarn.lock b/yarn.lock index 3e0eb7d3..97b3d425 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10,6 +10,21 @@ "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.24" +"@aws-cdk/asset-awscli-v1@^2.2.200": + version "2.2.202" + resolved "https://registry.yarnpkg.com/@aws-cdk/asset-awscli-v1/-/asset-awscli-v1-2.2.202.tgz#4627201d71f6a5c60db36385ce09cb81005f4b32" + integrity sha512-JqlF0D4+EVugnG5dAsNZMqhu3HW7ehOXm5SDMxMbXNDMdsF0pxtQKNHRl52z1U9igsHmaFpUgSGjbhAJ+0JONg== + +"@aws-cdk/asset-kubectl-v20@^2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@aws-cdk/asset-kubectl-v20/-/asset-kubectl-v20-2.1.2.tgz#d8e20b5f5dc20128ea2000dc479ca3c7ddc27248" + integrity sha512-3M2tELJOxQv0apCIiuKQ4pAbncz9GuLwnKFqxifWfe77wuMxyTRPmxssYHs42ePqzap1LT6GDcPygGs+hHstLg== + +"@aws-cdk/asset-node-proxy-agent-v6@^2.0.1": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@aws-cdk/asset-node-proxy-agent-v6/-/asset-node-proxy-agent-v6-2.0.3.tgz#9b5d213b5ce5ad4461f6a4720195ff8de72e6523" + integrity sha512-twhuEG+JPOYCYPx/xy5uH2+VUsIEhPTzDY0F1KuB+ocjWWB/KEDiOVL19nHvbPCB6fhWnkykXEMJ4HHcKvjtvg== + "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.24.6": version "7.24.6" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.6.tgz#ab88da19344445c3d8889af2216606d3329f3ef2" @@ -995,7 +1010,7 @@ ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.13.0: +ajv@^8.0.1, ajv@^8.13.0: version "8.16.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.16.0.tgz#22e2a92b94f005f7e0f9c9d39652ef0b8f6f0cb4" integrity sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw== @@ -1147,16 +1162,16 @@ arrify@^1.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" integrity sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA== +astral-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" + integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== -at-least-node@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" - integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== - available-typed-arrays@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846" @@ -1164,19 +1179,23 @@ available-typed-arrays@^1.0.7: dependencies: possible-typed-array-names "^1.0.0" -aws-cdk-lib@2.28.0: - version "2.28.0" - resolved "https://registry.yarnpkg.com/aws-cdk-lib/-/aws-cdk-lib-2.28.0.tgz#bf01b0233d41ba7c211c4a039258850c42459604" - integrity sha512-ZAhIQ+mX2JYx8st6enan8qBzts7o+PXFJxLABIUYZSSus/ScWx9POLIVsV28LXorM4Y2su23VfWM7iVmCNxYAQ== +aws-cdk-lib@2.94.0: + version "2.94.0" + resolved "https://registry.yarnpkg.com/aws-cdk-lib/-/aws-cdk-lib-2.94.0.tgz#b0e5be87611ff6628bc631dcc1f4569104124885" + integrity sha512-pB/UzKeM+p/wY9WuFYkEewOFUh2r8qwaML63is4vUChXY2G2Bj3pGyfJ97Xir2Q5KIhgJPJz5igdouI4+F9A+g== dependencies: + "@aws-cdk/asset-awscli-v1" "^2.2.200" + "@aws-cdk/asset-kubectl-v20" "^2.1.2" + "@aws-cdk/asset-node-proxy-agent-v6" "^2.0.1" "@balena/dockerignore" "^1.0.2" case "1.6.3" - fs-extra "^9.1.0" - ignore "^5.2.0" + fs-extra "^11.1.1" + ignore "^5.2.4" jsonschema "^1.4.1" minimatch "^3.1.2" - punycode "^2.1.1" - semver "^7.3.7" + punycode "^2.3.0" + semver "^7.5.4" + table "^6.8.1" yaml "1.10.2" aws-cdk@^2: @@ -2394,6 +2413,15 @@ fs-extra@^10.1.0: jsonfile "^6.0.1" universalify "^2.0.0" +fs-extra@^11.1.1: + version "11.2.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.2.0.tgz#e70e17dfad64232287d01929399e0ea7c86b0e5b" + integrity sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + fs-extra@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" @@ -2403,16 +2431,6 @@ fs-extra@^8.1.0: jsonfile "^4.0.0" universalify "^0.1.0" -fs-extra@^9.1.0: - version "9.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" - integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== - dependencies: - at-least-node "^1.0.0" - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -3781,6 +3799,11 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== +lodash.truncate@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" + integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw== + lodash@^4.17.15, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -4308,7 +4331,7 @@ psl@^1.1.33: resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== -punycode@^2.1.0, punycode@^2.1.1: +punycode@^2.1.0, punycode@^2.1.1, punycode@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== @@ -4554,7 +4577,7 @@ semver-intersect@^1.5.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== -semver@7.x, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.7, semver@^7.5.0, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.6.2: +semver@7.x, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.5.0, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.6.2: version "7.6.2" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== @@ -4640,6 +4663,15 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== +slice-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" + integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== + dependencies: + ansi-styles "^4.0.0" + astral-regex "^2.0.0" + is-fullwidth-code-point "^3.0.0" + sort-json@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/sort-json/-/sort-json-2.0.1.tgz#7338783bef807185dc37d5b02e3afd905d537cfb" @@ -4910,6 +4942,17 @@ symbol-tree@^3.2.4: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== +table@^6.8.1: + version "6.8.2" + resolved "https://registry.yarnpkg.com/table/-/table-6.8.2.tgz#c5504ccf201213fa227248bdc8c5569716ac6c58" + integrity sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA== + dependencies: + ajv "^8.0.1" + lodash.truncate "^4.4.2" + slice-ansi "^4.0.0" + string-width "^4.2.3" + strip-ansi "^6.0.1" + tapable@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0"