diff --git a/package.json b/package.json index 3ea3b84700a2b..1b60bc8a91d36 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "build-all": "tsc -b" }, "devDependencies": { - "@nx/workspace": "^16.3.2", + "@nx/workspace": "^16.5.1", "@types/node": "18.11.19", "@types/prettier": "2.6.0", "@yarnpkg/lockfile": "^1.1.0", @@ -24,17 +24,17 @@ "fs-extra": "^9.1.0", "graceful-fs": "^4.2.11", "jest-junit": "^13.2.0", - "jsii-diff": "1.82.0", - "jsii-pacmak": "1.82.0", - "jsii-reflect": "1.82.0", - "jsii-rosetta": "~5.0.8", + "jsii-diff": "1.84.0", + "jsii-pacmak": "1.84.0", + "jsii-reflect": "1.84.0", + "jsii-rosetta": "~5.1.6", "lerna": "^7.0.1", - "nx": "^16.3.2", + "nx": "^16.5.1", "patch-package": "^6.5.1", - "semver": "^7.5.2", + "semver": "^7.5.4", "standard-version": "^9.5.0", "ts-node": "^10.9.1", - "typescript": "~5.1.3" + "typescript": "~5.1.6" }, "resolutions": { "colors": "1.4.0", diff --git a/packages/@aws-cdk-testing/cli-integ/package.json b/packages/@aws-cdk-testing/cli-integ/package.json index 9263b44267546..3af893ac39102 100644 --- a/packages/@aws-cdk-testing/cli-integ/package.json +++ b/packages/@aws-cdk-testing/cli-integ/package.json @@ -39,16 +39,16 @@ }, "dependencies": { "@octokit/rest": "^18.12.0", - "aws-sdk": "^2.1379.0", + "aws-sdk": "^2.1414.0", "axios": "^0.27.2", "fs-extra": "^9.1.0", "glob": "^7.2.3", - "jest": "^29.5.0", + "jest": "^29.6.1", "jest-junit": "^14.0.1", "make-runnable": "^1.4.1", "npm": "^8.19.4", "p-queue": "^6.6.2", - "semver": "^7.5.1", + "semver": "^7.5.4", "ts-mock-imports": "^1.3.8", "yaml": "1.10.2", "yargs": "^17.7.2" diff --git a/packages/@aws-cdk-testing/framework-integ/package.json b/packages/@aws-cdk-testing/framework-integ/package.json index 7abd7a4468ec1..6ca0e389d34f8 100644 --- a/packages/@aws-cdk-testing/framework-integ/package.json +++ b/packages/@aws-cdk-testing/framework-integ/package.json @@ -37,12 +37,12 @@ }, "dependencies": { "@aws-cdk/integ-tests-alpha": "0.0.0", - "@aws-cdk/lambda-layer-kubectl-v24": "^2.0.195", + "@aws-cdk/lambda-layer-kubectl-v24": "^2.0.242", "aws-cdk-lib": "0.0.0", - "aws-sdk": "^2.1379.0", + "aws-sdk": "^2.1414.0", "aws-sdk-mock": "5.6.0", - "cdk8s": "^2.7.68", - "cdk8s-plus-24": "2.7.31", + "cdk8s": "^2.7.102", + "cdk8s-plus-24": "2.8.85", "constructs": "^10.0.0" }, "repository": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeilne-elastic-beanstalk-deploy.js.snapshot/aws-cdk-codepipeline-elastic-beanstalk-deploy.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeilne-elastic-beanstalk-deploy.js.snapshot/aws-cdk-codepipeline-elastic-beanstalk-deploy.assets.json index 5dc7b183e3649..99781a0e99c49 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeilne-elastic-beanstalk-deploy.js.snapshot/aws-cdk-codepipeline-elastic-beanstalk-deploy.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeilne-elastic-beanstalk-deploy.js.snapshot/aws-cdk-codepipeline-elastic-beanstalk-deploy.assets.json @@ -14,15 +14,15 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -53,7 +53,7 @@ } } }, - "2e074e7f676d73405cc42f0871d7a7cc4a2e7595d47ca65fb40ad4a7de6546b9": { + "ae905796f14ca862d4e6f19382d8b2aae475b34b7c2395bd8fea7789d31809c6": { "source": { "path": "aws-cdk-codepipeline-elastic-beanstalk-deploy.template.json", "packaging": "file" @@ -61,7 +61,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "2e074e7f676d73405cc42f0871d7a7cc4a2e7595d47ca65fb40ad4a7de6546b9.json", + "objectKey": "ae905796f14ca862d4e6f19382d8b2aae475b34b7c2395bd8fea7789d31809c6.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeilne-elastic-beanstalk-deploy.js.snapshot/aws-cdk-codepipeline-elastic-beanstalk-deploy.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeilne-elastic-beanstalk-deploy.js.snapshot/aws-cdk-codepipeline-elastic-beanstalk-deploy.template.json index 1629ade7b94f6..9a3b74e7b28c4 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeilne-elastic-beanstalk-deploy.js.snapshot/aws-cdk-codepipeline-elastic-beanstalk-deploy.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeilne-elastic-beanstalk-deploy.js.snapshot/aws-cdk-codepipeline-elastic-beanstalk-deploy.template.json @@ -155,7 +155,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } @@ -440,7 +440,7 @@ "Value": "AWSServiceRoleForElasticBeanstalkManagedUpdates" } ], - "SolutionStackName": "64bit Amazon Linux 2 v5.8.1 running Node.js 16" + "SolutionStackName": "64bit Amazon Linux 2 v5.8.3 running Node.js 16" }, "DependsOn": [ "beastalkapp", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeilne-elastic-beanstalk-deploy.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeilne-elastic-beanstalk-deploy.js.snapshot/manifest.json index f63c69e6052a3..38959e56d6489 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeilne-elastic-beanstalk-deploy.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeilne-elastic-beanstalk-deploy.js.snapshot/manifest.json @@ -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}/2e074e7f676d73405cc42f0871d7a7cc4a2e7595d47ca65fb40ad4a7de6546b9.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ae905796f14ca862d4e6f19382d8b2aae475b34b7c2395bd8fea7789d31809c6.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -66,7 +66,10 @@ "/aws-cdk-codepipeline-elastic-beanstalk-deploy/DeployApp/AwsCliLayer/Resource": [ { "type": "aws:cdk:logicalId", - "data": "DeployAppAwsCliLayerAEF99B2F" + "data": "DeployAppAwsCliLayerAEF99B2F", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] } ], "/aws-cdk-codepipeline-elastic-beanstalk-deploy/DeployApp/CustomResource/Default": [ @@ -120,7 +123,10 @@ "/aws-cdk-codepipeline-elastic-beanstalk-deploy/beanstlk-env": [ { "type": "aws:cdk:logicalId", - "data": "beanstlkenv" + "data": "beanstlkenv", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] } ], "/aws-cdk-codepipeline-elastic-beanstalk-deploy/Pipeline/Role/Resource": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeilne-elastic-beanstalk-deploy.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeilne-elastic-beanstalk-deploy.js.snapshot/tree.json index e44ae3eddd403..0170b594bc1db 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeilne-elastic-beanstalk-deploy.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeilne-elastic-beanstalk-deploy.js.snapshot/tree.json @@ -209,7 +209,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -692,7 +692,7 @@ "value": "AWSServiceRoleForElasticBeanstalkManagedUpdates" } ], - "solutionStackName": "64bit Amazon Linux 2 v5.8.1 running Node.js 16" + "solutionStackName": "64bit Amazon Linux 2 v5.8.3 running Node.js 16" } }, "constructInfo": { @@ -1113,13 +1113,13 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } }, "Deploy": { @@ -1269,13 +1269,13 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } } }, @@ -1319,7 +1319,7 @@ "path": "codepipeline-elastic-beanstalk-deploy/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } }, "DeployAssert": { @@ -1365,7 +1365,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeilne-elastic-beanstalk-deploy.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeilne-elastic-beanstalk-deploy.ts index eaffb52558bae..a1577b6d6998e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeilne-elastic-beanstalk-deploy.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeilne-elastic-beanstalk-deploy.ts @@ -78,7 +78,7 @@ const beanstalkApp = new elasticbeanstalk.CfnApplication(stack, 'beastalk-app', const beanstalkEnv = new elasticbeanstalk.CfnEnvironment(stack, 'beanstlk-env', { applicationName: beanstalkApp.applicationName!, environmentName: 'codepipeline-test-env', - solutionStackName: '64bit Amazon Linux 2 v5.8.1 running Node.js 16', + solutionStackName: '64bit Amazon Linux 2 v5.8.3 running Node.js 16', optionSettings: [ { namespace: 'aws:autoscaling:launchconfiguration', diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip similarity index 79% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip rename to packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip index e6cb898734b43..90a8a2a6e2615 100644 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/aws-ecs-integ.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/aws-ecs-integ.assets.json index 55526e5c3fbb5..85dc77d2daeab 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/aws-ecs-integ.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/aws-ecs-integ.assets.json @@ -14,15 +14,15 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -66,7 +66,7 @@ } } }, - "2822e758d5b8cc6412fcacb9006cac67744d6121aec5f69c46502326f0eb6925": { + "2266b416c0e22a52e28f34bd8f4473a302319ef046c0d951d65150fa649b27e2": { "source": { "path": "aws-ecs-integ.template.json", "packaging": "file" @@ -74,7 +74,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "2822e758d5b8cc6412fcacb9006cac67744d6121aec5f69c46502326f0eb6925.json", + "objectKey": "2266b416c0e22a52e28f34bd8f4473a302319ef046c0d951d65150fa649b27e2.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/aws-ecs-integ.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/aws-ecs-integ.template.json index 168a219a84187..deca437f5822d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/aws-ecs-integ.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/aws-ecs-integ.template.json @@ -1177,7 +1177,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/manifest.json index dc1183aa4ad79..bfe0b2e597aa4 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/manifest.json @@ -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}/2822e758d5b8cc6412fcacb9006cac67744d6121aec5f69c46502326f0eb6925.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2266b416c0e22a52e28f34bd8f4473a302319ef046c0d951d65150fa649b27e2.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -324,7 +324,10 @@ "/aws-ecs-integ/EnvFileDeployment/AwsCliLayer/Resource": [ { "type": "aws:cdk:logicalId", - "data": "EnvFileDeploymentAwsCliLayerA8FC897D" + "data": "EnvFileDeploymentAwsCliLayerA8FC897D", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] } ], "/aws-ecs-integ/EnvFileDeployment/CustomResource/Default": [ @@ -374,15 +377,6 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } - ], - "EcsClusterDefaultAutoScalingGroupLaunchTemplateProfile45668F20": [ - { - "type": "aws:cdk:logicalId", - "data": "EcsClusterDefaultAutoScalingGroupLaunchTemplateProfile45668F20", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } ] }, "displayName": "aws-ecs-integ" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/tree.json index 28b27da760976..52552e9332fa0 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.js.snapshot/tree.json @@ -1014,6 +1014,14 @@ "version": "0.0.0" } }, + "ImportedInstanceProfile": { + "id": "ImportedInstanceProfile", + "path": "aws-ecs-integ/EcsCluster/DefaultAutoScalingGroup/ImportedInstanceProfile", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, "LaunchTemplate": { "id": "LaunchTemplate", "path": "aws-ecs-integ/EcsCluster/DefaultAutoScalingGroup/LaunchTemplate", @@ -1428,7 +1436,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } }, "LifecycleHookDrainHook": { @@ -1852,7 +1860,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -2336,7 +2344,7 @@ "path": "Integ/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } }, "DeployAssert": { @@ -2382,7 +2390,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/hello-k8s.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/hello-k8s.ts index bcf0f464b2d07..e4cfcb9d89b29 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/hello-k8s.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/hello-k8s.ts @@ -4,7 +4,6 @@ export const resources = [ kind: 'Service', metadata: { name: 'hello-kubernetes' }, spec: { - type: 'LoadBalancer', ports: [{ port: 80, targetPort: 8080 }], selector: { app: 'hello-kubernetes' }, }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js deleted file mode 100644 index b89707a0a08e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js +++ /dev/null @@ -1,277 +0,0 @@ -"use strict"; -/* eslint-disable no-console */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ClusterResourceHandler = void 0; -const common_1 = require("./common"); -const compareLogging_1 = require("./compareLogging"); -const MAX_CLUSTER_NAME_LEN = 100; -class ClusterResourceHandler extends common_1.ResourceHandler { - get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - return this.physicalResourceId; - } - constructor(eks, event) { - super(eks, event); - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - // ------ - // CREATE - // ------ - async onCreate() { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - const clusterName = this.newProps.name || this.generateClusterName(); - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - return { - PhysicalResourceId: resp.cluster.name, - }; - } - async isCreateComplete() { - return this.isActive(); - } - // ------ - // DELETE - // ------ - async onDelete() { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } - catch (e) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } - else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - async isDeleteComplete() { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } - catch (e) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - console.log('describeCluster error:', e); - throw e; - } - return { - IsComplete: false, - }; - } - // ------ - // UPDATE - // ------ - async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - return this.onCreate(); - } - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - return this.updateClusterVersion(this.newProps.version); - } - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - if (updates.updateLogging || updates.updateAccess) { - const config = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - } - ; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - return { EksUpdateId: updateResponse.update?.id }; - } - // no updates - return; - } - async isUpdateComplete() { - console.log('isUpdateComplete'); - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - return this.isActive(); - } - async updateClusterVersion(newVersion) { - console.log(`updating cluster version to ${newVersion}`); - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - async isActive() { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } - else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } - else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - async isEksUpdateComplete(eksUpdateId) { - this.log({ isEksUpdateComplete: eksUpdateId }); - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - this.log({ describeUpdateResponse }); - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} -exports.ClusterResourceHandler = ClusterResourceHandler; -function parseProps(props) { - const parsed = props?.Config ?? {}; - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - return parsed; -} -function analyzeUpdate(oldProps, newProps) { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} -function setsEqual(first, second) { - return first.size === second.size && [...first].every((e) => second.has(e)); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBSy9CLHFDQUFxRTtBQUNyRSxxREFBdUQ7QUFHdkQsTUFBTSxvQkFBb0IsR0FBRyxHQUFHLENBQUM7QUFFakMsTUFBYSxzQkFBdUIsU0FBUSx3QkFBZTtJQUN6RCxJQUFXLFdBQVc7UUFDcEIsSUFBSSxDQUFDLElBQUksQ0FBQyxrQkFBa0IsRUFBRTtZQUM1QixNQUFNLElBQUksS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JuIGZpcnN0LnNpemUgPT09IHNlY29uZC5zaXplICYmIFsuLi5maXJzdF0uZXZlcnkoKGU6IHN0cmluZykgPT4gc2Vjb25kLmhhcyhlKSk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js deleted file mode 100644 index 34ab6ff0ba0e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FargateProfileResourceHandler = void 0; -const common_1 = require("./common"); -const MAX_NAME_LEN = 63; -class FargateProfileResourceHandler extends common_1.ResourceHandler { - async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - const createFargateProfile = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - const deleteFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - return; - } - async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - async isCreateComplete() { - return this.isUpdateComplete(); - } - async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - /** - * Generates a fargate profile name. - */ - generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - async queryStatus() { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - const describeFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - try { - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - return status; - } - catch (describeFargateProfileError) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} -exports.FargateProfileResourceHandler = FargateProfileResourceHandler; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW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F0ZVByb2ZpbGVSZXNwb25zZSB9KTtcbiAgICAgIGNvbnN0IHN0YXR1cyA9IGRlc2NyaWJlRmFyZ2F0ZVByb2ZpbGVSZXNwb25zZS5mYXJnYXRlUHJvZmlsZT8uc3RhdHVzO1xuXG4gICAgICBpZiAoc3RhdHVzID09PSAnQ1JFQVRFX0ZBSUxFRCcgfHwgc3RhdHVzID09PSAnREVMRVRFX0ZBSUxFRCcpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKHN0YXR1cyk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfSBjYXRjaCAoZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yOiBhbnkpIHtcbiAgICAgIGlmIChkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IuY29kZSA9PT0gJ1Jlc291cmNlTm90Rm91bmRFeGNlcHRpb24nKSB7XG4gICAgICAgIHRoaXMubG9nKCdyZWNlaXZlZCBSZXNvdXJjZU5vdEZvdW5kRXhjZXB0aW9uLCB0aGlzIG1lYW5zIHRoZSBwcm9maWxlIGhhcyBiZWVuIGRlbGV0ZWQgKG9yIG5ldmVyIGV4aXN0ZWQpJyk7XG4gICAgICAgIHJldHVybiAnTk9UX0ZPVU5EJztcbiAgICAgIH1cblxuICAgICAgdGhpcy5sb2coeyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IgfSk7XG4gICAgICB0aHJvdyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3I7XG4gICAgfVxuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js new file mode 100644 index 0000000000000..aefb970a3fe47 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js @@ -0,0 +1,280 @@ +"use strict"; +/* eslint-disable no-console */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClusterResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const compareLogging_1 = require("./compareLogging"); +const MAX_CLUSTER_NAME_LEN = 100; +class ClusterResourceHandler extends common_1.ResourceHandler { + get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + return this.physicalResourceId; + } + constructor(eks, event) { + super(eks, event); + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + // ------ + // CREATE + // ------ + async onCreate() { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + const clusterName = this.newProps.name || this.generateClusterName(); + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + return { + PhysicalResourceId: resp.cluster.name, + }; + } + async isCreateComplete() { + return this.isActive(); + } + // ------ + // DELETE + // ------ + async onDelete() { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } + catch (e) { + if (!(e instanceof client_eks_1.ResourceNotFoundException)) { + throw e; + } + else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + async isDeleteComplete() { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } + catch (e) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof client_eks_1.ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + console.log('describeCluster error:', e); + throw e; + } + return { + IsComplete: false, + }; + } + // ------ + // UPDATE + // ------ + async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + return this.onCreate(); + } + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + return this.updateClusterVersion(this.newProps.version); + } + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + if (updates.updateLogging || updates.updateAccess) { + const config = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + } + ; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + return { EksUpdateId: updateResponse.update?.id }; + } + // no updates + return; + } + async isUpdateComplete() { + console.log('isUpdateComplete'); + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + return this.isActive(); + } + async updateClusterVersion(newVersion) { + console.log(`updating cluster version to ${newVersion}`); + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + async isActive() { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } + else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } + else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + async isEksUpdateComplete(eksUpdateId) { + this.log({ isEksUpdateComplete: eksUpdateId }); + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + this.log({ describeUpdateResponse }); + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} +exports.ClusterResourceHandler = ClusterResourceHandler; +function parseProps(props) { + const parsed = props?.Config ?? {}; + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + return parsed; +} +function analyzeUpdate(oldProps, newProps) { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} +function setsEqual(first, second) { + return first.size === second.size && [...first].every((e) => second.has(e)); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBRS9CLDZEQUE2RDtBQUM3RCxvREFBZ0U7QUFHaEUscUNBQXFFO0FBQ3JFLHFEQUF1RDtBQUd2RCxNQUFNLG9CQUFvQixHQUFHLEdBQUcsQ0FBQztBQUVqQyxNQUFhLHNCQUF1QixTQUFRLHdCQUFlO0lBQ3pELElBQVcsV0FBVztRQUNwQixJQUFJLENBQUMsSUFBSSxDQUFDLGtCQUFrQixFQUFFO1lBQzVCLE1BQU0sSUFBSSxLQUFLLENBQUMsNERBQTRELENBQUMsQ0FBQztTQUMvRTtRQUVELE9BQU8sSUFBSSxDQUFDLGtCQUFrQixDQUFDO0tBQ2hDO0lBS0QsWUFBWSxHQUFjLEVBQUUsS0FBb0I7UUFDOUMsS0FBSyxDQUFDLEdBQUcsRUFBRSxLQUFLLENBQUMsQ0FBQztRQUVsQixJQUFJLENBQUMsUUFBUSxHQUFHLFVBQVUsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLENBQUM7UUFDMUQsSUFBSSxDQUFDLFFBQVEsR0FBRyxLQUFLLENBQUMsV0FBVyx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OLnN0cmluZ2lmeShvbGRWcGNQcm9wcy5zZWN1cml0eUdyb3VwSWRzPy5zb3J0KCkpLFxuICAgIHVwZGF0ZUFjY2VzczpcbiAgICAgIG5ld1ZwY1Byb3BzLmVuZHBvaW50UHJpdmF0ZUFjY2VzcyAhPT0gb2xkVnBjUHJvcHMuZW5kcG9pbnRQcml2YXRlQWNjZXNzIHx8XG4gICAgICBuZXdWcGNQcm9wcy5lbmRwb2ludFB1YmxpY0FjY2VzcyAhPT0gb2xkVnBjUHJvcHMuZW5kcG9pbnRQdWJsaWNBY2Nlc3MgfHxcbiAgICAgICFzZXRzRXF1YWwobmV3UHVibGljQWNjZXNzQ2lkcnMsIG9sZFB1YmxpY0FjY2Vzc0NpZHJzKSxcbiAgICByZXBsYWNlUm9sZTogbmV3UHJvcHMucm9sZUFybiAhPT0gb2xkUHJvcHMucm9sZUFybixcbiAgICB1cGRhdGVWZXJzaW9uOiBuZXdQcm9wcy52ZXJzaW9uICE9PSBvbGRQcm9wcy52ZXJzaW9uLFxuICAgIHVwZGF0ZUVuY3J5cHRpb246IEpTT04uc3RyaW5naWZ5KG5ld0VuYykgIT09IEpTT04uc3RyaW5naWZ5KG9sZEVuYyksXG4gICAgdXBkYXRlTG9nZ2luZzogSlNPTi5zdHJpbmdpZnkobmV3UHJvcHMubG9nZ2luZykgIT09IEpTT04uc3RyaW5naWZ5KG9sZFByb3BzLmxvZ2dpbmcpLFxuICB9O1xufVxuXG5mdW5jdGlvbiBzZXRzRXF1YWwoZmlyc3Q6IFNldDxzdHJpbmc+LCBzZWNvbmQ6IFNldDxzdHJpbmc+KSB7XG4gIHJldHVybiBmaXJzdC5zaXplID09PSBzZWNvbmQuc2l6ZSAmJiBbLi4uZmlyc3RdLmV2ZXJ5KChlOiBzdHJpbmcpID0+IHNlY29uZC5oYXMoZSkpO1xufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts similarity index 98% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts index c058e47b62c68..3a0a7294db31d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts @@ -1,6 +1,7 @@ /* eslint-disable no-console */ // eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; // eslint-disable-next-line import/no-extraneous-dependencies import * as aws from 'aws-sdk'; import { EksClient, ResourceEvent, ResourceHandler } from './common'; @@ -70,7 +71,7 @@ export class ClusterResourceHandler extends ResourceHandler { try { await this.eks.deleteCluster({ name: this.clusterName }); } catch (e: any) { - if (e.code !== 'ResourceNotFoundException') { + if (!(e instanceof ResourceNotFoundException)) { throw e; } else { console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); @@ -88,7 +89,8 @@ export class ClusterResourceHandler extends ResourceHandler { const resp = await this.eks.describeCluster({ name: this.clusterName }); console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); } catch (e: any) { - if (e.code === 'ResourceNotFoundException') { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof ResourceNotFoundException) { console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); return { IsComplete: true }; } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js new file mode 100644 index 0000000000000..ed1eab8530351 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FargateProfileResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const MAX_NAME_LEN = 63; +class FargateProfileResourceHandler extends common_1.ResourceHandler { + async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + const createFargateProfile = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + const deleteFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + return; + } + async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + async isCreateComplete() { + return this.isUpdateComplete(); + } + async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + /** + * Generates a fargate profile name. + */ + generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + async queryStatus() { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + const describeFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + try { + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + return status; + } + catch (describeFargateProfileError) { + if (describeFargateProfileError instanceof client_eks_1.ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} +exports.FargateProfileResourceHandler = FargateProfileResourceHandler; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJza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XRlUHJvZmlsZUVycm9yO1xuICAgIH1cbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts similarity index 95% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts index 7db97a7f69d38..16b9f9abfeb49 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts @@ -1,3 +1,5 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies import { ResourceHandler } from './common'; @@ -107,7 +109,7 @@ export class FargateProfileResourceHandler extends ResourceHandler { return status; } catch (describeFargateProfileError: any) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { + if (describeFargateProfileError instanceof ResourceNotFoundException) { this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); return 'NOT_FOUND'; } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip index 93f7400e6f8c2..11112de67d5be 100644 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip similarity index 79% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip index e6cb898734b43..90a8a2a6e2615 100644 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/aws-cdk-eks-cluster-alb-controller-test.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/aws-cdk-eks-cluster-alb-controller-test.assets.json index 6add6d166f74c..db9c7a020fac7 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/aws-cdk-eks-cluster-alb-controller-test.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/aws-cdk-eks-cluster-alb-controller-test.assets.json @@ -27,15 +27,15 @@ } } }, - "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649": { + "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31": { "source": { - "path": "asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649", + "path": "asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip", + "objectKey": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -66,15 +66,15 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -118,7 +118,7 @@ } } }, - "03d17cf4c28db537b0022c15973dfcbf24c64d601c8683ad6048973e86263845": { + "ed012d36e261547b5795bf6e996a1a006198858a3d725acbffba1fbf3945c568": { "source": { "path": "awscdkeksclusteralbcontrollertestawscdkawseksClusterResourceProvider5DBBAFBB.nested.template.json", "packaging": "file" @@ -126,12 +126,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "03d17cf4c28db537b0022c15973dfcbf24c64d601c8683ad6048973e86263845.json", + "objectKey": "ed012d36e261547b5795bf6e996a1a006198858a3d725acbffba1fbf3945c568.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "ef91cf38027fbab9acc28eafb2336c591805c0cfbb3b8c5aa5cf7ab254ae7f0a": { + "25fd3b4cf6204dc6e6e36db486314408eedf1b7d35b2c07902e894af57f6c2f5": { "source": { "path": "awscdkeksclusteralbcontrollertestawscdkawseksKubectlProviderA1AC28D1.nested.template.json", "packaging": "file" @@ -139,12 +139,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "ef91cf38027fbab9acc28eafb2336c591805c0cfbb3b8c5aa5cf7ab254ae7f0a.json", + "objectKey": "25fd3b4cf6204dc6e6e36db486314408eedf1b7d35b2c07902e894af57f6c2f5.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "62754c7e6bb26968937daae6e96929d03d6698fc78121759b492fa275c70254b": { + "428cdd49c835d507cf04b3ce2e908b84de14c09f1e8f4e2f07668bb49a6c37c6": { "source": { "path": "aws-cdk-eks-cluster-alb-controller-test.template.json", "packaging": "file" @@ -152,7 +152,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "62754c7e6bb26968937daae6e96929d03d6698fc78121759b492fa275c70254b.json", + "objectKey": "428cdd49c835d507cf04b3ce2e908b84de14c09f1e8f4e2f07668bb49a6c37c6.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/aws-cdk-eks-cluster-alb-controller-test.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/aws-cdk-eks-cluster-alb-controller-test.template.json index bffea8d634481..70ce386338b56 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/aws-cdk-eks-cluster-alb-controller-test.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/aws-cdk-eks-cluster-alb-controller-test.template.json @@ -973,7 +973,7 @@ "Fn::Join": [ "", [ - "[{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"name\":\"hello-server-deployment-c852e88c\",\"labels\":{\"aws.cdk.eks/prune-c88b1dfeeaf63e3024ab07862029ba60fd8907fb04\":\"\"}},\"spec\":{\"minReadySeconds\":0,\"progressDeadlineSeconds\":600,\"replicas\":2,\"selector\":{\"matchLabels\":{\"cdk8s.io/metadata.addr\":\"hello-server-Deployment-c8659a74\"}},\"strategy\":{\"rollingUpdate\":{\"maxSurge\":\"25%\",\"maxUnavailable\":\"25%\"},\"type\":\"RollingUpdate\"},\"template\":{\"metadata\":{\"labels\":{\"cdk8s.io/metadata.addr\":\"hello-server-Deployment-c8659a74\"}},\"spec\":{\"automountServiceAccountToken\":false,\"containers\":[{\"args\":[\"-text\",\"hello\"],\"image\":\"hashicorp/http-echo\",\"imagePullPolicy\":\"Always\",\"name\":\"main\",\"ports\":[{\"containerPort\":5678}],\"resources\":{\"limits\":{\"cpu\":\"1500m\",\"memory\":\"2048Mi\"},\"requests\":{\"cpu\":\"1000m\",\"memory\":\"512Mi\"}},\"securityContext\":{\"allowPrivilegeEscalation\":false,\"privileged\":false,\"readOnlyRootFilesystem\":true,\"runAsNonRoot\":true,\"runAsUser\":1005},\"startupProbe\":{\"failureThreshold\":3,\"tcpSocket\":{\"port\":5678}}}],\"dnsPolicy\":\"ClusterFirst\",\"hostNetwork\":false,\"restartPolicy\":\"Always\",\"securityContext\":{\"fsGroupChangePolicy\":\"Always\",\"runAsNonRoot\":true},\"setHostnameAsFQDN\":false}}}},{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"name\":\"hello-server-deployment-service-c8fd9c61\",\"labels\":{\"aws.cdk.eks/prune-c88b1dfeeaf63e3024ab07862029ba60fd8907fb04\":\"\"}},\"spec\":{\"externalIPs\":[],\"ports\":[{\"port\":5678,\"targetPort\":5678}],\"selector\":{\"cdk8s.io/metadata.addr\":\"hello-server-Deployment-c8659a74\"},\"type\":\"NodePort\"}},{\"apiVersion\":\"networking.k8s.io/v1\",\"kind\":\"Ingress\",\"metadata\":{\"annotations\":{\"kubernetes.io/ingress.class\":\"alb\",\"alb.ingress.kubernetes.io/scheme\":\"internal\",\"alb.ingress.kubernetes.io/inbound-cidrs\":\"", + "[{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"name\":\"hello-server-deployment-c852e88c\",\"labels\":{\"aws.cdk.eks/prune-c88b1dfeeaf63e3024ab07862029ba60fd8907fb04\":\"\"}},\"spec\":{\"minReadySeconds\":0,\"progressDeadlineSeconds\":600,\"replicas\":2,\"selector\":{\"matchLabels\":{\"cdk8s.io/metadata.addr\":\"hello-server-Deployment-c8659a74\"}},\"strategy\":{\"rollingUpdate\":{\"maxSurge\":\"25%\",\"maxUnavailable\":\"25%\"},\"type\":\"RollingUpdate\"},\"template\":{\"metadata\":{\"labels\":{\"cdk8s.io/metadata.addr\":\"hello-server-Deployment-c8659a74\"}},\"spec\":{\"automountServiceAccountToken\":false,\"containers\":[{\"args\":[\"-text\",\"hello\"],\"image\":\"hashicorp/http-echo\",\"imagePullPolicy\":\"Always\",\"name\":\"main\",\"ports\":[{\"containerPort\":5678}],\"resources\":{\"limits\":{\"cpu\":\"1500m\",\"memory\":\"2048Mi\"},\"requests\":{\"cpu\":\"1000m\",\"memory\":\"512Mi\"}},\"securityContext\":{\"allowPrivilegeEscalation\":false,\"privileged\":false,\"readOnlyRootFilesystem\":true,\"runAsNonRoot\":true,\"runAsUser\":1005},\"startupProbe\":{\"failureThreshold\":3,\"tcpSocket\":{\"port\":5678}}}],\"dnsPolicy\":\"ClusterFirst\",\"hostNetwork\":false,\"restartPolicy\":\"Always\",\"securityContext\":{\"fsGroupChangePolicy\":\"Always\",\"runAsNonRoot\":true},\"setHostnameAsFQDN\":false,\"terminationGracePeriodSeconds\":30}}}},{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"name\":\"hello-server-deployment-service-c8fd9c61\",\"labels\":{\"aws.cdk.eks/prune-c88b1dfeeaf63e3024ab07862029ba60fd8907fb04\":\"\"}},\"spec\":{\"externalIPs\":[],\"ports\":[{\"port\":5678,\"targetPort\":5678}],\"selector\":{\"cdk8s.io/metadata.addr\":\"hello-server-Deployment-c8659a74\"},\"type\":\"NodePort\"}},{\"apiVersion\":\"networking.k8s.io/v1\",\"kind\":\"Ingress\",\"metadata\":{\"annotations\":{\"kubernetes.io/ingress.class\":\"alb\",\"alb.ingress.kubernetes.io/scheme\":\"internal\",\"alb.ingress.kubernetes.io/inbound-cidrs\":\"", { "Fn::GetAtt": [ "Vpc8378EB38", @@ -1055,7 +1055,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/03d17cf4c28db537b0022c15973dfcbf24c64d601c8683ad6048973e86263845.json" + "/ed012d36e261547b5795bf6e996a1a006198858a3d725acbffba1fbf3945c568.json" ] ] } @@ -1105,7 +1105,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/ef91cf38027fbab9acc28eafb2336c591805c0cfbb3b8c5aa5cf7ab254ae7f0a.json" + "/25fd3b4cf6204dc6e6e36db486314408eedf1b7d35b2c07902e894af57f6c2f5.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/awscdkeksclusteralbcontrollertestawscdkawseksClusterResourceProvider5DBBAFBB.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/awscdkeksclusteralbcontrollertestawscdkawseksClusterResourceProvider5DBBAFBB.nested.template.json index ed6cbd00f552e..f3cfee43d3295 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/awscdkeksclusteralbcontrollertestawscdkawseksClusterResourceProvider5DBBAFBB.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/awscdkeksclusteralbcontrollertestawscdkawseksClusterResourceProvider5DBBAFBB.nested.template.json @@ -50,7 +50,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "onEvent handler for EKS cluster resource provider", "Environment": { @@ -115,7 +115,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "isComplete handler for EKS cluster resource provider", "Environment": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/awscdkeksclusteralbcontrollertestawscdkawseksKubectlProviderA1AC28D1.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/awscdkeksclusteralbcontrollertestawscdkawseksKubectlProviderA1AC28D1.nested.template.json index 70fad39f3fe86..3905b8e79fd85 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/awscdkeksclusteralbcontrollertestawscdkawseksKubectlProviderA1AC28D1.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/awscdkeksclusteralbcontrollertestawscdkawseksKubectlProviderA1AC28D1.nested.template.json @@ -49,7 +49,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/cdk.out index f0b901e7c06e5..560dae10d018f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"33.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/manifest.json index 68c7429365325..c35042201558e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/manifest.json @@ -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}/62754c7e6bb26968937daae6e96929d03d6698fc78121759b492fa275c70254b.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/428cdd49c835d507cf04b3ce2e908b84de14c09f1e8f4e2f07668bb49a6c37c6.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/tree.json index 805465973aeb6..bf4ed9f85098b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/tree.json @@ -697,7 +697,7 @@ }, "constructInfo": { "fqn": "@aws-cdk/lambda-layer-kubectl-v24.KubectlV24Layer", - "version": "2.0.229" + "version": "2.0.242" } }, "Cluster": { @@ -1563,7 +1563,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "onEvent handler for EKS cluster resource provider", "environment": { @@ -1695,7 +1695,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "isComplete handler for EKS cluster resource provider", "environment": { @@ -2601,7 +2601,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/03d17cf4c28db537b0022c15973dfcbf24c64d601c8683ad6048973e86263845.json" + "/ed012d36e261547b5795bf6e996a1a006198858a3d725acbffba1fbf3945c568.json" ] ] } @@ -2748,7 +2748,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -3112,7 +3112,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/ef91cf38027fbab9acc28eafb2336c591805c0cfbb3b8c5aa5cf7ab254ae7f0a.json" + "/25fd3b4cf6204dc6e6e36db486314408eedf1b7d35b2c07902e894af57f6c2f5.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js deleted file mode 100644 index b89707a0a08e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js +++ /dev/null @@ -1,277 +0,0 @@ -"use strict"; -/* eslint-disable no-console */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ClusterResourceHandler = void 0; -const common_1 = require("./common"); -const compareLogging_1 = require("./compareLogging"); -const MAX_CLUSTER_NAME_LEN = 100; -class ClusterResourceHandler extends common_1.ResourceHandler { - get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - return this.physicalResourceId; - } - constructor(eks, event) { - super(eks, event); - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - // ------ - // CREATE - // ------ - async onCreate() { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - const clusterName = this.newProps.name || this.generateClusterName(); - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - return { - PhysicalResourceId: resp.cluster.name, - }; - } - async isCreateComplete() { - return this.isActive(); - } - // ------ - // DELETE - // ------ - async onDelete() { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } - catch (e) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } - else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - async isDeleteComplete() { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } - catch (e) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - console.log('describeCluster error:', e); - throw e; - } - return { - IsComplete: false, - }; - } - // ------ - // UPDATE - // ------ - async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - return this.onCreate(); - } - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - return this.updateClusterVersion(this.newProps.version); - } - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - if (updates.updateLogging || updates.updateAccess) { - const config = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - } - ; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - return { EksUpdateId: updateResponse.update?.id }; - } - // no updates - return; - } - async isUpdateComplete() { - console.log('isUpdateComplete'); - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - return this.isActive(); - } - async updateClusterVersion(newVersion) { - console.log(`updating cluster version to ${newVersion}`); - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - async isActive() { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } - else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } - else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - async isEksUpdateComplete(eksUpdateId) { - this.log({ isEksUpdateComplete: eksUpdateId }); - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - this.log({ describeUpdateResponse }); - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} -exports.ClusterResourceHandler = ClusterResourceHandler; -function parseProps(props) { - const parsed = props?.Config ?? {}; - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - return parsed; -} -function analyzeUpdate(oldProps, newProps) { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} -function setsEqual(first, second) { - return first.size === second.size && [...first].every((e) => second.has(e)); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBSy9CLHFDQUFxRTtBQUNyRSxxREFBdUQ7QUFHdkQsTUFBTSxvQkFBb0IsR0FBRyxHQUFHLENBQUM7QUFFakMsTUFBYSxzQkFBdUIsU0FBUSx3QkFBZTtJQUN6RCxJQUFXLFdBQVc7UUFDcEIsSUFBSSxDQUFDLElBQUksQ0FBQyxrQkFBa0IsRUFBRTtZQUM1QixNQUFNLElBQUksS0FBSyxDQUFDLDREQUE0RCxDQUFDLENBQUM7U0FDL0U7UUFFRCxPQUFPLElBQUksQ0FBQyxrQkFBa0IsQ0FBQztLQUNoQztJQUtELFlBQVksR0FBYyxFQUFFLEtBQW9CO1FBQzlDLEtBQUssQ0FBQyxHQUFHLEVBQUUsS0FBSyxDQUFDLENBQUM7UUFFbEIsSUFBSSxDQUFDLFFBQVEsR0FBRyxVQUFVLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO1FBQzFELElBQUksQ0FBQyxRQUFRLEdBQUcsS0FBSyxDQUFDLFdBQVcsS0FBSyxRQUFRLENBQUMsQ0FBQyxDQUFDLFVBQVUsQ0FBQyxLQUFLLENBQUMscUJBQXFCLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDO1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NzICE9PSBvbGRWcGNQcm9wcy5lbmRwb2ludFB1YmxpY0FjY2VzcyB8fFxuICAgICAgIXNldHNFcXVhbChuZXdQdWJsaWNBY2Nlc3NDaWRycywgb2xkUHVibGljQWNjZXNzQ2lkcnMpLFxuICAgIHJlcGxhY2VSb2xlOiBuZXdQcm9wcy5yb2xlQXJuICE9PSBvbGRQcm9wcy5yb2xlQXJuLFxuICAgIHVwZGF0ZVZlcnNpb246IG5ld1Byb3BzLnZlcnNpb24gIT09IG9sZFByb3BzLnZlcnNpb24sXG4gICAgdXBkYXRlRW5jcnlwdGlvbjogSlNPTi5zdHJpbmdpZnkobmV3RW5jKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkRW5jKSxcbiAgICB1cGRhdGVMb2dnaW5nOiBKU09OLnN0cmluZ2lmeShuZXdQcm9wcy5sb2dnaW5nKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkUHJvcHMubG9nZ2luZyksXG4gIH07XG59XG5cbmZ1bmN0aW9uIHNldHNFcXVhbChmaXJzdDogU2V0PHN0cmluZz4sIHNlY29uZDogU2V0PHN0cmluZz4pIHtcbiAgcmV0dXJuIGZpcnN0LnNpemUgPT09IHNlY29uZC5zaXplICYmIFsuLi5maXJzdF0uZXZlcnkoKGU6IHN0cmluZykgPT4gc2Vjb25kLmhhcyhlKSk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js deleted file mode 100644 index 34ab6ff0ba0e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FargateProfileResourceHandler = void 0; -const common_1 = require("./common"); -const MAX_NAME_LEN = 63; -class FargateProfileResourceHandler extends common_1.ResourceHandler { - async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - const createFargateProfile = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - const deleteFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - return; - } - async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - async isCreateComplete() { - return this.isUpdateComplete(); - } - async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - /** - * Generates a fargate profile name. - */ - generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - async queryStatus() { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - const describeFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - try { - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - return status; - } - catch (describeFargateProfileError) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} -exports.FargateProfileResourceHandler = FargateProfileResourceHandler; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EscUNBQTJDO0FBRTNDLE1BQU0sWUFBWSxHQUFHLEVBQUUsQ0FBQztBQUV4QixNQUFhLDZCQUE4QixTQUFRLHdCQUFlO0lBQ3RELEtBQUssQ0FBQyxRQUFRO1FBQ3RCLE1BQU0sa0JBQWtCLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNLENBQUMsa0JBQWtCLElBQUksSUFBSSxDQUFDLG1CQUFtQixFQUFFLENBQUM7UUFFakgsTUFBTSxvQkFBb0IsR0FBd0M7WUFDaEUsa0JBQWtCO1lBQ2xCLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNO1NBQ3hDLENBQUM7UUFFRixJQUFJLENB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XJyb3IuY29kZSA9PT0gJ1Jlc291cmNlTm90Rm91bmRFeGNlcHRpb24nKSB7XG4gICAgICAgIHRoaXMubG9nKCdyZWNlaXZlZCBSZXNvdXJjZU5vdEZvdW5kRXhjZXB0aW9uLCB0aGlzIG1lYW5zIHRoZSBwcm9maWxlIGhhcyBiZWVuIGRlbGV0ZWQgKG9yIG5ldmVyIGV4aXN0ZWQpJyk7XG4gICAgICAgIHJldHVybiAnTk9UX0ZPVU5EJztcbiAgICAgIH1cblxuICAgICAgdGhpcy5sb2coeyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IgfSk7XG4gICAgICB0aHJvdyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3I7XG4gICAgfVxuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js new file mode 100644 index 0000000000000..aefb970a3fe47 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js @@ -0,0 +1,280 @@ +"use strict"; +/* eslint-disable no-console */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClusterResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const compareLogging_1 = require("./compareLogging"); +const MAX_CLUSTER_NAME_LEN = 100; +class ClusterResourceHandler extends common_1.ResourceHandler { + get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + return this.physicalResourceId; + } + constructor(eks, event) { + super(eks, event); + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + // ------ + // CREATE + // ------ + async onCreate() { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + const clusterName = this.newProps.name || this.generateClusterName(); + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + return { + PhysicalResourceId: resp.cluster.name, + }; + } + async isCreateComplete() { + return this.isActive(); + } + // ------ + // DELETE + // ------ + async onDelete() { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } + catch (e) { + if (!(e instanceof client_eks_1.ResourceNotFoundException)) { + throw e; + } + else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + async isDeleteComplete() { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } + catch (e) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof client_eks_1.ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + console.log('describeCluster error:', e); + throw e; + } + return { + IsComplete: false, + }; + } + // ------ + // UPDATE + // ------ + async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + return this.onCreate(); + } + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + return this.updateClusterVersion(this.newProps.version); + } + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + if (updates.updateLogging || updates.updateAccess) { + const config = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + } + ; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + return { EksUpdateId: updateResponse.update?.id }; + } + // no updates + return; + } + async isUpdateComplete() { + console.log('isUpdateComplete'); + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + return this.isActive(); + } + async updateClusterVersion(newVersion) { + console.log(`updating cluster version to ${newVersion}`); + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + async isActive() { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } + else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } + else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + async isEksUpdateComplete(eksUpdateId) { + this.log({ isEksUpdateComplete: eksUpdateId }); + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + this.log({ describeUpdateResponse }); + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} +exports.ClusterResourceHandler = ClusterResourceHandler; +function parseProps(props) { + const parsed = props?.Config ?? {}; + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + return parsed; +} +function analyzeUpdate(oldProps, newProps) { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} +function setsEqual(first, second) { + return first.size === second.size && [...first].every((e) => second.has(e)); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvd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0FjY2Vzc0NpZHJzKSxcbiAgICByZXBsYWNlUm9sZTogbmV3UHJvcHMucm9sZUFybiAhPT0gb2xkUHJvcHMucm9sZUFybixcbiAgICB1cGRhdGVWZXJzaW9uOiBuZXdQcm9wcy52ZXJzaW9uICE9PSBvbGRQcm9wcy52ZXJzaW9uLFxuICAgIHVwZGF0ZUVuY3J5cHRpb246IEpTT04uc3RyaW5naWZ5KG5ld0VuYykgIT09IEpTT04uc3RyaW5naWZ5KG9sZEVuYyksXG4gICAgdXBkYXRlTG9nZ2luZzogSlNPTi5zdHJpbmdpZnkobmV3UHJvcHMubG9nZ2luZykgIT09IEpTT04uc3RyaW5naWZ5KG9sZFByb3BzLmxvZ2dpbmcpLFxuICB9O1xufVxuXG5mdW5jdGlvbiBzZXRzRXF1YWwoZmlyc3Q6IFNldDxzdHJpbmc+LCBzZWNvbmQ6IFNldDxzdHJpbmc+KSB7XG4gIHJldHVybiBmaXJzdC5zaXplID09PSBzZWNvbmQuc2l6ZSAmJiBbLi4uZmlyc3RdLmV2ZXJ5KChlOiBzdHJpbmcpID0+IHNlY29uZC5oYXMoZSkpO1xufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts similarity index 98% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts index c058e47b62c68..3a0a7294db31d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts @@ -1,6 +1,7 @@ /* eslint-disable no-console */ // eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; // eslint-disable-next-line import/no-extraneous-dependencies import * as aws from 'aws-sdk'; import { EksClient, ResourceEvent, ResourceHandler } from './common'; @@ -70,7 +71,7 @@ export class ClusterResourceHandler extends ResourceHandler { try { await this.eks.deleteCluster({ name: this.clusterName }); } catch (e: any) { - if (e.code !== 'ResourceNotFoundException') { + if (!(e instanceof ResourceNotFoundException)) { throw e; } else { console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); @@ -88,7 +89,8 @@ export class ClusterResourceHandler extends ResourceHandler { const resp = await this.eks.describeCluster({ name: this.clusterName }); console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); } catch (e: any) { - if (e.code === 'ResourceNotFoundException') { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof ResourceNotFoundException) { console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); return { IsComplete: true }; } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js new file mode 100644 index 0000000000000..ed1eab8530351 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FargateProfileResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const MAX_NAME_LEN = 63; +class FargateProfileResourceHandler extends common_1.ResourceHandler { + async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + const createFargateProfile = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + const deleteFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + return; + } + async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + async isCreateComplete() { + return this.isUpdateComplete(); + } + async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + /** + * Generates a fargate profile name. + */ + generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + async queryStatus() { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + const describeFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + try { + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + return status; + } + catch (describeFargateProfileError) { + if (describeFargateProfileError instanceof client_eks_1.ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} +exports.FargateProfileResourceHandler = FargateProfileResourceHandler; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb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line at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts similarity index 95% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts index 7db97a7f69d38..16b9f9abfeb49 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts @@ -1,3 +1,5 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies import { ResourceHandler } from './common'; @@ -107,7 +109,7 @@ export class FargateProfileResourceHandler extends ResourceHandler { return status; } catch (describeFargateProfileError: any) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { + if (describeFargateProfileError instanceof ResourceNotFoundException) { this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); return 'NOT_FOUND'; } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip index 93f7400e6f8c2..11112de67d5be 100644 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip similarity index 79% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip index e6cb898734b43..90a8a2a6e2615 100644 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/aws-cdk-eks-cluster-bottlerocket-ng-test.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/aws-cdk-eks-cluster-bottlerocket-ng-test.assets.json index 1bcc402a8bd7a..aa0c968f44aae 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/aws-cdk-eks-cluster-bottlerocket-ng-test.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/aws-cdk-eks-cluster-bottlerocket-ng-test.assets.json @@ -27,15 +27,15 @@ } } }, - "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649": { + "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31": { "source": { - "path": "asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649", + "path": "asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip", + "objectKey": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -66,20 +66,20 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "bdf702e57b56cbfa0d04058257f2cf794def3496ab3121b25a1632b7e7d2016b": { + "e87f00befb440934fcea852540998d464dffa21d194337f3ecfa5d44d0a9d84a": { "source": { "path": "awscdkeksclusterbottlerocketngtestawscdkawseksClusterResourceProvider7EC04E81.nested.template.json", "packaging": "file" @@ -87,12 +87,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "bdf702e57b56cbfa0d04058257f2cf794def3496ab3121b25a1632b7e7d2016b.json", + "objectKey": "e87f00befb440934fcea852540998d464dffa21d194337f3ecfa5d44d0a9d84a.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "796ff19246e8d3cbe41a8bb2f1ce3b5dedb5687958765fad3a3031a77e0c3362": { + "f6e8396f4e07857a35676217a1808b698f3ab60f755792a0d146cd5b601fa537": { "source": { "path": "awscdkeksclusterbottlerocketngtestawscdkawseksKubectlProviderE02BC096.nested.template.json", "packaging": "file" @@ -100,12 +100,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "796ff19246e8d3cbe41a8bb2f1ce3b5dedb5687958765fad3a3031a77e0c3362.json", + "objectKey": "f6e8396f4e07857a35676217a1808b698f3ab60f755792a0d146cd5b601fa537.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "10e329ef469b98a93b5919c149a66826866f25aec7efd58f05998bc90f2cd311": { + "98b694cff6ebbf29ba2d93aee00916353ee228aab7083c59933c863c06dc1b61": { "source": { "path": "aws-cdk-eks-cluster-bottlerocket-ng-test.template.json", "packaging": "file" @@ -113,7 +113,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "10e329ef469b98a93b5919c149a66826866f25aec7efd58f05998bc90f2cd311.json", + "objectKey": "98b694cff6ebbf29ba2d93aee00916353ee228aab7083c59933c863c06dc1b61.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/aws-cdk-eks-cluster-bottlerocket-ng-test.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/aws-cdk-eks-cluster-bottlerocket-ng-test.template.json index fb8208ebb9520..e7bdd15c893a9 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/aws-cdk-eks-cluster-bottlerocket-ng-test.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/aws-cdk-eks-cluster-bottlerocket-ng-test.template.json @@ -1090,7 +1090,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/bdf702e57b56cbfa0d04058257f2cf794def3496ab3121b25a1632b7e7d2016b.json" + "/e87f00befb440934fcea852540998d464dffa21d194337f3ecfa5d44d0a9d84a.json" ] ] } @@ -1140,7 +1140,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/796ff19246e8d3cbe41a8bb2f1ce3b5dedb5687958765fad3a3031a77e0c3362.json" + "/f6e8396f4e07857a35676217a1808b698f3ab60f755792a0d146cd5b601fa537.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/awscdkeksclusterbottlerocketngtestawscdkawseksClusterResourceProvider7EC04E81.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/awscdkeksclusterbottlerocketngtestawscdkawseksClusterResourceProvider7EC04E81.nested.template.json index 74aaac95963f3..045fb3a0b9352 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/awscdkeksclusterbottlerocketngtestawscdkawseksClusterResourceProvider7EC04E81.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/awscdkeksclusterbottlerocketngtestawscdkawseksClusterResourceProvider7EC04E81.nested.template.json @@ -50,7 +50,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "onEvent handler for EKS cluster resource provider", "Environment": { @@ -115,7 +115,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "isComplete handler for EKS cluster resource provider", "Environment": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/awscdkeksclusterbottlerocketngtestawscdkawseksKubectlProviderE02BC096.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/awscdkeksclusterbottlerocketngtestawscdkawseksKubectlProviderE02BC096.nested.template.json index a14bd873f5644..4d421e35c59bf 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/awscdkeksclusterbottlerocketngtestawscdkawseksKubectlProviderE02BC096.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/awscdkeksclusterbottlerocketngtestawscdkawseksKubectlProviderE02BC096.nested.template.json @@ -49,7 +49,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/cdk.out index f0b901e7c06e5..560dae10d018f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"33.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/manifest.json index 022384ef7f4ac..b27051d27fcab 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/manifest.json @@ -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}/10e329ef469b98a93b5919c149a66826866f25aec7efd58f05998bc90f2cd311.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/98b694cff6ebbf29ba2d93aee00916353ee228aab7083c59933c863c06dc1b61.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/tree.json index 1623bb150c641..cade5798a99fb 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-bottlerocket-ng.js.snapshot/tree.json @@ -755,7 +755,7 @@ }, "constructInfo": { "fqn": "@aws-cdk/lambda-layer-kubectl-v24.KubectlV24Layer", - "version": "2.0.229" + "version": "2.0.242" } }, "Cluster": { @@ -1678,7 +1678,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "onEvent handler for EKS cluster resource provider", "environment": { @@ -1810,7 +1810,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "isComplete handler for EKS cluster resource provider", "environment": { @@ -2716,7 +2716,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/bdf702e57b56cbfa0d04058257f2cf794def3496ab3121b25a1632b7e7d2016b.json" + "/e87f00befb440934fcea852540998d464dffa21d194337f3ecfa5d44d0a9d84a.json" ] ] } @@ -2863,7 +2863,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -3227,7 +3227,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/796ff19246e8d3cbe41a8bb2f1ce3b5dedb5687958765fad3a3031a77e0c3362.json" + "/f6e8396f4e07857a35676217a1808b698f3ab60f755792a0d146cd5b601fa537.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js deleted file mode 100644 index b89707a0a08e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js +++ /dev/null @@ -1,277 +0,0 @@ -"use strict"; -/* eslint-disable no-console */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ClusterResourceHandler = void 0; -const common_1 = require("./common"); -const compareLogging_1 = require("./compareLogging"); -const MAX_CLUSTER_NAME_LEN = 100; -class ClusterResourceHandler extends common_1.ResourceHandler { - get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - return this.physicalResourceId; - } - constructor(eks, event) { - super(eks, event); - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - // ------ - // CREATE - // ------ - async onCreate() { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - const clusterName = this.newProps.name || this.generateClusterName(); - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - return { - PhysicalResourceId: resp.cluster.name, - }; - } - async isCreateComplete() { - return this.isActive(); - } - // ------ - // DELETE - // ------ - async onDelete() { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } - catch (e) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } - else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - async isDeleteComplete() { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } - catch (e) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - console.log('describeCluster error:', e); - throw e; - } - return { - IsComplete: false, - }; - } - // ------ - // UPDATE - // ------ - async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - return this.onCreate(); - } - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - return this.updateClusterVersion(this.newProps.version); - } - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - if (updates.updateLogging || updates.updateAccess) { - const config = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - } - ; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - return { EksUpdateId: updateResponse.update?.id }; - } - // no updates - return; - } - async isUpdateComplete() { - console.log('isUpdateComplete'); - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - return this.isActive(); - } - async updateClusterVersion(newVersion) { - console.log(`updating cluster version to ${newVersion}`); - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - async isActive() { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } - else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } - else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - async isEksUpdateComplete(eksUpdateId) { - this.log({ isEksUpdateComplete: eksUpdateId }); - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - this.log({ describeUpdateResponse }); - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} -exports.ClusterResourceHandler = ClusterResourceHandler; -function parseProps(props) { - const parsed = props?.Config ?? {}; - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - return parsed; -} -function analyzeUpdate(oldProps, newProps) { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} -function setsEqual(first, second) { - return first.size === second.size && [...first].every((e) => second.has(e)); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBSy9CLHFDQUFxRTtBQUNyRSxxREFBdUQ7QUFHdkQsTUFBTSxvQkFBb0IsR0FBRyxHQUFHLENBQUM7QUFFakMsTUFBYSxzQkFBdUIsU0FBUSx3QkFBZTtJQUN6RCxJQUFXLFdBQVc7UUFDcEIsSUFBSSxDQUFDLElBQUksQ0FBQyxrQkFBa0IsRUFBRTtZQUM1QixNQUFNLElBQUksS0FBSyxDQUFDLDREQUE0RCxDQUFDLENBQUM7U0FDL0U7UUFFRCxPQUFPLElBQUksQ0FBQyxrQkFBa0IsQ0FBQztLQUNoQztJQUtELFlBQVksR0FBYyxFQUFFLEtBQW9CO1FBQzlDLEtBQUssQ0FBQyxHQUFHLEVBQUUsS0FBSyxDQUFDLENBQUM7UUFFbEIsSUFBSSxDQUFDLFFBQVEsR0FBRyxVQUFVLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO1FBQzFELElBQUksQ0FBQyxRQUFRLEdBQUcsS0FBSyxDQUFDLFdBQVcsS0FBSyxRQUFRLENBQUMsQ0FBQyxDQUFDLFVBQVUsQ0FBQyxLQUFLLENBQUMscUJBQXFCLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUF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jZXNzICE9PSBvbGRWcGNQcm9wcy5lbmRwb2ludFB1YmxpY0FjY2VzcyB8fFxuICAgICAgIXNldHNFcXVhbChuZXdQdWJsaWNBY2Nlc3NDaWRycywgb2xkUHVibGljQWNjZXNzQ2lkcnMpLFxuICAgIHJlcGxhY2VSb2xlOiBuZXdQcm9wcy5yb2xlQXJuICE9PSBvbGRQcm9wcy5yb2xlQXJuLFxuICAgIHVwZGF0ZVZlcnNpb246IG5ld1Byb3BzLnZlcnNpb24gIT09IG9sZFByb3BzLnZlcnNpb24sXG4gICAgdXBkYXRlRW5jcnlwdGlvbjogSlNPTi5zdHJpbmdpZnkobmV3RW5jKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkRW5jKSxcbiAgICB1cGRhdGVMb2dnaW5nOiBKU09OLnN0cmluZ2lmeShuZXdQcm9wcy5sb2dnaW5nKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkUHJvcHMubG9nZ2luZyksXG4gIH07XG59XG5cbmZ1bmN0aW9uIHNldHNFcXVhbChmaXJzdDogU2V0PHN0cmluZz4sIHNlY29uZDogU2V0PHN0cmluZz4pIHtcbiAgcmV0dXJuIGZpcnN0LnNpemUgPT09IHNlY29uZC5zaXplICYmIFsuLi5maXJzdF0uZXZlcnkoKGU6IHN0cmluZykgPT4gc2Vjb25kLmhhcyhlKSk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js deleted file mode 100644 index 34ab6ff0ba0e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FargateProfileResourceHandler = void 0; -const common_1 = require("./common"); -const MAX_NAME_LEN = 63; -class FargateProfileResourceHandler extends common_1.ResourceHandler { - async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - const createFargateProfile = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - const deleteFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - return; - } - async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - async isCreateComplete() { - return this.isUpdateComplete(); - } - async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - /** - * Generates a fargate profile name. - */ - generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - async queryStatus() { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - const describeFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - try { - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - return status; - } - catch (describeFargateProfileError) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} -exports.FargateProfileResourceHandler = FargateProfileResourceHandler; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EscUNBQTJDO0FBRTNDLE1BQU0sWUFBWSxHQUFHLEVBQUUsQ0FBQztBQUV4QixNQUFhLDZCQUE4QixTQUFRLHdCQUFlO0lBQ3RELEtBQUssQ0FBQyxRQUFRO1FBQ3RCLE1BQU0sa0JBQWtCLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNLENBQUMsa0JBQWtCLElBQUksSUFBSSxDQUFDLG1CQUFtQixFQUFFLENBQUM7UUFFakgsTUFBTSxvQkFBb0IsR0FBd0M7WUFDaEUsa0JBQWtCO1lBQ2xCLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNO1NBQ3hDLENBQUM7UUFFR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Qcm9maWxlRXJyb3IuY29kZSA9PT0gJ1Jlc291cmNlTm90Rm91bmRFeGNlcHRpb24nKSB7XG4gICAgICAgIHRoaXMubG9nKCdyZWNlaXZlZCBSZXNvdXJjZU5vdEZvdW5kRXhjZXB0aW9uLCB0aGlzIG1lYW5zIHRoZSBwcm9maWxlIGhhcyBiZWVuIGRlbGV0ZWQgKG9yIG5ldmVyIGV4aXN0ZWQpJyk7XG4gICAgICAgIHJldHVybiAnTk9UX0ZPVU5EJztcbiAgICAgIH1cblxuICAgICAgdGhpcy5sb2coeyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IgfSk7XG4gICAgICB0aHJvdyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3I7XG4gICAgfVxuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js new file mode 100644 index 0000000000000..aefb970a3fe47 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js @@ -0,0 +1,280 @@ +"use strict"; +/* eslint-disable no-console */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClusterResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const compareLogging_1 = require("./compareLogging"); +const MAX_CLUSTER_NAME_LEN = 100; +class ClusterResourceHandler extends common_1.ResourceHandler { + get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + return this.physicalResourceId; + } + constructor(eks, event) { + super(eks, event); + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + // ------ + // CREATE + // ------ + async onCreate() { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + const clusterName = this.newProps.name || this.generateClusterName(); + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + return { + PhysicalResourceId: resp.cluster.name, + }; + } + async isCreateComplete() { + return this.isActive(); + } + // ------ + // DELETE + // ------ + async onDelete() { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } + catch (e) { + if (!(e instanceof client_eks_1.ResourceNotFoundException)) { + throw e; + } + else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + async isDeleteComplete() { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } + catch (e) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof client_eks_1.ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + console.log('describeCluster error:', e); + throw e; + } + return { + IsComplete: false, + }; + } + // ------ + // UPDATE + // ------ + async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + return this.onCreate(); + } + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + return this.updateClusterVersion(this.newProps.version); + } + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + if (updates.updateLogging || updates.updateAccess) { + const config = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + } + ; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + return { EksUpdateId: updateResponse.update?.id }; + } + // no updates + return; + } + async isUpdateComplete() { + console.log('isUpdateComplete'); + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + return this.isActive(); + } + async updateClusterVersion(newVersion) { + console.log(`updating cluster version to ${newVersion}`); + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + async isActive() { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } + else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } + else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + async isEksUpdateComplete(eksUpdateId) { + this.log({ isEksUpdateComplete: eksUpdateId }); + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + this.log({ describeUpdateResponse }); + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} +exports.ClusterResourceHandler = ClusterResourceHandler; +function parseProps(props) { + const parsed = props?.Config ?? {}; + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + return parsed; +} +function analyzeUpdate(oldProps, newProps) { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} +function setsEqual(first, second) { + return first.size === second.size && [...first].every((e) => second.has(e)); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlI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zQ2lkcnMsIG9sZFB1YmxpY0FjY2Vzc0NpZHJzKSxcbiAgICByZXBsYWNlUm9sZTogbmV3UHJvcHMucm9sZUFybiAhPT0gb2xkUHJvcHMucm9sZUFybixcbiAgICB1cGRhdGVWZXJzaW9uOiBuZXdQcm9wcy52ZXJzaW9uICE9PSBvbGRQcm9wcy52ZXJzaW9uLFxuICAgIHVwZGF0ZUVuY3J5cHRpb246IEpTT04uc3RyaW5naWZ5KG5ld0VuYykgIT09IEpTT04uc3RyaW5naWZ5KG9sZEVuYyksXG4gICAgdXBkYXRlTG9nZ2luZzogSlNPTi5zdHJpbmdpZnkobmV3UHJvcHMubG9nZ2luZykgIT09IEpTT04uc3RyaW5naWZ5KG9sZFByb3BzLmxvZ2dpbmcpLFxuICB9O1xufVxuXG5mdW5jdGlvbiBzZXRzRXF1YWwoZmlyc3Q6IFNldDxzdHJpbmc+LCBzZWNvbmQ6IFNldDxzdHJpbmc+KSB7XG4gIHJldHVybiBmaXJzdC5zaXplID09PSBzZWNvbmQuc2l6ZSAmJiBbLi4uZmlyc3RdLmV2ZXJ5KChlOiBzdHJpbmcpID0+IHNlY29uZC5oYXMoZSkpO1xufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts similarity index 98% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts index c058e47b62c68..3a0a7294db31d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts @@ -1,6 +1,7 @@ /* eslint-disable no-console */ // eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; // eslint-disable-next-line import/no-extraneous-dependencies import * as aws from 'aws-sdk'; import { EksClient, ResourceEvent, ResourceHandler } from './common'; @@ -70,7 +71,7 @@ export class ClusterResourceHandler extends ResourceHandler { try { await this.eks.deleteCluster({ name: this.clusterName }); } catch (e: any) { - if (e.code !== 'ResourceNotFoundException') { + if (!(e instanceof ResourceNotFoundException)) { throw e; } else { console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); @@ -88,7 +89,8 @@ export class ClusterResourceHandler extends ResourceHandler { const resp = await this.eks.describeCluster({ name: this.clusterName }); console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); } catch (e: any) { - if (e.code === 'ResourceNotFoundException') { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof ResourceNotFoundException) { console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); return { IsComplete: true }; } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js new file mode 100644 index 0000000000000..ed1eab8530351 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FargateProfileResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const MAX_NAME_LEN = 63; +class FargateProfileResourceHandler extends common_1.ResourceHandler { + async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + const createFargateProfile = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + const deleteFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + return; + } + async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + async isCreateComplete() { + return this.isUpdateComplete(); + } + async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + /** + * Generates a fargate profile name. + */ + generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + async queryStatus() { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + const describeFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + try { + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + return status; + } + catch (describeFargateProfileError) { + if (describeFargateProfileError instanceof client_eks_1.ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} +exports.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YXRlUHJvZmlsZUVycm9yIH0pO1xuICAgICAgdGhyb3cgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yO1xuICAgIH1cbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts similarity index 95% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts index 7db97a7f69d38..16b9f9abfeb49 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts @@ -1,3 +1,5 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies import { ResourceHandler } from './common'; @@ -107,7 +109,7 @@ export class FargateProfileResourceHandler extends ResourceHandler { return status; } catch (describeFargateProfileError: any) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { + if (describeFargateProfileError instanceof ResourceNotFoundException) { this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); return 'NOT_FOUND'; } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip index 93f7400e6f8c2..11112de67d5be 100644 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip similarity index 79% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip index e6cb898734b43..90a8a2a6e2615 100644 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/aws-cdk-eks-handlers-in-vpc-test.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/aws-cdk-eks-handlers-in-vpc-test.assets.json index 0ab5ec9ff370d..51e68ee890094 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/aws-cdk-eks-handlers-in-vpc-test.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/aws-cdk-eks-handlers-in-vpc-test.assets.json @@ -27,15 +27,15 @@ } } }, - "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649": { + "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31": { "source": { - "path": "asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649", + "path": "asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip", + "objectKey": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -66,20 +66,20 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "8424daa9cfcccc73abb4d66980ab63605a3ee5ce37f4abe1c57eae0711a049b4": { + "7a8c08240a6659d9c519f00442134a4f9f35c4efe8055c13127f603621631863": { "source": { "path": "awscdkekshandlersinvpctestawscdkawseksClusterResourceProvider9260AB35.nested.template.json", "packaging": "file" @@ -87,12 +87,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "8424daa9cfcccc73abb4d66980ab63605a3ee5ce37f4abe1c57eae0711a049b4.json", + "objectKey": "7a8c08240a6659d9c519f00442134a4f9f35c4efe8055c13127f603621631863.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "458ef586f4450721bfb17837974eac5e52e9e1a5d2921c1dc251b38ab2192fea": { + "6c002ccd7f6b3563ded7bc83c53b00d2b1253c8ebf18ff8c51b1993a452beef9": { "source": { "path": "awscdkekshandlersinvpctestawscdkawseksKubectlProvider72227111.nested.template.json", "packaging": "file" @@ -100,12 +100,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "458ef586f4450721bfb17837974eac5e52e9e1a5d2921c1dc251b38ab2192fea.json", + "objectKey": "6c002ccd7f6b3563ded7bc83c53b00d2b1253c8ebf18ff8c51b1993a452beef9.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "957237d98b62add081e745fac7caa18a6dd4dfdc97c53ce3eb35418abbf16e2a": { + "d87a1588053944807513221c5b603c5d73b03a772eddb022b5bac42dc6807a66": { "source": { "path": "aws-cdk-eks-handlers-in-vpc-test.template.json", "packaging": "file" @@ -113,7 +113,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "957237d98b62add081e745fac7caa18a6dd4dfdc97c53ce3eb35418abbf16e2a.json", + "objectKey": "d87a1588053944807513221c5b603c5d73b03a772eddb022b5bac42dc6807a66.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/aws-cdk-eks-handlers-in-vpc-test.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/aws-cdk-eks-handlers-in-vpc-test.template.json index aa898452ec988..f270fea2168f4 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/aws-cdk-eks-handlers-in-vpc-test.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/aws-cdk-eks-handlers-in-vpc-test.template.json @@ -1017,7 +1017,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/8424daa9cfcccc73abb4d66980ab63605a3ee5ce37f4abe1c57eae0711a049b4.json" + "/7a8c08240a6659d9c519f00442134a4f9f35c4efe8055c13127f603621631863.json" ] ] } @@ -1073,7 +1073,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/458ef586f4450721bfb17837974eac5e52e9e1a5d2921c1dc251b38ab2192fea.json" + "/6c002ccd7f6b3563ded7bc83c53b00d2b1253c8ebf18ff8c51b1993a452beef9.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/awscdkekshandlersinvpctestawscdkawseksClusterResourceProvider9260AB35.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/awscdkekshandlersinvpctestawscdkawseksClusterResourceProvider9260AB35.nested.template.json index 74ce1ac71ec8e..cb2a940ca092b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/awscdkekshandlersinvpctestawscdkawseksClusterResourceProvider9260AB35.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/awscdkekshandlersinvpctestawscdkawseksClusterResourceProvider9260AB35.nested.template.json @@ -78,7 +78,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "onEvent handler for EKS cluster resource provider", "Environment": { @@ -189,7 +189,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "isComplete handler for EKS cluster resource provider", "Environment": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/awscdkekshandlersinvpctestawscdkawseksKubectlProvider72227111.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/awscdkekshandlersinvpctestawscdkawseksKubectlProvider72227111.nested.template.json index 5f178a77e6d6d..590152267a0ae 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/awscdkekshandlersinvpctestawscdkawseksKubectlProvider72227111.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/awscdkekshandlersinvpctestawscdkawseksKubectlProvider72227111.nested.template.json @@ -49,7 +49,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/cdk.out index f0b901e7c06e5..560dae10d018f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"33.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/manifest.json index 41d3f147b370f..9932fdda6da8e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/manifest.json @@ -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}/957237d98b62add081e745fac7caa18a6dd4dfdc97c53ce3eb35418abbf16e2a.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/d87a1588053944807513221c5b603c5d73b03a772eddb022b5bac42dc6807a66.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/tree.json index 551d0ca42a25a..442f2633736e1 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-handlers-vpc.js.snapshot/tree.json @@ -62,7 +62,7 @@ }, "constructInfo": { "fqn": "@aws-cdk/lambda-layer-kubectl-v24.KubectlV24Layer", - "version": "2.0.229" + "version": "2.0.242" } }, "EksAllHandlersInVpcStack": { @@ -1581,7 +1581,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "onEvent handler for EKS cluster resource provider", "environment": { @@ -1777,7 +1777,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "isComplete handler for EKS cluster resource provider", "environment": { @@ -2928,7 +2928,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/8424daa9cfcccc73abb4d66980ab63605a3ee5ce37f4abe1c57eae0711a049b4.json" + "/7a8c08240a6659d9c519f00442134a4f9f35c4efe8055c13127f603621631863.json" ] ] } @@ -3075,7 +3075,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -3439,7 +3439,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/458ef586f4450721bfb17837974eac5e52e9e1a5d2921c1dc251b38ab2192fea.json" + "/6c002ccd7f6b3563ded7bc83c53b00d2b1253c8ebf18ff8c51b1993a452beef9.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip deleted file mode 100644 index e6cb898734b43..0000000000000 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and /dev/null differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js deleted file mode 100644 index b89707a0a08e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js +++ /dev/null @@ -1,277 +0,0 @@ -"use strict"; -/* eslint-disable no-console */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ClusterResourceHandler = void 0; -const common_1 = require("./common"); -const compareLogging_1 = require("./compareLogging"); -const MAX_CLUSTER_NAME_LEN = 100; -class ClusterResourceHandler extends common_1.ResourceHandler { - get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - return this.physicalResourceId; - } - constructor(eks, event) { - super(eks, event); - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - // ------ - // CREATE - // ------ - async onCreate() { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - const clusterName = this.newProps.name || this.generateClusterName(); - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - return { - PhysicalResourceId: resp.cluster.name, - }; - } - async isCreateComplete() { - return this.isActive(); - } - // ------ - // DELETE - // ------ - async onDelete() { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } - catch (e) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } - else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - async isDeleteComplete() { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } - catch (e) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - console.log('describeCluster error:', e); - throw e; - } - return { - IsComplete: false, - }; - } - // ------ - // UPDATE - // ------ - async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - return this.onCreate(); - } - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - return this.updateClusterVersion(this.newProps.version); - } - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - if (updates.updateLogging || updates.updateAccess) { - const config = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - } - ; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - return { EksUpdateId: updateResponse.update?.id }; - } - // no updates - return; - } - async isUpdateComplete() { - console.log('isUpdateComplete'); - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - return this.isActive(); - } - async updateClusterVersion(newVersion) { - console.log(`updating cluster version to ${newVersion}`); - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - async isActive() { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } - else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } - else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - async isEksUpdateComplete(eksUpdateId) { - this.log({ isEksUpdateComplete: eksUpdateId }); - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - this.log({ describeUpdateResponse }); - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} -exports.ClusterResourceHandler = ClusterResourceHandler; -function parseProps(props) { - const parsed = props?.Config ?? {}; - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - return parsed; -} -function analyzeUpdate(oldProps, newProps) { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} -function setsEqual(first, second) { - return first.size === second.size && [...first].every((e) => second.has(e)); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBSy9CLHFDQUFxRTtBQUNyRSxxREFBdUQ7QUFHdkQsTUFBTSxvQkFBb0IsR0FBRyxHQUFHLENBQUM7QUFFakMsTUFBYSxzQkFBdUIsU0FBUSx3QkFBZTtJQUN6RCxJQUFXLFdBQVc7UUFDcEIsSUFBSSxDQUFDLElBQUksQ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4sIHNlY29uZDogU2V0PHN0cmluZz4pIHtcbiAgcmV0dXJuIGZpcnN0LnNpemUgPT09IHNlY29uZC5zaXplICYmIFsuLi5maXJzdF0uZXZlcnkoKGU6IHN0cmluZykgPT4gc2Vjb25kLmhhcyhlKSk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js deleted file mode 100644 index 34ab6ff0ba0e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FargateProfileResourceHandler = void 0; -const common_1 = require("./common"); -const MAX_NAME_LEN = 63; -class FargateProfileResourceHandler extends common_1.ResourceHandler { - async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - const createFargateProfile = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - const deleteFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - return; - } - async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - async isCreateComplete() { - return this.isUpdateComplete(); - } - async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - /** - * Generates a fargate profile name. - */ - generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - async queryStatus() { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - const describeFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - try { - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - return status; - } - catch (describeFargateProfileError) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} -exports.FargateProfileResourceHandler = FargateProfileResourceHandler; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiL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UHJvZmlsZSk7XG4gICAgICB0aGlzLmxvZyh7IGRlc2NyaWJlRmFyZ2F0ZVByb2ZpbGVSZXNwb25zZSB9KTtcbiAgICAgIGNvbnN0IHN0YXR1cyA9IGRlc2NyaWJlRmFyZ2F0ZVByb2ZpbGVSZXNwb25zZS5mYXJnYXRlUHJvZmlsZT8uc3RhdHVzO1xuXG4gICAgICBpZiAoc3RhdHVzID09PSAnQ1JFQVRFX0ZBSUxFRCcgfHwgc3RhdHVzID09PSAnREVMRVRFX0ZBSUxFRCcpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKHN0YXR1cyk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfSBjYXRjaCAoZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yOiBhbnkpIHtcbiAgICAgIGlmIChkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IuY29kZSA9PT0gJ1Jlc291cmNlTm90Rm91bmRFeGNlcHRpb24nKSB7XG4gICAgICAgIHRoaXMubG9nKCdyZWNlaXZlZCBSZXNvdXJjZU5vdEZvdW5kRXhjZXB0aW9uLCB0aGlzIG1lYW5zIHRoZSBwcm9maWxlIGhhcyBiZWVuIGRlbGV0ZWQgKG9yIG5ldmVyIGV4aXN0ZWQpJyk7XG4gICAgICAgIHJldHVybiAnTk9UX0ZPVU5EJztcbiAgICAgIH1cblxuICAgICAgdGhpcy5sb2coeyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IgfSk7XG4gICAgICB0aHJvdyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3I7XG4gICAgfVxuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js new file mode 100644 index 0000000000000..aefb970a3fe47 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js @@ -0,0 +1,280 @@ +"use strict"; +/* eslint-disable no-console */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClusterResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const compareLogging_1 = require("./compareLogging"); +const MAX_CLUSTER_NAME_LEN = 100; +class ClusterResourceHandler extends common_1.ResourceHandler { + get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + return this.physicalResourceId; + } + constructor(eks, event) { + super(eks, event); + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + // ------ + // CREATE + // ------ + async onCreate() { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + const clusterName = this.newProps.name || this.generateClusterName(); + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + return { + PhysicalResourceId: resp.cluster.name, + }; + } + async isCreateComplete() { + return this.isActive(); + } + // ------ + // DELETE + // ------ + async onDelete() { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } + catch (e) { + if (!(e instanceof client_eks_1.ResourceNotFoundException)) { + throw e; + } + else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + async isDeleteComplete() { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } + catch (e) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof client_eks_1.ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + console.log('describeCluster error:', e); + throw e; + } + return { + IsComplete: false, + }; + } + // ------ + // UPDATE + // ------ + async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + return this.onCreate(); + } + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + return this.updateClusterVersion(this.newProps.version); + } + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + if (updates.updateLogging || updates.updateAccess) { + const config = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + } + ; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + return { EksUpdateId: updateResponse.update?.id }; + } + // no updates + return; + } + async isUpdateComplete() { + console.log('isUpdateComplete'); + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + return this.isActive(); + } + async updateClusterVersion(newVersion) { + console.log(`updating cluster version to ${newVersion}`); + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + async isActive() { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } + else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } + else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + async isEksUpdateComplete(eksUpdateId) { + this.log({ isEksUpdateComplete: eksUpdateId }); + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + this.log({ describeUpdateResponse }); + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} +exports.ClusterResourceHandler = ClusterResourceHandler; +function parseProps(props) { + const parsed = props?.Config ?? {}; + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + return parsed; +} +function analyzeUpdate(oldProps, newProps) { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} +function setsEqual(first, second) { + return first.size === second.size && [...first].every((e) => second.has(e)); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBRS9CLDZEQUE2RDtBQUM3RCxvREFBZ0U7QUFHaEUscUNBQXFFO0FBQ3JFLHFEQUF1RDtBQUd2RCxNQUFNLG9CQUFvQixHQUFHLEdBQUcsQ0FBQztBQUVqQyxNQUFhLHNCQUF1QixTQUFRLHdCQUFlO0lBQ3pELElBQVcsV0FBVztRQUNwQixJQUFJLENBQUMsSUFBSSxDQUFDLGtCQUFrQixFQUFFO1lBQzVCLE1BQU0sSUFBSSxLQUFLLENBQUMsNERBQTRELENBQUMsQ0FBQztTQUMvRTtRQUVELE9BQU8sSUFBSSxDQUFDLGtCQUFrQixDQUFDO0tBQ2hDO0lBS0QsWUFBWSxHQUFjLEVBQUUsS0FBb0I7UUFDOUMsS0FBSyxDQUFDLEdBQUcsRUFBRSxLQUFLLENBQUMsQ0FBQztRQUVsQixJQUFJLENBQUMsUUFBUSxHQUFHLFVBQVUsQ0FBQyxJQUFJLENBQUMsS0FBSyx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xufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts similarity index 98% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts index c058e47b62c68..3a0a7294db31d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.alb-controller.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts @@ -1,6 +1,7 @@ /* eslint-disable no-console */ // eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; // eslint-disable-next-line import/no-extraneous-dependencies import * as aws from 'aws-sdk'; import { EksClient, ResourceEvent, ResourceHandler } from './common'; @@ -70,7 +71,7 @@ export class ClusterResourceHandler extends ResourceHandler { try { await this.eks.deleteCluster({ name: this.clusterName }); } catch (e: any) { - if (e.code !== 'ResourceNotFoundException') { + if (!(e instanceof ResourceNotFoundException)) { throw e; } else { console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); @@ -88,7 +89,8 @@ export class ClusterResourceHandler extends ResourceHandler { const resp = await this.eks.describeCluster({ name: this.clusterName }); console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); } catch (e: any) { - if (e.code === 'ResourceNotFoundException') { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof ResourceNotFoundException) { console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); return { IsComplete: true }; } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js new file mode 100644 index 0000000000000..ed1eab8530351 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FargateProfileResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const MAX_NAME_LEN = 63; +class FargateProfileResourceHandler extends common_1.ResourceHandler { + async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + const createFargateProfile = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + const deleteFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + return; + } + async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + async isCreateComplete() { + return this.isUpdateComplete(); + } + async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + /** + * Generates a fargate profile name. + */ + generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + async queryStatus() { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + const describeFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + try { + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + return status; + } + catch (describeFargateProfileError) { + if (describeFargateProfileError instanceof client_eks_1.ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} +exports.FargateProfileResourceHandler = FargateProfileResourceHandler; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsNkRBQTZEO0FBQzdELG9EQUFnRTtBQUVoRSxxQ0FBMkM7QUFFM0MsTUFBTSxZQUFZLEdBQUcsRUFBRSxDQUFDO0FBRXhCLE1BQWEsNkJBQThCLFNBQVEsd0JBQWU7SUFDdEQsS0FBSyxDQUFDLFFBQVE7UUFDdEIsTUFBTSxrQkFBa0IsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU0sQ0FBQyxrQkFBa0IsSUFBSSxJQUFJLENBQUMsbUJBQW1CLEVBQUUsQ0FBQztRQUVqSCxNQUFNLG9CQUFvQixHQUF3QztZQUNoRSxrQkFBa0I7WUFDbEIsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU07U0FDeEMsQ0FBQztRQUVGLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxvQkFBb0IsRUFBRSxDQUFDLENBQUM7UUFDbkMsTUFBTSw0QkFBNEIsR0FBRyxNQUFNLElBQUksQ0FBQyxHQUFHLENBQUMsb0JBQW9CLENBQUMsb0JBQW9CLENBQUMsQ0FBQztRQUMvRixJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsNEJBQTRCLEVBQUUsQ0FBQyxDQUFDO1FBRTNDLElBQUks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3VuZEV4Y2VwdGlvbiwgdGhpcyBtZWFucyB0aGUgcHJvZmlsZSBoYXMgYmVlbiBkZWxldGVkIChvciBuZXZlciBleGlzdGVkKScpO1xuICAgICAgICByZXR1cm4gJ05PVF9GT1VORCc7XG4gICAgICB9XG5cbiAgICAgIHRoaXMubG9nKHsgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yIH0pO1xuICAgICAgdGhyb3cgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yO1xuICAgIH1cbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts similarity index 95% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts index 7db97a7f69d38..16b9f9abfeb49 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts @@ -1,3 +1,5 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies import { ResourceHandler } from './common'; @@ -107,7 +109,7 @@ export class FargateProfileResourceHandler extends ResourceHandler { return status; } catch (describeFargateProfileError: any) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { + if (describeFargateProfileError instanceof ResourceNotFoundException) { this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); return 'NOT_FOUND'; } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip index 93f7400e6f8c2..11112de67d5be 100644 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip new file mode 100644 index 0000000000000..90a8a2a6e2615 Binary files /dev/null and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/aws-cdk-eks-import-cluster-test.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/aws-cdk-eks-import-cluster-test.assets.json index 4ed62dbb62c17..5873cdb7db44c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/aws-cdk-eks-import-cluster-test.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/aws-cdk-eks-import-cluster-test.assets.json @@ -27,15 +27,15 @@ } } }, - "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649": { + "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31": { "source": { - "path": "asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649", + "path": "asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip", + "objectKey": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -66,15 +66,15 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -118,7 +118,7 @@ } } }, - "d49a28b4a2bdf4c01ccd1d3b6850da410d69e434e5ebb1c0e4a6a79c58999709": { + "12c92c6a62f2ed0ae0e3e93b996b0ed3972dab29419c5be7988263414ee75c48": { "source": { "path": "awscdkeksimportclustertestawscdkawseksClusterResourceProvider7AA2A5F4.nested.template.json", "packaging": "file" @@ -126,12 +126,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "d49a28b4a2bdf4c01ccd1d3b6850da410d69e434e5ebb1c0e4a6a79c58999709.json", + "objectKey": "12c92c6a62f2ed0ae0e3e93b996b0ed3972dab29419c5be7988263414ee75c48.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "bb48ed13f0eca488ce3f5d4f6dc253477544aaee9844f55e6742966db334fba7": { + "0801db69bb84b9d8bd2fb0aff85da82aaca59934d3c0bcb5b7427518e0095746": { "source": { "path": "awscdkeksimportclustertestawscdkawseksKubectlProvider31F66FBD.nested.template.json", "packaging": "file" @@ -139,12 +139,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "bb48ed13f0eca488ce3f5d4f6dc253477544aaee9844f55e6742966db334fba7.json", + "objectKey": "0801db69bb84b9d8bd2fb0aff85da82aaca59934d3c0bcb5b7427518e0095746.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "1bc81e193fc17b39e9cf938d6f06aa21800fefb6651bb4330f10e4c69032a7b0": { + "4d9a984477d2dc582b777258a9ad5707fb9edc526d02959e13c1b05ef178f11b": { "source": { "path": "aws-cdk-eks-import-cluster-test.template.json", "packaging": "file" @@ -152,7 +152,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "1bc81e193fc17b39e9cf938d6f06aa21800fefb6651bb4330f10e4c69032a7b0.json", + "objectKey": "4d9a984477d2dc582b777258a9ad5707fb9edc526d02959e13c1b05ef178f11b.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/aws-cdk-eks-import-cluster-test.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/aws-cdk-eks-import-cluster-test.template.json index c18a96a1afc68..d94227763726e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/aws-cdk-eks-import-cluster-test.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/aws-cdk-eks-import-cluster-test.template.json @@ -1067,7 +1067,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/d49a28b4a2bdf4c01ccd1d3b6850da410d69e434e5ebb1c0e4a6a79c58999709.json" + "/12c92c6a62f2ed0ae0e3e93b996b0ed3972dab29419c5be7988263414ee75c48.json" ] ] } @@ -1117,7 +1117,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/bb48ed13f0eca488ce3f5d4f6dc253477544aaee9844f55e6742966db334fba7.json" + "/0801db69bb84b9d8bd2fb0aff85da82aaca59934d3c0bcb5b7427518e0095746.json" ] ] } @@ -1209,7 +1209,7 @@ "Outputs.awscdkeksimportclustertestawscdkawseksKubectlProviderframeworkonEvent301ACD4FArn" ] }, - "Manifest": "[{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"name\":\"hello-kubernetes\",\"labels\":{\"aws.cdk.eks/prune-c8a0a5fce98cac6b5f687bcc725725618b782f0c92\":\"\"}},\"spec\":{\"type\":\"LoadBalancer\",\"ports\":[{\"port\":80,\"targetPort\":8080}],\"selector\":{\"app\":\"hello-kubernetes\"}}},{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"name\":\"hello-kubernetes\",\"labels\":{\"aws.cdk.eks/prune-c8a0a5fce98cac6b5f687bcc725725618b782f0c92\":\"\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"app\":\"hello-kubernetes\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"hello-kubernetes\"}},\"spec\":{\"containers\":[{\"name\":\"hello-kubernetes\",\"image\":\"paulbouwer/hello-kubernetes:1.5\",\"ports\":[{\"containerPort\":8080}]}]}}}}]", + "Manifest": "[{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"name\":\"hello-kubernetes\",\"labels\":{\"aws.cdk.eks/prune-c8a0a5fce98cac6b5f687bcc725725618b782f0c92\":\"\"}},\"spec\":{\"ports\":[{\"port\":80,\"targetPort\":8080}],\"selector\":{\"app\":\"hello-kubernetes\"}}},{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"name\":\"hello-kubernetes\",\"labels\":{\"aws.cdk.eks/prune-c8a0a5fce98cac6b5f687bcc725725618b782f0c92\":\"\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"app\":\"hello-kubernetes\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"hello-kubernetes\"}},\"spec\":{\"containers\":[{\"name\":\"hello-kubernetes\",\"image\":\"paulbouwer/hello-kubernetes:1.5\",\"ports\":[{\"containerPort\":8080}]}]}}}}]", "ClusterName": { "Ref": "Cluster9EE0221C" }, @@ -1244,6 +1244,7 @@ }, "Release": "mportclustertestimportedclusterchartdashboard428d91dc", "Chart": "kubernetes-dashboard", + "Version": "6.0.8", "Namespace": "default", "Repository": "https://kubernetes.github.io/dashboard/", "CreateNamespace": true @@ -1356,10 +1357,12 @@ "Arn" ] }, - "Release": "rtclustertestimportedclusterchartnginxingress47a466aa", + "Release": "nginx-ingress", "Chart": "nginx-ingress", + "Version": "0.17.1", "Wait": true, "Timeout": "900s", + "Values": "{\"controller\":{\"service\":{\"create\":false}}}", "Namespace": "nginx", "Repository": "https://helm.nginx.com/stable" }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclusterDefaultTestDeployAssertFBF4B356.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/awscdkeksimportclusterDefaultTestDeployAssert71CEFD92.assets.json similarity index 87% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclusterDefaultTestDeployAssertFBF4B356.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/awscdkeksimportclusterDefaultTestDeployAssert71CEFD92.assets.json index ec29cb4ddb70a..6ca0fdb9a086a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclusterDefaultTestDeployAssertFBF4B356.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/awscdkeksimportclusterDefaultTestDeployAssert71CEFD92.assets.json @@ -3,7 +3,7 @@ "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { - "path": "awscdkeksclusterDefaultTestDeployAssertFBF4B356.template.json", + "path": "awscdkeksimportclusterDefaultTestDeployAssert71CEFD92.template.json", "packaging": "file" }, "destinations": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/awscdkeksclusterDefaultTestDeployAssertFBF4B356.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/awscdkeksimportclusterDefaultTestDeployAssert71CEFD92.template.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/awscdkeksclusterDefaultTestDeployAssertFBF4B356.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/awscdkeksimportclusterDefaultTestDeployAssert71CEFD92.template.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/awscdkeksimportclustertestawscdkawseksClusterResourceProvider7AA2A5F4.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/awscdkeksimportclustertestawscdkawseksClusterResourceProvider7AA2A5F4.nested.template.json index 31d35d479e85b..fdcb69ccacc79 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/awscdkeksimportclustertestawscdkawseksClusterResourceProvider7AA2A5F4.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/awscdkeksimportclustertestawscdkawseksClusterResourceProvider7AA2A5F4.nested.template.json @@ -50,7 +50,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "onEvent handler for EKS cluster resource provider", "Environment": { @@ -115,7 +115,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "isComplete handler for EKS cluster resource provider", "Environment": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/awscdkeksimportclustertestawscdkawseksKubectlProvider31F66FBD.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/awscdkeksimportclustertestawscdkawseksKubectlProvider31F66FBD.nested.template.json index c9c2ed5e1fb39..634b8024f4b48 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/awscdkeksimportclustertestawscdkawseksKubectlProvider31F66FBD.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/awscdkeksimportclustertestawscdkawseksKubectlProvider31F66FBD.nested.template.json @@ -49,7 +49,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/cdk.out index f0b901e7c06e5..560dae10d018f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"33.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/integ.json index ec280eb0cda09..44a12aee54201 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/integ.json @@ -1,7 +1,7 @@ { "version": "32.0.0", "testCases": { - "aws-cdk-eks-cluster/DefaultTest": { + "aws-cdk-eks-import-cluster/DefaultTest": { "stacks": [ "aws-cdk-eks-import-cluster-test" ], @@ -13,8 +13,8 @@ } } }, - "assertionStack": "aws-cdk-eks-cluster/DefaultTest/DeployAssert", - "assertionStackName": "awscdkeksclusterDefaultTestDeployAssertFBF4B356" + "assertionStack": "aws-cdk-eks-import-cluster/DefaultTest/DeployAssert", + "assertionStackName": "awscdkeksimportclusterDefaultTestDeployAssert71CEFD92" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/manifest.json index 9f362900b0da7..8dc6d27be2178 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/manifest.json @@ -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}/1bc81e193fc17b39e9cf938d6f06aa21800fefb6651bb4330f10e4c69032a7b0.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/4d9a984477d2dc582b777258a9ad5707fb9edc526d02959e13c1b05ef178f11b.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -606,19 +606,19 @@ }, "displayName": "aws-cdk-eks-import-cluster-test" }, - "awscdkeksclusterDefaultTestDeployAssertFBF4B356.assets": { + "awscdkeksimportclusterDefaultTestDeployAssert71CEFD92.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "awscdkeksclusterDefaultTestDeployAssertFBF4B356.assets.json", + "file": "awscdkeksimportclusterDefaultTestDeployAssert71CEFD92.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "awscdkeksclusterDefaultTestDeployAssertFBF4B356": { + "awscdkeksimportclusterDefaultTestDeployAssert71CEFD92": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "awscdkeksclusterDefaultTestDeployAssertFBF4B356.template.json", + "templateFile": "awscdkeksimportclusterDefaultTestDeployAssert71CEFD92.template.json", "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}", @@ -626,7 +626,7 @@ "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "awscdkeksclusterDefaultTestDeployAssertFBF4B356.assets" + "awscdkeksimportclusterDefaultTestDeployAssert71CEFD92.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -635,23 +635,23 @@ } }, "dependencies": [ - "awscdkeksclusterDefaultTestDeployAssertFBF4B356.assets" + "awscdkeksimportclusterDefaultTestDeployAssert71CEFD92.assets" ], "metadata": { - "/aws-cdk-eks-cluster/DefaultTest/DeployAssert/BootstrapVersion": [ + "/aws-cdk-eks-import-cluster/DefaultTest/DeployAssert/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/aws-cdk-eks-cluster/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + "/aws-cdk-eks-import-cluster/DefaultTest/DeployAssert/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "aws-cdk-eks-cluster/DefaultTest/DeployAssert" + "displayName": "aws-cdk-eks-import-cluster/DefaultTest/DeployAssert" }, "Tree": { "type": "cdk:tree", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/tree.json index ddb2ad8b03378..8263be843441c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/tree.json @@ -756,7 +756,7 @@ }, "constructInfo": { "fqn": "@aws-cdk/lambda-layer-kubectl-v24.KubectlV24Layer", - "version": "2.0.229" + "version": "2.0.242" } }, "Cluster": { @@ -1623,7 +1623,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "onEvent handler for EKS cluster resource provider", "environment": { @@ -1755,7 +1755,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "isComplete handler for EKS cluster resource provider", "environment": { @@ -2661,7 +2661,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/d49a28b4a2bdf4c01ccd1d3b6850da410d69e434e5ebb1c0e4a6a79c58999709.json" + "/12c92c6a62f2ed0ae0e3e93b996b0ed3972dab29419c5be7988263414ee75c48.json" ] ] } @@ -2808,7 +2808,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -3172,7 +3172,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/bb48ed13f0eca488ce3f5d4f6dc253477544aaee9844f55e6742966db334fba7.json" + "/0801db69bb84b9d8bd2fb0aff85da82aaca59934d3c0bcb5b7427518e0095746.json" ] ] } @@ -3805,17 +3805,17 @@ "version": "0.0.0" } }, - "aws-cdk-eks-cluster": { - "id": "aws-cdk-eks-cluster", - "path": "aws-cdk-eks-cluster", + "aws-cdk-eks-import-cluster": { + "id": "aws-cdk-eks-import-cluster", + "path": "aws-cdk-eks-import-cluster", "children": { "DefaultTest": { "id": "DefaultTest", - "path": "aws-cdk-eks-cluster/DefaultTest", + "path": "aws-cdk-eks-import-cluster/DefaultTest", "children": { "Default": { "id": "Default", - "path": "aws-cdk-eks-cluster/DefaultTest/Default", + "path": "aws-cdk-eks-import-cluster/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", "version": "10.2.55" @@ -3823,11 +3823,11 @@ }, "DeployAssert": { "id": "DeployAssert", - "path": "aws-cdk-eks-cluster/DefaultTest/DeployAssert", + "path": "aws-cdk-eks-import-cluster/DefaultTest/DeployAssert", "children": { "BootstrapVersion": { "id": "BootstrapVersion", - "path": "aws-cdk-eks-cluster/DefaultTest/DeployAssert/BootstrapVersion", + "path": "aws-cdk-eks-import-cluster/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -3835,7 +3835,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "aws-cdk-eks-cluster/DefaultTest/DeployAssert/CheckBootstrapVersion", + "path": "aws-cdk-eks-import-cluster/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.ts index 2261d946ebcbd..1aabc87df9a1f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.ts @@ -128,6 +128,16 @@ class EksClusterStack extends Stack { repository: 'https://helm.nginx.com/stable', namespace: 'nginx', wait: true, + release: 'nginx-ingress', + // https://github.com/nginxinc/helm-charts/tree/master/stable + version: '0.17.1', + values: { + controller: { + service: { + create: false, + }, + }, + }, createNamespace: false, timeout: Duration.minutes(15), }); @@ -159,6 +169,8 @@ class EksClusterStack extends Stack { // deploy the Kubernetes dashboard through a helm chart this.importedCluster.addHelmChart('dashboard', { chart: 'kubernetes-dashboard', + // https://artifacthub.io/packages/helm/k8s-dashboard/kubernetes-dashboard + version: '6.0.8', repository: 'https://kubernetes.github.io/dashboard/', }); } @@ -197,7 +209,7 @@ class EksClusterStack extends Stack { const app = new App(); const stack = new EksClusterStack(app, 'aws-cdk-eks-import-cluster-test'); -new integ.IntegTest(app, 'aws-cdk-eks-cluster', { +new integ.IntegTest(app, 'aws-cdk-eks-import-cluster', { testCases: [stack], diffAssets: true, cdkCommandOptions: { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip deleted file mode 100644 index e6cb898734b43..0000000000000 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and /dev/null differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js deleted file mode 100644 index b89707a0a08e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js +++ /dev/null @@ -1,277 +0,0 @@ -"use strict"; -/* eslint-disable no-console */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ClusterResourceHandler = void 0; -const common_1 = require("./common"); -const compareLogging_1 = require("./compareLogging"); -const MAX_CLUSTER_NAME_LEN = 100; -class ClusterResourceHandler extends common_1.ResourceHandler { - get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - return this.physicalResourceId; - } - constructor(eks, event) { - super(eks, event); - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - // ------ - // CREATE - // ------ - async onCreate() { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - const clusterName = this.newProps.name || this.generateClusterName(); - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - return { - PhysicalResourceId: resp.cluster.name, - }; - } - async isCreateComplete() { - return this.isActive(); - } - // ------ - // DELETE - // ------ - async onDelete() { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } - catch (e) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } - else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - async isDeleteComplete() { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } - catch (e) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - console.log('describeCluster error:', e); - throw e; - } - return { - IsComplete: false, - }; - } - // ------ - // UPDATE - // ------ - async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - return this.onCreate(); - } - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - return this.updateClusterVersion(this.newProps.version); - } - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - if (updates.updateLogging || updates.updateAccess) { - const config = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - } - ; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - return { EksUpdateId: updateResponse.update?.id }; - } - // no updates - return; - } - async isUpdateComplete() { - console.log('isUpdateComplete'); - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - return this.isActive(); - } - async updateClusterVersion(newVersion) { - console.log(`updating cluster version to ${newVersion}`); - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - async isActive() { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } - else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } - else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - async isEksUpdateComplete(eksUpdateId) { - this.log({ isEksUpdateComplete: eksUpdateId }); - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - this.log({ describeUpdateResponse }); - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} -exports.ClusterResourceHandler = ClusterResourceHandler; -function parseProps(props) { - const parsed = props?.Config ?? {}; - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - return parsed; -} -function analyzeUpdate(oldProps, newProps) { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} -function setsEqual(first, second) { - return first.size === second.size && [...first].every((e) => second.has(e)); -} -//# sourceMappingURL=data:application/json;base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byb3BzLnZlcnNpb24gIT09IG9sZFByb3BzLnZlcnNpb24sXG4gICAgdXBkYXRlRW5jcnlwdGlvbjogSlNPTi5zdHJpbmdpZnkobmV3RW5jKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkRW5jKSxcbiAgICB1cGRhdGVMb2dnaW5nOiBKU09OLnN0cmluZ2lmeShuZXdQcm9wcy5sb2dnaW5nKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkUHJvcHMubG9nZ2luZyksXG4gIH07XG59XG5cbmZ1bmN0aW9uIHNldHNFcXVhbChmaXJzdDogU2V0PHN0cmluZz4sIHNlY29uZDogU2V0PHN0cmluZz4pIHtcbiAgcmV0dXJuIGZpcnN0LnNpemUgPT09IHNlY29uZC5zaXplICYmIFsuLi5maXJzdF0uZXZlcnkoKGU6IHN0cmluZykgPT4gc2Vjb25kLmhhcyhlKSk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts deleted file mode 100644 index c058e47b62c68..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts +++ /dev/null @@ -1,348 +0,0 @@ -/* eslint-disable no-console */ - -// eslint-disable-next-line import/no-extraneous-dependencies -// eslint-disable-next-line import/no-extraneous-dependencies -import * as aws from 'aws-sdk'; -import { EksClient, ResourceEvent, ResourceHandler } from './common'; -import { compareLoggingProps } from './compareLogging'; -import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; - -const MAX_CLUSTER_NAME_LEN = 100; - -export class ClusterResourceHandler extends ResourceHandler { - public get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - - return this.physicalResourceId; - } - - private readonly newProps: aws.EKS.CreateClusterRequest; - private readonly oldProps: Partial; - - constructor(eks: EksClient, event: ResourceEvent) { - super(eks, event); - - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - - // ------ - // CREATE - // ------ - - protected async onCreate(): Promise { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - - const clusterName = this.newProps.name || this.generateClusterName(); - - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - - return { - PhysicalResourceId: resp.cluster.name, - }; - } - - protected async isCreateComplete() { - return this.isActive(); - } - - // ------ - // DELETE - // ------ - - protected async onDelete(): Promise { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } catch (e: any) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - - protected async isDeleteComplete(): Promise { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } catch (e: any) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - - console.log('describeCluster error:', e); - throw e; - } - - return { - IsComplete: false, - }; - } - - // ------ - // UPDATE - // ------ - - protected async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - - return this.onCreate(); - } - - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - - return this.updateClusterVersion(this.newProps.version); - } - - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - - if (updates.updateLogging || updates.updateAccess) { - const config: aws.EKS.UpdateClusterConfigRequest = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - }; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - - return { EksUpdateId: updateResponse.update?.id }; - } - - // no updates - return; - } - - protected async isUpdateComplete() { - console.log('isUpdateComplete'); - - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - - return this.isActive(); - } - - private async updateClusterVersion(newVersion: string) { - console.log(`updating cluster version to ${newVersion}`); - - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - - private async isActive(): Promise { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url - - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - - private async isEksUpdateComplete(eksUpdateId: string) { - this.log({ isEksUpdateComplete: eksUpdateId }); - - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - - this.log({ describeUpdateResponse }); - - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - - private generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} - -function parseProps(props: any): aws.EKS.CreateClusterRequest { - - const parsed = props?.Config ?? {}; - - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - - return parsed; - -} - -interface UpdateMap { - replaceName: boolean; // name - replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds - replaceRole: boolean; // roleArn - - updateVersion: boolean; // version - updateLogging: boolean; // logging - updateEncryption: boolean; // encryption (cannot be updated) - updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess -} - -function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: - JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: - newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} - -function setsEqual(first: Set, second: Set) { - return first.size === second.size && [...first].every((e: string) => second.has(e)); -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js deleted file mode 100644 index 34ab6ff0ba0e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FargateProfileResourceHandler = void 0; -const common_1 = require("./common"); -const MAX_NAME_LEN = 63; -class FargateProfileResourceHandler extends common_1.ResourceHandler { - async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - const createFargateProfile = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - const deleteFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - return; - } - async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - async isCreateComplete() { - return this.isUpdateComplete(); - } - async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - /** - * Generates a fargate profile name. - */ - generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - async queryStatus() { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - const describeFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - try { - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - return status; - } - catch (describeFargateProfileError) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} -exports.FargateProfileResourceHandler = FargateProfileResourceHandler; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EscUNBQTJDO0FBRTNDLE1BQU0sWUFBWSxHQUFHLEVBQUUsQ0FBQztBQUV4QixNQUFhLDZCQUE4QixTQUFRLHdCQUFlO0lBQ3RELEtBQUssQ0FBQyxRQUFRO1FBQ3RCLE1BQU0sa0JBQWtCLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNLENBQ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CcpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKHN0YXR1cyk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfSBjYXRjaCAoZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yOiBhbnkpIHtcbiAgICAgIGlmIChkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IuY29kZSA9PT0gJ1Jlc291cmNlTm90Rm91bmRFeGNlcHRpb24nKSB7XG4gICAgICAgIHRoaXMubG9nKCdyZWNlaXZlZCBSZXNvdXJjZU5vdEZvdW5kRXhjZXB0aW9uLCB0aGlzIG1lYW5zIHRoZSBwcm9maWxlIGhhcyBiZWVuIGRlbGV0ZWQgKG9yIG5ldmVyIGV4aXN0ZWQpJyk7XG4gICAgICAgIHJldHVybiAnTk9UX0ZPVU5EJztcbiAgICAgIH1cblxuICAgICAgdGhpcy5sb2coeyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IgfSk7XG4gICAgICB0aHJvdyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3I7XG4gICAgfVxuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts deleted file mode 100644 index 7db97a7f69d38..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts +++ /dev/null @@ -1,119 +0,0 @@ -import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies -import { ResourceHandler } from './common'; - -const MAX_NAME_LEN = 63; - -export class FargateProfileResourceHandler extends ResourceHandler { - protected async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - - const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - - protected async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - - const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - - return; - } - - protected async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - - protected async isCreateComplete() { - return this.isUpdateComplete(); - } - - protected async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - - protected async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - - /** - * Generates a fargate profile name. - */ - private generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - private async queryStatus(): Promise { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - - const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - try { - - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - - return status; - } catch (describeFargateProfileError: any) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js new file mode 100644 index 0000000000000..aefb970a3fe47 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js @@ -0,0 +1,280 @@ +"use strict"; +/* eslint-disable no-console */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClusterResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const compareLogging_1 = require("./compareLogging"); +const MAX_CLUSTER_NAME_LEN = 100; +class ClusterResourceHandler extends common_1.ResourceHandler { + get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + return this.physicalResourceId; + } + constructor(eks, event) { + super(eks, event); + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + // ------ + // CREATE + // ------ + async onCreate() { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + const clusterName = this.newProps.name || this.generateClusterName(); + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + return { + PhysicalResourceId: resp.cluster.name, + }; + } + async isCreateComplete() { + return this.isActive(); + } + // ------ + // DELETE + // ------ + async onDelete() { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } + catch (e) { + if (!(e instanceof client_eks_1.ResourceNotFoundException)) { + throw e; + } + else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + async isDeleteComplete() { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } + catch (e) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof client_eks_1.ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + console.log('describeCluster error:', e); + throw e; + } + return { + IsComplete: false, + }; + } + // ------ + // UPDATE + // ------ + async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + return this.onCreate(); + } + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + return this.updateClusterVersion(this.newProps.version); + } + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + if (updates.updateLogging || updates.updateAccess) { + const config = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + } + ; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + return { EksUpdateId: updateResponse.update?.id }; + } + // no updates + return; + } + async isUpdateComplete() { + console.log('isUpdateComplete'); + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + return this.isActive(); + } + async updateClusterVersion(newVersion) { + console.log(`updating cluster version to ${newVersion}`); + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + async isActive() { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } + else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } + else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + async isEksUpdateComplete(eksUpdateId) { + this.log({ isEksUpdateComplete: eksUpdateId }); + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + this.log({ describeUpdateResponse }); + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} +exports.ClusterResourceHandler = ClusterResourceHandler; +function parseProps(props) { + const parsed = props?.Config ?? {}; + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + return parsed; +} +function analyzeUpdate(oldProps, newProps) { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} +function setsEqual(first, second) { + return first.size === second.size && [...first].every((e) => second.has(e)); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyI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YmxpY0FjY2Vzc0NpZHJzKSxcbiAgICByZXBsYWNlUm9sZTogbmV3UHJvcHMucm9sZUFybiAhPT0gb2xkUHJvcHMucm9sZUFybixcbiAgICB1cGRhdGVWZXJzaW9uOiBuZXdQcm9wcy52ZXJzaW9uICE9PSBvbGRQcm9wcy52ZXJzaW9uLFxuICAgIHVwZGF0ZUVuY3J5cHRpb246IEpTT04uc3RyaW5naWZ5KG5ld0VuYykgIT09IEpTT04uc3RyaW5naWZ5KG9sZEVuYyksXG4gICAgdXBkYXRlTG9nZ2luZzogSlNPTi5zdHJpbmdpZnkobmV3UHJvcHMubG9nZ2luZykgIT09IEpTT04uc3RyaW5naWZ5KG9sZFByb3BzLmxvZ2dpbmcpLFxuICB9O1xufVxuXG5mdW5jdGlvbiBzZXRzRXF1YWwoZmlyc3Q6IFNldDxzdHJpbmc+LCBzZWNvbmQ6IFNldDxzdHJpbmc+KSB7XG4gIHJldHVybiBmaXJzdC5zaXplID09PSBzZWNvbmQuc2l6ZSAmJiBbLi4uZmlyc3RdLmV2ZXJ5KChlOiBzdHJpbmcpID0+IHNlY29uZC5oYXMoZSkpO1xufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts new file mode 100644 index 0000000000000..3a0a7294db31d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts @@ -0,0 +1,350 @@ +/* eslint-disable no-console */ + +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +// eslint-disable-next-line import/no-extraneous-dependencies +import * as aws from 'aws-sdk'; +import { EksClient, ResourceEvent, ResourceHandler } from './common'; +import { compareLoggingProps } from './compareLogging'; +import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; + +const MAX_CLUSTER_NAME_LEN = 100; + +export class ClusterResourceHandler extends ResourceHandler { + public get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + + return this.physicalResourceId; + } + + private readonly newProps: aws.EKS.CreateClusterRequest; + private readonly oldProps: Partial; + + constructor(eks: EksClient, event: ResourceEvent) { + super(eks, event); + + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + + // ------ + // CREATE + // ------ + + protected async onCreate(): Promise { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + + const clusterName = this.newProps.name || this.generateClusterName(); + + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + + return { + PhysicalResourceId: resp.cluster.name, + }; + } + + protected async isCreateComplete() { + return this.isActive(); + } + + // ------ + // DELETE + // ------ + + protected async onDelete(): Promise { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } catch (e: any) { + if (!(e instanceof ResourceNotFoundException)) { + throw e; + } else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + + protected async isDeleteComplete(): Promise { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } catch (e: any) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + + console.log('describeCluster error:', e); + throw e; + } + + return { + IsComplete: false, + }; + } + + // ------ + // UPDATE + // ------ + + protected async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + + return this.onCreate(); + } + + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + + return this.updateClusterVersion(this.newProps.version); + } + + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + + if (updates.updateLogging || updates.updateAccess) { + const config: aws.EKS.UpdateClusterConfigRequest = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + }; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + + return { EksUpdateId: updateResponse.update?.id }; + } + + // no updates + return; + } + + protected async isUpdateComplete() { + console.log('isUpdateComplete'); + + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + + return this.isActive(); + } + + private async updateClusterVersion(newVersion: string) { + console.log(`updating cluster version to ${newVersion}`); + + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + + private async isActive(): Promise { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url + + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + + private async isEksUpdateComplete(eksUpdateId: string) { + this.log({ isEksUpdateComplete: eksUpdateId }); + + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + + this.log({ describeUpdateResponse }); + + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + + private generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} + +function parseProps(props: any): aws.EKS.CreateClusterRequest { + + const parsed = props?.Config ?? {}; + + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + + return parsed; + +} + +interface UpdateMap { + replaceName: boolean; // name + replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds + replaceRole: boolean; // roleArn + + updateVersion: boolean; // version + updateLogging: boolean; // logging + updateEncryption: boolean; // encryption (cannot be updated) + updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess +} + +function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: + JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: + newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} + +function setsEqual(first: Set, second: Set) { + return first.size === second.size && [...first].every((e: string) => second.has(e)); +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js new file mode 100644 index 0000000000000..ed1eab8530351 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FargateProfileResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const MAX_NAME_LEN = 63; +class FargateProfileResourceHandler extends common_1.ResourceHandler { + async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + const createFargateProfile = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + const deleteFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + return; + } + async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + async isCreateComplete() { + return this.isUpdateComplete(); + } + async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + /** + * Generates a fargate profile name. + */ + generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + async queryStatus() { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + const describeFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + try { + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + return status; + } + catch (describeFargateProfileError) { + if (describeFargateProfileError instanceof client_eks_1.ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} +exports.FargateProfileResourceHandler = FargateProfileResourceHandler; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsNkRBQTZEO0FBQzdELG9EQUFnRTtBQUVoRSxxQ0FBMkM7QUFFM0MsTUFBTSxZQUFZLEdBQUcsRUFBRSxDQUFDO0FBRXhCLE1BQWEsNkJBQThCLFNBQVEsd0JBQWU7SUFDdEQsS0FBSyxDQUFDLFFBQVE7UUFDdEIsTUFBTSxrQkFBa0IsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU0sQ0FBQyxrQkFBa0IsSUFBSSxJQUFJLENBQUMsbUJBQW1CLEVBQUUsQ0FBQztRQUVqSCxNQUFNLG9CQUFvQixHQUF3QztZQUNoRSxrQkFBa0I7WUFDbEIsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU07U0FDeEMsQ0FBQztRQUVGLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxvQkFBb0IsRUFBRSxDQUFDLENBQUM7UUFDbkMsTUFBTSw0QkFBNEIsR0FBRyxNQUFNLElBQUksQ0FBQyxHQUFHLENBQUMsb0JBQW9CLENBQUMsb0JBQW9CLENBQUMsQ0FBQztRQUMvRixJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsNEJBQTRCLEVBQUUsQ0FBQyxDQUFDO1FBRTNDLElBQUksQ0FBQyw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y2VwdGlvbiwgdGhpcyBtZWFucyB0aGUgcHJvZmlsZSBoYXMgYmVlbiBkZWxldGVkIChvciBuZXZlciBleGlzdGVkKScpO1xuICAgICAgICByZXR1cm4gJ05PVF9GT1VORCc7XG4gICAgICB9XG5cbiAgICAgIHRoaXMubG9nKHsgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yIH0pO1xuICAgICAgdGhyb3cgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yO1xuICAgIH1cbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts new file mode 100644 index 0000000000000..16b9f9abfeb49 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts @@ -0,0 +1,121 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies +import { ResourceHandler } from './common'; + +const MAX_NAME_LEN = 63; + +export class FargateProfileResourceHandler extends ResourceHandler { + protected async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + + const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + + protected async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + + const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + + return; + } + + protected async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + + protected async isCreateComplete() { + return this.isUpdateComplete(); + } + + protected async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + + protected async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + + /** + * Generates a fargate profile name. + */ + private generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + private async queryStatus(): Promise { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + + const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + try { + + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + + return status; + } catch (describeFargateProfileError: any) { + if (describeFargateProfileError instanceof ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip index 93f7400e6f8c2..11112de67d5be 100644 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip new file mode 100644 index 0000000000000..90a8a2a6e2615 Binary files /dev/null and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/aws-cdk-eks-cluster-test.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/aws-cdk-eks-cluster-ipv6-test.assets.json similarity index 83% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/aws-cdk-eks-cluster-test.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/aws-cdk-eks-cluster-ipv6-test.assets.json index 5f8d41dedf525..5cae492a654f6 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/aws-cdk-eks-cluster-test.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/aws-cdk-eks-cluster-ipv6-test.assets.json @@ -29,15 +29,15 @@ } } }, - "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649": { + "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31": { "source": { - "path": "asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649", + "path": "asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31", "packaging": "zip" }, "destinations": { "current_account-us-east-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1", - "objectKey": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip", + "objectKey": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip", "region": "us-east-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-us-east-1" } @@ -71,15 +71,15 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-us-east-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "region": "us-east-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-us-east-1" } @@ -127,43 +127,43 @@ } } }, - "38d703160bc45251d27e806080a42e0e3e95a76199d0d1342c10c86a6a132f01": { + "64046515013419724c0ca215fe4d8d669956a8ca5130f0e9c0d33ae7bf4b7f6a": { "source": { - "path": "awscdkeksclustertestawscdkawseksClusterResourceProvider5F388D1A.nested.template.json", + "path": "awscdkeksclusteripv6testawscdkawseksClusterResourceProviderAC8DB286.nested.template.json", "packaging": "file" }, "destinations": { "current_account-us-east-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1", - "objectKey": "38d703160bc45251d27e806080a42e0e3e95a76199d0d1342c10c86a6a132f01.json", + "objectKey": "64046515013419724c0ca215fe4d8d669956a8ca5130f0e9c0d33ae7bf4b7f6a.json", "region": "us-east-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-us-east-1" } } }, - "c4dcedad1cadbfa87852da53c1c41533ef51e3bd1395cd2d70fffb677c3c81a9": { + "93843e4b671dc93f732e6d83b774f771506bee567af9b86071390b802cbc4d66": { "source": { - "path": "awscdkeksclustertestawscdkawseksKubectlProviderE05943BF.nested.template.json", + "path": "awscdkeksclusteripv6testawscdkawseksKubectlProvider3E7CED93.nested.template.json", "packaging": "file" }, "destinations": { "current_account-us-east-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1", - "objectKey": "c4dcedad1cadbfa87852da53c1c41533ef51e3bd1395cd2d70fffb677c3c81a9.json", + "objectKey": "93843e4b671dc93f732e6d83b774f771506bee567af9b86071390b802cbc4d66.json", "region": "us-east-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-us-east-1" } } }, - "2e89414f1121ee451ba0a62318b9f3ddecd3f8b5b7dc3c2d74b75df1e328a3af": { + "2a592f65a66a57f9a6c4030f4118873bf568e155ea5035f6787e2818e6a57d43": { "source": { - "path": "aws-cdk-eks-cluster-test.template.json", + "path": "aws-cdk-eks-cluster-ipv6-test.template.json", "packaging": "file" }, "destinations": { "current_account-us-east-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1", - "objectKey": "2e89414f1121ee451ba0a62318b9f3ddecd3f8b5b7dc3c2d74b75df1e328a3af.json", + "objectKey": "2a592f65a66a57f9a6c4030f4118873bf568e155ea5035f6787e2818e6a57d43.json", "region": "us-east-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-us-east-1" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/aws-cdk-eks-cluster-test.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/aws-cdk-eks-cluster-ipv6-test.template.json similarity index 85% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/aws-cdk-eks-cluster-test.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/aws-cdk-eks-cluster-ipv6-test.template.json index 9b2ce6125c72a..89619f7ed6b54 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/aws-cdk-eks-cluster-test.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/aws-cdk-eks-cluster-ipv6-test.template.json @@ -69,7 +69,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Vpc" + "Value": "aws-cdk-eks-cluster-ipv6-test/Vpc" } ] } @@ -125,7 +125,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet1" + "Value": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1" } ], "VpcId": { @@ -146,7 +146,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet1" + "Value": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1" } ], "VpcId": { @@ -198,7 +198,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet1" + "Value": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1" } ] }, @@ -225,7 +225,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet1" + "Value": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1" } ] }, @@ -286,7 +286,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet2" + "Value": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet2" } ], "VpcId": { @@ -307,7 +307,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet2" + "Value": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet2" } ], "VpcId": { @@ -399,7 +399,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Vpc/PrivateSubnet1" + "Value": "aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet1" } ], "VpcId": { @@ -420,7 +420,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Vpc/PrivateSubnet1" + "Value": "aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet1" } ], "VpcId": { @@ -511,7 +511,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Vpc/PrivateSubnet2" + "Value": "aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet2" } ], "VpcId": { @@ -532,7 +532,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Vpc/PrivateSubnet2" + "Value": "aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet2" } ], "VpcId": { @@ -578,7 +578,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Vpc" + "Value": "aws-cdk-eks-cluster-ipv6-test/Vpc" } ] } @@ -860,10 +860,10 @@ "CIDR6" ] }, - "ClusterControlPlaneSecurityGroupfromawscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54443795AF111": { + "ClusterControlPlaneSecurityGroupfromawscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE4433ECAB7C9": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:443", + "Description": "from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:443", "FromPort": 443, "GroupId": { "Fn::GetAtt": [ @@ -884,10 +884,10 @@ "CIDR6" ] }, - "ClusterControlPlaneSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A324439DAF9D77": { + "ClusterControlPlaneSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D4432AF77268": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", + "Description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", "FromPort": 443, "GroupId": { "Fn::GetAtt": [ @@ -908,10 +908,10 @@ "CIDR6" ] }, - "ClusterControlPlaneSecurityGroupfromawscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858443B84847DA": { + "ClusterControlPlaneSecurityGroupfromawscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB443A1B1AA7A": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:443", + "Description": "from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:443", "FromPort": 443, "GroupId": { "Fn::GetAtt": [ @@ -932,10 +932,10 @@ "CIDR6" ] }, - "ClusterControlPlaneSecurityGroupfromawscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914443ECEF3F30": { + "ClusterControlPlaneSecurityGroupfromawscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB77642294439ECE17EF": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:443", + "Description": "from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:443", "FromPort": 443, "GroupId": { "Fn::GetAtt": [ @@ -956,10 +956,10 @@ "CIDR6" ] }, - "ClusterControlPlaneSecurityGroupfromawscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D474431DE5485F": { + "ClusterControlPlaneSecurityGroupfromawscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA034431582AEBA": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:443", + "Description": "from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:443", "FromPort": 443, "GroupId": { "Fn::GetAtt": [ @@ -999,13 +999,13 @@ { "Fn::GetAtt": [ "awscdkawseksClusterResourceProviderNestedStackawscdkawseksClusterResourceProviderNestedStackResource9827C454", - "Outputs.awscdkeksclustertestawscdkawseksClusterResourceProviderIsCompleteHandlerServiceRole970DAC30Arn" + "Outputs.awscdkeksclusteripv6testawscdkawseksClusterResourceProviderIsCompleteHandlerServiceRole1F912062Arn" ] }, { "Fn::GetAtt": [ "awscdkawseksClusterResourceProviderNestedStackawscdkawseksClusterResourceProviderNestedStackResource9827C454", - "Outputs.awscdkeksclustertestawscdkawseksClusterResourceProviderOnEventHandlerServiceRole5B783C71Arn" + "Outputs.awscdkeksclusteripv6testawscdkawseksClusterResourceProviderOnEventHandlerServiceRole6C18AE9AArn" ] } ] @@ -1158,7 +1158,7 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawseksClusterResourceProviderNestedStackawscdkawseksClusterResourceProviderNestedStackResource9827C454", - "Outputs.awscdkeksclustertestawscdkawseksClusterResourceProviderframeworkonEvent503C1667Arn" + "Outputs.awscdkeksclusteripv6testawscdkawseksClusterResourceProviderframeworkonEvent27EA7496Arn" ] }, "Config": { @@ -1344,10 +1344,10 @@ "CIDR6" ] }, - "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C544432C10EDB4": { + "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE443590558E1": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:443", + "Description": "from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:443", "FromPort": 443, "GroupId": { "Fn::GetAtt": [ @@ -1368,10 +1368,10 @@ "CIDR6" ] }, - "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54ALLTRAFFICA14EDC2C": { + "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DEALLTRAFFIC641CD112": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:ALL TRAFFIC", + "Description": "from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:ALL TRAFFIC", "GroupId": { "Fn::GetAtt": [ "Cluster9EE0221C", @@ -1390,10 +1390,10 @@ "CIDR6" ] }, - "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32443175FB542": { + "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D443F7BC2681": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", + "Description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", "FromPort": 443, "GroupId": { "Fn::GetAtt": [ @@ -1414,10 +1414,10 @@ "CIDR6" ] }, - "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterControlPlaneSecurityGroup2F1301344439997E64B": { + "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE44383B7C39C": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443", + "Description": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443", "FromPort": 443, "GroupId": { "Fn::GetAtt": [ @@ -1438,10 +1438,10 @@ "CIDR6" ] }, - "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A321025655359034D5F2": { + "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D1025655359FF1A5D4": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535", + "Description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535", "FromPort": 1025, "GroupId": { "Fn::GetAtt": [ @@ -1462,10 +1462,10 @@ "CIDR6" ] }, - "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterControlPlaneSecurityGroup2F130134102565535D0C036C4": { + "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE1025655351AB443C3": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535", + "Description": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535", "FromPort": 1025, "GroupId": { "Fn::GetAtt": [ @@ -1486,10 +1486,10 @@ "CIDR6" ] }, - "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32ALLTRAFFIC3F547F1B": { + "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6DALLTRAFFIC175DE2E1": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC", + "Description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC", "GroupId": { "Fn::GetAtt": [ "Cluster9EE0221C", @@ -1508,10 +1508,10 @@ "CIDR6" ] }, - "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858443A88C1345": { + "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB4439A9F1426": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:443", + "Description": "from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:443", "FromPort": 443, "GroupId": { "Fn::GetAtt": [ @@ -1532,10 +1532,10 @@ "CIDR6" ] }, - "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858ALLTRAFFIC18C2F6D7": { + "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBBALLTRAFFICDD19773F": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:ALL TRAFFIC", + "Description": "from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:ALL TRAFFIC", "GroupId": { "Fn::GetAtt": [ "Cluster9EE0221C", @@ -1554,10 +1554,10 @@ "CIDR6" ] }, - "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914443A80EB501": { + "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229443914C5D7E": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:443", + "Description": "from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:443", "FromPort": 443, "GroupId": { "Fn::GetAtt": [ @@ -1578,10 +1578,10 @@ "CIDR6" ] }, - "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914ALLTRAFFIC40B17035": { + "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229ALLTRAFFIC3B055075": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:ALL TRAFFIC", + "Description": "from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:ALL TRAFFIC", "GroupId": { "Fn::GetAtt": [ "Cluster9EE0221C", @@ -1600,10 +1600,10 @@ "CIDR6" ] }, - "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D474432A818F38": { + "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA034437EEB6700": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:443", + "Description": "from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:443", "FromPort": 443, "GroupId": { "Fn::GetAtt": [ @@ -1624,10 +1624,10 @@ "CIDR6" ] }, - "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47ALLTRAFFICDB5CD664": { + "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03ALLTRAFFIC39C98724": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:ALL TRAFFIC", + "Description": "from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:ALL TRAFFIC", "GroupId": { "Fn::GetAtt": [ "Cluster9EE0221C", @@ -1652,14 +1652,14 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B", - "Outputs.awscdkeksclustertestawscdkawseksKubectlProviderframeworkonEventC681B49AArn" + "Outputs.awscdkeksclusteripv6testawscdkawseksKubectlProviderframeworkonEvent383976A6Arn" ] }, "Manifest": { "Fn::Join": [ "", [ - "[{\"apiVersion\":\"v1\",\"kind\":\"ConfigMap\",\"metadata\":{\"name\":\"aws-auth\",\"namespace\":\"kube-system\",\"labels\":{\"aws.cdk.eks/prune-c842be348c45337cd97b8759de76d5a68b4910d487\":\"\"}},\"data\":{\"mapRoles\":\"[{\\\"rolearn\\\":\\\"", + "[{\"apiVersion\":\"v1\",\"kind\":\"ConfigMap\",\"metadata\":{\"name\":\"aws-auth\",\"namespace\":\"kube-system\",\"labels\":{\"aws.cdk.eks/prune-c8709010a4b980a3549e294e5d2b6033c70444b255\":\"\"}},\"data\":{\"mapRoles\":\"[{\\\"rolearn\\\":\\\"", { "Fn::GetAtt": [ "AdminRole38563C57", @@ -1763,7 +1763,7 @@ "Arn" ] }, - "PruneLabel": "aws.cdk.eks/prune-c842be348c45337cd97b8759de76d5a68b4910d487", + "PruneLabel": "aws.cdk.eks/prune-c8709010a4b980a3549e294e5d2b6033c70444b255", "Overwrite": true }, "DependsOn": [ @@ -1933,7 +1933,7 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawseksClusterResourceProviderNestedStackawscdkawseksClusterResourceProviderNestedStackResource9827C454", - "Outputs.awscdkeksclustertestawscdkawseksClusterResourceProviderframeworkonEvent503C1667Arn" + "Outputs.awscdkeksclusteripv6testawscdkawseksClusterResourceProviderframeworkonEvent27EA7496Arn" ] }, "AssumeRoleArn": { @@ -1968,7 +1968,7 @@ "ClusterNodesInstanceSecurityGroup899246BD": { "Type": "AWS::EC2::SecurityGroup", "Properties": { - "GroupDescription": "aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceSecurityGroup", + "GroupDescription": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceSecurityGroup", "SecurityGroupEgress": [ { "CidrIp": "0.0.0.0/0", @@ -1979,7 +1979,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Cluster/Nodes" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes" } ], "VpcId": { @@ -1990,10 +1990,10 @@ "CIDR6" ] }, - "ClusterNodesInstanceSecurityGroupfromawscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54ALLTRAFFICBC5FBE2E": { + "ClusterNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DEALLTRAFFIC7A69EC66": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:ALL TRAFFIC", + "Description": "from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:ALL TRAFFIC", "GroupId": { "Fn::GetAtt": [ "ClusterNodesInstanceSecurityGroup899246BD", @@ -2012,10 +2012,10 @@ "CIDR6" ] }, - "ClusterNodesInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32443DC7FAF39": { + "ClusterNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D4435B21533A": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", + "Description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", "FromPort": 443, "GroupId": { "Fn::GetAtt": [ @@ -2036,10 +2036,10 @@ "CIDR6" ] }, - "ClusterNodesInstanceSecurityGroupfromawscdkeksclustertestClusterControlPlaneSecurityGroup2F130134443AE10EB12": { + "ClusterNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE4432931D2E6": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443", + "Description": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443", "FromPort": 443, "GroupId": { "Fn::GetAtt": [ @@ -2060,10 +2060,10 @@ "CIDR6" ] }, - "ClusterNodesInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32102565535D6A46ADB": { + "ClusterNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D102565535A7F35F64": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535", + "Description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535", "FromPort": 1025, "GroupId": { "Fn::GetAtt": [ @@ -2084,10 +2084,10 @@ "CIDR6" ] }, - "ClusterNodesInstanceSecurityGroupfromawscdkeksclustertestClusterControlPlaneSecurityGroup2F1301341025655359F401D0D": { + "ClusterNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE102565535CF4750C4": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535", + "Description": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535", "FromPort": 1025, "GroupId": { "Fn::GetAtt": [ @@ -2108,10 +2108,10 @@ "CIDR6" ] }, - "ClusterNodesInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32ALLTRAFFIC14EF5815": { + "ClusterNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6DALLTRAFFIC67D1F519": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC", + "Description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC", "GroupId": { "Fn::GetAtt": [ "ClusterNodesInstanceSecurityGroup899246BD", @@ -2200,7 +2200,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Cluster/Nodes" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes" } ] }, @@ -2274,7 +2274,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Cluster/Nodes/LaunchTemplate" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/LaunchTemplate" } ] }, @@ -2297,7 +2297,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Cluster/Nodes/LaunchTemplate" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/LaunchTemplate" } ] } @@ -2325,7 +2325,7 @@ "CertificateAuthorityData" ] }, - "' --use-max-pods true\n/opt/aws/bin/cfn-signal --exit-code $? --stack aws-cdk-eks-cluster-test --resource ClusterNodesASGF172BD19 --region us-east-1" + "' --use-max-pods true\n/opt/aws/bin/cfn-signal --exit-code $? --stack aws-cdk-eks-cluster-ipv6-test --resource ClusterNodesASGF172BD19 --region us-east-1" ] ] } @@ -2351,7 +2351,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Cluster/Nodes/LaunchTemplate" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/LaunchTemplate" } ] } @@ -2397,7 +2397,7 @@ { "Key": "Name", "PropagateAtLaunch": true, - "Value": "aws-cdk-eks-cluster-test/Cluster/Nodes" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes" } ], "VPCZoneIdentifier": [ @@ -2421,7 +2421,7 @@ "ClusterNodesArmInstanceSecurityGroup599F388B": { "Type": "AWS::EC2::SecurityGroup", "Properties": { - "GroupDescription": "aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceSecurityGroup", + "GroupDescription": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceSecurityGroup", "SecurityGroupEgress": [ { "CidrIp": "0.0.0.0/0", @@ -2432,7 +2432,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Cluster/NodesArm" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm" } ], "VpcId": { @@ -2443,10 +2443,10 @@ "CIDR6" ] }, - "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858ALLTRAFFIC83BB7106": { + "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBBALLTRAFFIC7E1EC03D": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:ALL TRAFFIC", + "Description": "from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:ALL TRAFFIC", "GroupId": { "Fn::GetAtt": [ "ClusterNodesArmInstanceSecurityGroup599F388B", @@ -2465,10 +2465,10 @@ "CIDR6" ] }, - "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32443AC8AE5BF": { + "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D4436712E874": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", + "Description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", "FromPort": 443, "GroupId": { "Fn::GetAtt": [ @@ -2489,10 +2489,10 @@ "CIDR6" ] }, - "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclustertestClusterControlPlaneSecurityGroup2F13013444328ED4211": { + "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE44335ECB898": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443", + "Description": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443", "FromPort": 443, "GroupId": { "Fn::GetAtt": [ @@ -2513,10 +2513,10 @@ "CIDR6" ] }, - "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32102565535F5718241": { + "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D102565535C8B8BE39": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535", + "Description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535", "FromPort": 1025, "GroupId": { "Fn::GetAtt": [ @@ -2537,10 +2537,10 @@ "CIDR6" ] }, - "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclustertestClusterControlPlaneSecurityGroup2F13013410256553586052D07": { + "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE102565535A80FF723": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535", + "Description": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535", "FromPort": 1025, "GroupId": { "Fn::GetAtt": [ @@ -2561,10 +2561,10 @@ "CIDR6" ] }, - "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32ALLTRAFFIC655074AB": { + "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6DALLTRAFFICA21F70E4": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC", + "Description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC", "GroupId": { "Fn::GetAtt": [ "ClusterNodesArmInstanceSecurityGroup599F388B", @@ -2653,7 +2653,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Cluster/NodesArm" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm" } ] }, @@ -2727,7 +2727,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Cluster/NodesArm/LaunchTemplate" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/LaunchTemplate" } ] }, @@ -2750,7 +2750,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Cluster/NodesArm/LaunchTemplate" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/LaunchTemplate" } ] } @@ -2778,7 +2778,7 @@ "CertificateAuthorityData" ] }, - "' --use-max-pods true\n/opt/aws/bin/cfn-signal --exit-code $? --stack aws-cdk-eks-cluster-test --resource ClusterNodesArmASG40A593D0 --region us-east-1" + "' --use-max-pods true\n/opt/aws/bin/cfn-signal --exit-code $? --stack aws-cdk-eks-cluster-ipv6-test --resource ClusterNodesArmASG40A593D0 --region us-east-1" ] ] } @@ -2804,7 +2804,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Cluster/NodesArm/LaunchTemplate" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/LaunchTemplate" } ] } @@ -2850,7 +2850,7 @@ { "Key": "Name", "PropagateAtLaunch": true, - "Value": "aws-cdk-eks-cluster-test/Cluster/NodesArm" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm" } ], "VPCZoneIdentifier": [ @@ -2874,7 +2874,7 @@ "ClusterBottlerocketNodesInstanceSecurityGroup3794A94B": { "Type": "AWS::EC2::SecurityGroup", "Properties": { - "GroupDescription": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceSecurityGroup", + "GroupDescription": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceSecurityGroup", "SecurityGroupEgress": [ { "CidrIp": "0.0.0.0/0", @@ -2885,7 +2885,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes" } ], "VpcId": { @@ -2896,10 +2896,10 @@ "CIDR6" ] }, - "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914ALLTRAFFIC7B6353A7": { + "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229ALLTRAFFIC681C13E7": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:ALL TRAFFIC", + "Description": "from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:ALL TRAFFIC", "GroupId": { "Fn::GetAtt": [ "ClusterBottlerocketNodesInstanceSecurityGroup3794A94B", @@ -2918,10 +2918,10 @@ "CIDR6" ] }, - "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32443D1686B16": { + "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D44354C22497": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", + "Description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", "FromPort": 443, "GroupId": { "Fn::GetAtt": [ @@ -2942,10 +2942,10 @@ "CIDR6" ] }, - "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclustertestClusterControlPlaneSecurityGroup2F130134443A6D43789": { + "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE443707A5FDB": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443", + "Description": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443", "FromPort": 443, "GroupId": { "Fn::GetAtt": [ @@ -2966,10 +2966,10 @@ "CIDR6" ] }, - "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32102565535674E85A7": { + "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D102565535BB921D93": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535", + "Description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535", "FromPort": 1025, "GroupId": { "Fn::GetAtt": [ @@ -2990,10 +2990,10 @@ "CIDR6" ] }, - "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclustertestClusterControlPlaneSecurityGroup2F1301341025655352CE8AD9A": { + "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE102565535587DF246": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535", + "Description": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535", "FromPort": 1025, "GroupId": { "Fn::GetAtt": [ @@ -3014,10 +3014,10 @@ "CIDR6" ] }, - "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32ALLTRAFFICFAF900F2": { + "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6DALLTRAFFIC2A7F9925": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC", + "Description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC", "GroupId": { "Fn::GetAtt": [ "ClusterBottlerocketNodesInstanceSecurityGroup3794A94B", @@ -3106,7 +3106,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes" } ] }, @@ -3180,7 +3180,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/LaunchTemplate" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/LaunchTemplate" } ] }, @@ -3203,7 +3203,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/LaunchTemplate" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/LaunchTemplate" } ] } @@ -3257,7 +3257,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/LaunchTemplate" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/LaunchTemplate" } ] } @@ -3303,7 +3303,7 @@ { "Key": "Name", "PropagateAtLaunch": true, - "Value": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes" } ], "VPCZoneIdentifier": [ @@ -3327,7 +3327,7 @@ "ClusterspotInstanceSecurityGroup01F7B1CE": { "Type": "AWS::EC2::SecurityGroup", "Properties": { - "GroupDescription": "aws-cdk-eks-cluster-test/Cluster/spot/InstanceSecurityGroup", + "GroupDescription": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceSecurityGroup", "SecurityGroupEgress": [ { "CidrIp": "0.0.0.0/0", @@ -3338,7 +3338,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Cluster/spot" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot" } ], "VpcId": { @@ -3349,10 +3349,10 @@ "CIDR6" ] }, - "ClusterspotInstanceSecurityGroupfromawscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47ALLTRAFFIC2B1A12D9": { + "ClusterspotInstanceSecurityGroupfromawscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03ALLTRAFFIC1FD26D74": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:ALL TRAFFIC", + "Description": "from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:ALL TRAFFIC", "GroupId": { "Fn::GetAtt": [ "ClusterspotInstanceSecurityGroup01F7B1CE", @@ -3371,10 +3371,10 @@ "CIDR6" ] }, - "ClusterspotInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A324438F751704": { + "ClusterspotInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D4430026205F": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", + "Description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", "FromPort": 443, "GroupId": { "Fn::GetAtt": [ @@ -3395,10 +3395,10 @@ "CIDR6" ] }, - "ClusterspotInstanceSecurityGroupfromawscdkeksclustertestClusterControlPlaneSecurityGroup2F1301344430650F325": { + "ClusterspotInstanceSecurityGroupfromawscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE44373B6F417": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443", + "Description": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443", "FromPort": 443, "GroupId": { "Fn::GetAtt": [ @@ -3419,10 +3419,10 @@ "CIDR6" ] }, - "ClusterspotInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A321025655350D837827": { + "ClusterspotInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D102565535E77539BD": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535", + "Description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535", "FromPort": 1025, "GroupId": { "Fn::GetAtt": [ @@ -3443,10 +3443,10 @@ "CIDR6" ] }, - "ClusterspotInstanceSecurityGroupfromawscdkeksclustertestClusterControlPlaneSecurityGroup2F130134102565535C7203235": { + "ClusterspotInstanceSecurityGroupfromawscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE1025655357246D15F": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535", + "Description": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535", "FromPort": 1025, "GroupId": { "Fn::GetAtt": [ @@ -3467,10 +3467,10 @@ "CIDR6" ] }, - "ClusterspotInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32ALLTRAFFIC59C23477": { + "ClusterspotInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6DALLTRAFFIC5330BC8B": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "Description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC", + "Description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC", "GroupId": { "Fn::GetAtt": [ "ClusterspotInstanceSecurityGroup01F7B1CE", @@ -3559,7 +3559,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Cluster/spot" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot" } ] }, @@ -3639,7 +3639,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Cluster/spot/LaunchTemplate" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/LaunchTemplate" } ] }, @@ -3662,7 +3662,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Cluster/spot/LaunchTemplate" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/LaunchTemplate" } ] } @@ -3690,7 +3690,7 @@ "CertificateAuthorityData" ] }, - "' --use-max-pods true --aws-api-retry-attempts 5\n/opt/aws/bin/cfn-signal --exit-code $? --stack aws-cdk-eks-cluster-test --resource ClusterspotASG857494B6 --region us-east-1" + "' --use-max-pods true --aws-api-retry-attempts 5\n/opt/aws/bin/cfn-signal --exit-code $? --stack aws-cdk-eks-cluster-ipv6-test --resource ClusterspotASG857494B6 --region us-east-1" ] ] } @@ -3716,7 +3716,7 @@ }, { "Key": "Name", - "Value": "aws-cdk-eks-cluster-test/Cluster/spot/LaunchTemplate" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/LaunchTemplate" } ] } @@ -3762,7 +3762,7 @@ { "Key": "Name", "PropagateAtLaunch": true, - "Value": "aws-cdk-eks-cluster-test/Cluster/spot" + "Value": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot" } ], "VPCZoneIdentifier": [ @@ -3789,7 +3789,7 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B", - "Outputs.awscdkeksclustertestawscdkawseksKubectlProviderframeworkonEventC681B49AArn" + "Outputs.awscdkeksclusteripv6testawscdkawseksKubectlProviderframeworkonEvent383976A6Arn" ] }, "ClusterName": { @@ -3801,7 +3801,7 @@ "Arn" ] }, - "Release": "ksclustertestclusterchartspotinterrupthandlerf41ba997", + "Release": "usteripv6testclusterchartspotinterrupthandlere35c3de9", "Chart": "aws-node-termination-handler", "Version": "0.18.0", "Values": "{\"nodeSelector\":{\"lifecycle\":\"Ec2Spot\"}}", @@ -4347,10 +4347,10 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B", - "Outputs.awscdkeksclustertestawscdkawseksKubectlProviderframeworkonEventC681B49AArn" + "Outputs.awscdkeksclusteripv6testawscdkawseksKubectlProviderframeworkonEvent383976A6Arn" ] }, - "Manifest": "[{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"name\":\"hello-kubernetes\",\"labels\":{\"aws.cdk.eks/prune-c8f0f7140f7358e29b7f58e81b507dcf744a3908f4\":\"\"}},\"spec\":{\"type\":\"LoadBalancer\",\"ports\":[{\"port\":80,\"targetPort\":8080}],\"selector\":{\"app\":\"hello-kubernetes\"}}},{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"name\":\"hello-kubernetes\",\"labels\":{\"aws.cdk.eks/prune-c8f0f7140f7358e29b7f58e81b507dcf744a3908f4\":\"\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"app\":\"hello-kubernetes\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"hello-kubernetes\"}},\"spec\":{\"containers\":[{\"name\":\"hello-kubernetes\",\"image\":\"paulbouwer/hello-kubernetes:1.5\",\"ports\":[{\"containerPort\":8080}]}]}}}}]", + "Manifest": "[{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"name\":\"hello-kubernetes\",\"labels\":{\"aws.cdk.eks/prune-c857e5928dedf3ab260d0e79df8bb4cad40c0fc39f\":\"\"}},\"spec\":{\"ports\":[{\"port\":80,\"targetPort\":8080}],\"selector\":{\"app\":\"hello-kubernetes\"}}},{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"name\":\"hello-kubernetes\",\"labels\":{\"aws.cdk.eks/prune-c857e5928dedf3ab260d0e79df8bb4cad40c0fc39f\":\"\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"app\":\"hello-kubernetes\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"hello-kubernetes\"}},\"spec\":{\"containers\":[{\"name\":\"hello-kubernetes\",\"image\":\"paulbouwer/hello-kubernetes:1.5\",\"ports\":[{\"containerPort\":8080}]}]}}}}]", "ClusterName": { "Ref": "Cluster9EE0221C" }, @@ -4360,7 +4360,7 @@ "Arn" ] }, - "PruneLabel": "aws.cdk.eks/prune-c8f0f7140f7358e29b7f58e81b507dcf744a3908f4" + "PruneLabel": "aws.cdk.eks/prune-c857e5928dedf3ab260d0e79df8bb4cad40c0fc39f" }, "DependsOn": [ "CIDR6", @@ -4375,7 +4375,7 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B", - "Outputs.awscdkeksclustertestawscdkawseksKubectlProviderframeworkonEventC681B49AArn" + "Outputs.awscdkeksclusteripv6testawscdkawseksKubectlProviderframeworkonEvent383976A6Arn" ] }, "ClusterName": { @@ -4387,8 +4387,9 @@ "Arn" ] }, - "Release": "awscdkeksclustertestclusterchartdashboard1f3d83fe", + "Release": "awscdkeksclusteripv6testclusterchartdashboard7d0f17f1", "Chart": "kubernetes-dashboard", + "Version": "6.0.8", "Namespace": "default", "Repository": "https://kubernetes.github.io/dashboard/", "CreateNamespace": true @@ -4406,7 +4407,7 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B", - "Outputs.awscdkeksclustertestawscdkawseksKubectlProviderframeworkonEventC681B49AArn" + "Outputs.awscdkeksclusteripv6testawscdkawseksKubectlProviderframeworkonEvent383976A6Arn" ] }, "ClusterName": { @@ -4418,7 +4419,7 @@ "Arn" ] }, - "Release": "awscdkeksclustertestclustercharttestchart9d337ff7", + "Release": "awscdkeksclusteripv6testclustercharttestchart55b4b16c", "ChartAssetURL": { "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1/d65fbdc11b108e0386ed8577c454d4544f6d4e7960f84a0d2e211478d6324dbf.zip" }, @@ -4438,14 +4439,14 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B", - "Outputs.awscdkeksclustertestawscdkawseksKubectlProviderframeworkonEventC681B49AArn" + "Outputs.awscdkeksclusteripv6testawscdkawseksKubectlProviderframeworkonEvent383976A6Arn" ] }, "Manifest": { "Fn::Join": [ "", [ - "[{\"apiVersion\":\"v1\",\"kind\":\"ConfigMap\",\"metadata\":{\"name\":\"chart-config-map-c820e51c\",\"labels\":{\"aws.cdk.eks/prune-c89c99db0e333353528b2e912b1fb988b6870edc75\":\"\"}},\"data\":{\"clusterName\":\"", + "[{\"apiVersion\":\"v1\",\"kind\":\"ConfigMap\",\"metadata\":{\"name\":\"chart-config-map-c820e51c\",\"labels\":{\"aws.cdk.eks/prune-c8a4647b41837ccb80fac3f90c9d2b1b83b2b17b0f\":\"\"}},\"data\":{\"clusterName\":\"", { "Ref": "Cluster9EE0221C" }, @@ -4462,7 +4463,7 @@ "Arn" ] }, - "PruneLabel": "aws.cdk.eks/prune-c89c99db0e333353528b2e912b1fb988b6870edc75" + "PruneLabel": "aws.cdk.eks/prune-c8a4647b41837ccb80fac3f90c9d2b1b83b2b17b0f" }, "DependsOn": [ "CIDR6", @@ -4477,10 +4478,10 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B", - "Outputs.awscdkeksclustertestawscdkawseksKubectlProviderframeworkonEventC681B49AArn" + "Outputs.awscdkeksclusteripv6testawscdkawseksKubectlProviderframeworkonEvent383976A6Arn" ] }, - "Manifest": "[{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"name\":\"nginx\",\"labels\":{\"aws.cdk.eks/prune-c84fd26f70b01a84daa5d3646e813820af6fde0970\":\"\"}}}]", + "Manifest": "[{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"name\":\"nginx\",\"labels\":{\"aws.cdk.eks/prune-c893c714b666ac633e6f779b60a86213c0ee669753\":\"\"}}}]", "ClusterName": { "Ref": "Cluster9EE0221C" }, @@ -4490,7 +4491,7 @@ "Arn" ] }, - "PruneLabel": "aws.cdk.eks/prune-c84fd26f70b01a84daa5d3646e813820af6fde0970" + "PruneLabel": "aws.cdk.eks/prune-c893c714b666ac633e6f779b60a86213c0ee669753" }, "DependsOn": [ "CIDR6", @@ -4505,7 +4506,7 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B", - "Outputs.awscdkeksclustertestawscdkawseksKubectlProviderframeworkonEventC681B49AArn" + "Outputs.awscdkeksclusteripv6testawscdkawseksKubectlProviderframeworkonEvent383976A6Arn" ] }, "ClusterName": { @@ -4517,10 +4518,12 @@ "Arn" ] }, - "Release": "awscdkeksclustertestclusterchartnginxingressa7f70129", + "Release": "nginx-ingress", "Chart": "nginx-ingress", + "Version": "0.17.1", "Wait": true, "Timeout": "900s", + "Values": "{\"controller\":{\"service\":{\"create\":false}}}", "Namespace": "nginx", "Repository": "https://helm.nginx.com/stable" }, @@ -4573,7 +4576,7 @@ } ] }, - ":sub\":\"system:serviceaccount:default:awscdkeksclustertestclustermyserviceaccount4080bcdd\"}" + ":sub\":\"system:serviceaccount:default:awscdkeksclusteripv6testclustermyserviceaccount622f395f\"}" ] ] } @@ -4620,14 +4623,14 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B", - "Outputs.awscdkeksclustertestawscdkawseksKubectlProviderframeworkonEventC681B49AArn" + "Outputs.awscdkeksclusteripv6testawscdkawseksKubectlProviderframeworkonEvent383976A6Arn" ] }, "Manifest": { "Fn::Join": [ "", [ - "[{\"apiVersion\":\"v1\",\"kind\":\"ServiceAccount\",\"metadata\":{\"name\":\"awscdkeksclustertestclustermyserviceaccount4080bcdd\",\"namespace\":\"default\",\"labels\":{\"aws.cdk.eks/prune-c8f8dbf23319159cc2fef46283f7450b814e818252\":\"\",\"app.kubernetes.io/name\":\"awscdkeksclustertestclustermyserviceaccount4080bcdd\"},\"annotations\":{\"eks.amazonaws.com/role-arn\":\"", + "[{\"apiVersion\":\"v1\",\"kind\":\"ServiceAccount\",\"metadata\":{\"name\":\"awscdkeksclusteripv6testclustermyserviceaccount622f395f\",\"namespace\":\"default\",\"labels\":{\"aws.cdk.eks/prune-c8b5f973f54f16a7f43ef1fc9fc3bcfc2f739b9d80\":\"\",\"app.kubernetes.io/name\":\"awscdkeksclusteripv6testclustermyserviceaccount622f395f\"},\"annotations\":{\"eks.amazonaws.com/role-arn\":\"", { "Fn::GetAtt": [ "ClusterMyServiceAccountRole85337B29", @@ -4647,7 +4650,7 @@ "Arn" ] }, - "PruneLabel": "aws.cdk.eks/prune-c8f8dbf23319159cc2fef46283f7450b814e818252" + "PruneLabel": "aws.cdk.eks/prune-c8b5f973f54f16a7f43ef1fc9fc3bcfc2f739b9d80" }, "DependsOn": [ "CIDR6", @@ -4723,7 +4726,7 @@ } ] }, - ":sub\":\"system:serviceaccount:default:awscdkeksclustertestclustermyextendedserviceaccounte1ac12ae\"}" + ":sub\":\"system:serviceaccount:default:awscdkeksclusteripv6testclustermyextendedserviceaccount5e8d533c\"}" ] ] } @@ -4770,14 +4773,14 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B", - "Outputs.awscdkeksclustertestawscdkawseksKubectlProviderframeworkonEventC681B49AArn" + "Outputs.awscdkeksclusteripv6testawscdkawseksKubectlProviderframeworkonEvent383976A6Arn" ] }, "Manifest": { "Fn::Join": [ "", [ - "[{\"apiVersion\":\"v1\",\"kind\":\"ServiceAccount\",\"metadata\":{\"name\":\"awscdkeksclustertestclustermyextendedserviceaccounte1ac12ae\",\"namespace\":\"default\",\"labels\":{\"aws.cdk.eks/prune-c8794052a8684d4683f84b33861d88bc4524fe40a4\":\"\",\"app.kubernetes.io/name\":\"awscdkeksclustertestclustermyextendedserviceaccounte1ac12ae\",\"some-label\":\"with-some-value\"},\"annotations\":{\"eks.amazonaws.com/role-arn\":\"", + "[{\"apiVersion\":\"v1\",\"kind\":\"ServiceAccount\",\"metadata\":{\"name\":\"awscdkeksclusteripv6testclustermyextendedserviceaccount5e8d533c\",\"namespace\":\"default\",\"labels\":{\"aws.cdk.eks/prune-c8873ce11b40458d0d1b09c4a70684303d0b37d402\":\"\",\"app.kubernetes.io/name\":\"awscdkeksclusteripv6testclustermyextendedserviceaccount5e8d533c\",\"some-label\":\"with-some-value\"},\"annotations\":{\"eks.amazonaws.com/role-arn\":\"", { "Fn::GetAtt": [ "ClusterMyExtendedServiceAccountRole064047AA", @@ -4797,7 +4800,7 @@ "Arn" ] }, - "PruneLabel": "aws.cdk.eks/prune-c8794052a8684d4683f84b33861d88bc4524fe40a4" + "PruneLabel": "aws.cdk.eks/prune-c8873ce11b40458d0d1b09c4a70684303d0b37d402" }, "DependsOn": [ "CIDR6", @@ -4821,7 +4824,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "/38d703160bc45251d27e806080a42e0e3e95a76199d0d1342c10c86a6a132f01.json" + "/64046515013419724c0ca215fe4d8d669956a8ca5130f0e9c0d33ae7bf4b7f6a.json" ] ] } @@ -4833,22 +4836,22 @@ "Type": "AWS::CloudFormation::Stack", "Properties": { "Parameters": { - "referencetoawscdkeksclustertestKubectlLayerD8FA674ERef": { + "referencetoawscdkeksclusteripv6testKubectlLayer6BCCECB5Ref": { "Ref": "KubectlLayer600207B5" }, - "referencetoawscdkeksclustertestClusterKubectlHandlerRoleA258E53AArn": { + "referencetoawscdkeksclusteripv6testClusterKubectlHandlerRoleCDF70F2CArn": { "Fn::GetAtt": [ "ClusterKubectlHandlerRole94549F93", "Arn" ] }, - "referencetoawscdkeksclustertestVpcPrivateSubnet1Subnet32A4EC2ARef": { + "referencetoawscdkeksclusteripv6testVpcPrivateSubnet1Subnet8169B811Ref": { "Ref": "VpcPrivateSubnet1Subnet536B997A" }, - "referencetoawscdkeksclustertestVpcPrivateSubnet2Subnet5CC53627Ref": { + "referencetoawscdkeksclusteripv6testVpcPrivateSubnet2Subnet21732C40Ref": { "Ref": "VpcPrivateSubnet2Subnet3788AAA1" }, - "referencetoawscdkeksclustertestClusterD76DFF87ClusterSecurityGroupId": { + "referencetoawscdkeksclusteripv6testCluster1C21F8EDClusterSecurityGroupId": { "Fn::GetAtt": [ "Cluster9EE0221C", "ClusterSecurityGroupId" @@ -4867,7 +4870,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "/c4dcedad1cadbfa87852da53c1c41533ef51e3bd1395cd2d70fffb677c3c81a9.json" + "/93843e4b671dc93f732e6d83b774f771506bee567af9b86071390b802cbc4d66.json" ] ] } @@ -4913,10 +4916,10 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B", - "Outputs.awscdkeksclustertestawscdkawseksKubectlProviderframeworkonEventC681B49AArn" + "Outputs.awscdkeksclusteripv6testawscdkawseksKubectlProviderframeworkonEvent383976A6Arn" ] }, - "Manifest": "[{\"apiVersion\":\"v1\",\"kind\":\"ConfigMap\",\"data\":{\"hello\":\"world\"},\"metadata\":{\"name\":\"config-map\",\"labels\":{\"aws.cdk.eks/prune-c89cbcc5d9bdd35cfc69c0334c0a9af21d1e0e372e\":\"\"}},\"unknown\":{\"key\":\"value\"}}]", + "Manifest": "[{\"apiVersion\":\"v1\",\"kind\":\"ConfigMap\",\"data\":{\"hello\":\"world\"},\"metadata\":{\"name\":\"config-map\",\"labels\":{\"aws.cdk.eks/prune-c892df0e0dff43984f6024f29abd9ac243e424f87a\":\"\"}},\"unknown\":{\"key\":\"value\"}}]", "ClusterName": { "Ref": "Cluster9EE0221C" }, @@ -4926,7 +4929,7 @@ "Arn" ] }, - "PruneLabel": "aws.cdk.eks/prune-c89cbcc5d9bdd35cfc69c0334c0a9af21d1e0e372e", + "PruneLabel": "aws.cdk.eks/prune-c892df0e0dff43984f6024f29abd9ac243e424f87a", "SkipValidation": true }, "DependsOn": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/awscdkeksclusterDefaultTestDeployAssertFBF4B356.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclusteripv6DefaultTestDeployAssert2C014107.assets.json similarity index 87% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/awscdkeksclusterDefaultTestDeployAssertFBF4B356.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclusteripv6DefaultTestDeployAssert2C014107.assets.json index ec29cb4ddb70a..9ea576a791bb8 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-imported.js.snapshot/awscdkeksclusterDefaultTestDeployAssertFBF4B356.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclusteripv6DefaultTestDeployAssert2C014107.assets.json @@ -3,7 +3,7 @@ "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { - "path": "awscdkeksclusterDefaultTestDeployAssertFBF4B356.template.json", + "path": "awscdkeksclusteripv6DefaultTestDeployAssert2C014107.template.json", "packaging": "file" }, "destinations": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclusterDefaultTestDeployAssertFBF4B356.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclusteripv6DefaultTestDeployAssert2C014107.template.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclusterDefaultTestDeployAssertFBF4B356.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclusteripv6DefaultTestDeployAssert2C014107.template.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclustertestawscdkawseksClusterResourceProvider5F388D1A.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclusteripv6testawscdkawseksClusterResourceProviderAC8DB286.nested.template.json similarity index 95% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclustertestawscdkawseksClusterResourceProvider5F388D1A.nested.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclusteripv6testawscdkawseksClusterResourceProviderAC8DB286.nested.template.json index 4c46d5dc8c88a..650d790e9accd 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclustertestawscdkawseksClusterResourceProvider5F388D1A.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclusteripv6testawscdkawseksClusterResourceProviderAC8DB286.nested.template.json @@ -50,7 +50,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "onEvent handler for EKS cluster resource provider", "Environment": { @@ -115,7 +115,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "isComplete handler for EKS cluster resource provider", "Environment": { @@ -251,7 +251,7 @@ }, "S3Key": "73b60c2cf141bf58c33cfaa33858f5c84103a0232ba7192d696536488f7731c4.zip" }, - "Description": "AWS CDK resource provider framework - onEvent (aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider)", + "Description": "AWS CDK resource provider framework - onEvent (aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -388,7 +388,7 @@ }, "S3Key": "73b60c2cf141bf58c33cfaa33858f5c84103a0232ba7192d696536488f7731c4.zip" }, - "Description": "AWS CDK resource provider framework - isComplete (aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider)", + "Description": "AWS CDK resource provider framework - isComplete (aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -522,7 +522,7 @@ }, "S3Key": "73b60c2cf141bf58c33cfaa33858f5c84103a0232ba7192d696536488f7731c4.zip" }, - "Description": "AWS CDK resource provider framework - onTimeout (aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider)", + "Description": "AWS CDK resource provider framework - onTimeout (aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -672,7 +672,7 @@ } }, "Outputs": { - "awscdkeksclustertestawscdkawseksClusterResourceProviderOnEventHandlerServiceRole5B783C71Arn": { + "awscdkeksclusteripv6testawscdkawseksClusterResourceProviderOnEventHandlerServiceRole6C18AE9AArn": { "Value": { "Fn::GetAtt": [ "OnEventHandlerServiceRole15A26729", @@ -680,7 +680,7 @@ ] } }, - "awscdkeksclustertestawscdkawseksClusterResourceProviderIsCompleteHandlerServiceRole970DAC30Arn": { + "awscdkeksclusteripv6testawscdkawseksClusterResourceProviderIsCompleteHandlerServiceRole1F912062Arn": { "Value": { "Fn::GetAtt": [ "IsCompleteHandlerServiceRole5810CC58", @@ -688,7 +688,7 @@ ] } }, - "awscdkeksclustertestawscdkawseksClusterResourceProviderframeworkonEvent503C1667Arn": { + "awscdkeksclusteripv6testawscdkawseksClusterResourceProviderframeworkonEvent27EA7496Arn": { "Value": { "Fn::GetAtt": [ "ProviderframeworkonEvent83C1D0A7", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclustertestawscdkawseksKubectlProviderE05943BF.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclusteripv6testawscdkawseksKubectlProvider3E7CED93.nested.template.json similarity index 74% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclustertestawscdkawseksKubectlProviderE05943BF.nested.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclusteripv6testawscdkawseksKubectlProvider3E7CED93.nested.template.json index 32e261dbf363c..14edb0ef785a2 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclustertestawscdkawseksKubectlProviderE05943BF.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/awscdkeksclusteripv6testawscdkawseksKubectlProvider3E7CED93.nested.template.json @@ -16,27 +16,27 @@ "Ref": "AwsCliLayerF44AAF94" }, { - "Ref": "referencetoawscdkeksclustertestKubectlLayerD8FA674ERef" + "Ref": "referencetoawscdkeksclusteripv6testKubectlLayer6BCCECB5Ref" } ], "MemorySize": 1024, "Role": { - "Ref": "referencetoawscdkeksclustertestClusterKubectlHandlerRoleA258E53AArn" + "Ref": "referencetoawscdkeksclusteripv6testClusterKubectlHandlerRoleCDF70F2CArn" }, "Runtime": "python3.7", "Timeout": 900, "VpcConfig": { "SecurityGroupIds": [ { - "Ref": "referencetoawscdkeksclustertestClusterD76DFF87ClusterSecurityGroupId" + "Ref": "referencetoawscdkeksclusteripv6testCluster1C21F8EDClusterSecurityGroupId" } ], "SubnetIds": [ { - "Ref": "referencetoawscdkeksclustertestVpcPrivateSubnet1Subnet32A4EC2ARef" + "Ref": "referencetoawscdkeksclusteripv6testVpcPrivateSubnet1Subnet8169B811Ref" }, { - "Ref": "referencetoawscdkeksclustertestVpcPrivateSubnet2Subnet5CC53627Ref" + "Ref": "referencetoawscdkeksclusteripv6testVpcPrivateSubnet2Subnet21732C40Ref" } ] } @@ -49,7 +49,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } @@ -148,7 +148,7 @@ }, "S3Key": "73b60c2cf141bf58c33cfaa33858f5c84103a0232ba7192d696536488f7731c4.zip" }, - "Description": "AWS CDK resource provider framework - onEvent (aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Provider)", + "Description": "AWS CDK resource provider framework - onEvent (aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Provider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -171,15 +171,15 @@ "VpcConfig": { "SecurityGroupIds": [ { - "Ref": "referencetoawscdkeksclustertestClusterD76DFF87ClusterSecurityGroupId" + "Ref": "referencetoawscdkeksclusteripv6testCluster1C21F8EDClusterSecurityGroupId" } ], "SubnetIds": [ { - "Ref": "referencetoawscdkeksclustertestVpcPrivateSubnet1Subnet32A4EC2ARef" + "Ref": "referencetoawscdkeksclusteripv6testVpcPrivateSubnet1Subnet8169B811Ref" }, { - "Ref": "referencetoawscdkeksclustertestVpcPrivateSubnet2Subnet5CC53627Ref" + "Ref": "referencetoawscdkeksclusteripv6testVpcPrivateSubnet2Subnet21732C40Ref" } ] } @@ -191,7 +191,7 @@ } }, "Outputs": { - "awscdkeksclustertestawscdkawseksKubectlProviderframeworkonEventC681B49AArn": { + "awscdkeksclusteripv6testawscdkawseksKubectlProviderframeworkonEvent383976A6Arn": { "Value": { "Fn::GetAtt": [ "ProviderframeworkonEvent83C1D0A7", @@ -201,19 +201,19 @@ } }, "Parameters": { - "referencetoawscdkeksclustertestKubectlLayerD8FA674ERef": { + "referencetoawscdkeksclusteripv6testKubectlLayer6BCCECB5Ref": { "Type": "String" }, - "referencetoawscdkeksclustertestClusterKubectlHandlerRoleA258E53AArn": { + "referencetoawscdkeksclusteripv6testClusterKubectlHandlerRoleCDF70F2CArn": { "Type": "String" }, - "referencetoawscdkeksclustertestVpcPrivateSubnet1Subnet32A4EC2ARef": { + "referencetoawscdkeksclusteripv6testVpcPrivateSubnet1Subnet8169B811Ref": { "Type": "String" }, - "referencetoawscdkeksclustertestVpcPrivateSubnet2Subnet5CC53627Ref": { + "referencetoawscdkeksclusteripv6testVpcPrivateSubnet2Subnet21732C40Ref": { "Type": "String" }, - "referencetoawscdkeksclustertestClusterD76DFF87ClusterSecurityGroupId": { + "referencetoawscdkeksclusteripv6testCluster1C21F8EDClusterSecurityGroupId": { "Type": "String" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/cdk.out index f0b901e7c06e5..560dae10d018f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"33.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/integ.json index 0a8e97417e938..6aa5ac603b480 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/integ.json @@ -1,9 +1,9 @@ { "version": "32.0.0", "testCases": { - "aws-cdk-eks-cluster/DefaultTest": { + "aws-cdk-eks-cluster-ipv6/DefaultTest": { "stacks": [ - "aws-cdk-eks-cluster-test" + "aws-cdk-eks-cluster-ipv6-test" ], "diffAssets": true, "cdkCommandOptions": { @@ -13,8 +13,8 @@ } } }, - "assertionStack": "aws-cdk-eks-cluster/DefaultTest/DeployAssert", - "assertionStackName": "awscdkeksclusterDefaultTestDeployAssertFBF4B356" + "assertionStack": "aws-cdk-eks-cluster-ipv6/DefaultTest/DeployAssert", + "assertionStackName": "awscdkeksclusteripv6DefaultTestDeployAssert2C014107" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/manifest.json index 2954a4d6ac7ad..63489c57ab6b7 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/manifest.json @@ -1,27 +1,27 @@ { "version": "32.0.0", "artifacts": { - "aws-cdk-eks-cluster-test.assets": { + "aws-cdk-eks-cluster-ipv6-test.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "aws-cdk-eks-cluster-test.assets.json", + "file": "aws-cdk-eks-cluster-ipv6-test.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "aws-cdk-eks-cluster-test": { + "aws-cdk-eks-cluster-ipv6-test": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/us-east-1", "properties": { - "templateFile": "aws-cdk-eks-cluster-test.template.json", + "templateFile": "aws-cdk-eks-cluster-ipv6-test.template.json", "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-us-east-1", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-us-east-1", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1/2e89414f1121ee451ba0a62318b9f3ddecd3f8b5b7dc3c2d74b75df1e328a3af.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1/2a592f65a66a57f9a6c4030f4118873bf568e155ea5035f6787e2818e6a57d43.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "aws-cdk-eks-cluster-test.assets" + "aws-cdk-eks-cluster-ipv6-test.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-us-east-1", @@ -30,1153 +30,1153 @@ } }, "dependencies": [ - "aws-cdk-eks-cluster-test.assets" + "aws-cdk-eks-cluster-ipv6-test.assets" ], "metadata": { - "/aws-cdk-eks-cluster-test/AdminRole/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/AdminRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "AdminRole38563C57" } ], - "/aws-cdk-eks-cluster-test/SecretsKey/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/SecretsKey/Resource": [ { "type": "aws:cdk:logicalId", "data": "SecretsKey317DCF94" } ], - "/aws-cdk-eks-cluster-test/Vpc/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/Resource": [ { "type": "aws:cdk:logicalId", "data": "Vpc8378EB38" } ], - "/aws-cdk-eks-cluster-test/Vpc/PublicSubnet1/Subnet": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1/Subnet": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet1Subnet5C2D37C4" } ], - "/aws-cdk-eks-cluster-test/Vpc/PublicSubnet1/RouteTable": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet1RouteTable6C95E38E" } ], - "/aws-cdk-eks-cluster-test/Vpc/PublicSubnet1/RouteTableAssociation": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet1RouteTableAssociation97140677" } ], - "/aws-cdk-eks-cluster-test/Vpc/PublicSubnet1/DefaultRoute": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet1DefaultRoute3DA9E72A" } ], - "/aws-cdk-eks-cluster-test/Vpc/PublicSubnet1/EIP": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1/EIP": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet1EIPD7E02669" } ], - "/aws-cdk-eks-cluster-test/Vpc/PublicSubnet1/NATGateway": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1/NATGateway": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet1NATGateway4D7517AA" } ], - "/aws-cdk-eks-cluster-test/Vpc/PublicSubnet2/Subnet": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet2/Subnet": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet2Subnet691E08A3" } ], - "/aws-cdk-eks-cluster-test/Vpc/PublicSubnet2/RouteTable": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet2/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet2RouteTable94F7E489" } ], - "/aws-cdk-eks-cluster-test/Vpc/PublicSubnet2/RouteTableAssociation": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet2/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet2RouteTableAssociationDD5762D8" } ], - "/aws-cdk-eks-cluster-test/Vpc/PublicSubnet2/DefaultRoute": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet2/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet2DefaultRoute97F91067" } ], - "/aws-cdk-eks-cluster-test/Vpc/PrivateSubnet1/Subnet": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet1/Subnet": [ { "type": "aws:cdk:logicalId", "data": "VpcPrivateSubnet1Subnet536B997A" } ], - "/aws-cdk-eks-cluster-test/Vpc/PrivateSubnet1/RouteTable": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet1/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "VpcPrivateSubnet1RouteTableB2C5B500" } ], - "/aws-cdk-eks-cluster-test/Vpc/PrivateSubnet1/RouteTableAssociation": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet1/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "VpcPrivateSubnet1RouteTableAssociation70C59FA6" } ], - "/aws-cdk-eks-cluster-test/Vpc/PrivateSubnet1/DefaultRoute": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet1/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "VpcPrivateSubnet1DefaultRouteBE02A9ED" } ], - "/aws-cdk-eks-cluster-test/Vpc/PrivateSubnet2/Subnet": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet2/Subnet": [ { "type": "aws:cdk:logicalId", "data": "VpcPrivateSubnet2Subnet3788AAA1" } ], - "/aws-cdk-eks-cluster-test/Vpc/PrivateSubnet2/RouteTable": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet2/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "VpcPrivateSubnet2RouteTableA678073B" } ], - "/aws-cdk-eks-cluster-test/Vpc/PrivateSubnet2/RouteTableAssociation": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet2/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "VpcPrivateSubnet2RouteTableAssociationA89CAD56" } ], - "/aws-cdk-eks-cluster-test/Vpc/PrivateSubnet2/DefaultRoute": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet2/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "VpcPrivateSubnet2DefaultRoute060D2087" } ], - "/aws-cdk-eks-cluster-test/Vpc/IGW": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/IGW": [ { "type": "aws:cdk:logicalId", "data": "VpcIGWD7BA715C" } ], - "/aws-cdk-eks-cluster-test/Vpc/VPCGW": [ + "/aws-cdk-eks-cluster-ipv6-test/Vpc/VPCGW": [ { "type": "aws:cdk:logicalId", "data": "VpcVPCGWBF912B6E" } ], - "/aws-cdk-eks-cluster-test/CIDR6": [ + "/aws-cdk-eks-cluster-ipv6-test/CIDR6": [ { "type": "aws:cdk:logicalId", "data": "CIDR6" } ], - "/aws-cdk-eks-cluster-test/KubectlLayer/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/KubectlLayer/Resource": [ { "type": "aws:cdk:logicalId", "data": "KubectlLayer600207B5" } ], - "/aws-cdk-eks-cluster-test/Cluster/KubectlHandlerRole/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/KubectlHandlerRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterKubectlHandlerRole94549F93" } ], - "/aws-cdk-eks-cluster-test/Cluster/KubectlHandlerRole/DefaultPolicy/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/KubectlHandlerRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterKubectlHandlerRoleDefaultPolicyE44083DD" } ], - "/aws-cdk-eks-cluster-test/Cluster/Role/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Role/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterRoleFA261979" } ], - "/aws-cdk-eks-cluster-test/Cluster/ControlPlaneSecurityGroup/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ControlPlaneSecurityGroup/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterControlPlaneSecurityGroupD274242C" } ], - "/aws-cdk-eks-cluster-test/Cluster/ControlPlaneSecurityGroup/from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:443": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ControlPlaneSecurityGroup/from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:443": [ { "type": "aws:cdk:logicalId", - "data": "ClusterControlPlaneSecurityGroupfromawscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54443795AF111" + "data": "ClusterControlPlaneSecurityGroupfromawscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE4433ECAB7C9" } ], - "/aws-cdk-eks-cluster-test/Cluster/ControlPlaneSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ControlPlaneSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443": [ { "type": "aws:cdk:logicalId", - "data": "ClusterControlPlaneSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A324439DAF9D77" + "data": "ClusterControlPlaneSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D4432AF77268" } ], - "/aws-cdk-eks-cluster-test/Cluster/ControlPlaneSecurityGroup/from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:443": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ControlPlaneSecurityGroup/from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:443": [ { "type": "aws:cdk:logicalId", - "data": "ClusterControlPlaneSecurityGroupfromawscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858443B84847DA" + "data": "ClusterControlPlaneSecurityGroupfromawscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB443A1B1AA7A" } ], - "/aws-cdk-eks-cluster-test/Cluster/ControlPlaneSecurityGroup/from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:443": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ControlPlaneSecurityGroup/from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:443": [ { "type": "aws:cdk:logicalId", - "data": "ClusterControlPlaneSecurityGroupfromawscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914443ECEF3F30" + "data": "ClusterControlPlaneSecurityGroupfromawscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB77642294439ECE17EF" } ], - "/aws-cdk-eks-cluster-test/Cluster/ControlPlaneSecurityGroup/from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:443": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ControlPlaneSecurityGroup/from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:443": [ { "type": "aws:cdk:logicalId", - "data": "ClusterControlPlaneSecurityGroupfromawscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D474431DE5485F" + "data": "ClusterControlPlaneSecurityGroupfromawscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA034431582AEBA" } ], - "/aws-cdk-eks-cluster-test/Cluster/Resource/CreationRole/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Resource/CreationRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterCreationRole360249B6" } ], - "/aws-cdk-eks-cluster-test/Cluster/Resource/CreationRole/DefaultPolicy/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Resource/CreationRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterCreationRoleDefaultPolicyE8BDFC7B" } ], - "/aws-cdk-eks-cluster-test/Cluster/Resource/Resource/Default": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Resource/Resource/Default": [ { "type": "aws:cdk:logicalId", "data": "Cluster9EE0221C" } ], - "/aws-cdk-eks-cluster-test/Cluster/KubectlReadyBarrier": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/KubectlReadyBarrier": [ { "type": "aws:cdk:logicalId", "data": "ClusterKubectlReadyBarrier200052AF" } ], - "/aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from {IndirectPeer}:ALL TRAFFIC": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from {IndirectPeer}:ALL TRAFFIC": [ { "type": "aws:cdk:logicalId", "data": "ClusterClusterSecurityGroupfromIndirectPeerALLTRAFFICB574992D" } ], - "/aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from 10.0.0.0_8:ALL TRAFFIC": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from 10.0.0.0_8:ALL TRAFFIC": [ { "type": "aws:cdk:logicalId", "data": "ClusterClusterSecurityGroupfrom100008ALLTRAFFIC1289F1DD" } ], - "/aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:443": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:443": [ { "type": "aws:cdk:logicalId", - "data": "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C544432C10EDB4" + "data": "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE443590558E1" } ], - "/aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:ALL TRAFFIC": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:ALL TRAFFIC": [ { "type": "aws:cdk:logicalId", - "data": "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54ALLTRAFFICA14EDC2C" + "data": "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DEALLTRAFFIC641CD112" } ], - "/aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443": [ { "type": "aws:cdk:logicalId", - "data": "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32443175FB542" + "data": "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D443F7BC2681" } ], - "/aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443": [ { "type": "aws:cdk:logicalId", - "data": "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterControlPlaneSecurityGroup2F1301344439997E64B" + "data": "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE44383B7C39C" } ], - "/aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535": [ { "type": "aws:cdk:logicalId", - "data": "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A321025655359034D5F2" + "data": "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D1025655359FF1A5D4" } ], - "/aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535": [ { "type": "aws:cdk:logicalId", - "data": "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterControlPlaneSecurityGroup2F130134102565535D0C036C4" + "data": "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE1025655351AB443C3" } ], - "/aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC": [ { "type": "aws:cdk:logicalId", - "data": "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32ALLTRAFFIC3F547F1B" + "data": "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6DALLTRAFFIC175DE2E1" } ], - "/aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:443": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:443": [ { "type": "aws:cdk:logicalId", - "data": "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858443A88C1345" + "data": "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB4439A9F1426" } ], - "/aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:ALL TRAFFIC": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:ALL TRAFFIC": [ { "type": "aws:cdk:logicalId", - "data": "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858ALLTRAFFIC18C2F6D7" + "data": "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBBALLTRAFFICDD19773F" } ], - "/aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:443": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:443": [ { "type": "aws:cdk:logicalId", - "data": "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914443A80EB501" + "data": "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229443914C5D7E" } ], - "/aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:ALL TRAFFIC": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:ALL TRAFFIC": [ { "type": "aws:cdk:logicalId", - "data": "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914ALLTRAFFIC40B17035" + "data": "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229ALLTRAFFIC3B055075" } ], - "/aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:443": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:443": [ { "type": "aws:cdk:logicalId", - "data": "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D474432A818F38" + "data": "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA034437EEB6700" } ], - "/aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:ALL TRAFFIC": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:ALL TRAFFIC": [ { "type": "aws:cdk:logicalId", - "data": "ClusterClusterSecurityGroupfromawscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47ALLTRAFFICDB5CD664" + "data": "ClusterClusterSecurityGroupfromawscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03ALLTRAFFIC39C98724" } ], - "/aws-cdk-eks-cluster-test/Cluster/HasEcrPublic": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/HasEcrPublic": [ { "type": "aws:cdk:logicalId", "data": "ClusterHasEcrPublic8EE1114E" } ], - "/aws-cdk-eks-cluster-test/Cluster/AwsAuth/manifest/Resource/Default": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/AwsAuth/manifest/Resource/Default": [ { "type": "aws:cdk:logicalId", "data": "ClusterAwsAuthmanifestFE51F8AE" } ], - "/aws-cdk-eks-cluster-test/Cluster/NodegroupDefaultCapacity/NodeGroupRole/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/NodegroupDefaultCapacity/NodeGroupRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodegroupDefaultCapacityNodeGroupRole55953B04" } ], - "/aws-cdk-eks-cluster-test/Cluster/NodegroupDefaultCapacity/NodeGroupRole/DefaultPolicy/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/NodegroupDefaultCapacity/NodeGroupRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodegroupDefaultCapacityNodeGroupRoleDefaultPolicyA9DAB860" } ], - "/aws-cdk-eks-cluster-test/Cluster/NodegroupDefaultCapacity/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/NodegroupDefaultCapacity/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodegroupDefaultCapacityDA0920A3" } ], - "/aws-cdk-eks-cluster-test/Cluster/ConfigCommand": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/ConfigCommand": [ { "type": "aws:cdk:logicalId", "data": "ClusterConfigCommand43AAE40F" } ], - "/aws-cdk-eks-cluster-test/Cluster/GetTokenCommand": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/GetTokenCommand": [ { "type": "aws:cdk:logicalId", "data": "ClusterGetTokenCommand06AE992E" } ], - "/aws-cdk-eks-cluster-test/Cluster/fargate-profile-default/PodExecutionRole/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/fargate-profile-default/PodExecutionRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterfargateprofiledefaultPodExecutionRole09952CFF" } ], - "/aws-cdk-eks-cluster-test/Cluster/fargate-profile-default/Resource/Default": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/fargate-profile-default/Resource/Default": [ { "type": "aws:cdk:logicalId", "data": "ClusterfargateprofiledefaultEFC59F14" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceSecurityGroup": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceSecurityGroup": [ { "type": "aws:cdk:warning", "data": "Ignoring Egress rule since 'allowAllOutbound' is set to true; To add customized rules, set allowAllOutbound=false on the SecurityGroup" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceSecurityGroup/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceSecurityGroup/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodesInstanceSecurityGroup899246BD" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:ALL TRAFFIC": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:ALL TRAFFIC": [ { "type": "aws:cdk:logicalId", - "data": "ClusterNodesInstanceSecurityGroupfromawscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54ALLTRAFFICBC5FBE2E" + "data": "ClusterNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DEALLTRAFFIC7A69EC66" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443": [ { "type": "aws:cdk:logicalId", - "data": "ClusterNodesInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32443DC7FAF39" + "data": "ClusterNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D4435B21533A" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443": [ { "type": "aws:cdk:logicalId", - "data": "ClusterNodesInstanceSecurityGroupfromawscdkeksclustertestClusterControlPlaneSecurityGroup2F130134443AE10EB12" + "data": "ClusterNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE4432931D2E6" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535": [ { "type": "aws:cdk:logicalId", - "data": "ClusterNodesInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32102565535D6A46ADB" + "data": "ClusterNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D102565535A7F35F64" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535": [ { "type": "aws:cdk:logicalId", - "data": "ClusterNodesInstanceSecurityGroupfromawscdkeksclustertestClusterControlPlaneSecurityGroup2F1301341025655359F401D0D" + "data": "ClusterNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE102565535CF4750C4" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC": [ { "type": "aws:cdk:logicalId", - "data": "ClusterNodesInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32ALLTRAFFIC14EF5815" + "data": "ClusterNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6DALLTRAFFIC67D1F519" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceRole/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodesInstanceRoleC3C01328" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceProfile": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceProfile": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodesInstanceProfileF2DD0E21" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodes/LaunchTemplate/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/LaunchTemplate/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodesLaunchTemplateD1028D0D" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodes/ASG": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/ASG": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodesASGF172BD19" } ], - "/aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceSecurityGroup": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceSecurityGroup": [ { "type": "aws:cdk:warning", "data": "Ignoring Egress rule since 'allowAllOutbound' is set to true; To add customized rules, set allowAllOutbound=false on the SecurityGroup" } ], - "/aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceSecurityGroup/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceSecurityGroup/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodesArmInstanceSecurityGroup599F388B" } ], - "/aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:ALL TRAFFIC": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:ALL TRAFFIC": [ { "type": "aws:cdk:logicalId", - "data": "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858ALLTRAFFIC83BB7106" + "data": "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBBALLTRAFFIC7E1EC03D" } ], - "/aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443": [ { "type": "aws:cdk:logicalId", - "data": "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32443AC8AE5BF" + "data": "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D4436712E874" } ], - "/aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443": [ { "type": "aws:cdk:logicalId", - "data": "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclustertestClusterControlPlaneSecurityGroup2F13013444328ED4211" + "data": "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE44335ECB898" } ], - "/aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535": [ { "type": "aws:cdk:logicalId", - "data": "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32102565535F5718241" + "data": "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D102565535C8B8BE39" } ], - "/aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535": [ { "type": "aws:cdk:logicalId", - "data": "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclustertestClusterControlPlaneSecurityGroup2F13013410256553586052D07" + "data": "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE102565535A80FF723" } ], - "/aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC": [ { "type": "aws:cdk:logicalId", - "data": "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32ALLTRAFFIC655074AB" + "data": "ClusterNodesArmInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6DALLTRAFFICA21F70E4" } ], - "/aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceRole/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodesArmInstanceRoleB93D3298" } ], - "/aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceProfile": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceProfile": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodesArmInstanceProfile158C5C9F" } ], - "/aws-cdk-eks-cluster-test/Cluster/NodesArm/LaunchTemplate/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/LaunchTemplate/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodesArmLaunchTemplateB6CFBA44" } ], - "/aws-cdk-eks-cluster-test/Cluster/NodesArm/ASG": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/ASG": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodesArmASG40A593D0" } ], - "/aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceSecurityGroup": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceSecurityGroup": [ { "type": "aws:cdk:warning", "data": "Ignoring Egress rule since 'allowAllOutbound' is set to true; To add customized rules, set allowAllOutbound=false on the SecurityGroup" } ], - "/aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterBottlerocketNodesInstanceSecurityGroup3794A94B" } ], - "/aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:ALL TRAFFIC": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:ALL TRAFFIC": [ { "type": "aws:cdk:logicalId", - "data": "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914ALLTRAFFIC7B6353A7" + "data": "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229ALLTRAFFIC681C13E7" } ], - "/aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443": [ { "type": "aws:cdk:logicalId", - "data": "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32443D1686B16" + "data": "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D44354C22497" } ], - "/aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443": [ { "type": "aws:cdk:logicalId", - "data": "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclustertestClusterControlPlaneSecurityGroup2F130134443A6D43789" + "data": "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE443707A5FDB" } ], - "/aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535": [ { "type": "aws:cdk:logicalId", - "data": "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32102565535674E85A7" + "data": "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D102565535BB921D93" } ], - "/aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535": [ { "type": "aws:cdk:logicalId", - "data": "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclustertestClusterControlPlaneSecurityGroup2F1301341025655352CE8AD9A" + "data": "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE102565535587DF246" } ], - "/aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC": [ { "type": "aws:cdk:logicalId", - "data": "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32ALLTRAFFICFAF900F2" + "data": "ClusterBottlerocketNodesInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6DALLTRAFFIC2A7F9925" } ], - "/aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceRole/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterBottlerocketNodesInstanceRole68E4BCFB" } ], - "/aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceProfile": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceProfile": [ { "type": "aws:cdk:logicalId", "data": "ClusterBottlerocketNodesInstanceProfileB6E2F25A" } ], - "/aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/LaunchTemplate/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/LaunchTemplate/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterBottlerocketNodesLaunchTemplate54246C29" } ], - "/aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/ASG": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/ASG": [ { "type": "aws:cdk:logicalId", "data": "ClusterBottlerocketNodesASGA27A9B70" } ], - "/aws-cdk-eks-cluster-test/Cluster/spot/InstanceSecurityGroup": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceSecurityGroup": [ { "type": "aws:cdk:warning", "data": "Ignoring Egress rule since 'allowAllOutbound' is set to true; To add customized rules, set allowAllOutbound=false on the SecurityGroup" } ], - "/aws-cdk-eks-cluster-test/Cluster/spot/InstanceSecurityGroup/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceSecurityGroup/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterspotInstanceSecurityGroup01F7B1CE" } ], - "/aws-cdk-eks-cluster-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:ALL TRAFFIC": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:ALL TRAFFIC": [ { "type": "aws:cdk:logicalId", - "data": "ClusterspotInstanceSecurityGroupfromawscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47ALLTRAFFIC2B1A12D9" + "data": "ClusterspotInstanceSecurityGroupfromawscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03ALLTRAFFIC1FD26D74" } ], - "/aws-cdk-eks-cluster-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443": [ { "type": "aws:cdk:logicalId", - "data": "ClusterspotInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A324438F751704" + "data": "ClusterspotInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D4430026205F" } ], - "/aws-cdk-eks-cluster-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443": [ { "type": "aws:cdk:logicalId", - "data": "ClusterspotInstanceSecurityGroupfromawscdkeksclustertestClusterControlPlaneSecurityGroup2F1301344430650F325" + "data": "ClusterspotInstanceSecurityGroupfromawscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE44373B6F417" } ], - "/aws-cdk-eks-cluster-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535": [ { "type": "aws:cdk:logicalId", - "data": "ClusterspotInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A321025655350D837827" + "data": "ClusterspotInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D102565535E77539BD" } ], - "/aws-cdk-eks-cluster-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535": [ { "type": "aws:cdk:logicalId", - "data": "ClusterspotInstanceSecurityGroupfromawscdkeksclustertestClusterControlPlaneSecurityGroup2F130134102565535C7203235" + "data": "ClusterspotInstanceSecurityGroupfromawscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE1025655357246D15F" } ], - "/aws-cdk-eks-cluster-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC": [ { "type": "aws:cdk:logicalId", - "data": "ClusterspotInstanceSecurityGroupfromawscdkeksclustertestClusterClusterSecurityGroupF7265A32ALLTRAFFIC59C23477" + "data": "ClusterspotInstanceSecurityGroupfromawscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6DALLTRAFFIC5330BC8B" } ], - "/aws-cdk-eks-cluster-test/Cluster/spot/InstanceRole/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterspotInstanceRole39043830" } ], - "/aws-cdk-eks-cluster-test/Cluster/spot/InstanceProfile": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceProfile": [ { "type": "aws:cdk:logicalId", "data": "ClusterspotInstanceProfileAB88D077" } ], - "/aws-cdk-eks-cluster-test/Cluster/spot/LaunchTemplate/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/spot/LaunchTemplate/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterspotLaunchTemplate5652F38D" } ], - "/aws-cdk-eks-cluster-test/Cluster/spot/ASG": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/spot/ASG": [ { "type": "aws:cdk:logicalId", "data": "ClusterspotASG857494B6" } ], - "/aws-cdk-eks-cluster-test/Cluster/chart-spot-interrupt-handler/Resource/Default": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/chart-spot-interrupt-handler/Resource/Default": [ { "type": "aws:cdk:logicalId", "data": "Clusterchartspotinterrupthandler79E2D768" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng/NodeGroupRole/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng/NodeGroupRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodegroupextrangNodeGroupRole23AE23D0" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng/NodeGroupRole/DefaultPolicy/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng/NodeGroupRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodegroupextrangNodeGroupRoleDefaultPolicyC787D047" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodegroupextrangF9406A09" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-spot/NodeGroupRole/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-spot/NodeGroupRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodegroupextrangspotNodeGroupRoleB53B4857" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-spot/NodeGroupRole/DefaultPolicy/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-spot/NodeGroupRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodegroupextrangspotNodeGroupRoleDefaultPolicyF0EB5936" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-spot/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-spot/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodegroupextrangspotB327AE6B" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-arm/NodeGroupRole/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-arm/NodeGroupRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodegroupextrangarmNodeGroupRoleADF5749F" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-arm/NodeGroupRole/DefaultPolicy/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-arm/NodeGroupRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodegroupextrangarmNodeGroupRoleDefaultPolicyB52D103B" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-arm/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-arm/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodegroupextrangarm7773987A" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-arm3/NodeGroupRole/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-arm3/NodeGroupRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodegroupextrangarm3NodeGroupRole3A6AB3EC" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-arm3/NodeGroupRole/DefaultPolicy/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-arm3/NodeGroupRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodegroupextrangarm3NodeGroupRoleDefaultPolicyC04F2FFE" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-arm3/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-arm3/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodegroupextrangarm327128311" } ], - "/aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng2/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng2/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterNodegroupextrang2F1FB0D40" } ], - "/aws-cdk-eks-cluster-test/Cluster/manifest-HelloApp/Resource/Default": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/manifest-HelloApp/Resource/Default": [ { "type": "aws:cdk:logicalId", "data": "ClustermanifestHelloApp078A45D8" } ], - "/aws-cdk-eks-cluster-test/Cluster/chart-dashboard/Resource/Default": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/chart-dashboard/Resource/Default": [ { "type": "aws:cdk:logicalId", "data": "Clusterchartdashboard4AA45F3F" } ], - "/aws-cdk-eks-cluster-test/Cluster/chart-test-chart/Resource/Default": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/chart-test-chart/Resource/Default": [ { "type": "aws:cdk:logicalId", "data": "Clustercharttestchart9FD698EB" } ], - "/aws-cdk-eks-cluster-test/Cluster/cdk8s-chart/Resource/Default": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/cdk8s-chart/Resource/Default": [ { "type": "aws:cdk:logicalId", "data": "Clustercdk8schartDADD257F" } ], - "/aws-cdk-eks-cluster-test/Cluster/manifest-nginx-namespace/Resource/Default": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/manifest-nginx-namespace/Resource/Default": [ { "type": "aws:cdk:logicalId", "data": "ClustermanifestnginxnamespaceA68B4CE0" } ], - "/aws-cdk-eks-cluster-test/Cluster/chart-nginx-ingress/Resource/Default": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/chart-nginx-ingress/Resource/Default": [ { "type": "aws:cdk:logicalId", "data": "Clusterchartnginxingress1193EC3F" } ], - "/aws-cdk-eks-cluster-test/Cluster/MyServiceAccount/ConditionJson/Resource/Default": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/MyServiceAccount/ConditionJson/Resource/Default": [ { "type": "aws:cdk:logicalId", "data": "ClusterMyServiceAccountConditionJson671C0633" } ], - "/aws-cdk-eks-cluster-test/Cluster/MyServiceAccount/Role/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/MyServiceAccount/Role/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterMyServiceAccountRole85337B29" } ], - "/aws-cdk-eks-cluster-test/Cluster/MyServiceAccount/manifest-MyServiceAccountServiceAccountResource/Resource/Default": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/MyServiceAccount/manifest-MyServiceAccountServiceAccountResource/Resource/Default": [ { "type": "aws:cdk:logicalId", "data": "ClusterMyServiceAccountmanifestMyServiceAccountServiceAccountResource67018F11" } ], - "/aws-cdk-eks-cluster-test/Cluster/OpenIdConnectProvider/Resource/Default": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/OpenIdConnectProvider/Resource/Default": [ { "type": "aws:cdk:logicalId", "data": "ClusterOpenIdConnectProviderE7EB0530" } ], - "/aws-cdk-eks-cluster-test/Cluster/MyExtendedServiceAccount/ConditionJson/Resource/Default": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/MyExtendedServiceAccount/ConditionJson/Resource/Default": [ { "type": "aws:cdk:logicalId", "data": "ClusterMyExtendedServiceAccountConditionJsonF780F28A" } ], - "/aws-cdk-eks-cluster-test/Cluster/MyExtendedServiceAccount/Role/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/MyExtendedServiceAccount/Role/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterMyExtendedServiceAccountRole064047AA" } ], - "/aws-cdk-eks-cluster-test/Cluster/MyExtendedServiceAccount/manifest-MyExtendedServiceAccountServiceAccountResource/Resource/Default": [ + "/aws-cdk-eks-cluster-ipv6-test/Cluster/MyExtendedServiceAccount/manifest-MyExtendedServiceAccountServiceAccountResource/Resource/Default": [ { "type": "aws:cdk:logicalId", "data": "ClusterMyExtendedServiceAccountmanifestMyExtendedServiceAccountServiceAccountResource90162712" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/NodeProxyAgentLayer/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/NodeProxyAgentLayer/Resource": [ { "type": "aws:cdk:logicalId", "data": "NodeProxyAgentLayer924C1971" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/OnEventHandler/ServiceRole/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/OnEventHandler/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "OnEventHandlerServiceRole15A26729" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/OnEventHandler/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/OnEventHandler/Resource": [ { "type": "aws:cdk:logicalId", "data": "OnEventHandler42BEBAE0" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/IsCompleteHandler/ServiceRole/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/IsCompleteHandler/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "IsCompleteHandlerServiceRole5810CC58" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/IsCompleteHandler/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/IsCompleteHandler/Resource": [ { "type": "aws:cdk:logicalId", "data": "IsCompleteHandler7073F4DA" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/ServiceRole/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEventServiceRole9FF04296" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEventServiceRoleDefaultPolicy48CD2133" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEvent83C1D0A7" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/ServiceRole/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkisCompleteServiceRoleB1087139" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkisCompleteServiceRoleDefaultPolicy2E7140AC" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkisComplete26D7B0CB" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/ServiceRole/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonTimeoutServiceRole28643D26" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonTimeoutServiceRoleDefaultPolicy2688969F" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonTimeout0B47CA38" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/waiter-state-machine/Role/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/waiter-state-machine/Role/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderwaiterstatemachineRole0C7159F9" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderwaiterstatemachineRoleDefaultPolicyD3C3DA1A" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/waiter-state-machine/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/waiter-state-machine/Resource": [ { "type": "aws:cdk:logicalId", "data": "Providerwaiterstatemachine5D4A9DF0" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/awscdkeksclustertestawscdkawseksClusterResourceProviderOnEventHandlerServiceRole5B783C71Arn": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/awscdkeksclusteripv6testawscdkawseksClusterResourceProviderOnEventHandlerServiceRole6C18AE9AArn": [ { "type": "aws:cdk:logicalId", - "data": "awscdkeksclustertestawscdkawseksClusterResourceProviderOnEventHandlerServiceRole5B783C71Arn" + "data": "awscdkeksclusteripv6testawscdkawseksClusterResourceProviderOnEventHandlerServiceRole6C18AE9AArn" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/awscdkeksclustertestawscdkawseksClusterResourceProviderIsCompleteHandlerServiceRole970DAC30Arn": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/awscdkeksclusteripv6testawscdkawseksClusterResourceProviderIsCompleteHandlerServiceRole1F912062Arn": [ { "type": "aws:cdk:logicalId", - "data": "awscdkeksclustertestawscdkawseksClusterResourceProviderIsCompleteHandlerServiceRole970DAC30Arn" + "data": "awscdkeksclusteripv6testawscdkawseksClusterResourceProviderIsCompleteHandlerServiceRole1F912062Arn" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/awscdkeksclustertestawscdkawseksClusterResourceProviderframeworkonEvent503C1667Arn": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/awscdkeksclusteripv6testawscdkawseksClusterResourceProviderframeworkonEvent27EA7496Arn": [ { "type": "aws:cdk:logicalId", - "data": "awscdkeksclustertestawscdkawseksClusterResourceProviderframeworkonEvent503C1667Arn" + "data": "awscdkeksclusteripv6testawscdkawseksClusterResourceProviderframeworkonEvent27EA7496Arn" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider.NestedStack/@aws-cdk--aws-eks.ClusterResourceProvider.NestedStackResource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider.NestedStack/@aws-cdk--aws-eks.ClusterResourceProvider.NestedStackResource": [ { "type": "aws:cdk:logicalId", "data": "awscdkawseksClusterResourceProviderNestedStackawscdkawseksClusterResourceProviderNestedStackResource9827C454" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Handler/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Handler/Resource": [ { "type": "aws:cdk:logicalId", "data": "Handler886CB40B" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/AwsCliLayer/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/AwsCliLayer/Resource": [ { "type": "aws:cdk:logicalId", "data": "AwsCliLayerF44AAF94" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/ServiceRole/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEventServiceRole9FF04296" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEventServiceRoleDefaultPolicy48CD2133" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/Resource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEvent83C1D0A7" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/awscdkeksclustertestawscdkawseksKubectlProviderframeworkonEventC681B49AArn": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/awscdkeksclusteripv6testawscdkawseksKubectlProviderframeworkonEvent383976A6Arn": [ { "type": "aws:cdk:logicalId", - "data": "awscdkeksclustertestawscdkawseksKubectlProviderframeworkonEventC681B49AArn" + "data": "awscdkeksclusteripv6testawscdkawseksKubectlProviderframeworkonEvent383976A6Arn" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/reference-to-awscdkeksclustertestKubectlLayerD8FA674ERef": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/reference-to-awscdkeksclusteripv6testKubectlLayer6BCCECB5Ref": [ { "type": "aws:cdk:logicalId", - "data": "referencetoawscdkeksclustertestKubectlLayerD8FA674ERef" + "data": "referencetoawscdkeksclusteripv6testKubectlLayer6BCCECB5Ref" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/reference-to-awscdkeksclustertestClusterKubectlHandlerRoleA258E53AArn": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/reference-to-awscdkeksclusteripv6testClusterKubectlHandlerRoleCDF70F2CArn": [ { "type": "aws:cdk:logicalId", - "data": "referencetoawscdkeksclustertestClusterKubectlHandlerRoleA258E53AArn" + "data": "referencetoawscdkeksclusteripv6testClusterKubectlHandlerRoleCDF70F2CArn" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/reference-to-awscdkeksclustertestVpcPrivateSubnet1Subnet32A4EC2ARef": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/reference-to-awscdkeksclusteripv6testVpcPrivateSubnet1Subnet8169B811Ref": [ { "type": "aws:cdk:logicalId", - "data": "referencetoawscdkeksclustertestVpcPrivateSubnet1Subnet32A4EC2ARef" + "data": "referencetoawscdkeksclusteripv6testVpcPrivateSubnet1Subnet8169B811Ref" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/reference-to-awscdkeksclustertestVpcPrivateSubnet2Subnet5CC53627Ref": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/reference-to-awscdkeksclusteripv6testVpcPrivateSubnet2Subnet21732C40Ref": [ { "type": "aws:cdk:logicalId", - "data": "referencetoawscdkeksclustertestVpcPrivateSubnet2Subnet5CC53627Ref" + "data": "referencetoawscdkeksclusteripv6testVpcPrivateSubnet2Subnet21732C40Ref" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/reference-to-awscdkeksclustertestClusterD76DFF87ClusterSecurityGroupId": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/reference-to-awscdkeksclusteripv6testCluster1C21F8EDClusterSecurityGroupId": [ { "type": "aws:cdk:logicalId", - "data": "referencetoawscdkeksclustertestClusterD76DFF87ClusterSecurityGroupId" + "data": "referencetoawscdkeksclusteripv6testCluster1C21F8EDClusterSecurityGroupId" } ], - "/aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider.NestedStack/@aws-cdk--aws-eks.KubectlProvider.NestedStackResource": [ + "/aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider.NestedStack/@aws-cdk--aws-eks.KubectlProvider.NestedStackResource": [ { "type": "aws:cdk:logicalId", "data": "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B" } ], - "/aws-cdk-eks-cluster-test/SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ + "/aws-cdk-eks-cluster-ipv6-test/SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ { "type": "aws:cdk:logicalId", "data": "SsmParameterValueawsserviceeksoptimizedami124amazonlinux2recommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter" } ], - "/aws-cdk-eks-cluster-test/SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2-arm64--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ + "/aws-cdk-eks-cluster-ipv6-test/SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2-arm64--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ { "type": "aws:cdk:logicalId", "data": "SsmParameterValueawsserviceeksoptimizedami124amazonlinux2arm64recommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter" } ], - "/aws-cdk-eks-cluster-test/SsmParameterValue:--aws--service--bottlerocket--aws-k8s-1.24--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ + "/aws-cdk-eks-cluster-ipv6-test/SsmParameterValue:--aws--service--bottlerocket--aws-k8s-1.24--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ { "type": "aws:cdk:logicalId", "data": "SsmParameterValueawsservicebottlerocketawsk8s124x8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter" } ], - "/aws-cdk-eks-cluster-test/SsmParameterValue:--aws--service--eks--optimized-ami--1.25--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ + "/aws-cdk-eks-cluster-ipv6-test/SsmParameterValue:--aws--service--eks--optimized-ami--1.25--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ { "type": "aws:cdk:logicalId", "data": "SsmParameterValueawsserviceeksoptimizedami125amazonlinux2recommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter" } ], - "/aws-cdk-eks-cluster-test/LaunchTemplate": [ + "/aws-cdk-eks-cluster-ipv6-test/LaunchTemplate": [ { "type": "aws:cdk:logicalId", "data": "LaunchTemplate" } ], - "/aws-cdk-eks-cluster-test/HelloAppWithoutValidation/Resource/Default": [ + "/aws-cdk-eks-cluster-ipv6-test/HelloAppWithoutValidation/Resource/Default": [ { "type": "aws:cdk:logicalId", "data": "HelloAppWithoutValidation7C638ACB" } ], - "/aws-cdk-eks-cluster-test/Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider/Role": [ + "/aws-cdk-eks-cluster-ipv6-test/Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", "data": "CustomAWSCDKOpenIdConnectProviderCustomResourceProviderRole517FED65" } ], - "/aws-cdk-eks-cluster-test/Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider/Handler": [ + "/aws-cdk-eks-cluster-ipv6-test/Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider/Handler": [ { "type": "aws:cdk:logicalId", "data": "CustomAWSCDKOpenIdConnectProviderCustomResourceProviderHandlerF2C543E0" } ], - "/aws-cdk-eks-cluster-test/AWSCDKCfnUtilsProviderCustomResourceProvider/Role": [ + "/aws-cdk-eks-cluster-ipv6-test/AWSCDKCfnUtilsProviderCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", "data": "AWSCDKCfnUtilsProviderCustomResourceProviderRoleFE0EE867" } ], - "/aws-cdk-eks-cluster-test/AWSCDKCfnUtilsProviderCustomResourceProvider/Handler": [ + "/aws-cdk-eks-cluster-ipv6-test/AWSCDKCfnUtilsProviderCustomResourceProvider/Handler": [ { "type": "aws:cdk:logicalId", "data": "AWSCDKCfnUtilsProviderCustomResourceProviderHandlerCF82AA57" } ], - "/aws-cdk-eks-cluster-test/ClusterEndpoint": [ + "/aws-cdk-eks-cluster-ipv6-test/ClusterEndpoint": [ { "type": "aws:cdk:logicalId", "data": "ClusterEndpoint" } ], - "/aws-cdk-eks-cluster-test/ClusterArn": [ + "/aws-cdk-eks-cluster-ipv6-test/ClusterArn": [ { "type": "aws:cdk:logicalId", "data": "ClusterArn" } ], - "/aws-cdk-eks-cluster-test/ClusterCertificateAuthorityData": [ + "/aws-cdk-eks-cluster-ipv6-test/ClusterCertificateAuthorityData": [ { "type": "aws:cdk:logicalId", "data": "ClusterCertificateAuthorityData" } ], - "/aws-cdk-eks-cluster-test/ClusterSecurityGroupId": [ + "/aws-cdk-eks-cluster-ipv6-test/ClusterSecurityGroupId": [ { "type": "aws:cdk:logicalId", "data": "ClusterSecurityGroupId" } ], - "/aws-cdk-eks-cluster-test/ClusterEncryptionConfigKeyArn": [ + "/aws-cdk-eks-cluster-ipv6-test/ClusterEncryptionConfigKeyArn": [ { "type": "aws:cdk:logicalId", "data": "ClusterEncryptionConfigKeyArn" } ], - "/aws-cdk-eks-cluster-test/ClusterName": [ + "/aws-cdk-eks-cluster-ipv6-test/ClusterName": [ { "type": "aws:cdk:logicalId", "data": "ClusterName" } ], - "/aws-cdk-eks-cluster-test/BootstrapVersion": [ + "/aws-cdk-eks-cluster-ipv6-test/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/aws-cdk-eks-cluster-test/CheckBootstrapVersion": [ + "/aws-cdk-eks-cluster-ipv6-test/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "aws-cdk-eks-cluster-test" + "displayName": "aws-cdk-eks-cluster-ipv6-test" }, - "awscdkeksclusterDefaultTestDeployAssertFBF4B356.assets": { + "awscdkeksclusteripv6DefaultTestDeployAssert2C014107.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "awscdkeksclusterDefaultTestDeployAssertFBF4B356.assets.json", + "file": "awscdkeksclusteripv6DefaultTestDeployAssert2C014107.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "awscdkeksclusterDefaultTestDeployAssertFBF4B356": { + "awscdkeksclusteripv6DefaultTestDeployAssert2C014107": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "awscdkeksclusterDefaultTestDeployAssertFBF4B356.template.json", + "templateFile": "awscdkeksclusteripv6DefaultTestDeployAssert2C014107.template.json", "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}", @@ -1184,7 +1184,7 @@ "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "awscdkeksclusterDefaultTestDeployAssertFBF4B356.assets" + "awscdkeksclusteripv6DefaultTestDeployAssert2C014107.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -1193,23 +1193,23 @@ } }, "dependencies": [ - "awscdkeksclusterDefaultTestDeployAssertFBF4B356.assets" + "awscdkeksclusteripv6DefaultTestDeployAssert2C014107.assets" ], "metadata": { - "/aws-cdk-eks-cluster/DefaultTest/DeployAssert/BootstrapVersion": [ + "/aws-cdk-eks-cluster-ipv6/DefaultTest/DeployAssert/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/aws-cdk-eks-cluster/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + "/aws-cdk-eks-cluster-ipv6/DefaultTest/DeployAssert/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "aws-cdk-eks-cluster/DefaultTest/DeployAssert" + "displayName": "aws-cdk-eks-cluster-ipv6/DefaultTest/DeployAssert" }, "Tree": { "type": "cdk:tree", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/tree.json index 3c4103bcf86e8..0c0de780bb4f3 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.js.snapshot/tree.json @@ -4,17 +4,17 @@ "id": "App", "path": "", "children": { - "aws-cdk-eks-cluster-test": { - "id": "aws-cdk-eks-cluster-test", - "path": "aws-cdk-eks-cluster-test", + "aws-cdk-eks-cluster-ipv6-test": { + "id": "aws-cdk-eks-cluster-ipv6-test", + "path": "aws-cdk-eks-cluster-ipv6-test", "children": { "AdminRole": { "id": "AdminRole", - "path": "aws-cdk-eks-cluster-test/AdminRole", + "path": "aws-cdk-eks-cluster-ipv6-test/AdminRole", "children": { "ImportAdminRole": { "id": "ImportAdminRole", - "path": "aws-cdk-eks-cluster-test/AdminRole/ImportAdminRole", + "path": "aws-cdk-eks-cluster-ipv6-test/AdminRole/ImportAdminRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -22,7 +22,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/AdminRole/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/AdminRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -64,11 +64,11 @@ }, "SecretsKey": { "id": "SecretsKey", - "path": "aws-cdk-eks-cluster-test/SecretsKey", + "path": "aws-cdk-eks-cluster-ipv6-test/SecretsKey", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/SecretsKey/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/SecretsKey/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::KMS::Key", "aws:cdk:cloudformation:props": { @@ -111,11 +111,11 @@ }, "Vpc": { "id": "Vpc", - "path": "aws-cdk-eks-cluster-test/Vpc", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Vpc/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::VPC", "aws:cdk:cloudformation:props": { @@ -126,7 +126,7 @@ "tags": [ { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Vpc" + "value": "aws-cdk-eks-cluster-ipv6-test/Vpc" } ] } @@ -138,11 +138,11 @@ }, "PublicSubnet1": { "id": "PublicSubnet1", - "path": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet1", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1", "children": { "Subnet": { "id": "Subnet", - "path": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet1/Subnet", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { @@ -194,7 +194,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet1" + "value": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1" } ], "vpcId": { @@ -209,7 +209,7 @@ }, "Acl": { "id": "Acl", - "path": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet1/Acl", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1/Acl", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -217,7 +217,7 @@ }, "RouteTable": { "id": "RouteTable", - "path": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet1/RouteTable", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { @@ -228,7 +228,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet1" + "value": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1" } ], "vpcId": { @@ -243,7 +243,7 @@ }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet1/RouteTableAssociation", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -262,7 +262,7 @@ }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet1/DefaultRoute", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { @@ -282,7 +282,7 @@ }, "EIP": { "id": "EIP", - "path": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet1/EIP", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1/EIP", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::EIP", "aws:cdk:cloudformation:props": { @@ -294,7 +294,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet1" + "value": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1" } ] } @@ -306,7 +306,7 @@ }, "NATGateway": { "id": "NATGateway", - "path": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet1/NATGateway", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1/NATGateway", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", "aws:cdk:cloudformation:props": { @@ -326,7 +326,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet1" + "value": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet1" } ] } @@ -344,11 +344,11 @@ }, "PublicSubnet2": { "id": "PublicSubnet2", - "path": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet2", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet2", "children": { "Subnet": { "id": "Subnet", - "path": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet2/Subnet", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet2/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { @@ -400,7 +400,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet2" + "value": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet2" } ], "vpcId": { @@ -415,7 +415,7 @@ }, "Acl": { "id": "Acl", - "path": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet2/Acl", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet2/Acl", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -423,7 +423,7 @@ }, "RouteTable": { "id": "RouteTable", - "path": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet2/RouteTable", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet2/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { @@ -434,7 +434,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet2" + "value": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet2" } ], "vpcId": { @@ -449,7 +449,7 @@ }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet2/RouteTableAssociation", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet2/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -468,7 +468,7 @@ }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-cdk-eks-cluster-test/Vpc/PublicSubnet2/DefaultRoute", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PublicSubnet2/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { @@ -494,11 +494,11 @@ }, "PrivateSubnet1": { "id": "PrivateSubnet1", - "path": "aws-cdk-eks-cluster-test/Vpc/PrivateSubnet1", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet1", "children": { "Subnet": { "id": "Subnet", - "path": "aws-cdk-eks-cluster-test/Vpc/PrivateSubnet1/Subnet", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet1/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { @@ -550,7 +550,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Vpc/PrivateSubnet1" + "value": "aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet1" } ], "vpcId": { @@ -565,7 +565,7 @@ }, "Acl": { "id": "Acl", - "path": "aws-cdk-eks-cluster-test/Vpc/PrivateSubnet1/Acl", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet1/Acl", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -573,7 +573,7 @@ }, "RouteTable": { "id": "RouteTable", - "path": "aws-cdk-eks-cluster-test/Vpc/PrivateSubnet1/RouteTable", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet1/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { @@ -584,7 +584,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Vpc/PrivateSubnet1" + "value": "aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet1" } ], "vpcId": { @@ -599,7 +599,7 @@ }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-cdk-eks-cluster-test/Vpc/PrivateSubnet1/RouteTableAssociation", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet1/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -618,7 +618,7 @@ }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-cdk-eks-cluster-test/Vpc/PrivateSubnet1/DefaultRoute", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet1/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { @@ -644,11 +644,11 @@ }, "PrivateSubnet2": { "id": "PrivateSubnet2", - "path": "aws-cdk-eks-cluster-test/Vpc/PrivateSubnet2", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet2", "children": { "Subnet": { "id": "Subnet", - "path": "aws-cdk-eks-cluster-test/Vpc/PrivateSubnet2/Subnet", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet2/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { @@ -700,7 +700,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Vpc/PrivateSubnet2" + "value": "aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet2" } ], "vpcId": { @@ -715,7 +715,7 @@ }, "Acl": { "id": "Acl", - "path": "aws-cdk-eks-cluster-test/Vpc/PrivateSubnet2/Acl", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet2/Acl", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -723,7 +723,7 @@ }, "RouteTable": { "id": "RouteTable", - "path": "aws-cdk-eks-cluster-test/Vpc/PrivateSubnet2/RouteTable", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet2/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { @@ -734,7 +734,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Vpc/PrivateSubnet2" + "value": "aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet2" } ], "vpcId": { @@ -749,7 +749,7 @@ }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-cdk-eks-cluster-test/Vpc/PrivateSubnet2/RouteTableAssociation", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet2/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -768,7 +768,7 @@ }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-cdk-eks-cluster-test/Vpc/PrivateSubnet2/DefaultRoute", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/PrivateSubnet2/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { @@ -794,14 +794,14 @@ }, "IGW": { "id": "IGW", - "path": "aws-cdk-eks-cluster-test/Vpc/IGW", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/IGW", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", "aws:cdk:cloudformation:props": { "tags": [ { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Vpc" + "value": "aws-cdk-eks-cluster-ipv6-test/Vpc" } ] } @@ -813,7 +813,7 @@ }, "VPCGW": { "id": "VPCGW", - "path": "aws-cdk-eks-cluster-test/Vpc/VPCGW", + "path": "aws-cdk-eks-cluster-ipv6-test/Vpc/VPCGW", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", "aws:cdk:cloudformation:props": { @@ -838,7 +838,7 @@ }, "CIDR6": { "id": "CIDR6", - "path": "aws-cdk-eks-cluster-test/CIDR6", + "path": "aws-cdk-eks-cluster-ipv6-test/CIDR6", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::VPCCidrBlock", "aws:cdk:cloudformation:props": { @@ -855,15 +855,15 @@ }, "KubectlLayer": { "id": "KubectlLayer", - "path": "aws-cdk-eks-cluster-test/KubectlLayer", + "path": "aws-cdk-eks-cluster-ipv6-test/KubectlLayer", "children": { "Code": { "id": "Code", - "path": "aws-cdk-eks-cluster-test/KubectlLayer/Code", + "path": "aws-cdk-eks-cluster-ipv6-test/KubectlLayer/Code", "children": { "Stage": { "id": "Stage", - "path": "aws-cdk-eks-cluster-test/KubectlLayer/Code/Stage", + "path": "aws-cdk-eks-cluster-ipv6-test/KubectlLayer/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -871,7 +871,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-cdk-eks-cluster-test/KubectlLayer/Code/AssetBucket", + "path": "aws-cdk-eks-cluster-ipv6-test/KubectlLayer/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -885,7 +885,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/KubectlLayer/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/KubectlLayer/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::LayerVersion", "aws:cdk:cloudformation:props": { @@ -907,20 +907,20 @@ }, "constructInfo": { "fqn": "@aws-cdk/lambda-layer-kubectl-v24.KubectlV24Layer", - "version": "2.0.229" + "version": "2.0.242" } }, "Cluster": { "id": "Cluster", - "path": "aws-cdk-eks-cluster-test/Cluster", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster", "children": { "KubectlHandlerRole": { "id": "KubectlHandlerRole", - "path": "aws-cdk-eks-cluster-test/Cluster/KubectlHandlerRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/KubectlHandlerRole", "children": { "ImportKubectlHandlerRole": { "id": "ImportKubectlHandlerRole", - "path": "aws-cdk-eks-cluster-test/Cluster/KubectlHandlerRole/ImportKubectlHandlerRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/KubectlHandlerRole/ImportKubectlHandlerRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -928,7 +928,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/KubectlHandlerRole/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/KubectlHandlerRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1011,11 +1011,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdk-eks-cluster-test/Cluster/KubectlHandlerRole/DefaultPolicy", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/KubectlHandlerRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/KubectlHandlerRole/DefaultPolicy/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/KubectlHandlerRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1104,11 +1104,11 @@ }, "Role": { "id": "Role", - "path": "aws-cdk-eks-cluster-test/Cluster/Role", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Role", "children": { "ImportRole": { "id": "ImportRole", - "path": "aws-cdk-eks-cluster-test/Cluster/Role/ImportRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -1116,7 +1116,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Role/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Role/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1161,11 +1161,11 @@ }, "ControlPlaneSecurityGroup": { "id": "ControlPlaneSecurityGroup", - "path": "aws-cdk-eks-cluster-test/Cluster/ControlPlaneSecurityGroup", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ControlPlaneSecurityGroup", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/ControlPlaneSecurityGroup/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ControlPlaneSecurityGroup/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", "aws:cdk:cloudformation:props": { @@ -1228,13 +1228,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:443": { - "id": "from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:443", - "path": "aws-cdk-eks-cluster-test/Cluster/ControlPlaneSecurityGroup/from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:443", + "from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:443": { + "id": "from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:443", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ControlPlaneSecurityGroup/from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:443", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:443", + "description": "from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:443", "fromPort": 443, "groupId": { "Fn::GetAtt": [ @@ -1257,13 +1257,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443": { - "id": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", - "path": "aws-cdk-eks-cluster-test/Cluster/ControlPlaneSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", + "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443": { + "id": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ControlPlaneSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", + "description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", "fromPort": 443, "groupId": { "Fn::GetAtt": [ @@ -1286,13 +1286,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:443": { - "id": "from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:443", - "path": "aws-cdk-eks-cluster-test/Cluster/ControlPlaneSecurityGroup/from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:443", + "from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:443": { + "id": "from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:443", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ControlPlaneSecurityGroup/from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:443", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:443", + "description": "from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:443", "fromPort": 443, "groupId": { "Fn::GetAtt": [ @@ -1315,13 +1315,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:443": { - "id": "from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:443", - "path": "aws-cdk-eks-cluster-test/Cluster/ControlPlaneSecurityGroup/from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:443", + "from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:443": { + "id": "from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:443", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ControlPlaneSecurityGroup/from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:443", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:443", + "description": "from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:443", "fromPort": 443, "groupId": { "Fn::GetAtt": [ @@ -1344,13 +1344,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:443": { - "id": "from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:443", - "path": "aws-cdk-eks-cluster-test/Cluster/ControlPlaneSecurityGroup/from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:443", + "from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:443": { + "id": "from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:443", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ControlPlaneSecurityGroup/from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:443", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:443", + "description": "from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:443", "fromPort": 443, "groupId": { "Fn::GetAtt": [ @@ -1381,15 +1381,15 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Resource", "children": { "CreationRole": { "id": "CreationRole", - "path": "aws-cdk-eks-cluster-test/Cluster/Resource/CreationRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Resource/CreationRole", "children": { "ImportCreationRole": { "id": "ImportCreationRole", - "path": "aws-cdk-eks-cluster-test/Cluster/Resource/CreationRole/ImportCreationRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Resource/CreationRole/ImportCreationRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -1397,7 +1397,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Resource/CreationRole/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Resource/CreationRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1417,13 +1417,13 @@ { "Fn::GetAtt": [ "awscdkawseksClusterResourceProviderNestedStackawscdkawseksClusterResourceProviderNestedStackResource9827C454", - "Outputs.awscdkeksclustertestawscdkawseksClusterResourceProviderIsCompleteHandlerServiceRole970DAC30Arn" + "Outputs.awscdkeksclusteripv6testawscdkawseksClusterResourceProviderIsCompleteHandlerServiceRole1F912062Arn" ] }, { "Fn::GetAtt": [ "awscdkawseksClusterResourceProviderNestedStackawscdkawseksClusterResourceProviderNestedStackResource9827C454", - "Outputs.awscdkeksclustertestawscdkawseksClusterResourceProviderOnEventHandlerServiceRole5B783C71Arn" + "Outputs.awscdkeksclusteripv6testawscdkawseksClusterResourceProviderOnEventHandlerServiceRole6C18AE9AArn" ] } ] @@ -1441,11 +1441,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdk-eks-cluster-test/Cluster/Resource/CreationRole/DefaultPolicy", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Resource/CreationRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Resource/CreationRole/DefaultPolicy/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Resource/CreationRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1553,11 +1553,11 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Resource/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Resource/Resource", "children": { "Default": { "id": "Default", - "path": "aws-cdk-eks-cluster-test/Cluster/Resource/Resource/Default", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Resource/Resource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -1577,7 +1577,7 @@ }, "KubectlReadyBarrier": { "id": "KubectlReadyBarrier", - "path": "aws-cdk-eks-cluster-test/Cluster/KubectlReadyBarrier", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/KubectlReadyBarrier", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -1585,11 +1585,11 @@ }, "ClusterSecurityGroup": { "id": "ClusterSecurityGroup", - "path": "aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup", "children": { "from {IndirectPeer}:ALL TRAFFIC": { "id": "from {IndirectPeer}:ALL TRAFFIC", - "path": "aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from {IndirectPeer}:ALL TRAFFIC", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from {IndirectPeer}:ALL TRAFFIC", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { @@ -1640,7 +1640,7 @@ }, "from 10.0.0.0_8:ALL TRAFFIC": { "id": "from 10.0.0.0_8:ALL TRAFFIC", - "path": "aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from 10.0.0.0_8:ALL TRAFFIC", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from 10.0.0.0_8:ALL TRAFFIC", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { @@ -1660,13 +1660,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:443": { - "id": "from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:443", - "path": "aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:443", + "from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:443": { + "id": "from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:443", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:443", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:443", + "description": "from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:443", "fromPort": 443, "groupId": { "Fn::GetAtt": [ @@ -1689,13 +1689,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:ALL TRAFFIC": { - "id": "from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:ALL TRAFFIC", - "path": "aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:ALL TRAFFIC", + "from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:ALL TRAFFIC": { + "id": "from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:ALL TRAFFIC", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:ALL TRAFFIC", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:ALL TRAFFIC", + "description": "from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:ALL TRAFFIC", "groupId": { "Fn::GetAtt": [ "Cluster9EE0221C", @@ -1716,13 +1716,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443": { - "id": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", - "path": "aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", + "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443": { + "id": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", + "description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", "fromPort": 443, "groupId": { "Fn::GetAtt": [ @@ -1745,13 +1745,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443": { - "id": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443", - "path": "aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443", + "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443": { + "id": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443", + "description": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443", "fromPort": 443, "groupId": { "Fn::GetAtt": [ @@ -1774,13 +1774,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535": { - "id": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535", - "path": "aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535", + "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535": { + "id": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535", + "description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535", "fromPort": 1025, "groupId": { "Fn::GetAtt": [ @@ -1803,13 +1803,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535": { - "id": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535", - "path": "aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535", + "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535": { + "id": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535", + "description": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535", "fromPort": 1025, "groupId": { "Fn::GetAtt": [ @@ -1832,13 +1832,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC": { - "id": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC", - "path": "aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC", + "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC": { + "id": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC", + "description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC", "groupId": { "Fn::GetAtt": [ "Cluster9EE0221C", @@ -1859,13 +1859,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:443": { - "id": "from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:443", - "path": "aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:443", + "from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:443": { + "id": "from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:443", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:443", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:443", + "description": "from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:443", "fromPort": 443, "groupId": { "Fn::GetAtt": [ @@ -1888,13 +1888,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:ALL TRAFFIC": { - "id": "from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:ALL TRAFFIC", - "path": "aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:ALL TRAFFIC", + "from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:ALL TRAFFIC": { + "id": "from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:ALL TRAFFIC", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:ALL TRAFFIC", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:ALL TRAFFIC", + "description": "from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:ALL TRAFFIC", "groupId": { "Fn::GetAtt": [ "Cluster9EE0221C", @@ -1915,13 +1915,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:443": { - "id": "from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:443", - "path": "aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:443", + "from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:443": { + "id": "from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:443", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:443", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:443", + "description": "from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:443", "fromPort": 443, "groupId": { "Fn::GetAtt": [ @@ -1944,13 +1944,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:ALL TRAFFIC": { - "id": "from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:ALL TRAFFIC", - "path": "aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:ALL TRAFFIC", + "from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:ALL TRAFFIC": { + "id": "from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:ALL TRAFFIC", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:ALL TRAFFIC", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:ALL TRAFFIC", + "description": "from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:ALL TRAFFIC", "groupId": { "Fn::GetAtt": [ "Cluster9EE0221C", @@ -1971,13 +1971,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:443": { - "id": "from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:443", - "path": "aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:443", + "from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:443": { + "id": "from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:443", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:443", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:443", + "description": "from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:443", "fromPort": 443, "groupId": { "Fn::GetAtt": [ @@ -2000,13 +2000,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:ALL TRAFFIC": { - "id": "from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:ALL TRAFFIC", - "path": "aws-cdk-eks-cluster-test/Cluster/ClusterSecurityGroup/from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:ALL TRAFFIC", + "from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:ALL TRAFFIC": { + "id": "from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:ALL TRAFFIC", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ClusterSecurityGroup/from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:ALL TRAFFIC", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:ALL TRAFFIC", + "description": "from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:ALL TRAFFIC", "groupId": { "Fn::GetAtt": [ "Cluster9EE0221C", @@ -2035,7 +2035,7 @@ }, "HasEcrPublic": { "id": "HasEcrPublic", - "path": "aws-cdk-eks-cluster-test/Cluster/HasEcrPublic", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/HasEcrPublic", "constructInfo": { "fqn": "aws-cdk-lib.CfnCondition", "version": "0.0.0" @@ -2043,19 +2043,19 @@ }, "AwsAuth": { "id": "AwsAuth", - "path": "aws-cdk-eks-cluster-test/Cluster/AwsAuth", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/AwsAuth", "children": { "manifest": { "id": "manifest", - "path": "aws-cdk-eks-cluster-test/Cluster/AwsAuth/manifest", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/AwsAuth/manifest", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/AwsAuth/manifest/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/AwsAuth/manifest/Resource", "children": { "Default": { "id": "Default", - "path": "aws-cdk-eks-cluster-test/Cluster/AwsAuth/manifest/Resource/Default", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/AwsAuth/manifest/Resource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -2081,15 +2081,15 @@ }, "NodegroupDefaultCapacity": { "id": "NodegroupDefaultCapacity", - "path": "aws-cdk-eks-cluster-test/Cluster/NodegroupDefaultCapacity", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodegroupDefaultCapacity", "children": { "NodeGroupRole": { "id": "NodeGroupRole", - "path": "aws-cdk-eks-cluster-test/Cluster/NodegroupDefaultCapacity/NodeGroupRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodegroupDefaultCapacity/NodeGroupRole", "children": { "ImportNodeGroupRole": { "id": "ImportNodeGroupRole", - "path": "aws-cdk-eks-cluster-test/Cluster/NodegroupDefaultCapacity/NodeGroupRole/ImportNodeGroupRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodegroupDefaultCapacity/NodeGroupRole/ImportNodeGroupRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -2097,7 +2097,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/NodegroupDefaultCapacity/NodeGroupRole/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodegroupDefaultCapacity/NodeGroupRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -2160,11 +2160,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdk-eks-cluster-test/Cluster/NodegroupDefaultCapacity/NodeGroupRole/DefaultPolicy", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodegroupDefaultCapacity/NodeGroupRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/NodegroupDefaultCapacity/NodeGroupRole/DefaultPolicy/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodegroupDefaultCapacity/NodeGroupRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -2208,7 +2208,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/NodegroupDefaultCapacity/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodegroupDefaultCapacity/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EKS::Nodegroup", "aws:cdk:cloudformation:props": { @@ -2254,7 +2254,7 @@ }, "ConfigCommand": { "id": "ConfigCommand", - "path": "aws-cdk-eks-cluster-test/Cluster/ConfigCommand", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/ConfigCommand", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -2262,7 +2262,7 @@ }, "GetTokenCommand": { "id": "GetTokenCommand", - "path": "aws-cdk-eks-cluster-test/Cluster/GetTokenCommand", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/GetTokenCommand", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -2270,15 +2270,15 @@ }, "fargate-profile-default": { "id": "fargate-profile-default", - "path": "aws-cdk-eks-cluster-test/Cluster/fargate-profile-default", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/fargate-profile-default", "children": { "PodExecutionRole": { "id": "PodExecutionRole", - "path": "aws-cdk-eks-cluster-test/Cluster/fargate-profile-default/PodExecutionRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/fargate-profile-default/PodExecutionRole", "children": { "ImportPodExecutionRole": { "id": "ImportPodExecutionRole", - "path": "aws-cdk-eks-cluster-test/Cluster/fargate-profile-default/PodExecutionRole/ImportPodExecutionRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/fargate-profile-default/PodExecutionRole/ImportPodExecutionRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -2286,7 +2286,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/fargate-profile-default/PodExecutionRole/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/fargate-profile-default/PodExecutionRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -2331,11 +2331,11 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/fargate-profile-default/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/fargate-profile-default/Resource", "children": { "Default": { "id": "Default", - "path": "aws-cdk-eks-cluster-test/Cluster/fargate-profile-default/Resource/Default", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/fargate-profile-default/Resource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -2355,19 +2355,19 @@ }, "Nodes": { "id": "Nodes", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodes", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes", "children": { "InstanceSecurityGroup": { "id": "InstanceSecurityGroup", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceSecurityGroup", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceSecurityGroup", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceSecurityGroup/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceSecurityGroup/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", "aws:cdk:cloudformation:props": { - "groupDescription": "aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceSecurityGroup", + "groupDescription": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceSecurityGroup", "securityGroupEgress": [ { "cidrIp": "0.0.0.0/0", @@ -2378,7 +2378,7 @@ "tags": [ { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/Nodes" + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes" } ], "vpcId": { @@ -2391,13 +2391,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:ALL TRAFFIC": { - "id": "from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:ALL TRAFFIC", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:ALL TRAFFIC", + "from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:ALL TRAFFIC": { + "id": "from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:ALL TRAFFIC", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:ALL TRAFFIC", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterNodesInstanceSecurityGroupD0B64C54:ALL TRAFFIC", + "description": "from awscdkeksclusteripv6testClusterNodesInstanceSecurityGroup329A56DE:ALL TRAFFIC", "groupId": { "Fn::GetAtt": [ "ClusterNodesInstanceSecurityGroup899246BD", @@ -2418,13 +2418,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443": { - "id": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", + "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443": { + "id": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", + "description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", "fromPort": 443, "groupId": { "Fn::GetAtt": [ @@ -2447,13 +2447,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443": { - "id": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443", + "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443": { + "id": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443", + "description": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443", "fromPort": 443, "groupId": { "Fn::GetAtt": [ @@ -2476,13 +2476,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535": { - "id": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535", + "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535": { + "id": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535", + "description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535", "fromPort": 1025, "groupId": { "Fn::GetAtt": [ @@ -2505,13 +2505,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535": { - "id": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535", + "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535": { + "id": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535", + "description": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535", "fromPort": 1025, "groupId": { "Fn::GetAtt": [ @@ -2534,13 +2534,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC": { - "id": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC", + "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC": { + "id": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC", + "description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC", "groupId": { "Fn::GetAtt": [ "ClusterNodesInstanceSecurityGroup899246BD", @@ -2569,11 +2569,11 @@ }, "InstanceRole": { "id": "InstanceRole", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceRole", "children": { "ImportInstanceRole": { "id": "ImportInstanceRole", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceRole/ImportInstanceRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceRole/ImportInstanceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -2581,7 +2581,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceRole/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -2652,7 +2652,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/Nodes" + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes" } ] } @@ -2670,7 +2670,7 @@ }, "InstanceProfile": { "id": "InstanceProfile", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodes/InstanceProfile", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/InstanceProfile", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", "aws:cdk:cloudformation:props": { @@ -2688,7 +2688,7 @@ }, "ImportedInstanceProfile": { "id": "ImportedInstanceProfile", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodes/ImportedInstanceProfile", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/ImportedInstanceProfile", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -2696,11 +2696,11 @@ }, "LaunchTemplate": { "id": "LaunchTemplate", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodes/LaunchTemplate", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/LaunchTemplate", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodes/LaunchTemplate/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/LaunchTemplate/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::LaunchTemplate", "aws:cdk:cloudformation:props": { @@ -2754,7 +2754,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/Nodes/LaunchTemplate" + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/LaunchTemplate" } ] }, @@ -2777,7 +2777,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/Nodes/LaunchTemplate" + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/LaunchTemplate" } ] } @@ -2805,7 +2805,7 @@ "CertificateAuthorityData" ] }, - "' --use-max-pods true\n/opt/aws/bin/cfn-signal --exit-code $? --stack aws-cdk-eks-cluster-test --resource ClusterNodesASGF172BD19 --region us-east-1" + "' --use-max-pods true\n/opt/aws/bin/cfn-signal --exit-code $? --stack aws-cdk-eks-cluster-ipv6-test --resource ClusterNodesASGF172BD19 --region us-east-1" ] ] } @@ -2831,7 +2831,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/Nodes/LaunchTemplate" + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/LaunchTemplate" } ] } @@ -2851,7 +2851,7 @@ }, "ASG": { "id": "ASG", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodes/ASG", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes/ASG", "attributes": { "aws:cdk:cloudformation:type": "AWS::AutoScaling::AutoScalingGroup", "aws:cdk:cloudformation:props": { @@ -2886,7 +2886,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/Nodes", + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodes", "propagateAtLaunch": true } ], @@ -2913,19 +2913,19 @@ }, "NodesArm": { "id": "NodesArm", - "path": "aws-cdk-eks-cluster-test/Cluster/NodesArm", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm", "children": { "InstanceSecurityGroup": { "id": "InstanceSecurityGroup", - "path": "aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceSecurityGroup", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceSecurityGroup", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceSecurityGroup/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceSecurityGroup/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", "aws:cdk:cloudformation:props": { - "groupDescription": "aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceSecurityGroup", + "groupDescription": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceSecurityGroup", "securityGroupEgress": [ { "cidrIp": "0.0.0.0/0", @@ -2936,7 +2936,7 @@ "tags": [ { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/NodesArm" + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm" } ], "vpcId": { @@ -2949,13 +2949,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:ALL TRAFFIC": { - "id": "from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:ALL TRAFFIC", - "path": "aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:ALL TRAFFIC", + "from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:ALL TRAFFIC": { + "id": "from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:ALL TRAFFIC", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:ALL TRAFFIC", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterNodesArmInstanceSecurityGroup52C45858:ALL TRAFFIC", + "description": "from awscdkeksclusteripv6testClusterNodesArmInstanceSecurityGroupFEB06BBB:ALL TRAFFIC", "groupId": { "Fn::GetAtt": [ "ClusterNodesArmInstanceSecurityGroup599F388B", @@ -2976,13 +2976,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443": { - "id": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", - "path": "aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", + "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443": { + "id": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", + "description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", "fromPort": 443, "groupId": { "Fn::GetAtt": [ @@ -3005,13 +3005,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443": { - "id": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443", - "path": "aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443", + "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443": { + "id": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443", + "description": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443", "fromPort": 443, "groupId": { "Fn::GetAtt": [ @@ -3034,13 +3034,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535": { - "id": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535", - "path": "aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535", + "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535": { + "id": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535", + "description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535", "fromPort": 1025, "groupId": { "Fn::GetAtt": [ @@ -3063,13 +3063,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535": { - "id": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535", - "path": "aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535", + "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535": { + "id": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535", + "description": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535", "fromPort": 1025, "groupId": { "Fn::GetAtt": [ @@ -3092,13 +3092,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC": { - "id": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC", - "path": "aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC", + "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC": { + "id": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC", + "description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC", "groupId": { "Fn::GetAtt": [ "ClusterNodesArmInstanceSecurityGroup599F388B", @@ -3127,11 +3127,11 @@ }, "InstanceRole": { "id": "InstanceRole", - "path": "aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceRole", "children": { "ImportInstanceRole": { "id": "ImportInstanceRole", - "path": "aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceRole/ImportInstanceRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceRole/ImportInstanceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -3139,7 +3139,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceRole/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -3210,7 +3210,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/NodesArm" + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm" } ] } @@ -3228,7 +3228,7 @@ }, "InstanceProfile": { "id": "InstanceProfile", - "path": "aws-cdk-eks-cluster-test/Cluster/NodesArm/InstanceProfile", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/InstanceProfile", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", "aws:cdk:cloudformation:props": { @@ -3246,7 +3246,7 @@ }, "ImportedInstanceProfile": { "id": "ImportedInstanceProfile", - "path": "aws-cdk-eks-cluster-test/Cluster/NodesArm/ImportedInstanceProfile", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/ImportedInstanceProfile", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -3254,11 +3254,11 @@ }, "LaunchTemplate": { "id": "LaunchTemplate", - "path": "aws-cdk-eks-cluster-test/Cluster/NodesArm/LaunchTemplate", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/LaunchTemplate", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/NodesArm/LaunchTemplate/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/LaunchTemplate/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::LaunchTemplate", "aws:cdk:cloudformation:props": { @@ -3312,7 +3312,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/NodesArm/LaunchTemplate" + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/LaunchTemplate" } ] }, @@ -3335,7 +3335,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/NodesArm/LaunchTemplate" + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/LaunchTemplate" } ] } @@ -3363,7 +3363,7 @@ "CertificateAuthorityData" ] }, - "' --use-max-pods true\n/opt/aws/bin/cfn-signal --exit-code $? --stack aws-cdk-eks-cluster-test --resource ClusterNodesArmASG40A593D0 --region us-east-1" + "' --use-max-pods true\n/opt/aws/bin/cfn-signal --exit-code $? --stack aws-cdk-eks-cluster-ipv6-test --resource ClusterNodesArmASG40A593D0 --region us-east-1" ] ] } @@ -3389,7 +3389,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/NodesArm/LaunchTemplate" + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/LaunchTemplate" } ] } @@ -3409,7 +3409,7 @@ }, "ASG": { "id": "ASG", - "path": "aws-cdk-eks-cluster-test/Cluster/NodesArm/ASG", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm/ASG", "attributes": { "aws:cdk:cloudformation:type": "AWS::AutoScaling::AutoScalingGroup", "aws:cdk:cloudformation:props": { @@ -3444,7 +3444,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/NodesArm", + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/NodesArm", "propagateAtLaunch": true } ], @@ -3471,19 +3471,19 @@ }, "BottlerocketNodes": { "id": "BottlerocketNodes", - "path": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes", "children": { "InstanceSecurityGroup": { "id": "InstanceSecurityGroup", - "path": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceSecurityGroup", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceSecurityGroup", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", "aws:cdk:cloudformation:props": { - "groupDescription": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceSecurityGroup", + "groupDescription": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceSecurityGroup", "securityGroupEgress": [ { "cidrIp": "0.0.0.0/0", @@ -3494,7 +3494,7 @@ "tags": [ { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes" + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes" } ], "vpcId": { @@ -3507,13 +3507,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:ALL TRAFFIC": { - "id": "from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:ALL TRAFFIC", - "path": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:ALL TRAFFIC", + "from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:ALL TRAFFIC": { + "id": "from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:ALL TRAFFIC", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:ALL TRAFFIC", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterBottlerocketNodesInstanceSecurityGroup83FE7914:ALL TRAFFIC", + "description": "from awscdkeksclusteripv6testClusterBottlerocketNodesInstanceSecurityGroupB7764229:ALL TRAFFIC", "groupId": { "Fn::GetAtt": [ "ClusterBottlerocketNodesInstanceSecurityGroup3794A94B", @@ -3534,13 +3534,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443": { - "id": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", - "path": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", + "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443": { + "id": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", + "description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", "fromPort": 443, "groupId": { "Fn::GetAtt": [ @@ -3563,13 +3563,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443": { - "id": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443", - "path": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443", + "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443": { + "id": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443", + "description": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443", "fromPort": 443, "groupId": { "Fn::GetAtt": [ @@ -3592,13 +3592,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535": { - "id": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535", - "path": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535", + "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535": { + "id": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535", + "description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535", "fromPort": 1025, "groupId": { "Fn::GetAtt": [ @@ -3621,13 +3621,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535": { - "id": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535", - "path": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535", + "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535": { + "id": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535", + "description": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535", "fromPort": 1025, "groupId": { "Fn::GetAtt": [ @@ -3650,13 +3650,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC": { - "id": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC", - "path": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC", + "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC": { + "id": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC", + "description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC", "groupId": { "Fn::GetAtt": [ "ClusterBottlerocketNodesInstanceSecurityGroup3794A94B", @@ -3685,11 +3685,11 @@ }, "InstanceRole": { "id": "InstanceRole", - "path": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceRole", "children": { "ImportInstanceRole": { "id": "ImportInstanceRole", - "path": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceRole/ImportInstanceRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceRole/ImportInstanceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -3697,7 +3697,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceRole/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -3768,7 +3768,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes" + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes" } ] } @@ -3786,7 +3786,7 @@ }, "InstanceProfile": { "id": "InstanceProfile", - "path": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/InstanceProfile", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/InstanceProfile", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", "aws:cdk:cloudformation:props": { @@ -3804,7 +3804,7 @@ }, "ImportedInstanceProfile": { "id": "ImportedInstanceProfile", - "path": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/ImportedInstanceProfile", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/ImportedInstanceProfile", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -3812,11 +3812,11 @@ }, "LaunchTemplate": { "id": "LaunchTemplate", - "path": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/LaunchTemplate", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/LaunchTemplate", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/LaunchTemplate/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/LaunchTemplate/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::LaunchTemplate", "aws:cdk:cloudformation:props": { @@ -3870,7 +3870,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/LaunchTemplate" + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/LaunchTemplate" } ] }, @@ -3893,7 +3893,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/LaunchTemplate" + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/LaunchTemplate" } ] } @@ -3947,7 +3947,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/LaunchTemplate" + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/LaunchTemplate" } ] } @@ -3967,7 +3967,7 @@ }, "ASG": { "id": "ASG", - "path": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes/ASG", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes/ASG", "attributes": { "aws:cdk:cloudformation:type": "AWS::AutoScaling::AutoScalingGroup", "aws:cdk:cloudformation:props": { @@ -4002,7 +4002,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/BottlerocketNodes", + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/BottlerocketNodes", "propagateAtLaunch": true } ], @@ -4029,19 +4029,19 @@ }, "spot": { "id": "spot", - "path": "aws-cdk-eks-cluster-test/Cluster/spot", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot", "children": { "InstanceSecurityGroup": { "id": "InstanceSecurityGroup", - "path": "aws-cdk-eks-cluster-test/Cluster/spot/InstanceSecurityGroup", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceSecurityGroup", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/spot/InstanceSecurityGroup/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceSecurityGroup/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", "aws:cdk:cloudformation:props": { - "groupDescription": "aws-cdk-eks-cluster-test/Cluster/spot/InstanceSecurityGroup", + "groupDescription": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceSecurityGroup", "securityGroupEgress": [ { "cidrIp": "0.0.0.0/0", @@ -4052,7 +4052,7 @@ "tags": [ { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/spot" + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot" } ], "vpcId": { @@ -4065,13 +4065,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:ALL TRAFFIC": { - "id": "from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:ALL TRAFFIC", - "path": "aws-cdk-eks-cluster-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:ALL TRAFFIC", + "from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:ALL TRAFFIC": { + "id": "from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:ALL TRAFFIC", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:ALL TRAFFIC", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterspotInstanceSecurityGroupF50F5D47:ALL TRAFFIC", + "description": "from awscdkeksclusteripv6testClusterspotInstanceSecurityGroupF363CA03:ALL TRAFFIC", "groupId": { "Fn::GetAtt": [ "ClusterspotInstanceSecurityGroup01F7B1CE", @@ -4092,13 +4092,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443": { - "id": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", - "path": "aws-cdk-eks-cluster-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", + "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443": { + "id": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:443", + "description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:443", "fromPort": 443, "groupId": { "Fn::GetAtt": [ @@ -4121,13 +4121,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443": { - "id": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443", - "path": "aws-cdk-eks-cluster-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443", + "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443": { + "id": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:443", + "description": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:443", "fromPort": 443, "groupId": { "Fn::GetAtt": [ @@ -4150,13 +4150,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535": { - "id": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535", - "path": "aws-cdk-eks-cluster-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535", + "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535": { + "id": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:1025-65535", + "description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:1025-65535", "fromPort": 1025, "groupId": { "Fn::GetAtt": [ @@ -4179,13 +4179,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535": { - "id": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535", - "path": "aws-cdk-eks-cluster-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535", + "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535": { + "id": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterControlPlaneSecurityGroup2F130134:1025-65535", + "description": "from awscdkeksclusteripv6testClusterControlPlaneSecurityGroup919BFEFE:1025-65535", "fromPort": 1025, "groupId": { "Fn::GetAtt": [ @@ -4208,13 +4208,13 @@ "version": "0.0.0" } }, - "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC": { - "id": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC", - "path": "aws-cdk-eks-cluster-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC", + "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC": { + "id": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceSecurityGroup/from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "description": "from awscdkeksclustertestClusterClusterSecurityGroupF7265A32:ALL TRAFFIC", + "description": "from awscdkeksclusteripv6testClusterClusterSecurityGroupE4D19A6D:ALL TRAFFIC", "groupId": { "Fn::GetAtt": [ "ClusterspotInstanceSecurityGroup01F7B1CE", @@ -4243,11 +4243,11 @@ }, "InstanceRole": { "id": "InstanceRole", - "path": "aws-cdk-eks-cluster-test/Cluster/spot/InstanceRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceRole", "children": { "ImportInstanceRole": { "id": "ImportInstanceRole", - "path": "aws-cdk-eks-cluster-test/Cluster/spot/InstanceRole/ImportInstanceRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceRole/ImportInstanceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -4255,7 +4255,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/spot/InstanceRole/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -4326,7 +4326,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/spot" + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot" } ] } @@ -4344,7 +4344,7 @@ }, "InstanceProfile": { "id": "InstanceProfile", - "path": "aws-cdk-eks-cluster-test/Cluster/spot/InstanceProfile", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/InstanceProfile", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", "aws:cdk:cloudformation:props": { @@ -4362,7 +4362,7 @@ }, "ImportedInstanceProfile": { "id": "ImportedInstanceProfile", - "path": "aws-cdk-eks-cluster-test/Cluster/spot/ImportedInstanceProfile", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/ImportedInstanceProfile", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -4370,11 +4370,11 @@ }, "LaunchTemplate": { "id": "LaunchTemplate", - "path": "aws-cdk-eks-cluster-test/Cluster/spot/LaunchTemplate", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/LaunchTemplate", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/spot/LaunchTemplate/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/LaunchTemplate/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::LaunchTemplate", "aws:cdk:cloudformation:props": { @@ -4434,7 +4434,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/spot/LaunchTemplate" + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/LaunchTemplate" } ] }, @@ -4457,7 +4457,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/spot/LaunchTemplate" + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/LaunchTemplate" } ] } @@ -4485,7 +4485,7 @@ "CertificateAuthorityData" ] }, - "' --use-max-pods true --aws-api-retry-attempts 5\n/opt/aws/bin/cfn-signal --exit-code $? --stack aws-cdk-eks-cluster-test --resource ClusterspotASG857494B6 --region us-east-1" + "' --use-max-pods true --aws-api-retry-attempts 5\n/opt/aws/bin/cfn-signal --exit-code $? --stack aws-cdk-eks-cluster-ipv6-test --resource ClusterspotASG857494B6 --region us-east-1" ] ] } @@ -4511,7 +4511,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/spot/LaunchTemplate" + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/LaunchTemplate" } ] } @@ -4531,7 +4531,7 @@ }, "ASG": { "id": "ASG", - "path": "aws-cdk-eks-cluster-test/Cluster/spot/ASG", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot/ASG", "attributes": { "aws:cdk:cloudformation:type": "AWS::AutoScaling::AutoScalingGroup", "aws:cdk:cloudformation:props": { @@ -4566,7 +4566,7 @@ }, { "key": "Name", - "value": "aws-cdk-eks-cluster-test/Cluster/spot", + "value": "aws-cdk-eks-cluster-ipv6-test/Cluster/spot", "propagateAtLaunch": true } ], @@ -4593,15 +4593,15 @@ }, "chart-spot-interrupt-handler": { "id": "chart-spot-interrupt-handler", - "path": "aws-cdk-eks-cluster-test/Cluster/chart-spot-interrupt-handler", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/chart-spot-interrupt-handler", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/chart-spot-interrupt-handler/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/chart-spot-interrupt-handler/Resource", "children": { "Default": { "id": "Default", - "path": "aws-cdk-eks-cluster-test/Cluster/chart-spot-interrupt-handler/Resource/Default", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/chart-spot-interrupt-handler/Resource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -4621,15 +4621,15 @@ }, "Nodegroupextra-ng": { "id": "Nodegroupextra-ng", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng", "children": { "NodeGroupRole": { "id": "NodeGroupRole", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng/NodeGroupRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng/NodeGroupRole", "children": { "ImportNodeGroupRole": { "id": "ImportNodeGroupRole", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng/NodeGroupRole/ImportNodeGroupRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng/NodeGroupRole/ImportNodeGroupRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -4637,7 +4637,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng/NodeGroupRole/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng/NodeGroupRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -4700,11 +4700,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng/NodeGroupRole/DefaultPolicy", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng/NodeGroupRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng/NodeGroupRole/DefaultPolicy/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng/NodeGroupRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -4748,7 +4748,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EKS::Nodegroup", "aws:cdk:cloudformation:props": { @@ -4794,15 +4794,15 @@ }, "Nodegroupextra-ng-spot": { "id": "Nodegroupextra-ng-spot", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-spot", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-spot", "children": { "NodeGroupRole": { "id": "NodeGroupRole", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-spot/NodeGroupRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-spot/NodeGroupRole", "children": { "ImportNodeGroupRole": { "id": "ImportNodeGroupRole", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-spot/NodeGroupRole/ImportNodeGroupRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-spot/NodeGroupRole/ImportNodeGroupRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -4810,7 +4810,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-spot/NodeGroupRole/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-spot/NodeGroupRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -4873,11 +4873,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-spot/NodeGroupRole/DefaultPolicy", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-spot/NodeGroupRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-spot/NodeGroupRole/DefaultPolicy/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-spot/NodeGroupRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -4921,7 +4921,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-spot/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-spot/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EKS::Nodegroup", "aws:cdk:cloudformation:props": { @@ -4970,15 +4970,15 @@ }, "Nodegroupextra-ng-arm": { "id": "Nodegroupextra-ng-arm", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-arm", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-arm", "children": { "NodeGroupRole": { "id": "NodeGroupRole", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-arm/NodeGroupRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-arm/NodeGroupRole", "children": { "ImportNodeGroupRole": { "id": "ImportNodeGroupRole", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-arm/NodeGroupRole/ImportNodeGroupRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-arm/NodeGroupRole/ImportNodeGroupRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -4986,7 +4986,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-arm/NodeGroupRole/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-arm/NodeGroupRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -5049,11 +5049,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-arm/NodeGroupRole/DefaultPolicy", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-arm/NodeGroupRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-arm/NodeGroupRole/DefaultPolicy/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-arm/NodeGroupRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -5097,7 +5097,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-arm/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-arm/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EKS::Nodegroup", "aws:cdk:cloudformation:props": { @@ -5143,15 +5143,15 @@ }, "Nodegroupextra-ng-arm3": { "id": "Nodegroupextra-ng-arm3", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-arm3", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-arm3", "children": { "NodeGroupRole": { "id": "NodeGroupRole", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-arm3/NodeGroupRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-arm3/NodeGroupRole", "children": { "ImportNodeGroupRole": { "id": "ImportNodeGroupRole", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-arm3/NodeGroupRole/ImportNodeGroupRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-arm3/NodeGroupRole/ImportNodeGroupRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -5159,7 +5159,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-arm3/NodeGroupRole/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-arm3/NodeGroupRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -5222,11 +5222,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-arm3/NodeGroupRole/DefaultPolicy", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-arm3/NodeGroupRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-arm3/NodeGroupRole/DefaultPolicy/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-arm3/NodeGroupRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -5270,7 +5270,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng-arm3/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng-arm3/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EKS::Nodegroup", "aws:cdk:cloudformation:props": { @@ -5316,11 +5316,11 @@ }, "Nodegroupextra-ng2": { "id": "Nodegroupextra-ng2", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng2", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng2", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/Nodegroupextra-ng2/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/Nodegroupextra-ng2/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EKS::Nodegroup", "aws:cdk:cloudformation:props": { @@ -5373,15 +5373,15 @@ }, "manifest-HelloApp": { "id": "manifest-HelloApp", - "path": "aws-cdk-eks-cluster-test/Cluster/manifest-HelloApp", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/manifest-HelloApp", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/manifest-HelloApp/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/manifest-HelloApp/Resource", "children": { "Default": { "id": "Default", - "path": "aws-cdk-eks-cluster-test/Cluster/manifest-HelloApp/Resource/Default", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/manifest-HelloApp/Resource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -5401,15 +5401,15 @@ }, "chart-dashboard": { "id": "chart-dashboard", - "path": "aws-cdk-eks-cluster-test/Cluster/chart-dashboard", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/chart-dashboard", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/chart-dashboard/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/chart-dashboard/Resource", "children": { "Default": { "id": "Default", - "path": "aws-cdk-eks-cluster-test/Cluster/chart-dashboard/Resource/Default", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/chart-dashboard/Resource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -5429,15 +5429,15 @@ }, "chart-test-chart": { "id": "chart-test-chart", - "path": "aws-cdk-eks-cluster-test/Cluster/chart-test-chart", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/chart-test-chart", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/chart-test-chart/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/chart-test-chart/Resource", "children": { "Default": { "id": "Default", - "path": "aws-cdk-eks-cluster-test/Cluster/chart-test-chart/Resource/Default", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/chart-test-chart/Resource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -5457,15 +5457,15 @@ }, "cdk8s-chart": { "id": "cdk8s-chart", - "path": "aws-cdk-eks-cluster-test/Cluster/cdk8s-chart", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/cdk8s-chart", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/cdk8s-chart/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/cdk8s-chart/Resource", "children": { "Default": { "id": "Default", - "path": "aws-cdk-eks-cluster-test/Cluster/cdk8s-chart/Resource/Default", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/cdk8s-chart/Resource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -5485,15 +5485,15 @@ }, "manifest-nginx-namespace": { "id": "manifest-nginx-namespace", - "path": "aws-cdk-eks-cluster-test/Cluster/manifest-nginx-namespace", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/manifest-nginx-namespace", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/manifest-nginx-namespace/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/manifest-nginx-namespace/Resource", "children": { "Default": { "id": "Default", - "path": "aws-cdk-eks-cluster-test/Cluster/manifest-nginx-namespace/Resource/Default", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/manifest-nginx-namespace/Resource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -5513,15 +5513,15 @@ }, "chart-nginx-ingress": { "id": "chart-nginx-ingress", - "path": "aws-cdk-eks-cluster-test/Cluster/chart-nginx-ingress", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/chart-nginx-ingress", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/chart-nginx-ingress/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/chart-nginx-ingress/Resource", "children": { "Default": { "id": "Default", - "path": "aws-cdk-eks-cluster-test/Cluster/chart-nginx-ingress/Resource/Default", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/chart-nginx-ingress/Resource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -5541,19 +5541,19 @@ }, "MyServiceAccount": { "id": "MyServiceAccount", - "path": "aws-cdk-eks-cluster-test/Cluster/MyServiceAccount", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/MyServiceAccount", "children": { "ConditionJson": { "id": "ConditionJson", - "path": "aws-cdk-eks-cluster-test/Cluster/MyServiceAccount/ConditionJson", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/MyServiceAccount/ConditionJson", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/MyServiceAccount/ConditionJson/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/MyServiceAccount/ConditionJson/Resource", "children": { "Default": { "id": "Default", - "path": "aws-cdk-eks-cluster-test/Cluster/MyServiceAccount/ConditionJson/Resource/Default", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/MyServiceAccount/ConditionJson/Resource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -5573,11 +5573,11 @@ }, "Role": { "id": "Role", - "path": "aws-cdk-eks-cluster-test/Cluster/MyServiceAccount/Role", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/MyServiceAccount/Role", "children": { "ImportRole": { "id": "ImportRole", - "path": "aws-cdk-eks-cluster-test/Cluster/MyServiceAccount/Role/ImportRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/MyServiceAccount/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -5585,7 +5585,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/MyServiceAccount/Role/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/MyServiceAccount/Role/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -5626,15 +5626,15 @@ }, "manifest-MyServiceAccountServiceAccountResource": { "id": "manifest-MyServiceAccountServiceAccountResource", - "path": "aws-cdk-eks-cluster-test/Cluster/MyServiceAccount/manifest-MyServiceAccountServiceAccountResource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/MyServiceAccount/manifest-MyServiceAccountServiceAccountResource", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/MyServiceAccount/manifest-MyServiceAccountServiceAccountResource/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/MyServiceAccount/manifest-MyServiceAccountServiceAccountResource/Resource", "children": { "Default": { "id": "Default", - "path": "aws-cdk-eks-cluster-test/Cluster/MyServiceAccount/manifest-MyServiceAccountServiceAccountResource/Resource/Default", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/MyServiceAccount/manifest-MyServiceAccountServiceAccountResource/Resource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -5660,15 +5660,15 @@ }, "OpenIdConnectProvider": { "id": "OpenIdConnectProvider", - "path": "aws-cdk-eks-cluster-test/Cluster/OpenIdConnectProvider", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/OpenIdConnectProvider", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/OpenIdConnectProvider/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/OpenIdConnectProvider/Resource", "children": { "Default": { "id": "Default", - "path": "aws-cdk-eks-cluster-test/Cluster/OpenIdConnectProvider/Resource/Default", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/OpenIdConnectProvider/Resource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -5688,19 +5688,19 @@ }, "MyExtendedServiceAccount": { "id": "MyExtendedServiceAccount", - "path": "aws-cdk-eks-cluster-test/Cluster/MyExtendedServiceAccount", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/MyExtendedServiceAccount", "children": { "ConditionJson": { "id": "ConditionJson", - "path": "aws-cdk-eks-cluster-test/Cluster/MyExtendedServiceAccount/ConditionJson", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/MyExtendedServiceAccount/ConditionJson", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/MyExtendedServiceAccount/ConditionJson/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/MyExtendedServiceAccount/ConditionJson/Resource", "children": { "Default": { "id": "Default", - "path": "aws-cdk-eks-cluster-test/Cluster/MyExtendedServiceAccount/ConditionJson/Resource/Default", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/MyExtendedServiceAccount/ConditionJson/Resource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -5720,11 +5720,11 @@ }, "Role": { "id": "Role", - "path": "aws-cdk-eks-cluster-test/Cluster/MyExtendedServiceAccount/Role", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/MyExtendedServiceAccount/Role", "children": { "ImportRole": { "id": "ImportRole", - "path": "aws-cdk-eks-cluster-test/Cluster/MyExtendedServiceAccount/Role/ImportRole", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/MyExtendedServiceAccount/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -5732,7 +5732,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/MyExtendedServiceAccount/Role/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/MyExtendedServiceAccount/Role/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -5773,15 +5773,15 @@ }, "manifest-MyExtendedServiceAccountServiceAccountResource": { "id": "manifest-MyExtendedServiceAccountServiceAccountResource", - "path": "aws-cdk-eks-cluster-test/Cluster/MyExtendedServiceAccount/manifest-MyExtendedServiceAccountServiceAccountResource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/MyExtendedServiceAccount/manifest-MyExtendedServiceAccountServiceAccountResource", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/Cluster/MyExtendedServiceAccount/manifest-MyExtendedServiceAccountServiceAccountResource/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/MyExtendedServiceAccount/manifest-MyExtendedServiceAccountServiceAccountResource/Resource", "children": { "Default": { "id": "Default", - "path": "aws-cdk-eks-cluster-test/Cluster/MyExtendedServiceAccount/manifest-MyExtendedServiceAccountServiceAccountResource/Resource/Default", + "path": "aws-cdk-eks-cluster-ipv6-test/Cluster/MyExtendedServiceAccount/manifest-MyExtendedServiceAccountServiceAccountResource/Resource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -5813,19 +5813,19 @@ }, "@aws-cdk--aws-eks.ClusterResourceProvider": { "id": "@aws-cdk--aws-eks.ClusterResourceProvider", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider", "children": { "NodeProxyAgentLayer": { "id": "NodeProxyAgentLayer", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/NodeProxyAgentLayer", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/NodeProxyAgentLayer", "children": { "Code": { "id": "Code", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/NodeProxyAgentLayer/Code", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/NodeProxyAgentLayer/Code", "children": { "Stage": { "id": "Stage", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/NodeProxyAgentLayer/Code/Stage", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/NodeProxyAgentLayer/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -5833,7 +5833,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/NodeProxyAgentLayer/Code/AssetBucket", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/NodeProxyAgentLayer/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -5847,7 +5847,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/NodeProxyAgentLayer/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/NodeProxyAgentLayer/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::LayerVersion", "aws:cdk:cloudformation:props": { @@ -5873,15 +5873,15 @@ }, "OnEventHandler": { "id": "OnEventHandler", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/OnEventHandler", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/OnEventHandler", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/OnEventHandler/ServiceRole", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/OnEventHandler/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/OnEventHandler/ServiceRole/ImportServiceRole", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/OnEventHandler/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -5889,7 +5889,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/OnEventHandler/ServiceRole/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/OnEventHandler/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -5934,11 +5934,11 @@ }, "Code": { "id": "Code", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/OnEventHandler/Code", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/OnEventHandler/Code", "children": { "Stage": { "id": "Stage", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/OnEventHandler/Code/Stage", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/OnEventHandler/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -5946,7 +5946,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/OnEventHandler/Code/AssetBucket", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/OnEventHandler/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -5960,7 +5960,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/OnEventHandler/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/OnEventHandler/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -5968,7 +5968,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "onEvent handler for EKS cluster resource provider", "environment": { @@ -6005,15 +6005,15 @@ }, "IsCompleteHandler": { "id": "IsCompleteHandler", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/IsCompleteHandler", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/IsCompleteHandler", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/IsCompleteHandler/ServiceRole", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/IsCompleteHandler/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/IsCompleteHandler/ServiceRole/ImportServiceRole", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/IsCompleteHandler/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -6021,7 +6021,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/IsCompleteHandler/ServiceRole/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/IsCompleteHandler/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -6066,11 +6066,11 @@ }, "Code": { "id": "Code", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/IsCompleteHandler/Code", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/IsCompleteHandler/Code", "children": { "Stage": { "id": "Stage", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/IsCompleteHandler/Code/Stage", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/IsCompleteHandler/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -6078,7 +6078,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/IsCompleteHandler/Code/AssetBucket", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/IsCompleteHandler/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -6092,7 +6092,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/IsCompleteHandler/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/IsCompleteHandler/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -6100,7 +6100,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "isComplete handler for EKS cluster resource provider", "environment": { @@ -6137,19 +6137,19 @@ }, "Provider": { "id": "Provider", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider", "children": { "framework-onEvent": { "id": "framework-onEvent", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/ServiceRole", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/ServiceRole/ImportServiceRole", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -6157,7 +6157,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/ServiceRole/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -6196,11 +6196,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -6289,11 +6289,11 @@ }, "Code": { "id": "Code", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/Code", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/Code", "children": { "Stage": { "id": "Stage", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/Code/Stage", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -6301,7 +6301,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/Code/AssetBucket", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -6315,7 +6315,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onEvent/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -6325,7 +6325,7 @@ }, "s3Key": "73b60c2cf141bf58c33cfaa33858f5c84103a0232ba7192d696536488f7731c4.zip" }, - "description": "AWS CDK resource provider framework - onEvent (aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider)", + "description": "AWS CDK resource provider framework - onEvent (aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider)", "environment": { "variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -6369,15 +6369,15 @@ }, "framework-isComplete": { "id": "framework-isComplete", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/ServiceRole", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/ServiceRole/ImportServiceRole", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -6385,7 +6385,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/ServiceRole/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -6424,11 +6424,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -6510,11 +6510,11 @@ }, "Code": { "id": "Code", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/Code", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/Code", "children": { "Stage": { "id": "Stage", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/Code/Stage", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -6522,7 +6522,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/Code/AssetBucket", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -6536,7 +6536,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-isComplete/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -6546,7 +6546,7 @@ }, "s3Key": "73b60c2cf141bf58c33cfaa33858f5c84103a0232ba7192d696536488f7731c4.zip" }, - "description": "AWS CDK resource provider framework - isComplete (aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider)", + "description": "AWS CDK resource provider framework - isComplete (aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider)", "environment": { "variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -6587,15 +6587,15 @@ }, "framework-onTimeout": { "id": "framework-onTimeout", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/ServiceRole", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/ServiceRole/ImportServiceRole", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -6603,7 +6603,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/ServiceRole/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -6642,11 +6642,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -6728,11 +6728,11 @@ }, "Code": { "id": "Code", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/Code", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/Code", "children": { "Stage": { "id": "Stage", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/Code/Stage", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -6740,7 +6740,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/Code/AssetBucket", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -6754,7 +6754,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/framework-onTimeout/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -6764,7 +6764,7 @@ }, "s3Key": "73b60c2cf141bf58c33cfaa33858f5c84103a0232ba7192d696536488f7731c4.zip" }, - "description": "AWS CDK resource provider framework - onTimeout (aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider)", + "description": "AWS CDK resource provider framework - onTimeout (aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider)", "environment": { "variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -6805,15 +6805,15 @@ }, "waiter-state-machine": { "id": "waiter-state-machine", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/waiter-state-machine", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/waiter-state-machine", "children": { "Role": { "id": "Role", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/waiter-state-machine/Role", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/waiter-state-machine/Role", "children": { "ImportRole": { "id": "ImportRole", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/waiter-state-machine/Role/ImportRole", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/waiter-state-machine/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -6821,7 +6821,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/waiter-state-machine/Role/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/waiter-state-machine/Role/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -6846,11 +6846,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/waiter-state-machine/Role/DefaultPolicy", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/waiter-state-machine/Role/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -6932,7 +6932,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/waiter-state-machine/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/Provider/waiter-state-machine/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -6950,25 +6950,25 @@ "version": "0.0.0" } }, - "awscdkeksclustertestawscdkawseksClusterResourceProviderOnEventHandlerServiceRole5B783C71Arn": { - "id": "awscdkeksclustertestawscdkawseksClusterResourceProviderOnEventHandlerServiceRole5B783C71Arn", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/awscdkeksclustertestawscdkawseksClusterResourceProviderOnEventHandlerServiceRole5B783C71Arn", + "awscdkeksclusteripv6testawscdkawseksClusterResourceProviderOnEventHandlerServiceRole6C18AE9AArn": { + "id": "awscdkeksclusteripv6testawscdkawseksClusterResourceProviderOnEventHandlerServiceRole6C18AE9AArn", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/awscdkeksclusteripv6testawscdkawseksClusterResourceProviderOnEventHandlerServiceRole6C18AE9AArn", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "awscdkeksclustertestawscdkawseksClusterResourceProviderIsCompleteHandlerServiceRole970DAC30Arn": { - "id": "awscdkeksclustertestawscdkawseksClusterResourceProviderIsCompleteHandlerServiceRole970DAC30Arn", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/awscdkeksclustertestawscdkawseksClusterResourceProviderIsCompleteHandlerServiceRole970DAC30Arn", + "awscdkeksclusteripv6testawscdkawseksClusterResourceProviderIsCompleteHandlerServiceRole1F912062Arn": { + "id": "awscdkeksclusteripv6testawscdkawseksClusterResourceProviderIsCompleteHandlerServiceRole1F912062Arn", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/awscdkeksclusteripv6testawscdkawseksClusterResourceProviderIsCompleteHandlerServiceRole1F912062Arn", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "awscdkeksclustertestawscdkawseksClusterResourceProviderframeworkonEvent503C1667Arn": { - "id": "awscdkeksclustertestawscdkawseksClusterResourceProviderframeworkonEvent503C1667Arn", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider/awscdkeksclustertestawscdkawseksClusterResourceProviderframeworkonEvent503C1667Arn", + "awscdkeksclusteripv6testawscdkawseksClusterResourceProviderframeworkonEvent27EA7496Arn": { + "id": "awscdkeksclusteripv6testawscdkawseksClusterResourceProviderframeworkonEvent27EA7496Arn", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider/awscdkeksclusteripv6testawscdkawseksClusterResourceProviderframeworkonEvent27EA7496Arn", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -6982,11 +6982,11 @@ }, "@aws-cdk--aws-eks.ClusterResourceProvider.NestedStack": { "id": "@aws-cdk--aws-eks.ClusterResourceProvider.NestedStack", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider.NestedStack", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider.NestedStack", "children": { "@aws-cdk--aws-eks.ClusterResourceProvider.NestedStackResource": { "id": "@aws-cdk--aws-eks.ClusterResourceProvider.NestedStackResource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.ClusterResourceProvider.NestedStack/@aws-cdk--aws-eks.ClusterResourceProvider.NestedStackResource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.ClusterResourceProvider.NestedStack/@aws-cdk--aws-eks.ClusterResourceProvider.NestedStackResource", "attributes": { "aws:cdk:cloudformation:type": "AWS::CloudFormation::Stack", "aws:cdk:cloudformation:props": { @@ -7002,7 +7002,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "/38d703160bc45251d27e806080a42e0e3e95a76199d0d1342c10c86a6a132f01.json" + "/64046515013419724c0ca215fe4d8d669956a8ca5130f0e9c0d33ae7bf4b7f6a.json" ] ] } @@ -7021,19 +7021,19 @@ }, "@aws-cdk--aws-eks.KubectlProvider": { "id": "@aws-cdk--aws-eks.KubectlProvider", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider", "children": { "Handler": { "id": "Handler", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Handler", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Handler", "children": { "Code": { "id": "Code", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Handler/Code", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Handler/Code", "children": { "Stage": { "id": "Stage", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Handler/Code/Stage", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Handler/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -7041,7 +7041,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Handler/Code/AssetBucket", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Handler/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -7055,7 +7055,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Handler/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Handler/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -7072,27 +7072,27 @@ "Ref": "AwsCliLayerF44AAF94" }, { - "Ref": "referencetoawscdkeksclustertestKubectlLayerD8FA674ERef" + "Ref": "referencetoawscdkeksclusteripv6testKubectlLayer6BCCECB5Ref" } ], "memorySize": 1024, "role": { - "Ref": "referencetoawscdkeksclustertestClusterKubectlHandlerRoleA258E53AArn" + "Ref": "referencetoawscdkeksclusteripv6testClusterKubectlHandlerRoleCDF70F2CArn" }, "runtime": "python3.7", "timeout": 900, "vpcConfig": { "subnetIds": [ { - "Ref": "referencetoawscdkeksclustertestVpcPrivateSubnet1Subnet32A4EC2ARef" + "Ref": "referencetoawscdkeksclusteripv6testVpcPrivateSubnet1Subnet8169B811Ref" }, { - "Ref": "referencetoawscdkeksclustertestVpcPrivateSubnet2Subnet5CC53627Ref" + "Ref": "referencetoawscdkeksclusteripv6testVpcPrivateSubnet2Subnet21732C40Ref" } ], "securityGroupIds": [ { - "Ref": "referencetoawscdkeksclustertestClusterD76DFF87ClusterSecurityGroupId" + "Ref": "referencetoawscdkeksclusteripv6testCluster1C21F8EDClusterSecurityGroupId" } ] } @@ -7111,15 +7111,15 @@ }, "AwsCliLayer": { "id": "AwsCliLayer", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/AwsCliLayer", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/AwsCliLayer", "children": { "Code": { "id": "Code", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/AwsCliLayer/Code", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/AwsCliLayer/Code", "children": { "Stage": { "id": "Stage", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/AwsCliLayer/Code/Stage", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/AwsCliLayer/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -7127,7 +7127,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/AwsCliLayer/Code/AssetBucket", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/AwsCliLayer/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -7141,7 +7141,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/AwsCliLayer/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/AwsCliLayer/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::LayerVersion", "aws:cdk:cloudformation:props": { @@ -7149,7 +7149,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -7167,7 +7167,7 @@ }, "ConditionalPolicyArn": { "id": "ConditionalPolicyArn", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/ConditionalPolicyArn", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/ConditionalPolicyArn", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -7175,7 +7175,7 @@ }, "conditionalPolicy": { "id": "conditionalPolicy", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/conditionalPolicy", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/conditionalPolicy", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -7183,19 +7183,19 @@ }, "Provider": { "id": "Provider", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Provider", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Provider", "children": { "framework-onEvent": { "id": "framework-onEvent", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/ServiceRole", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/ServiceRole/ImportServiceRole", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -7203,7 +7203,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/ServiceRole/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -7254,11 +7254,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -7320,11 +7320,11 @@ }, "Code": { "id": "Code", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/Code", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/Code", "children": { "Stage": { "id": "Stage", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/Code/Stage", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -7332,7 +7332,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/Code/AssetBucket", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -7346,7 +7346,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Provider/framework-onEvent/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -7356,7 +7356,7 @@ }, "s3Key": "73b60c2cf141bf58c33cfaa33858f5c84103a0232ba7192d696536488f7731c4.zip" }, - "description": "AWS CDK resource provider framework - onEvent (aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/Provider)", + "description": "AWS CDK resource provider framework - onEvent (aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/Provider)", "environment": { "variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -7379,15 +7379,15 @@ "vpcConfig": { "subnetIds": [ { - "Ref": "referencetoawscdkeksclustertestVpcPrivateSubnet1Subnet32A4EC2ARef" + "Ref": "referencetoawscdkeksclusteripv6testVpcPrivateSubnet1Subnet8169B811Ref" }, { - "Ref": "referencetoawscdkeksclustertestVpcPrivateSubnet2Subnet5CC53627Ref" + "Ref": "referencetoawscdkeksclusteripv6testVpcPrivateSubnet2Subnet21732C40Ref" } ], "securityGroupIds": [ { - "Ref": "referencetoawscdkeksclustertestClusterD76DFF87ClusterSecurityGroupId" + "Ref": "referencetoawscdkeksclusteripv6testCluster1C21F8EDClusterSecurityGroupId" } ] } @@ -7410,49 +7410,49 @@ "version": "0.0.0" } }, - "awscdkeksclustertestawscdkawseksKubectlProviderframeworkonEventC681B49AArn": { - "id": "awscdkeksclustertestawscdkawseksKubectlProviderframeworkonEventC681B49AArn", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/awscdkeksclustertestawscdkawseksKubectlProviderframeworkonEventC681B49AArn", + "awscdkeksclusteripv6testawscdkawseksKubectlProviderframeworkonEvent383976A6Arn": { + "id": "awscdkeksclusteripv6testawscdkawseksKubectlProviderframeworkonEvent383976A6Arn", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/awscdkeksclusteripv6testawscdkawseksKubectlProviderframeworkonEvent383976A6Arn", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "reference-to-awscdkeksclustertestKubectlLayerD8FA674ERef": { - "id": "reference-to-awscdkeksclustertestKubectlLayerD8FA674ERef", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/reference-to-awscdkeksclustertestKubectlLayerD8FA674ERef", + "reference-to-awscdkeksclusteripv6testKubectlLayer6BCCECB5Ref": { + "id": "reference-to-awscdkeksclusteripv6testKubectlLayer6BCCECB5Ref", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/reference-to-awscdkeksclusteripv6testKubectlLayer6BCCECB5Ref", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" } }, - "reference-to-awscdkeksclustertestClusterKubectlHandlerRoleA258E53AArn": { - "id": "reference-to-awscdkeksclustertestClusterKubectlHandlerRoleA258E53AArn", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/reference-to-awscdkeksclustertestClusterKubectlHandlerRoleA258E53AArn", + "reference-to-awscdkeksclusteripv6testClusterKubectlHandlerRoleCDF70F2CArn": { + "id": "reference-to-awscdkeksclusteripv6testClusterKubectlHandlerRoleCDF70F2CArn", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/reference-to-awscdkeksclusteripv6testClusterKubectlHandlerRoleCDF70F2CArn", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" } }, - "reference-to-awscdkeksclustertestVpcPrivateSubnet1Subnet32A4EC2ARef": { - "id": "reference-to-awscdkeksclustertestVpcPrivateSubnet1Subnet32A4EC2ARef", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/reference-to-awscdkeksclustertestVpcPrivateSubnet1Subnet32A4EC2ARef", + "reference-to-awscdkeksclusteripv6testVpcPrivateSubnet1Subnet8169B811Ref": { + "id": "reference-to-awscdkeksclusteripv6testVpcPrivateSubnet1Subnet8169B811Ref", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/reference-to-awscdkeksclusteripv6testVpcPrivateSubnet1Subnet8169B811Ref", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" } }, - "reference-to-awscdkeksclustertestVpcPrivateSubnet2Subnet5CC53627Ref": { - "id": "reference-to-awscdkeksclustertestVpcPrivateSubnet2Subnet5CC53627Ref", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/reference-to-awscdkeksclustertestVpcPrivateSubnet2Subnet5CC53627Ref", + "reference-to-awscdkeksclusteripv6testVpcPrivateSubnet2Subnet21732C40Ref": { + "id": "reference-to-awscdkeksclusteripv6testVpcPrivateSubnet2Subnet21732C40Ref", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/reference-to-awscdkeksclusteripv6testVpcPrivateSubnet2Subnet21732C40Ref", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" } }, - "reference-to-awscdkeksclustertestClusterD76DFF87ClusterSecurityGroupId": { - "id": "reference-to-awscdkeksclustertestClusterD76DFF87ClusterSecurityGroupId", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider/reference-to-awscdkeksclustertestClusterD76DFF87ClusterSecurityGroupId", + "reference-to-awscdkeksclusteripv6testCluster1C21F8EDClusterSecurityGroupId": { + "id": "reference-to-awscdkeksclusteripv6testCluster1C21F8EDClusterSecurityGroupId", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider/reference-to-awscdkeksclusteripv6testCluster1C21F8EDClusterSecurityGroupId", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -7466,31 +7466,31 @@ }, "@aws-cdk--aws-eks.KubectlProvider.NestedStack": { "id": "@aws-cdk--aws-eks.KubectlProvider.NestedStack", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider.NestedStack", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider.NestedStack", "children": { "@aws-cdk--aws-eks.KubectlProvider.NestedStackResource": { "id": "@aws-cdk--aws-eks.KubectlProvider.NestedStackResource", - "path": "aws-cdk-eks-cluster-test/@aws-cdk--aws-eks.KubectlProvider.NestedStack/@aws-cdk--aws-eks.KubectlProvider.NestedStackResource", + "path": "aws-cdk-eks-cluster-ipv6-test/@aws-cdk--aws-eks.KubectlProvider.NestedStack/@aws-cdk--aws-eks.KubectlProvider.NestedStackResource", "attributes": { "aws:cdk:cloudformation:type": "AWS::CloudFormation::Stack", "aws:cdk:cloudformation:props": { "parameters": { - "referencetoawscdkeksclustertestKubectlLayerD8FA674ERef": { + "referencetoawscdkeksclusteripv6testKubectlLayer6BCCECB5Ref": { "Ref": "KubectlLayer600207B5" }, - "referencetoawscdkeksclustertestClusterKubectlHandlerRoleA258E53AArn": { + "referencetoawscdkeksclusteripv6testClusterKubectlHandlerRoleCDF70F2CArn": { "Fn::GetAtt": [ "ClusterKubectlHandlerRole94549F93", "Arn" ] }, - "referencetoawscdkeksclustertestVpcPrivateSubnet1Subnet32A4EC2ARef": { + "referencetoawscdkeksclusteripv6testVpcPrivateSubnet1Subnet8169B811Ref": { "Ref": "VpcPrivateSubnet1Subnet536B997A" }, - "referencetoawscdkeksclustertestVpcPrivateSubnet2Subnet5CC53627Ref": { + "referencetoawscdkeksclusteripv6testVpcPrivateSubnet2Subnet21732C40Ref": { "Ref": "VpcPrivateSubnet2Subnet3788AAA1" }, - "referencetoawscdkeksclustertestClusterD76DFF87ClusterSecurityGroupId": { + "referencetoawscdkeksclusteripv6testCluster1C21F8EDClusterSecurityGroupId": { "Fn::GetAtt": [ "Cluster9EE0221C", "ClusterSecurityGroupId" @@ -7509,7 +7509,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "/c4dcedad1cadbfa87852da53c1c41533ef51e3bd1395cd2d70fffb677c3c81a9.json" + "/93843e4b671dc93f732e6d83b774f771506bee567af9b86071390b802cbc4d66.json" ] ] } @@ -7528,7 +7528,7 @@ }, "SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": { "id": "SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", - "path": "aws-cdk-eks-cluster-test/SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "path": "aws-cdk-eks-cluster-ipv6-test/SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -7536,7 +7536,7 @@ }, "SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118": { "id": "SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", - "path": "aws-cdk-eks-cluster-test/SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", + "path": "aws-cdk-eks-cluster-ipv6-test/SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -7544,7 +7544,7 @@ }, "SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2-arm64--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": { "id": "SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2-arm64--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", - "path": "aws-cdk-eks-cluster-test/SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2-arm64--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "path": "aws-cdk-eks-cluster-ipv6-test/SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2-arm64--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -7552,7 +7552,7 @@ }, "SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2-arm64--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118": { "id": "SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2-arm64--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", - "path": "aws-cdk-eks-cluster-test/SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2-arm64--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", + "path": "aws-cdk-eks-cluster-ipv6-test/SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2-arm64--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -7560,7 +7560,7 @@ }, "SsmParameterValue:--aws--service--bottlerocket--aws-k8s-1.24--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": { "id": "SsmParameterValue:--aws--service--bottlerocket--aws-k8s-1.24--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", - "path": "aws-cdk-eks-cluster-test/SsmParameterValue:--aws--service--bottlerocket--aws-k8s-1.24--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "path": "aws-cdk-eks-cluster-ipv6-test/SsmParameterValue:--aws--service--bottlerocket--aws-k8s-1.24--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -7568,7 +7568,7 @@ }, "SsmParameterValue:--aws--service--bottlerocket--aws-k8s-1.24--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118": { "id": "SsmParameterValue:--aws--service--bottlerocket--aws-k8s-1.24--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", - "path": "aws-cdk-eks-cluster-test/SsmParameterValue:--aws--service--bottlerocket--aws-k8s-1.24--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", + "path": "aws-cdk-eks-cluster-ipv6-test/SsmParameterValue:--aws--service--bottlerocket--aws-k8s-1.24--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -7576,7 +7576,7 @@ }, "SsmParameterValue:--aws--service--eks--optimized-ami--1.25--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": { "id": "SsmParameterValue:--aws--service--eks--optimized-ami--1.25--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", - "path": "aws-cdk-eks-cluster-test/SsmParameterValue:--aws--service--eks--optimized-ami--1.25--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "path": "aws-cdk-eks-cluster-ipv6-test/SsmParameterValue:--aws--service--eks--optimized-ami--1.25--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -7584,7 +7584,7 @@ }, "SsmParameterValue:--aws--service--eks--optimized-ami--1.25--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118": { "id": "SsmParameterValue:--aws--service--eks--optimized-ami--1.25--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", - "path": "aws-cdk-eks-cluster-test/SsmParameterValue:--aws--service--eks--optimized-ami--1.25--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", + "path": "aws-cdk-eks-cluster-ipv6-test/SsmParameterValue:--aws--service--eks--optimized-ami--1.25--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -7592,7 +7592,7 @@ }, "LaunchTemplate": { "id": "LaunchTemplate", - "path": "aws-cdk-eks-cluster-test/LaunchTemplate", + "path": "aws-cdk-eks-cluster-ipv6-test/LaunchTemplate", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::LaunchTemplate", "aws:cdk:cloudformation:props": { @@ -7624,15 +7624,15 @@ }, "HelloAppWithoutValidation": { "id": "HelloAppWithoutValidation", - "path": "aws-cdk-eks-cluster-test/HelloAppWithoutValidation", + "path": "aws-cdk-eks-cluster-ipv6-test/HelloAppWithoutValidation", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-eks-cluster-test/HelloAppWithoutValidation/Resource", + "path": "aws-cdk-eks-cluster-ipv6-test/HelloAppWithoutValidation/Resource", "children": { "Default": { "id": "Default", - "path": "aws-cdk-eks-cluster-test/HelloAppWithoutValidation/Resource/Default", + "path": "aws-cdk-eks-cluster-ipv6-test/HelloAppWithoutValidation/Resource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -7652,11 +7652,11 @@ }, "ChartAsset": { "id": "ChartAsset", - "path": "aws-cdk-eks-cluster-test/ChartAsset", + "path": "aws-cdk-eks-cluster-ipv6-test/ChartAsset", "children": { "Stage": { "id": "Stage", - "path": "aws-cdk-eks-cluster-test/ChartAsset/Stage", + "path": "aws-cdk-eks-cluster-ipv6-test/ChartAsset/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -7664,7 +7664,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-cdk-eks-cluster-test/ChartAsset/AssetBucket", + "path": "aws-cdk-eks-cluster-ipv6-test/ChartAsset/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -7678,11 +7678,11 @@ }, "Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider": { "id": "Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider", - "path": "aws-cdk-eks-cluster-test/Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider", + "path": "aws-cdk-eks-cluster-ipv6-test/Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider", "children": { "Staging": { "id": "Staging", - "path": "aws-cdk-eks-cluster-test/Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider/Staging", + "path": "aws-cdk-eks-cluster-ipv6-test/Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -7690,7 +7690,7 @@ }, "Role": { "id": "Role", - "path": "aws-cdk-eks-cluster-test/Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider/Role", + "path": "aws-cdk-eks-cluster-ipv6-test/Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -7698,7 +7698,7 @@ }, "Handler": { "id": "Handler", - "path": "aws-cdk-eks-cluster-test/Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider/Handler", + "path": "aws-cdk-eks-cluster-ipv6-test/Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -7712,11 +7712,11 @@ }, "AWSCDKCfnUtilsProviderCustomResourceProvider": { "id": "AWSCDKCfnUtilsProviderCustomResourceProvider", - "path": "aws-cdk-eks-cluster-test/AWSCDKCfnUtilsProviderCustomResourceProvider", + "path": "aws-cdk-eks-cluster-ipv6-test/AWSCDKCfnUtilsProviderCustomResourceProvider", "children": { "Staging": { "id": "Staging", - "path": "aws-cdk-eks-cluster-test/AWSCDKCfnUtilsProviderCustomResourceProvider/Staging", + "path": "aws-cdk-eks-cluster-ipv6-test/AWSCDKCfnUtilsProviderCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -7724,7 +7724,7 @@ }, "Role": { "id": "Role", - "path": "aws-cdk-eks-cluster-test/AWSCDKCfnUtilsProviderCustomResourceProvider/Role", + "path": "aws-cdk-eks-cluster-ipv6-test/AWSCDKCfnUtilsProviderCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -7732,7 +7732,7 @@ }, "Handler": { "id": "Handler", - "path": "aws-cdk-eks-cluster-test/AWSCDKCfnUtilsProviderCustomResourceProvider/Handler", + "path": "aws-cdk-eks-cluster-ipv6-test/AWSCDKCfnUtilsProviderCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -7746,7 +7746,7 @@ }, "ClusterEndpoint": { "id": "ClusterEndpoint", - "path": "aws-cdk-eks-cluster-test/ClusterEndpoint", + "path": "aws-cdk-eks-cluster-ipv6-test/ClusterEndpoint", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -7754,7 +7754,7 @@ }, "ClusterArn": { "id": "ClusterArn", - "path": "aws-cdk-eks-cluster-test/ClusterArn", + "path": "aws-cdk-eks-cluster-ipv6-test/ClusterArn", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -7762,7 +7762,7 @@ }, "ClusterCertificateAuthorityData": { "id": "ClusterCertificateAuthorityData", - "path": "aws-cdk-eks-cluster-test/ClusterCertificateAuthorityData", + "path": "aws-cdk-eks-cluster-ipv6-test/ClusterCertificateAuthorityData", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -7770,7 +7770,7 @@ }, "ClusterSecurityGroupId": { "id": "ClusterSecurityGroupId", - "path": "aws-cdk-eks-cluster-test/ClusterSecurityGroupId", + "path": "aws-cdk-eks-cluster-ipv6-test/ClusterSecurityGroupId", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -7778,7 +7778,7 @@ }, "ClusterEncryptionConfigKeyArn": { "id": "ClusterEncryptionConfigKeyArn", - "path": "aws-cdk-eks-cluster-test/ClusterEncryptionConfigKeyArn", + "path": "aws-cdk-eks-cluster-ipv6-test/ClusterEncryptionConfigKeyArn", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -7786,7 +7786,7 @@ }, "ClusterName": { "id": "ClusterName", - "path": "aws-cdk-eks-cluster-test/ClusterName", + "path": "aws-cdk-eks-cluster-ipv6-test/ClusterName", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -7794,7 +7794,7 @@ }, "BootstrapVersion": { "id": "BootstrapVersion", - "path": "aws-cdk-eks-cluster-test/BootstrapVersion", + "path": "aws-cdk-eks-cluster-ipv6-test/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -7802,7 +7802,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "aws-cdk-eks-cluster-test/CheckBootstrapVersion", + "path": "aws-cdk-eks-cluster-ipv6-test/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" @@ -7814,17 +7814,17 @@ "version": "0.0.0" } }, - "aws-cdk-eks-cluster": { - "id": "aws-cdk-eks-cluster", - "path": "aws-cdk-eks-cluster", + "aws-cdk-eks-cluster-ipv6": { + "id": "aws-cdk-eks-cluster-ipv6", + "path": "aws-cdk-eks-cluster-ipv6", "children": { "DefaultTest": { "id": "DefaultTest", - "path": "aws-cdk-eks-cluster/DefaultTest", + "path": "aws-cdk-eks-cluster-ipv6/DefaultTest", "children": { "Default": { "id": "Default", - "path": "aws-cdk-eks-cluster/DefaultTest/Default", + "path": "aws-cdk-eks-cluster-ipv6/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", "version": "10.2.55" @@ -7832,11 +7832,11 @@ }, "DeployAssert": { "id": "DeployAssert", - "path": "aws-cdk-eks-cluster/DefaultTest/DeployAssert", + "path": "aws-cdk-eks-cluster-ipv6/DefaultTest/DeployAssert", "children": { "BootstrapVersion": { "id": "BootstrapVersion", - "path": "aws-cdk-eks-cluster/DefaultTest/DeployAssert/BootstrapVersion", + "path": "aws-cdk-eks-cluster-ipv6/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -7844,7 +7844,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "aws-cdk-eks-cluster/DefaultTest/DeployAssert/CheckBootstrapVersion", + "path": "aws-cdk-eks-cluster-ipv6/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.ts index a7da5363c5bbe..106efea8e152e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-ipv6.ts @@ -163,6 +163,16 @@ class EksClusterStack extends Stack { repository: 'https://helm.nginx.com/stable', namespace: 'nginx', wait: true, + release: 'nginx-ingress', + // https://github.com/nginxinc/helm-charts/tree/master/stable + version: '0.17.1', + values: { + controller: { + service: { + create: false, + }, + }, + }, createNamespace: false, timeout: Duration.minutes(15), }); @@ -194,6 +204,8 @@ class EksClusterStack extends Stack { // deploy the Kubernetes dashboard through a helm chart this.cluster.addHelmChart('dashboard', { chart: 'kubernetes-dashboard', + // https://artifacthub.io/packages/helm/k8s-dashboard/kubernetes-dashboard + version: '6.0.8', repository: 'https://kubernetes.github.io/dashboard/', }); } @@ -349,7 +361,7 @@ const app = new App(); // since the EKS optimized AMI is hard-coded here based on the region, // we need to actually pass in a specific region. -const stack = new EksClusterStack(app, 'aws-cdk-eks-cluster-test', { +const stack = new EksClusterStack(app, 'aws-cdk-eks-cluster-ipv6-test', { env: { region: 'us-east-1' }, }); @@ -368,7 +380,7 @@ if (process.env.CDK_INTEG_ACCOUNT !== '12345678') { } -new integ.IntegTest(app, 'aws-cdk-eks-cluster', { +new integ.IntegTest(app, 'aws-cdk-eks-cluster-ipv6', { testCases: [stack], diffAssets: true, cdkCommandOptions: { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip deleted file mode 100644 index e6cb898734b43..0000000000000 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and /dev/null differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js deleted file mode 100644 index b89707a0a08e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js +++ /dev/null @@ -1,277 +0,0 @@ -"use strict"; -/* eslint-disable no-console */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ClusterResourceHandler = void 0; -const common_1 = require("./common"); -const compareLogging_1 = require("./compareLogging"); -const MAX_CLUSTER_NAME_LEN = 100; -class ClusterResourceHandler extends common_1.ResourceHandler { - get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - return this.physicalResourceId; - } - constructor(eks, event) { - super(eks, event); - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - // ------ - // CREATE - // ------ - async onCreate() { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - const clusterName = this.newProps.name || this.generateClusterName(); - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - return { - PhysicalResourceId: resp.cluster.name, - }; - } - async isCreateComplete() { - return this.isActive(); - } - // ------ - // DELETE - // ------ - async onDelete() { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } - catch (e) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } - else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - async isDeleteComplete() { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } - catch (e) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - console.log('describeCluster error:', e); - throw e; - } - return { - IsComplete: false, - }; - } - // ------ - // UPDATE - // ------ - async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - return this.onCreate(); - } - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - return this.updateClusterVersion(this.newProps.version); - } - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - if (updates.updateLogging || updates.updateAccess) { - const config = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - } - ; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - return { EksUpdateId: updateResponse.update?.id }; - } - // no updates - return; - } - async isUpdateComplete() { - console.log('isUpdateComplete'); - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - return this.isActive(); - } - async updateClusterVersion(newVersion) { - console.log(`updating cluster version to ${newVersion}`); - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - async isActive() { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } - else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } - else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - async isEksUpdateComplete(eksUpdateId) { - this.log({ isEksUpdateComplete: eksUpdateId }); - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - this.log({ describeUpdateResponse }); - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} -exports.ClusterResourceHandler = ClusterResourceHandler; -function parseProps(props) { - const parsed = props?.Config ?? {}; - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - return parsed; -} -function analyzeUpdate(oldProps, newProps) { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} -function setsEqual(first, second) { - return first.size === second.size && [...first].every((e) => second.has(e)); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBSy9CLHFDQUFxRTtBQ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LnN0cmluZ2lmeShuZXdQcm9wcy5sb2dnaW5nKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkUHJvcHMubG9nZ2luZyksXG4gIH07XG59XG5cbmZ1bmN0aW9uIHNldHNFcXVhbChmaXJzdDogU2V0PHN0cmluZz4sIHNlY29uZDogU2V0PHN0cmluZz4pIHtcbiAgcmV0dXJuIGZpcnN0LnNpemUgPT09IHNlY29uZC5zaXplICYmIFsuLi5maXJzdF0uZXZlcnkoKGU6IHN0cmluZykgPT4gc2Vjb25kLmhhcyhlKSk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts deleted file mode 100644 index c058e47b62c68..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts +++ /dev/null @@ -1,348 +0,0 @@ -/* eslint-disable no-console */ - -// eslint-disable-next-line import/no-extraneous-dependencies -// eslint-disable-next-line import/no-extraneous-dependencies -import * as aws from 'aws-sdk'; -import { EksClient, ResourceEvent, ResourceHandler } from './common'; -import { compareLoggingProps } from './compareLogging'; -import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; - -const MAX_CLUSTER_NAME_LEN = 100; - -export class ClusterResourceHandler extends ResourceHandler { - public get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - - return this.physicalResourceId; - } - - private readonly newProps: aws.EKS.CreateClusterRequest; - private readonly oldProps: Partial; - - constructor(eks: EksClient, event: ResourceEvent) { - super(eks, event); - - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - - // ------ - // CREATE - // ------ - - protected async onCreate(): Promise { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - - const clusterName = this.newProps.name || this.generateClusterName(); - - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - - return { - PhysicalResourceId: resp.cluster.name, - }; - } - - protected async isCreateComplete() { - return this.isActive(); - } - - // ------ - // DELETE - // ------ - - protected async onDelete(): Promise { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } catch (e: any) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - - protected async isDeleteComplete(): Promise { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } catch (e: any) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - - console.log('describeCluster error:', e); - throw e; - } - - return { - IsComplete: false, - }; - } - - // ------ - // UPDATE - // ------ - - protected async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - - return this.onCreate(); - } - - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - - return this.updateClusterVersion(this.newProps.version); - } - - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - - if (updates.updateLogging || updates.updateAccess) { - const config: aws.EKS.UpdateClusterConfigRequest = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - }; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - - return { EksUpdateId: updateResponse.update?.id }; - } - - // no updates - return; - } - - protected async isUpdateComplete() { - console.log('isUpdateComplete'); - - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - - return this.isActive(); - } - - private async updateClusterVersion(newVersion: string) { - console.log(`updating cluster version to ${newVersion}`); - - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - - private async isActive(): Promise { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url - - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - - private async isEksUpdateComplete(eksUpdateId: string) { - this.log({ isEksUpdateComplete: eksUpdateId }); - - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - - this.log({ describeUpdateResponse }); - - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - - private generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} - -function parseProps(props: any): aws.EKS.CreateClusterRequest { - - const parsed = props?.Config ?? {}; - - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - - return parsed; - -} - -interface UpdateMap { - replaceName: boolean; // name - replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds - replaceRole: boolean; // roleArn - - updateVersion: boolean; // version - updateLogging: boolean; // logging - updateEncryption: boolean; // encryption (cannot be updated) - updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess -} - -function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: - JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: - newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} - -function setsEqual(first: Set, second: Set) { - return first.size === second.size && [...first].every((e: string) => second.has(e)); -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js deleted file mode 100644 index 34ab6ff0ba0e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FargateProfileResourceHandler = void 0; -const common_1 = require("./common"); -const MAX_NAME_LEN = 63; -class FargateProfileResourceHandler extends common_1.ResourceHandler { - async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - const createFargateProfile = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - const deleteFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - return; - } - async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - async isCreateComplete() { - return this.isUpdateComplete(); - } - async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - /** - * Generates a fargate profile name. - */ - generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - async queryStatus() { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - const describeFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - try { - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - return status; - } - catch (describeFargateProfileError) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} -exports.FargateProfileResourceHandler = FargateProfileResourceHandler; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EscUNBQTJDO0FBRTNDLE1BQU0sWUFBWSxHQUFHLEVBQUUsQ0FBQztBQUV4QixNQUFhLDZCQUE4QixTQUFRLHdCQUFlO0lBQ3RELEtBQUssQ0FBQyxRQUFRO1FBQ3RCLE1BQU0sa0JBQWtCLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNLENBQUMsa0JBQWtCLElBQUksSUFBSSxDQUFDLG1CQUFtQixFQUFFLENBQUM7UUFFakgsTUFBTSxvQkFBb0IsR0FBd0M7WUFDaEUsa0JBQWtCO1lBQ2xCLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0F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AgICAgIGlmIChkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IuY29kZSA9PT0gJ1Jlc291cmNlTm90Rm91bmRFeGNlcHRpb24nKSB7XG4gICAgICAgIHRoaXMubG9nKCdyZWNlaXZlZCBSZXNvdXJjZU5vdEZvdW5kRXhjZXB0aW9uLCB0aGlzIG1lYW5zIHRoZSBwcm9maWxlIGhhcyBiZWVuIGRlbGV0ZWQgKG9yIG5ldmVyIGV4aXN0ZWQpJyk7XG4gICAgICAgIHJldHVybiAnTk9UX0ZPVU5EJztcbiAgICAgIH1cblxuICAgICAgdGhpcy5sb2coeyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IgfSk7XG4gICAgICB0aHJvdyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3I7XG4gICAgfVxuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts deleted file mode 100644 index 7db97a7f69d38..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts +++ /dev/null @@ -1,119 +0,0 @@ -import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies -import { ResourceHandler } from './common'; - -const MAX_NAME_LEN = 63; - -export class FargateProfileResourceHandler extends ResourceHandler { - protected async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - - const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - - protected async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - - const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - - return; - } - - protected async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - - protected async isCreateComplete() { - return this.isUpdateComplete(); - } - - protected async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - - protected async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - - /** - * Generates a fargate profile name. - */ - private generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - private async queryStatus(): Promise { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - - const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - try { - - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - - return status; - } catch (describeFargateProfileError: any) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js new file mode 100644 index 0000000000000..aefb970a3fe47 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js @@ -0,0 +1,280 @@ +"use strict"; +/* eslint-disable no-console */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClusterResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const compareLogging_1 = require("./compareLogging"); +const MAX_CLUSTER_NAME_LEN = 100; +class ClusterResourceHandler extends common_1.ResourceHandler { + get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + return this.physicalResourceId; + } + constructor(eks, event) { + super(eks, event); + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + // ------ + // CREATE + // ------ + async onCreate() { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + const clusterName = this.newProps.name || this.generateClusterName(); + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + return { + PhysicalResourceId: resp.cluster.name, + }; + } + async isCreateComplete() { + return this.isActive(); + } + // ------ + // DELETE + // ------ + async onDelete() { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } + catch (e) { + if (!(e instanceof client_eks_1.ResourceNotFoundException)) { + throw e; + } + else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + async isDeleteComplete() { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } + catch (e) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof client_eks_1.ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + console.log('describeCluster error:', e); + throw e; + } + return { + IsComplete: false, + }; + } + // ------ + // UPDATE + // ------ + async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + return this.onCreate(); + } + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + return this.updateClusterVersion(this.newProps.version); + } + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + if (updates.updateLogging || updates.updateAccess) { + const config = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + } + ; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + return { EksUpdateId: updateResponse.update?.id }; + } + // no updates + return; + } + async isUpdateComplete() { + console.log('isUpdateComplete'); + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + return this.isActive(); + } + async updateClusterVersion(newVersion) { + console.log(`updating cluster version to ${newVersion}`); + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + async isActive() { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } + else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } + else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + async isEksUpdateComplete(eksUpdateId) { + this.log({ isEksUpdateComplete: eksUpdateId }); + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + this.log({ describeUpdateResponse }); + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} +exports.ClusterResourceHandler = ClusterResourceHandler; +function parseProps(props) { + const parsed = props?.Config ?? {}; + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + return parsed; +} +function analyzeUpdate(oldProps, newProps) { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} +function setsEqual(first, second) { + return first.size === second.size && [...first].every((e) => second.has(e)); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBRS9CLDZEQUE2RDtBQUM3RCxvREFBZ0U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zaW9uICE9PSBvbGRQcm9wcy52ZXJzaW9uLFxuICAgIHVwZGF0ZUVuY3J5cHRpb246IEpTT04uc3RyaW5naWZ5KG5ld0VuYykgIT09IEpTT04uc3RyaW5naWZ5KG9sZEVuYyksXG4gICAgdXBkYXRlTG9nZ2luZzogSlNPTi5zdHJpbmdpZnkobmV3UHJvcHMubG9nZ2luZykgIT09IEpTT04uc3RyaW5naWZ5KG9sZFByb3BzLmxvZ2dpbmcpLFxuICB9O1xufVxuXG5mdW5jdGlvbiBzZXRzRXF1YWwoZmlyc3Q6IFNldDxzdHJpbmc+LCBzZWNvbmQ6IFNldDxzdHJpbmc+KSB7XG4gIHJldHVybiBmaXJzdC5zaXplID09PSBzZWNvbmQuc2l6ZSAmJiBbLi4uZmlyc3RdLmV2ZXJ5KChlOiBzdHJpbmcpID0+IHNlY29uZC5oYXMoZSkpO1xufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts new file mode 100644 index 0000000000000..3a0a7294db31d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts @@ -0,0 +1,350 @@ +/* eslint-disable no-console */ + +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +// eslint-disable-next-line import/no-extraneous-dependencies +import * as aws from 'aws-sdk'; +import { EksClient, ResourceEvent, ResourceHandler } from './common'; +import { compareLoggingProps } from './compareLogging'; +import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; + +const MAX_CLUSTER_NAME_LEN = 100; + +export class ClusterResourceHandler extends ResourceHandler { + public get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + + return this.physicalResourceId; + } + + private readonly newProps: aws.EKS.CreateClusterRequest; + private readonly oldProps: Partial; + + constructor(eks: EksClient, event: ResourceEvent) { + super(eks, event); + + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + + // ------ + // CREATE + // ------ + + protected async onCreate(): Promise { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + + const clusterName = this.newProps.name || this.generateClusterName(); + + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + + return { + PhysicalResourceId: resp.cluster.name, + }; + } + + protected async isCreateComplete() { + return this.isActive(); + } + + // ------ + // DELETE + // ------ + + protected async onDelete(): Promise { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } catch (e: any) { + if (!(e instanceof ResourceNotFoundException)) { + throw e; + } else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + + protected async isDeleteComplete(): Promise { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } catch (e: any) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + + console.log('describeCluster error:', e); + throw e; + } + + return { + IsComplete: false, + }; + } + + // ------ + // UPDATE + // ------ + + protected async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + + return this.onCreate(); + } + + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + + return this.updateClusterVersion(this.newProps.version); + } + + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + + if (updates.updateLogging || updates.updateAccess) { + const config: aws.EKS.UpdateClusterConfigRequest = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + }; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + + return { EksUpdateId: updateResponse.update?.id }; + } + + // no updates + return; + } + + protected async isUpdateComplete() { + console.log('isUpdateComplete'); + + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + + return this.isActive(); + } + + private async updateClusterVersion(newVersion: string) { + console.log(`updating cluster version to ${newVersion}`); + + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + + private async isActive(): Promise { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url + + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + + private async isEksUpdateComplete(eksUpdateId: string) { + this.log({ isEksUpdateComplete: eksUpdateId }); + + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + + this.log({ describeUpdateResponse }); + + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + + private generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} + +function parseProps(props: any): aws.EKS.CreateClusterRequest { + + const parsed = props?.Config ?? {}; + + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + + return parsed; + +} + +interface UpdateMap { + replaceName: boolean; // name + replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds + replaceRole: boolean; // roleArn + + updateVersion: boolean; // version + updateLogging: boolean; // logging + updateEncryption: boolean; // encryption (cannot be updated) + updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess +} + +function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: + JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: + newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} + +function setsEqual(first: Set, second: Set) { + return first.size === second.size && [...first].every((e: string) => second.has(e)); +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js new file mode 100644 index 0000000000000..ed1eab8530351 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FargateProfileResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const MAX_NAME_LEN = 63; +class FargateProfileResourceHandler extends common_1.ResourceHandler { + async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + const createFargateProfile = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + const deleteFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + return; + } + async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + async isCreateComplete() { + return this.isUpdateComplete(); + } + async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + /** + * Generates a fargate profile name. + */ + generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + async queryStatus() { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + const describeFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + try { + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + return status; + } + catch (describeFargateProfileError) { + if (describeFargateProfileError instanceof client_eks_1.ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} +exports.FargateProfileResourceHandler = FargateProfileResourceHandler; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsNkRBQTZEO0FBQzdELG9EQUFnRTtBQUVoRSxxQ0FBMkM7QUFFM0MsTUFBTSxZQUFZLEdBQUcsRUFBRSxDQUFDO0FBRXhCLE1BQWEsNkJBQThCLFNBQVEsd0JBQWU7SUFDdEQsS0FBSyxDQUFDLFFBQVE7UUFDdEIsTUFBTSxrQkFBa0IsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU0sQ0FBQyxrQkFBa0IsSUFBSSxJQUFJLENBQUMsbUJBQW1CLEVBQUUsQ0FBQztRQUVqSCxNQUFNLG9CQUFvQixHQUF3QztZQUNoRSxrQkFBa0I7WUFDbEIsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU07U0FDeEMsQ0FBQztRQUVGLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxvQkFBb0IsRUFBRSxDQUFDLENBQUM7UUFDbkMsTUFBTSw0QkFBNEIsR0FBRyxNQUFNLElBQUksQ0FBQyxHQUFHLENBQUMsb0JBQW9CLENBQUMsb0JBQW9CLENBQUMsQ0FBQztRQUMvRixJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsNEJBQTRCLEVBQUUsQ0FBQyxDQUFDO1FBRTNDLElBQUksQ0FBQyw0QkFBNEIsQ0FBQyxjQUFjLEVBQUU7WUFDaEQsTUFBT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YXMgYmVlbiBkZWxldGVkIChvciBuZXZlciBleGlzdGVkKScpO1xuICAgICAgICByZXR1cm4gJ05PVF9GT1VORCc7XG4gICAgICB9XG5cbiAgICAgIHRoaXMubG9nKHsgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yIH0pO1xuICAgICAgdGhyb3cgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yO1xuICAgIH1cbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts new file mode 100644 index 0000000000000..16b9f9abfeb49 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts @@ -0,0 +1,121 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies +import { ResourceHandler } from './common'; + +const MAX_NAME_LEN = 63; + +export class FargateProfileResourceHandler extends ResourceHandler { + protected async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + + const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + + protected async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + + const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + + return; + } + + protected async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + + protected async isCreateComplete() { + return this.isUpdateComplete(); + } + + protected async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + + protected async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + + /** + * Generates a fargate profile name. + */ + private generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + private async queryStatus(): Promise { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + + const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + try { + + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + + return status; + } catch (describeFargateProfileError: any) { + if (describeFargateProfileError instanceof ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip index 93f7400e6f8c2..11112de67d5be 100644 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip new file mode 100644 index 0000000000000..90a8a2a6e2615 Binary files /dev/null and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/aws-cdk-eks-cluster-private-endpoint-test.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/aws-cdk-eks-cluster-private-endpoint-test.assets.json index 5ca246d3ac590..a6cc4d127c22f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/aws-cdk-eks-cluster-private-endpoint-test.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/aws-cdk-eks-cluster-private-endpoint-test.assets.json @@ -27,15 +27,15 @@ } } }, - "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649": { + "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31": { "source": { - "path": "asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649", + "path": "asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip", + "objectKey": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -66,20 +66,20 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "482ca8a889ef1b56f0a620923f8132a8bdd7297b08cbe4c2d8d207f274ee62a9": { + "b28350e97c47c6d05a58b67ef5b49d2bac23a4ca223d6c32837948f98711e30b": { "source": { "path": "awscdkeksclusterprivateendpointtestawscdkawseksClusterResourceProvider67118CB1.nested.template.json", "packaging": "file" @@ -87,12 +87,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "482ca8a889ef1b56f0a620923f8132a8bdd7297b08cbe4c2d8d207f274ee62a9.json", + "objectKey": "b28350e97c47c6d05a58b67ef5b49d2bac23a4ca223d6c32837948f98711e30b.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "1e580f91d69c74093aff26f7bb90dbeb04feb11a0d17ba14922f8b9e334317b5": { + "e90bde87fa303e3d3071f97e52af082d2ac6ff54ff115039cabc18b2a490b4e1": { "source": { "path": "awscdkeksclusterprivateendpointtestawscdkawseksKubectlProvider421F287E.nested.template.json", "packaging": "file" @@ -100,12 +100,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "1e580f91d69c74093aff26f7bb90dbeb04feb11a0d17ba14922f8b9e334317b5.json", + "objectKey": "e90bde87fa303e3d3071f97e52af082d2ac6ff54ff115039cabc18b2a490b4e1.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "fc662ff101c9c7a89278d91b6c762243af2e2bc4c1eb0ae7bfd1e109371ab23a": { + "36d40992bc5e922d6e575402d26a89f97f4c39a75d0fa1b4574bbb652974c273": { "source": { "path": "aws-cdk-eks-cluster-private-endpoint-test.template.json", "packaging": "file" @@ -113,7 +113,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "fc662ff101c9c7a89278d91b6c762243af2e2bc4c1eb0ae7bfd1e109371ab23a.json", + "objectKey": "36d40992bc5e922d6e575402d26a89f97f4c39a75d0fa1b4574bbb652974c273.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/aws-cdk-eks-cluster-private-endpoint-test.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/aws-cdk-eks-cluster-private-endpoint-test.template.json index b9f9b76088277..e68bdfd8a5604 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/aws-cdk-eks-cluster-private-endpoint-test.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/aws-cdk-eks-cluster-private-endpoint-test.template.json @@ -1027,7 +1027,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/482ca8a889ef1b56f0a620923f8132a8bdd7297b08cbe4c2d8d207f274ee62a9.json" + "/b28350e97c47c6d05a58b67ef5b49d2bac23a4ca223d6c32837948f98711e30b.json" ] ] } @@ -1077,7 +1077,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/1e580f91d69c74093aff26f7bb90dbeb04feb11a0d17ba14922f8b9e334317b5.json" + "/e90bde87fa303e3d3071f97e52af082d2ac6ff54ff115039cabc18b2a490b4e1.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/awscdkeksclusterprivateendpointtestawscdkawseksClusterResourceProvider67118CB1.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/awscdkeksclusterprivateendpointtestawscdkawseksClusterResourceProvider67118CB1.nested.template.json index 64cfe39c16fda..0d6982f958d56 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/awscdkeksclusterprivateendpointtestawscdkawseksClusterResourceProvider67118CB1.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/awscdkeksclusterprivateendpointtestawscdkawseksClusterResourceProvider67118CB1.nested.template.json @@ -50,7 +50,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "onEvent handler for EKS cluster resource provider", "Environment": { @@ -115,7 +115,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "isComplete handler for EKS cluster resource provider", "Environment": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/awscdkeksclusterprivateendpointtestawscdkawseksKubectlProvider421F287E.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/awscdkeksclusterprivateendpointtestawscdkawseksKubectlProvider421F287E.nested.template.json index 60db8918250a0..36ece0f6a6768 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/awscdkeksclusterprivateendpointtestawscdkawseksKubectlProvider421F287E.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/awscdkeksclusterprivateendpointtestawscdkawseksKubectlProvider421F287E.nested.template.json @@ -49,7 +49,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/cdk.out index f0b901e7c06e5..560dae10d018f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"33.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/manifest.json index a4e9eb0df9fc3..42a4763542e50 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/manifest.json @@ -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}/fc662ff101c9c7a89278d91b6c762243af2e2bc4c1eb0ae7bfd1e109371ab23a.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/36d40992bc5e922d6e575402d26a89f97f4c39a75d0fa1b4574bbb652974c273.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/tree.json index 0091976bb9462..6dcdfaa6844d1 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster-private-endpoint.js.snapshot/tree.json @@ -755,7 +755,7 @@ }, "constructInfo": { "fqn": "@aws-cdk/lambda-layer-kubectl-v24.KubectlV24Layer", - "version": "2.0.229" + "version": "2.0.242" } }, "Cluster": { @@ -1581,7 +1581,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "onEvent handler for EKS cluster resource provider", "environment": { @@ -1713,7 +1713,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "isComplete handler for EKS cluster resource provider", "environment": { @@ -2619,7 +2619,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/482ca8a889ef1b56f0a620923f8132a8bdd7297b08cbe4c2d8d207f274ee62a9.json" + "/b28350e97c47c6d05a58b67ef5b49d2bac23a4ca223d6c32837948f98711e30b.json" ] ] } @@ -2766,7 +2766,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -3130,7 +3130,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/1e580f91d69c74093aff26f7bb90dbeb04feb11a0d17ba14922f8b9e334317b5.json" + "/e90bde87fa303e3d3071f97e52af082d2ac6ff54ff115039cabc18b2a490b4e1.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip deleted file mode 100644 index e6cb898734b43..0000000000000 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and /dev/null differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js deleted file mode 100644 index b89707a0a08e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js +++ /dev/null @@ -1,277 +0,0 @@ -"use strict"; -/* eslint-disable no-console */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ClusterResourceHandler = void 0; -const common_1 = require("./common"); -const compareLogging_1 = require("./compareLogging"); -const MAX_CLUSTER_NAME_LEN = 100; -class ClusterResourceHandler extends common_1.ResourceHandler { - get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - return this.physicalResourceId; - } - constructor(eks, event) { - super(eks, event); - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - // ------ - // CREATE - // ------ - async onCreate() { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - const clusterName = this.newProps.name || this.generateClusterName(); - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - return { - PhysicalResourceId: resp.cluster.name, - }; - } - async isCreateComplete() { - return this.isActive(); - } - // ------ - // DELETE - // ------ - async onDelete() { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } - catch (e) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } - else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - async isDeleteComplete() { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } - catch (e) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - console.log('describeCluster error:', e); - throw e; - } - return { - IsComplete: false, - }; - } - // ------ - // UPDATE - // ------ - async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - return this.onCreate(); - } - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - return this.updateClusterVersion(this.newProps.version); - } - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - if (updates.updateLogging || updates.updateAccess) { - const config = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - } - ; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - return { EksUpdateId: updateResponse.update?.id }; - } - // no updates - return; - } - async isUpdateComplete() { - console.log('isUpdateComplete'); - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - return this.isActive(); - } - async updateClusterVersion(newVersion) { - console.log(`updating cluster version to ${newVersion}`); - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - async isActive() { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } - else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } - else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - async isEksUpdateComplete(eksUpdateId) { - this.log({ isEksUpdateComplete: eksUpdateId }); - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - this.log({ describeUpdateResponse }); - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} -exports.ClusterResourceHandler = ClusterResourceHandler; -function parseProps(props) { - const parsed = props?.Config ?? {}; - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - return parsed; -} -function analyzeUpdate(oldProps, newProps) { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} -function setsEqual(first, second) { - return first.size === second.size && [...first].every((e) => second.has(e)); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBSy9CLHFDQUFxRTtBQUNyRSxxREFBdUQ7QUFHdkQsTUFBTSxvQkFBb0IsR0FBRyxHQUFHLENBQUM7QUFFakMsTUFBYSxzQkFBdUIsU0FBUSx3QkFBZTtJQUN6RCxJQUFXLFdBQVc7UUFDcEIsSUFBSSxDQUFDLElBQUksQ0FBQyxrQkFBa0IsRUFBRTtZQUM1QixNQUFNLElBQUksS0FBSyxDQUFDLDREQUE0RCxDQUFDLENBQUM7U0FDL0U7UUFFRCxPQUFPLElBQUksQ0FBQyxrQkFBa0IsQ0FBQztLQUNoQztJQUtELFlBQVksR0FBYyxFQUFFLEtBQW9CO1FBQzlDLEtBQUssQ0FBQyxHQUFHLEVBQUUsS0FBSyxDQUFDLENBQUM7UUFFbEIsSUFBSSxDQUFDLF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aW5naWZ5KG9sZFZwY1Byb3BzLnNlY3VyaXR5R3JvdXBJZHM/LnNvcnQoKSksXG4gICAgdXBkYXRlQWNjZXNzOlxuICAgICAgbmV3VnBjUHJvcHMuZW5kcG9pbnRQcml2YXRlQWNjZXNzICE9PSBvbGRWcGNQcm9wcy5lbmRwb2ludFByaXZhdGVBY2Nlc3MgfHxcbiAgICAgIG5ld1ZwY1Byb3BzLmVuZHBvaW50UHVibGljQWNjZXNzICE9PSBvbGRWcGNQcm9wcy5lbmRwb2ludFB1YmxpY0FjY2VzcyB8fFxuICAgICAgIXNldHNFcXVhbChuZXdQdWJsaWNBY2Nlc3NDaWRycywgb2xkUHVibGljQWNjZXNzQ2lkcnMpLFxuICAgIHJlcGxhY2VSb2xlOiBuZXdQcm9wcy5yb2xlQXJuICE9PSBvbGRQcm9wcy5yb2xlQXJuLFxuICAgIHVwZGF0ZVZlcnNpb246IG5ld1Byb3BzLnZlcnNpb24gIT09IG9sZFByb3BzLnZlcnNpb24sXG4gICAgdXBkYXRlRW5jcnlwdGlvbjogSlNPTi5zdHJpbmdpZnkobmV3RW5jKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkRW5jKSxcbiAgICB1cGRhdGVMb2dnaW5nOiBKU09OLnN0cmluZ2lmeShuZXdQcm9wcy5sb2dnaW5nKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkUHJvcHMubG9nZ2luZyksXG4gIH07XG59XG5cbmZ1bmN0aW9uIHNldHNFcXVhbChmaXJzdDogU2V0PHN0cmluZz4sIHNlY29uZDogU2V0PHN0cmluZz4pIHtcbiAgcmV0dXJuIGZpcnN0LnNpemUgPT09IHNlY29uZC5zaXplICYmIFsuLi5maXJzdF0uZXZlcnkoKGU6IHN0cmluZykgPT4gc2Vjb25kLmhhcyhlKSk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts deleted file mode 100644 index c058e47b62c68..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts +++ /dev/null @@ -1,348 +0,0 @@ -/* eslint-disable no-console */ - -// eslint-disable-next-line import/no-extraneous-dependencies -// eslint-disable-next-line import/no-extraneous-dependencies -import * as aws from 'aws-sdk'; -import { EksClient, ResourceEvent, ResourceHandler } from './common'; -import { compareLoggingProps } from './compareLogging'; -import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; - -const MAX_CLUSTER_NAME_LEN = 100; - -export class ClusterResourceHandler extends ResourceHandler { - public get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - - return this.physicalResourceId; - } - - private readonly newProps: aws.EKS.CreateClusterRequest; - private readonly oldProps: Partial; - - constructor(eks: EksClient, event: ResourceEvent) { - super(eks, event); - - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - - // ------ - // CREATE - // ------ - - protected async onCreate(): Promise { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - - const clusterName = this.newProps.name || this.generateClusterName(); - - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - - return { - PhysicalResourceId: resp.cluster.name, - }; - } - - protected async isCreateComplete() { - return this.isActive(); - } - - // ------ - // DELETE - // ------ - - protected async onDelete(): Promise { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } catch (e: any) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - - protected async isDeleteComplete(): Promise { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } catch (e: any) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - - console.log('describeCluster error:', e); - throw e; - } - - return { - IsComplete: false, - }; - } - - // ------ - // UPDATE - // ------ - - protected async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - - return this.onCreate(); - } - - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - - return this.updateClusterVersion(this.newProps.version); - } - - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - - if (updates.updateLogging || updates.updateAccess) { - const config: aws.EKS.UpdateClusterConfigRequest = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - }; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - - return { EksUpdateId: updateResponse.update?.id }; - } - - // no updates - return; - } - - protected async isUpdateComplete() { - console.log('isUpdateComplete'); - - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - - return this.isActive(); - } - - private async updateClusterVersion(newVersion: string) { - console.log(`updating cluster version to ${newVersion}`); - - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - - private async isActive(): Promise { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url - - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - - private async isEksUpdateComplete(eksUpdateId: string) { - this.log({ isEksUpdateComplete: eksUpdateId }); - - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - - this.log({ describeUpdateResponse }); - - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - - private generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} - -function parseProps(props: any): aws.EKS.CreateClusterRequest { - - const parsed = props?.Config ?? {}; - - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - - return parsed; - -} - -interface UpdateMap { - replaceName: boolean; // name - replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds - replaceRole: boolean; // roleArn - - updateVersion: boolean; // version - updateLogging: boolean; // logging - updateEncryption: boolean; // encryption (cannot be updated) - updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess -} - -function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: - JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: - newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} - -function setsEqual(first: Set, second: Set) { - return first.size === second.size && [...first].every((e: string) => second.has(e)); -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js deleted file mode 100644 index 34ab6ff0ba0e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FargateProfileResourceHandler = void 0; -const common_1 = require("./common"); -const MAX_NAME_LEN = 63; -class FargateProfileResourceHandler extends common_1.ResourceHandler { - async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - const createFargateProfile = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - const deleteFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - return; - } - async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - async isCreateComplete() { - return this.isUpdateComplete(); - } - async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - /** - * Generates a fargate profile name. - */ - generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - async queryStatus() { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - const describeFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - try { - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - return status; - } - catch (describeFargateProfileError) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} -exports.FargateProfileResourceHandler = FargateProfileResourceHandler; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EscUNBQTJDO0FBRTNDLE1BQU0sWUFBWSxHQUFHLEVBQUUsQ0FBQztBQUV4QixNQUFhLDZCQUE4QixTQUFRLHdCQUFlO0lBQ3RELEtBQUssQ0FBQyxRQUFRO1FBQ3RCLE1BQU0sa0JBQWtCLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNLENBQUMsa0JBQWtCLElBQUksSUFBSSxDQUFDLG1CQUFtQixFQUFFLENBQUM7UUFFakgsTUFBTSxvQkFBb0IsR0FBd0M7WUFDaEUsa0JBQWtCO1lBQ2xCLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNO1NBQ3hDLENBQUM7UUFFRixJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsb0JBQW9CLEVBQUUsQ0FBQyxDQUFDO1FBQ25DLE1BQU0sNEJBQTRCLEdBQUcsTUFBTSxJQUFJLENBQUMsR0FBRyxDQUFDLG9CQUFvQixDQUFDLG9CQUFvQixDQUFDLENBQUM7UUFDL0YsSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLDRCQUE0QixFQUFFLENBQUMsQ0FBQztRQUUzQyxJQUFJLENBQUMsNEJBQTRCLENBQUMsY0FBYyxFQUFFO1lBQ2hELE1BQU0sSUFBSSxLQUFLLENBQUMsdUNBQXVDLENBQUMsQ0FBQztTQUMxRDtRQUVELE9BQU87WUFDTCxrQkFBa0IsRUFBRSw0QkFBNEIsQ0FBQyxj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59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts deleted file mode 100644 index 7db97a7f69d38..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts +++ /dev/null @@ -1,119 +0,0 @@ -import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies -import { ResourceHandler } from './common'; - -const MAX_NAME_LEN = 63; - -export class FargateProfileResourceHandler extends ResourceHandler { - protected async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - - const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - - protected async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - - const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - - return; - } - - protected async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - - protected async isCreateComplete() { - return this.isUpdateComplete(); - } - - protected async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - - protected async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - - /** - * Generates a fargate profile name. - */ - private generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - private async queryStatus(): Promise { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - - const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - try { - - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - - return status; - } catch (describeFargateProfileError: any) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js new file mode 100644 index 0000000000000..aefb970a3fe47 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js @@ -0,0 +1,280 @@ +"use strict"; +/* eslint-disable no-console */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClusterResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const compareLogging_1 = require("./compareLogging"); +const MAX_CLUSTER_NAME_LEN = 100; +class ClusterResourceHandler extends common_1.ResourceHandler { + get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + return this.physicalResourceId; + } + constructor(eks, event) { + super(eks, event); + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + // ------ + // CREATE + // ------ + async onCreate() { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + const clusterName = this.newProps.name || this.generateClusterName(); + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + return { + PhysicalResourceId: resp.cluster.name, + }; + } + async isCreateComplete() { + return this.isActive(); + } + // ------ + // DELETE + // ------ + async onDelete() { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } + catch (e) { + if (!(e instanceof client_eks_1.ResourceNotFoundException)) { + throw e; + } + else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + async isDeleteComplete() { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } + catch (e) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof client_eks_1.ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + console.log('describeCluster error:', e); + throw e; + } + return { + IsComplete: false, + }; + } + // ------ + // UPDATE + // ------ + async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + return this.onCreate(); + } + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + return this.updateClusterVersion(this.newProps.version); + } + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + if (updates.updateLogging || updates.updateAccess) { + const config = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + } + ; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + return { EksUpdateId: updateResponse.update?.id }; + } + // no updates + return; + } + async isUpdateComplete() { + console.log('isUpdateComplete'); + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + return this.isActive(); + } + async updateClusterVersion(newVersion) { + console.log(`updating cluster version to ${newVersion}`); + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + async isActive() { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } + else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } + else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + async isEksUpdateComplete(eksUpdateId) { + this.log({ isEksUpdateComplete: eksUpdateId }); + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + this.log({ describeUpdateResponse }); + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} +exports.ClusterResourceHandler = ClusterResourceHandler; +function parseProps(props) { + const parsed = props?.Config ?? {}; + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + return parsed; +} +function analyzeUpdate(oldProps, newProps) { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} +function setsEqual(first, second) { + return first.size === second.size && [...first].every((e) => second.has(e)); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBRS9CLDZEQUE2RDtBQUM3RCxvREFBZ0U7QUFHaEUscUNBQXFFO0FBQ3JFLHFEQUF1RDtBQUd2RCxNQUFNLG9CQUFvQixHQUFHLEdBQUcsQ0FBQztBQUVqQyxNQUFhLHNCQUF1QixTQUFRLHdCQUFlO0lBQ3pELElBQVcsV0FBVztRQUNwQixJQUFJLENBQUMsSUFBSSxDQUFDLGtCQUFrQixFQUFFO1lBQzVCLE1BQU0sSUFBSSxLQUFLLENBQUMsNERBQTRELENBQUMsQ0FBQztTQUMvRTtRQUVELE9BQU8sSUFBSSxDQUFDLGtCQUFrQixDQUFDO0tBQ2hDO0lBS0QsWUFBWSxHQUFjLEVBQUUsS0FBb0I7UUFDOUMsS0FBSyxDQUFDLEdBQUcsRUFBRSxLQUFLLENBQUMsQ0FBQztRQUVsQixJQUFJLENBQUMsUUFBUSxHQUFHLFVBQVUsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLENBQUM7UUFDMUQsSUFBSSxDQUFD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ws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts new file mode 100644 index 0000000000000..3a0a7294db31d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts @@ -0,0 +1,350 @@ +/* eslint-disable no-console */ + +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +// eslint-disable-next-line import/no-extraneous-dependencies +import * as aws from 'aws-sdk'; +import { EksClient, ResourceEvent, ResourceHandler } from './common'; +import { compareLoggingProps } from './compareLogging'; +import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; + +const MAX_CLUSTER_NAME_LEN = 100; + +export class ClusterResourceHandler extends ResourceHandler { + public get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + + return this.physicalResourceId; + } + + private readonly newProps: aws.EKS.CreateClusterRequest; + private readonly oldProps: Partial; + + constructor(eks: EksClient, event: ResourceEvent) { + super(eks, event); + + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + + // ------ + // CREATE + // ------ + + protected async onCreate(): Promise { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + + const clusterName = this.newProps.name || this.generateClusterName(); + + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + + return { + PhysicalResourceId: resp.cluster.name, + }; + } + + protected async isCreateComplete() { + return this.isActive(); + } + + // ------ + // DELETE + // ------ + + protected async onDelete(): Promise { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } catch (e: any) { + if (!(e instanceof ResourceNotFoundException)) { + throw e; + } else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + + protected async isDeleteComplete(): Promise { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } catch (e: any) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + + console.log('describeCluster error:', e); + throw e; + } + + return { + IsComplete: false, + }; + } + + // ------ + // UPDATE + // ------ + + protected async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + + return this.onCreate(); + } + + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + + return this.updateClusterVersion(this.newProps.version); + } + + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + + if (updates.updateLogging || updates.updateAccess) { + const config: aws.EKS.UpdateClusterConfigRequest = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + }; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + + return { EksUpdateId: updateResponse.update?.id }; + } + + // no updates + return; + } + + protected async isUpdateComplete() { + console.log('isUpdateComplete'); + + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + + return this.isActive(); + } + + private async updateClusterVersion(newVersion: string) { + console.log(`updating cluster version to ${newVersion}`); + + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + + private async isActive(): Promise { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url + + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + + private async isEksUpdateComplete(eksUpdateId: string) { + this.log({ isEksUpdateComplete: eksUpdateId }); + + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + + this.log({ describeUpdateResponse }); + + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + + private generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} + +function parseProps(props: any): aws.EKS.CreateClusterRequest { + + const parsed = props?.Config ?? {}; + + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + + return parsed; + +} + +interface UpdateMap { + replaceName: boolean; // name + replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds + replaceRole: boolean; // roleArn + + updateVersion: boolean; // version + updateLogging: boolean; // logging + updateEncryption: boolean; // encryption (cannot be updated) + updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess +} + +function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: + JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: + newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} + +function setsEqual(first: Set, second: Set) { + return first.size === second.size && [...first].every((e: string) => second.has(e)); +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js new file mode 100644 index 0000000000000..ed1eab8530351 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FargateProfileResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const MAX_NAME_LEN = 63; +class FargateProfileResourceHandler extends common_1.ResourceHandler { + async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + const createFargateProfile = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + const deleteFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + return; + } + async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + async isCreateComplete() { + return this.isUpdateComplete(); + } + async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + /** + * Generates a fargate profile name. + */ + generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + async queryStatus() { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + const describeFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + try { + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + return status; + } + catch (describeFargateProfileError) { + if (describeFargateProfileError instanceof client_eks_1.ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} +exports.FargateProfileResourceHandler = FargateProfileResourceHandler; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsNkRBQTZEO0FBQzdELG9EQUFnRTtBQUVoRSxxQ0FBMkM7QUFFM0MsTUFBTSxZQUFZLEdBQUcsRUFBRSxDQUFDO0FBRXhCLE1BQWEsNkJBQThCLFNBQVEsd0JBQWU7SUFDdEQsS0FBSyxDQUFDLFFBQVE7UUFDdEIsTUFBTSxrQkFBa0IsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU0sQ0FBQyxrQkFBa0IsSUFBSSxJQUFJLENBQUMsbUJBQW1CLEVBQUUsQ0FBQztRQUVqSCxNQUFNLG9CQUFvQixHQUF3QztZQUNoRSxrQkFBa0I7WUFDbEIsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU07U0FDeEMsQ0FBQztRQUVGLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxvQkFBb0IsRUFBRSxDQUFDLENBQUM7UUFDbkMsTUFBTSw0QkFBNEIsR0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SB7XG4gICAgICBpZiAoZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yIGluc3RhbmNlb2YgUmVzb3VyY2VOb3RGb3VuZEV4Y2VwdGlvbikge1xuICAgICAgICB0aGlzLmxvZygncmVjZWl2ZWQgUmVzb3VyY2VOb3RGb3VuZEV4Y2VwdGlvbiwgdGhpcyBtZWFucyB0aGUgcHJvZmlsZSBoYXMgYmVlbiBkZWxldGVkIChvciBuZXZlciBleGlzdGVkKScpO1xuICAgICAgICByZXR1cm4gJ05PVF9GT1VORCc7XG4gICAgICB9XG5cbiAgICAgIHRoaXMubG9nKHsgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yIH0pO1xuICAgICAgdGhyb3cgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yO1xuICAgIH1cbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts new file mode 100644 index 0000000000000..16b9f9abfeb49 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts @@ -0,0 +1,121 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies +import { ResourceHandler } from './common'; + +const MAX_NAME_LEN = 63; + +export class FargateProfileResourceHandler extends ResourceHandler { + protected async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + + const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + + protected async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + + const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + + return; + } + + protected async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + + protected async isCreateComplete() { + return this.isUpdateComplete(); + } + + protected async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + + protected async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + + /** + * Generates a fargate profile name. + */ + private generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + private async queryStatus(): Promise { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + + const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + try { + + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + + return status; + } catch (describeFargateProfileError: any) { + if (describeFargateProfileError instanceof ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip index 93f7400e6f8c2..11112de67d5be 100644 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip new file mode 100644 index 0000000000000..90a8a2a6e2615 Binary files /dev/null and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/aws-cdk-eks-cluster-test.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/aws-cdk-eks-cluster-test.assets.json index b5ce6d7b798fe..5bfd8369f6a79 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/aws-cdk-eks-cluster-test.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/aws-cdk-eks-cluster-test.assets.json @@ -29,15 +29,15 @@ } } }, - "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649": { + "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31": { "source": { - "path": "asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649", + "path": "asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31", "packaging": "zip" }, "destinations": { "current_account-us-east-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1", - "objectKey": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip", + "objectKey": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip", "region": "us-east-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-us-east-1" } @@ -71,15 +71,15 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-us-east-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "region": "us-east-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-us-east-1" } @@ -127,7 +127,7 @@ } } }, - "38d703160bc45251d27e806080a42e0e3e95a76199d0d1342c10c86a6a132f01": { + "a587dd90a65b677b28890be28013a7c23ea5e3dc218ad05efe3f552f039de7ee": { "source": { "path": "awscdkeksclustertestawscdkawseksClusterResourceProvider5F388D1A.nested.template.json", "packaging": "file" @@ -135,13 +135,13 @@ "destinations": { "current_account-us-east-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1", - "objectKey": "38d703160bc45251d27e806080a42e0e3e95a76199d0d1342c10c86a6a132f01.json", + "objectKey": "a587dd90a65b677b28890be28013a7c23ea5e3dc218ad05efe3f552f039de7ee.json", "region": "us-east-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-us-east-1" } } }, - "c4dcedad1cadbfa87852da53c1c41533ef51e3bd1395cd2d70fffb677c3c81a9": { + "08e97a0b00ee9b6a6906cbd76cf72e1f1b83b24330d074a3bed941d837d321c2": { "source": { "path": "awscdkeksclustertestawscdkawseksKubectlProviderE05943BF.nested.template.json", "packaging": "file" @@ -149,13 +149,13 @@ "destinations": { "current_account-us-east-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1", - "objectKey": "c4dcedad1cadbfa87852da53c1c41533ef51e3bd1395cd2d70fffb677c3c81a9.json", + "objectKey": "08e97a0b00ee9b6a6906cbd76cf72e1f1b83b24330d074a3bed941d837d321c2.json", "region": "us-east-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-us-east-1" } } }, - "f31b43cc8398fae82f2ea5a4c05ea276c03263a1e24694d018494d08556c1ec4": { + "3d424e3333ad93614792fe2203b74f0055bf038240680a60b9e1ef842261de2e": { "source": { "path": "aws-cdk-eks-cluster-test.template.json", "packaging": "file" @@ -163,7 +163,7 @@ "destinations": { "current_account-us-east-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1", - "objectKey": "f31b43cc8398fae82f2ea5a4c05ea276c03263a1e24694d018494d08556c1ec4.json", + "objectKey": "3d424e3333ad93614792fe2203b74f0055bf038240680a60b9e1ef842261de2e.json", "region": "us-east-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-us-east-1" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/aws-cdk-eks-cluster-test.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/aws-cdk-eks-cluster-test.template.json index 7a351e69a2a1a..58de49707cdaf 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/aws-cdk-eks-cluster-test.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/aws-cdk-eks-cluster-test.template.json @@ -3727,7 +3727,7 @@ "Outputs.awscdkeksclustertestawscdkawseksKubectlProviderframeworkonEventC681B49AArn" ] }, - "Manifest": "[{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"name\":\"hello-kubernetes\",\"labels\":{\"aws.cdk.eks/prune-c8f0f7140f7358e29b7f58e81b507dcf744a3908f4\":\"\"}},\"spec\":{\"type\":\"LoadBalancer\",\"ports\":[{\"port\":80,\"targetPort\":8080}],\"selector\":{\"app\":\"hello-kubernetes\"}}},{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"name\":\"hello-kubernetes\",\"labels\":{\"aws.cdk.eks/prune-c8f0f7140f7358e29b7f58e81b507dcf744a3908f4\":\"\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"app\":\"hello-kubernetes\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"hello-kubernetes\"}},\"spec\":{\"containers\":[{\"name\":\"hello-kubernetes\",\"image\":\"paulbouwer/hello-kubernetes:1.5\",\"ports\":[{\"containerPort\":8080}]}]}}}}]", + "Manifest": "[{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"name\":\"hello-kubernetes\",\"labels\":{\"aws.cdk.eks/prune-c8f0f7140f7358e29b7f58e81b507dcf744a3908f4\":\"\"}},\"spec\":{\"ports\":[{\"port\":80,\"targetPort\":8080}],\"selector\":{\"app\":\"hello-kubernetes\"}}},{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"name\":\"hello-kubernetes\",\"labels\":{\"aws.cdk.eks/prune-c8f0f7140f7358e29b7f58e81b507dcf744a3908f4\":\"\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"app\":\"hello-kubernetes\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"hello-kubernetes\"}},\"spec\":{\"containers\":[{\"name\":\"hello-kubernetes\",\"image\":\"paulbouwer/hello-kubernetes:1.5\",\"ports\":[{\"containerPort\":8080}]}]}}}}]", "ClusterName": { "Ref": "Cluster9EE0221C" }, @@ -3765,6 +3765,7 @@ }, "Release": "awscdkeksclustertestclusterchartdashboard1f3d83fe", "Chart": "kubernetes-dashboard", + "Version": "6.0.8", "Namespace": "default", "Repository": "https://kubernetes.github.io/dashboard/", "CreateNamespace": true @@ -3889,10 +3890,12 @@ "Arn" ] }, - "Release": "awscdkeksclustertestclusterchartnginxingressa7f70129", + "Release": "nginx-ingress", "Chart": "nginx-ingress", + "Version": "0.17.1", "Wait": true, "Timeout": "900s", + "Values": "{\"controller\":{\"service\":{\"create\":false}}}", "Namespace": "nginx", "Repository": "https://helm.nginx.com/stable" }, @@ -4175,7 +4178,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "/38d703160bc45251d27e806080a42e0e3e95a76199d0d1342c10c86a6a132f01.json" + "/a587dd90a65b677b28890be28013a7c23ea5e3dc218ad05efe3f552f039de7ee.json" ] ] } @@ -4221,7 +4224,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "/c4dcedad1cadbfa87852da53c1c41533ef51e3bd1395cd2d70fffb677c3c81a9.json" + "/08e97a0b00ee9b6a6906cbd76cf72e1f1b83b24330d074a3bed941d837d321c2.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/awscdkeksclustertestawscdkawseksClusterResourceProvider5F388D1A.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/awscdkeksclustertestawscdkawseksClusterResourceProvider5F388D1A.nested.template.json index 4c46d5dc8c88a..48191d05e3237 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/awscdkeksclustertestawscdkawseksClusterResourceProvider5F388D1A.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/awscdkeksclustertestawscdkawseksClusterResourceProvider5F388D1A.nested.template.json @@ -50,7 +50,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "onEvent handler for EKS cluster resource provider", "Environment": { @@ -115,7 +115,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "isComplete handler for EKS cluster resource provider", "Environment": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/awscdkeksclustertestawscdkawseksKubectlProviderE05943BF.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/awscdkeksclustertestawscdkawseksKubectlProviderE05943BF.nested.template.json index 32e261dbf363c..ada63228fc8a4 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/awscdkeksclustertestawscdkawseksKubectlProviderE05943BF.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/awscdkeksclustertestawscdkawseksKubectlProviderE05943BF.nested.template.json @@ -49,7 +49,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/cdk.out index f0b901e7c06e5..560dae10d018f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"33.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/manifest.json index f80cf091c0233..9f9512fb8a69e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-us-east-1", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-us-east-1", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1/f31b43cc8398fae82f2ea5a4c05ea276c03263a1e24694d018494d08556c1ec4.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1/3d424e3333ad93614792fe2203b74f0055bf038240680a60b9e1ef842261de2e.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/tree.json index 45dca6469207c..00f52e672c6d2 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/tree.json @@ -798,7 +798,7 @@ }, "constructInfo": { "fqn": "@aws-cdk/lambda-layer-kubectl-v24.KubectlV24Layer", - "version": "2.0.229" + "version": "2.0.242" } }, "Cluster": { @@ -5535,7 +5535,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "onEvent handler for EKS cluster resource provider", "environment": { @@ -5667,7 +5667,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "isComplete handler for EKS cluster resource provider", "environment": { @@ -6569,7 +6569,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "/38d703160bc45251d27e806080a42e0e3e95a76199d0d1342c10c86a6a132f01.json" + "/a587dd90a65b677b28890be28013a7c23ea5e3dc218ad05efe3f552f039de7ee.json" ] ] } @@ -6716,7 +6716,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -7076,7 +7076,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "/c4dcedad1cadbfa87852da53c1c41533ef51e3bd1395cd2d70fffb677c3c81a9.json" + "/08e97a0b00ee9b6a6906cbd76cf72e1f1b83b24330d074a3bed941d837d321c2.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.ts index 32faf17991c8f..84dccc854c867 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.ts @@ -131,6 +131,16 @@ class EksClusterStack extends Stack { repository: 'https://helm.nginx.com/stable', namespace: 'nginx', wait: true, + release: 'nginx-ingress', + // https://github.com/nginxinc/helm-charts/tree/master/stable + version: '0.17.1', + values: { + controller: { + service: { + create: false, + }, + }, + }, createNamespace: false, timeout: Duration.minutes(15), }); @@ -162,6 +172,8 @@ class EksClusterStack extends Stack { // deploy the Kubernetes dashboard through a helm chart this.cluster.addHelmChart('dashboard', { chart: 'kubernetes-dashboard', + // https://artifacthub.io/packages/helm/k8s-dashboard/kubernetes-dashboard + version: '6.0.8', repository: 'https://kubernetes.github.io/dashboard/', }); } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip deleted file mode 100644 index e6cb898734b43..0000000000000 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and /dev/null differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js deleted file mode 100644 index b89707a0a08e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js +++ /dev/null @@ -1,277 +0,0 @@ -"use strict"; -/* eslint-disable no-console */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ClusterResourceHandler = void 0; -const common_1 = require("./common"); -const compareLogging_1 = require("./compareLogging"); -const MAX_CLUSTER_NAME_LEN = 100; -class ClusterResourceHandler extends common_1.ResourceHandler { - get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - return this.physicalResourceId; - } - constructor(eks, event) { - super(eks, event); - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - // ------ - // CREATE - // ------ - async onCreate() { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - const clusterName = this.newProps.name || this.generateClusterName(); - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - return { - PhysicalResourceId: resp.cluster.name, - }; - } - async isCreateComplete() { - return this.isActive(); - } - // ------ - // DELETE - // ------ - async onDelete() { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } - catch (e) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } - else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - async isDeleteComplete() { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } - catch (e) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - console.log('describeCluster error:', e); - throw e; - } - return { - IsComplete: false, - }; - } - // ------ - // UPDATE - // ------ - async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - return this.onCreate(); - } - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - return this.updateClusterVersion(this.newProps.version); - } - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - if (updates.updateLogging || updates.updateAccess) { - const config = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - } - ; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - return { EksUpdateId: updateResponse.update?.id }; - } - // no updates - return; - } - async isUpdateComplete() { - console.log('isUpdateComplete'); - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - return this.isActive(); - } - async updateClusterVersion(newVersion) { - console.log(`updating cluster version to ${newVersion}`); - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - async isActive() { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } - else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } - else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - async isEksUpdateComplete(eksUpdateId) { - this.log({ isEksUpdateComplete: eksUpdateId }); - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - this.log({ describeUpdateResponse }); - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} -exports.ClusterResourceHandler = ClusterResourceHandler; -function parseProps(props) { - const parsed = props?.Config ?? {}; - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - return parsed; -} -function analyzeUpdate(oldProps, newProps) { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} -function setsEqual(first, second) { - return first.size === second.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xlQXJuLFxuICAgIHVwZGF0ZVZlcnNpb246IG5ld1Byb3BzLnZlcnNpb24gIT09IG9sZFByb3BzLnZlcnNpb24sXG4gICAgdXBkYXRlRW5jcnlwdGlvbjogSlNPTi5zdHJpbmdpZnkobmV3RW5jKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkRW5jKSxcbiAgICB1cGRhdGVMb2dnaW5nOiBKU09OLnN0cmluZ2lmeShuZXdQcm9wcy5sb2dnaW5nKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkUHJvcHMubG9nZ2luZyksXG4gIH07XG59XG5cbmZ1bmN0aW9uIHNldHNFcXVhbChmaXJzdDogU2V0PHN0cmluZz4sIHNlY29uZDogU2V0PHN0cmluZz4pIHtcbiAgcmV0dXJuIGZpcnN0LnNpemUgPT09IHNlY29uZC5zaXplICYmIFsuLi5maXJzdF0uZXZlcnkoKGU6IHN0cmluZykgPT4gc2Vjb25kLmhhcyhlKSk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts deleted file mode 100644 index c058e47b62c68..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts +++ /dev/null @@ -1,348 +0,0 @@ -/* eslint-disable no-console */ - -// eslint-disable-next-line import/no-extraneous-dependencies -// eslint-disable-next-line import/no-extraneous-dependencies -import * as aws from 'aws-sdk'; -import { EksClient, ResourceEvent, ResourceHandler } from './common'; -import { compareLoggingProps } from './compareLogging'; -import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; - -const MAX_CLUSTER_NAME_LEN = 100; - -export class ClusterResourceHandler extends ResourceHandler { - public get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - - return this.physicalResourceId; - } - - private readonly newProps: aws.EKS.CreateClusterRequest; - private readonly oldProps: Partial; - - constructor(eks: EksClient, event: ResourceEvent) { - super(eks, event); - - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - - // ------ - // CREATE - // ------ - - protected async onCreate(): Promise { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - - const clusterName = this.newProps.name || this.generateClusterName(); - - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - - return { - PhysicalResourceId: resp.cluster.name, - }; - } - - protected async isCreateComplete() { - return this.isActive(); - } - - // ------ - // DELETE - // ------ - - protected async onDelete(): Promise { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } catch (e: any) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - - protected async isDeleteComplete(): Promise { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } catch (e: any) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - - console.log('describeCluster error:', e); - throw e; - } - - return { - IsComplete: false, - }; - } - - // ------ - // UPDATE - // ------ - - protected async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - - return this.onCreate(); - } - - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - - return this.updateClusterVersion(this.newProps.version); - } - - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - - if (updates.updateLogging || updates.updateAccess) { - const config: aws.EKS.UpdateClusterConfigRequest = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - }; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - - return { EksUpdateId: updateResponse.update?.id }; - } - - // no updates - return; - } - - protected async isUpdateComplete() { - console.log('isUpdateComplete'); - - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - - return this.isActive(); - } - - private async updateClusterVersion(newVersion: string) { - console.log(`updating cluster version to ${newVersion}`); - - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - - private async isActive(): Promise { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url - - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - - private async isEksUpdateComplete(eksUpdateId: string) { - this.log({ isEksUpdateComplete: eksUpdateId }); - - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - - this.log({ describeUpdateResponse }); - - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - - private generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} - -function parseProps(props: any): aws.EKS.CreateClusterRequest { - - const parsed = props?.Config ?? {}; - - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - - return parsed; - -} - -interface UpdateMap { - replaceName: boolean; // name - replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds - replaceRole: boolean; // roleArn - - updateVersion: boolean; // version - updateLogging: boolean; // logging - updateEncryption: boolean; // encryption (cannot be updated) - updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess -} - -function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: - JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: - newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} - -function setsEqual(first: Set, second: Set) { - return first.size === second.size && [...first].every((e: string) => second.has(e)); -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js deleted file mode 100644 index 34ab6ff0ba0e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FargateProfileResourceHandler = void 0; -const common_1 = require("./common"); -const MAX_NAME_LEN = 63; -class FargateProfileResourceHandler extends common_1.ResourceHandler { - async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - const createFargateProfile = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - const deleteFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - return; - } - async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - async isCreateComplete() { - return this.isUpdateComplete(); - } - async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - /** - * Generates a fargate profile name. - */ - generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - async queryStatus() { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - const describeFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - try { - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - return status; - } - catch (describeFargateProfileError) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} -exports.FargateProfileResourceHandler = FargateProfileResourceHandler; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EscUNBQTJDO0FBRTNDLE1BQU0sWUFBWSxHQUFHLEVBQUUsQ0FBQztBQUV4QixNQUFhLDZCQUE4QixTQUFRLHdCQUFlO0lBQ3RELEtBQUssQ0FBQyxRQUFRO1FBQ3RCLE1BQU0sa0JBQWtCLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFB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PSAnREVMRVRFX0ZBSUxFRCcpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKHN0YXR1cyk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfSBjYXRjaCAoZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yOiBhbnkpIHtcbiAgICAgIGlmIChkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IuY29kZSA9PT0gJ1Jlc291cmNlTm90Rm91bmRFeGNlcHRpb24nKSB7XG4gICAgICAgIHRoaXMubG9nKCdyZWNlaXZlZCBSZXNvdXJjZU5vdEZvdW5kRXhjZXB0aW9uLCB0aGlzIG1lYW5zIHRoZSBwcm9maWxlIGhhcyBiZWVuIGRlbGV0ZWQgKG9yIG5ldmVyIGV4aXN0ZWQpJyk7XG4gICAgICAgIHJldHVybiAnTk9UX0ZPVU5EJztcbiAgICAgIH1cblxuICAgICAgdGhpcy5sb2coeyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IgfSk7XG4gICAgICB0aHJvdyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3I7XG4gICAgfVxuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts deleted file mode 100644 index 7db97a7f69d38..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts +++ /dev/null @@ -1,119 +0,0 @@ -import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies -import { ResourceHandler } from './common'; - -const MAX_NAME_LEN = 63; - -export class FargateProfileResourceHandler extends ResourceHandler { - protected async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - - const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - - protected async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - - const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - - return; - } - - protected async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - - protected async isCreateComplete() { - return this.isUpdateComplete(); - } - - protected async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - - protected async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - - /** - * Generates a fargate profile name. - */ - private generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - private async queryStatus(): Promise { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - - const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - try { - - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - - return status; - } catch (describeFargateProfileError: any) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js new file mode 100644 index 0000000000000..aefb970a3fe47 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js @@ -0,0 +1,280 @@ +"use strict"; +/* eslint-disable no-console */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClusterResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const compareLogging_1 = require("./compareLogging"); +const MAX_CLUSTER_NAME_LEN = 100; +class ClusterResourceHandler extends common_1.ResourceHandler { + get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + return this.physicalResourceId; + } + constructor(eks, event) { + super(eks, event); + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + // ------ + // CREATE + // ------ + async onCreate() { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + const clusterName = this.newProps.name || this.generateClusterName(); + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + return { + PhysicalResourceId: resp.cluster.name, + }; + } + async isCreateComplete() { + return this.isActive(); + } + // ------ + // DELETE + // ------ + async onDelete() { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } + catch (e) { + if (!(e instanceof client_eks_1.ResourceNotFoundException)) { + throw e; + } + else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + async isDeleteComplete() { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } + catch (e) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof client_eks_1.ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + console.log('describeCluster error:', e); + throw e; + } + return { + IsComplete: false, + }; + } + // ------ + // UPDATE + // ------ + async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + return this.onCreate(); + } + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + return this.updateClusterVersion(this.newProps.version); + } + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + if (updates.updateLogging || updates.updateAccess) { + const config = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + } + ; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + return { EksUpdateId: updateResponse.update?.id }; + } + // no updates + return; + } + async isUpdateComplete() { + console.log('isUpdateComplete'); + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + return this.isActive(); + } + async updateClusterVersion(newVersion) { + console.log(`updating cluster version to ${newVersion}`); + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + async isActive() { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } + else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } + else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + async isEksUpdateComplete(eksUpdateId) { + this.log({ isEksUpdateComplete: eksUpdateId }); + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + this.log({ describeUpdateResponse }); + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} +exports.ClusterResourceHandler = ClusterResourceHandler; +function parseProps(props) { + const parsed = props?.Config ?? {}; + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + return parsed; +} +function analyzeUpdate(oldProps, newProps) { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} +function setsEqual(first, second) { + return first.size === second.size && [...first].every((e) => second.has(e)); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZ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2Vzc0NpZHJzKSxcbiAgICByZXBsYWNlUm9sZTogbmV3UHJvcHMucm9sZUFybiAhPT0gb2xkUHJvcHMucm9sZUFybixcbiAgICB1cGRhdGVWZXJzaW9uOiBuZXdQcm9wcy52ZXJzaW9uICE9PSBvbGRQcm9wcy52ZXJzaW9uLFxuICAgIHVwZGF0ZUVuY3J5cHRpb246IEpTT04uc3RyaW5naWZ5KG5ld0VuYykgIT09IEpTT04uc3RyaW5naWZ5KG9sZEVuYyksXG4gICAgdXBkYXRlTG9nZ2luZzogSlNPTi5zdHJpbmdpZnkobmV3UHJvcHMubG9nZ2luZykgIT09IEpTT04uc3RyaW5naWZ5KG9sZFByb3BzLmxvZ2dpbmcpLFxuICB9O1xufVxuXG5mdW5jdGlvbiBzZXRzRXF1YWwoZmlyc3Q6IFNldDxzdHJpbmc+LCBzZWNvbmQ6IFNldDxzdHJpbmc+KSB7XG4gIHJldHVybiBmaXJzdC5zaXplID09PSBzZWNvbmQuc2l6ZSAmJiBbLi4uZmlyc3RdLmV2ZXJ5KChlOiBzdHJpbmcpID0+IHNlY29uZC5oYXMoZSkpO1xufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts new file mode 100644 index 0000000000000..3a0a7294db31d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts @@ -0,0 +1,350 @@ +/* eslint-disable no-console */ + +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +// eslint-disable-next-line import/no-extraneous-dependencies +import * as aws from 'aws-sdk'; +import { EksClient, ResourceEvent, ResourceHandler } from './common'; +import { compareLoggingProps } from './compareLogging'; +import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; + +const MAX_CLUSTER_NAME_LEN = 100; + +export class ClusterResourceHandler extends ResourceHandler { + public get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + + return this.physicalResourceId; + } + + private readonly newProps: aws.EKS.CreateClusterRequest; + private readonly oldProps: Partial; + + constructor(eks: EksClient, event: ResourceEvent) { + super(eks, event); + + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + + // ------ + // CREATE + // ------ + + protected async onCreate(): Promise { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + + const clusterName = this.newProps.name || this.generateClusterName(); + + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + + return { + PhysicalResourceId: resp.cluster.name, + }; + } + + protected async isCreateComplete() { + return this.isActive(); + } + + // ------ + // DELETE + // ------ + + protected async onDelete(): Promise { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } catch (e: any) { + if (!(e instanceof ResourceNotFoundException)) { + throw e; + } else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + + protected async isDeleteComplete(): Promise { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } catch (e: any) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + + console.log('describeCluster error:', e); + throw e; + } + + return { + IsComplete: false, + }; + } + + // ------ + // UPDATE + // ------ + + protected async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + + return this.onCreate(); + } + + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + + return this.updateClusterVersion(this.newProps.version); + } + + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + + if (updates.updateLogging || updates.updateAccess) { + const config: aws.EKS.UpdateClusterConfigRequest = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + }; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + + return { EksUpdateId: updateResponse.update?.id }; + } + + // no updates + return; + } + + protected async isUpdateComplete() { + console.log('isUpdateComplete'); + + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + + return this.isActive(); + } + + private async updateClusterVersion(newVersion: string) { + console.log(`updating cluster version to ${newVersion}`); + + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + + private async isActive(): Promise { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url + + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + + private async isEksUpdateComplete(eksUpdateId: string) { + this.log({ isEksUpdateComplete: eksUpdateId }); + + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + + this.log({ describeUpdateResponse }); + + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + + private generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} + +function parseProps(props: any): aws.EKS.CreateClusterRequest { + + const parsed = props?.Config ?? {}; + + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + + return parsed; + +} + +interface UpdateMap { + replaceName: boolean; // name + replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds + replaceRole: boolean; // roleArn + + updateVersion: boolean; // version + updateLogging: boolean; // logging + updateEncryption: boolean; // encryption (cannot be updated) + updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess +} + +function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: + JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: + newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} + +function setsEqual(first: Set, second: Set) { + return first.size === second.size && [...first].every((e: string) => second.has(e)); +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js new file mode 100644 index 0000000000000..ed1eab8530351 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FargateProfileResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const MAX_NAME_LEN = 63; +class FargateProfileResourceHandler extends common_1.ResourceHandler { + async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + const createFargateProfile = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + const deleteFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + return; + } + async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + async isCreateComplete() { + return this.isUpdateComplete(); + } + async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + /** + * Generates a fargate profile name. + */ + generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + async queryStatus() { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + const describeFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + try { + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + return status; + } + catch (describeFargateProfileError) { + if (describeFargateProfileError instanceof client_eks_1.ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} +exports.FargateProfileResourceHandler = FargateProfileResourceHandler; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsNkRBQTZEO0FBQzdELG9EQUFnRTtBQUVoRSxxQ0FBMkM7QUFFM0MsTUFBTSxZQUFZLEdBQUcsRUFBRSxDQUFDO0FBRXhCLE1BQWEsNkJBQThCLFNBQVEsd0JBQWU7SUFDdEQsS0FBSyxDQUFDLFFBQVE7UUFDdEIsTUFBTSxrQkFBa0IsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU0sQ0FBQyxrQkFBa0IsSUFBSSxJQUFJLENBQUMsbUJBQW1CLEVBQUUsQ0FBQztRQUVqSCxNQUFNLG9CQUFvQixHQUF3QztZQUNoRSxrQkFBa0I7WUFDbEIsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU07U0FDeEMsQ0FBQztRQUVGLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxvQkFBb0IsRUFBRSxDQUFDLENBQUM7UUFDbkMsTUFBTSw0QkFBNEIsR0FBRyxNQUFNLElBQUksQ0FBQyxHQUFHLENBQUMsb0JBQW9CLENBQUMsb0JBQW9CLENBQUMsQ0FBQztRQUMvRixJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsNEJBQTRCLEVBQUUsQ0FBQyxDQUFDO1FBRTNDLElBQUksQ0FBQyw0QkFBNEIsQ0FBQyxjQUFjLEVBQUU7WUFDaEQsTUFBTSxJQUFJLEtBQUssQ0FBQyx1Q0FBdUMsQ0FBQyxDQUFDO1NBQzFEO1FBRUQsT0FBTztZQUNMLGtCQUFrQixFQUFFLDRCQUE0QixDQUFDLG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MubG9nKHsgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yIH0pO1xuICAgICAgdGhyb3cgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yO1xuICAgIH1cbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts new file mode 100644 index 0000000000000..16b9f9abfeb49 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts @@ -0,0 +1,121 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies +import { ResourceHandler } from './common'; + +const MAX_NAME_LEN = 63; + +export class FargateProfileResourceHandler extends ResourceHandler { + protected async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + + const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + + protected async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + + const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + + return; + } + + protected async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + + protected async isCreateComplete() { + return this.isUpdateComplete(); + } + + protected async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + + protected async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + + /** + * Generates a fargate profile name. + */ + private generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + private async queryStatus(): Promise { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + + const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + try { + + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + + return status; + } catch (describeFargateProfileError: any) { + if (describeFargateProfileError instanceof ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip index 93f7400e6f8c2..11112de67d5be 100644 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip new file mode 100644 index 0000000000000..90a8a2a6e2615 Binary files /dev/null and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/aws-cdk-eks-helm-test.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/aws-cdk-eks-helm-test.assets.json index 3225cbb0d505a..74b95cf89de5e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/aws-cdk-eks-helm-test.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/aws-cdk-eks-helm-test.assets.json @@ -27,15 +27,15 @@ } } }, - "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649": { + "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31": { "source": { - "path": "asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649", + "path": "asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip", + "objectKey": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -66,15 +66,15 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -92,7 +92,7 @@ } } }, - "a36e7f1cafd44a387bd51772bd40674e7110b7308aa2f6b57280298dd561dd03": { + "1194910187291f441629d8e6aa0986fa797732d878ae8b7411c82ebda84e828b": { "source": { "path": "awscdkekshelmtestawscdkawseksClusterResourceProviderB64048CD.nested.template.json", "packaging": "file" @@ -100,12 +100,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a36e7f1cafd44a387bd51772bd40674e7110b7308aa2f6b57280298dd561dd03.json", + "objectKey": "1194910187291f441629d8e6aa0986fa797732d878ae8b7411c82ebda84e828b.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "71893a73e516134c84b4f51ea96cca1a2c7634f91e8aa540097d86c88d7578ed": { + "ebb65caa82279de10698c35b1b0c387f6dad4ac3bc0ead694672984a24448479": { "source": { "path": "awscdkekshelmtestawscdkawseksKubectlProvider207F42E4.nested.template.json", "packaging": "file" @@ -113,12 +113,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "71893a73e516134c84b4f51ea96cca1a2c7634f91e8aa540097d86c88d7578ed.json", + "objectKey": "ebb65caa82279de10698c35b1b0c387f6dad4ac3bc0ead694672984a24448479.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "0ab95709037165a6e49574da048b0a7a23a3fb6c89754a4dd11832805929bdc2": { + "bee5ef05347a05ca640d19860bc6ca9048f19d31fdc38dd593b76728829e4ab7": { "source": { "path": "aws-cdk-eks-helm-test.template.json", "packaging": "file" @@ -126,7 +126,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "0ab95709037165a6e49574da048b0a7a23a3fb6c89754a4dd11832805929bdc2.json", + "objectKey": "bee5ef05347a05ca640d19860bc6ca9048f19d31fdc38dd593b76728829e4ab7.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/aws-cdk-eks-helm-test.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/aws-cdk-eks-helm-test.template.json index 60ea8ab204b92..19100816b0c9b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/aws-cdk-eks-helm-test.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/aws-cdk-eks-helm-test.template.json @@ -1214,7 +1214,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/a36e7f1cafd44a387bd51772bd40674e7110b7308aa2f6b57280298dd561dd03.json" + "/1194910187291f441629d8e6aa0986fa797732d878ae8b7411c82ebda84e828b.json" ] ] } @@ -1264,7 +1264,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/71893a73e516134c84b4f51ea96cca1a2c7634f91e8aa540097d86c88d7578ed.json" + "/ebb65caa82279de10698c35b1b0c387f6dad4ac3bc0ead694672984a24448479.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/awscdkekshelmtestawscdkawseksClusterResourceProviderB64048CD.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/awscdkekshelmtestawscdkawseksClusterResourceProviderB64048CD.nested.template.json index 931ef89abefc8..7fd2f243232f5 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/awscdkekshelmtestawscdkawseksClusterResourceProviderB64048CD.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/awscdkekshelmtestawscdkawseksClusterResourceProviderB64048CD.nested.template.json @@ -50,7 +50,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "onEvent handler for EKS cluster resource provider", "Environment": { @@ -115,7 +115,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "isComplete handler for EKS cluster resource provider", "Environment": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/awscdkekshelmtestawscdkawseksKubectlProvider207F42E4.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/awscdkekshelmtestawscdkawseksKubectlProvider207F42E4.nested.template.json index 865edf6e327fa..11b8b17a79265 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/awscdkekshelmtestawscdkawseksKubectlProvider207F42E4.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/awscdkekshelmtestawscdkawseksKubectlProvider207F42E4.nested.template.json @@ -49,7 +49,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/cdk.out index f0b901e7c06e5..560dae10d018f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"33.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/manifest.json index 672b919feaf5c..7a73143a15c52 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/manifest.json @@ -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}/0ab95709037165a6e49574da048b0a7a23a3fb6c89754a4dd11832805929bdc2.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/bee5ef05347a05ca640d19860bc6ca9048f19d31fdc38dd593b76728829e4ab7.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/tree.json index 460356b351275..b6f6f072f2dd8 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/tree.json @@ -755,7 +755,7 @@ }, "constructInfo": { "fqn": "@aws-cdk/lambda-layer-kubectl-v24.KubectlV24Layer", - "version": "2.0.229" + "version": "2.0.242" } }, "Cluster": { @@ -1734,7 +1734,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "onEvent handler for EKS cluster resource provider", "environment": { @@ -1866,7 +1866,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "isComplete handler for EKS cluster resource provider", "environment": { @@ -2772,7 +2772,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/a36e7f1cafd44a387bd51772bd40674e7110b7308aa2f6b57280298dd561dd03.json" + "/1194910187291f441629d8e6aa0986fa797732d878ae8b7411c82ebda84e828b.json" ] ] } @@ -2919,7 +2919,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -3283,7 +3283,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/71893a73e516134c84b4f51ea96cca1a2c7634f91e8aa540097d86c88d7578ed.json" + "/ebb65caa82279de10698c35b1b0c387f6dad4ac3bc0ead694672984a24448479.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip deleted file mode 100644 index e6cb898734b43..0000000000000 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and /dev/null differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js deleted file mode 100644 index b89707a0a08e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js +++ /dev/null @@ -1,277 +0,0 @@ -"use strict"; -/* eslint-disable no-console */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ClusterResourceHandler = void 0; -const common_1 = require("./common"); -const compareLogging_1 = require("./compareLogging"); -const MAX_CLUSTER_NAME_LEN = 100; -class ClusterResourceHandler extends common_1.ResourceHandler { - get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - return this.physicalResourceId; - } - constructor(eks, event) { - super(eks, event); - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - // ------ - // CREATE - // ------ - async onCreate() { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - const clusterName = this.newProps.name || this.generateClusterName(); - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - return { - PhysicalResourceId: resp.cluster.name, - }; - } - async isCreateComplete() { - return this.isActive(); - } - // ------ - // DELETE - // ------ - async onDelete() { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } - catch (e) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } - else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - async isDeleteComplete() { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } - catch (e) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - console.log('describeCluster error:', e); - throw e; - } - return { - IsComplete: false, - }; - } - // ------ - // UPDATE - // ------ - async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - return this.onCreate(); - } - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - return this.updateClusterVersion(this.newProps.version); - } - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - if (updates.updateLogging || updates.updateAccess) { - const config = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - } - ; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - return { EksUpdateId: updateResponse.update?.id }; - } - // no updates - return; - } - async isUpdateComplete() { - console.log('isUpdateComplete'); - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - return this.isActive(); - } - async updateClusterVersion(newVersion) { - console.log(`updating cluster version to ${newVersion}`); - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - async isActive() { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } - else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } - else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - async isEksUpdateComplete(eksUpdateId) { - this.log({ isEksUpdateComplete: eksUpdateId }); - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - this.log({ describeUpdateResponse }); - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} -exports.ClusterResourceHandler = ClusterResourceHandler; -function parseProps(props) { - const parsed = props?.Config ?? {}; - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - return parsed; -} -function analyzeUpdate(oldProps, newProps) { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} -function setsEqual(first, second) { - return first.size === second.size && [...first].every((e) => second.has(e)); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsd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pZnkobmV3RW5jKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkRW5jKSxcbiAgICB1cGRhdGVMb2dnaW5nOiBKU09OLnN0cmluZ2lmeShuZXdQcm9wcy5sb2dnaW5nKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkUHJvcHMubG9nZ2luZyksXG4gIH07XG59XG5cbmZ1bmN0aW9uIHNldHNFcXVhbChmaXJzdDogU2V0PHN0cmluZz4sIHNlY29uZDogU2V0PHN0cmluZz4pIHtcbiAgcmV0dXJuIGZpcnN0LnNpemUgPT09IHNlY29uZC5zaXplICYmIFsuLi5maXJzdF0uZXZlcnkoKGU6IHN0cmluZykgPT4gc2Vjb25kLmhhcyhlKSk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts deleted file mode 100644 index c058e47b62c68..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts +++ /dev/null @@ -1,348 +0,0 @@ -/* eslint-disable no-console */ - -// eslint-disable-next-line import/no-extraneous-dependencies -// eslint-disable-next-line import/no-extraneous-dependencies -import * as aws from 'aws-sdk'; -import { EksClient, ResourceEvent, ResourceHandler } from './common'; -import { compareLoggingProps } from './compareLogging'; -import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; - -const MAX_CLUSTER_NAME_LEN = 100; - -export class ClusterResourceHandler extends ResourceHandler { - public get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - - return this.physicalResourceId; - } - - private readonly newProps: aws.EKS.CreateClusterRequest; - private readonly oldProps: Partial; - - constructor(eks: EksClient, event: ResourceEvent) { - super(eks, event); - - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - - // ------ - // CREATE - // ------ - - protected async onCreate(): Promise { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - - const clusterName = this.newProps.name || this.generateClusterName(); - - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - - return { - PhysicalResourceId: resp.cluster.name, - }; - } - - protected async isCreateComplete() { - return this.isActive(); - } - - // ------ - // DELETE - // ------ - - protected async onDelete(): Promise { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } catch (e: any) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - - protected async isDeleteComplete(): Promise { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } catch (e: any) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - - console.log('describeCluster error:', e); - throw e; - } - - return { - IsComplete: false, - }; - } - - // ------ - // UPDATE - // ------ - - protected async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - - return this.onCreate(); - } - - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - - return this.updateClusterVersion(this.newProps.version); - } - - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - - if (updates.updateLogging || updates.updateAccess) { - const config: aws.EKS.UpdateClusterConfigRequest = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - }; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - - return { EksUpdateId: updateResponse.update?.id }; - } - - // no updates - return; - } - - protected async isUpdateComplete() { - console.log('isUpdateComplete'); - - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - - return this.isActive(); - } - - private async updateClusterVersion(newVersion: string) { - console.log(`updating cluster version to ${newVersion}`); - - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - - private async isActive(): Promise { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url - - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - - private async isEksUpdateComplete(eksUpdateId: string) { - this.log({ isEksUpdateComplete: eksUpdateId }); - - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - - this.log({ describeUpdateResponse }); - - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - - private generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} - -function parseProps(props: any): aws.EKS.CreateClusterRequest { - - const parsed = props?.Config ?? {}; - - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - - return parsed; - -} - -interface UpdateMap { - replaceName: boolean; // name - replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds - replaceRole: boolean; // roleArn - - updateVersion: boolean; // version - updateLogging: boolean; // logging - updateEncryption: boolean; // encryption (cannot be updated) - updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess -} - -function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: - JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: - newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} - -function setsEqual(first: Set, second: Set) { - return first.size === second.size && [...first].every((e: string) => second.has(e)); -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js deleted file mode 100644 index 34ab6ff0ba0e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FargateProfileResourceHandler = void 0; -const common_1 = require("./common"); -const MAX_NAME_LEN = 63; -class FargateProfileResourceHandler extends common_1.ResourceHandler { - async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - const createFargateProfile = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - const deleteFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - return; - } - async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - async isCreateComplete() { - return this.isUpdateComplete(); - } - async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - /** - * Generates a fargate profile name. - */ - generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - async queryStatus() { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - const describeFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - try { - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - return status; - } - catch (describeFargateProfileError) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} -exports.FargateProfileResourceHandler = FargateProfileResourceHandler; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EscUNBQTJDO0FBRTNDLE1BQU0sWUFBWSxHQUFHLEVBQUUsQ0FBQztBQUV4QixNQUFhLDZCQUE4QixTQUFRLHdCQUFlO0lBQ3RELEtBQUssQ0FBQyxRQUFRO1FBQ3RCLE1BQU0sa0JBQWtCLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNLENBQUMsa0JBQWtCLElBQUksSUFBSSxDQUFDLG1CQUFtQixFQUFFLENBQUM7UUFFakgsTUFBTSxvQkFBb0IsR0FBd0M7WUFDaEUsa0JBQWtCO1lBQ2xCLEdBQUcsSUFBSSx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YXRlUHJvZmlsZUVycm9yOiBhbnkpIHtcbiAgICAgIGlmIChkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IuY29kZSA9PT0gJ1Jlc291cmNlTm90Rm91bmRFeGNlcHRpb24nKSB7XG4gICAgICAgIHRoaXMubG9nKCdyZWNlaXZlZCBSZXNvdXJjZU5vdEZvdW5kRXhjZXB0aW9uLCB0aGlzIG1lYW5zIHRoZSBwcm9maWxlIGhhcyBiZWVuIGRlbGV0ZWQgKG9yIG5ldmVyIGV4aXN0ZWQpJyk7XG4gICAgICAgIHJldHVybiAnTk9UX0ZPVU5EJztcbiAgICAgIH1cblxuICAgICAgdGhpcy5sb2coeyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IgfSk7XG4gICAgICB0aHJvdyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3I7XG4gICAgfVxuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts deleted file mode 100644 index 7db97a7f69d38..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts +++ /dev/null @@ -1,119 +0,0 @@ -import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies -import { ResourceHandler } from './common'; - -const MAX_NAME_LEN = 63; - -export class FargateProfileResourceHandler extends ResourceHandler { - protected async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - - const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - - protected async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - - const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - - return; - } - - protected async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - - protected async isCreateComplete() { - return this.isUpdateComplete(); - } - - protected async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - - protected async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - - /** - * Generates a fargate profile name. - */ - private generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - private async queryStatus(): Promise { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - - const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - try { - - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - - return status; - } catch (describeFargateProfileError: any) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js new file mode 100644 index 0000000000000..aefb970a3fe47 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js @@ -0,0 +1,280 @@ +"use strict"; +/* eslint-disable no-console */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClusterResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const compareLogging_1 = require("./compareLogging"); +const MAX_CLUSTER_NAME_LEN = 100; +class ClusterResourceHandler extends common_1.ResourceHandler { + get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + return this.physicalResourceId; + } + constructor(eks, event) { + super(eks, event); + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + // ------ + // CREATE + // ------ + async onCreate() { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + const clusterName = this.newProps.name || this.generateClusterName(); + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + return { + PhysicalResourceId: resp.cluster.name, + }; + } + async isCreateComplete() { + return this.isActive(); + } + // ------ + // DELETE + // ------ + async onDelete() { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } + catch (e) { + if (!(e instanceof client_eks_1.ResourceNotFoundException)) { + throw e; + } + else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + async isDeleteComplete() { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } + catch (e) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof client_eks_1.ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + console.log('describeCluster error:', e); + throw e; + } + return { + IsComplete: false, + }; + } + // ------ + // UPDATE + // ------ + async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + return this.onCreate(); + } + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + return this.updateClusterVersion(this.newProps.version); + } + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + if (updates.updateLogging || updates.updateAccess) { + const config = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + } + ; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + return { EksUpdateId: updateResponse.update?.id }; + } + // no updates + return; + } + async isUpdateComplete() { + console.log('isUpdateComplete'); + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + return this.isActive(); + } + async updateClusterVersion(newVersion) { + console.log(`updating cluster version to ${newVersion}`); + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + async isActive() { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } + else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } + else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + async isEksUpdateComplete(eksUpdateId) { + this.log({ isEksUpdateComplete: eksUpdateId }); + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + this.log({ describeUpdateResponse }); + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} +exports.ClusterResourceHandler = ClusterResourceHandler; +function parseProps(props) { + const parsed = props?.Config ?? {}; + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + return parsed; +} +function analyzeUpdate(oldProps, newProps) { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} +function setsEqual(first, second) { + return first.size === second.size && [...first].every((e) => second.has(e)); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBRS9CLDZEQUE2RDtBQUM3RCxvREFBZ0U7QUFHaEUscUNBQXFFO0FBQ3JFLHFEQUF1RDtBQUd2RCxNQU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ZUVuY3J5cHRpb246IEpTT04uc3RyaW5naWZ5KG5ld0VuYykgIT09IEpTT04uc3RyaW5naWZ5KG9sZEVuYyksXG4gICAgdXBkYXRlTG9nZ2luZzogSlNPTi5zdHJpbmdpZnkobmV3UHJvcHMubG9nZ2luZykgIT09IEpTT04uc3RyaW5naWZ5KG9sZFByb3BzLmxvZ2dpbmcpLFxuICB9O1xufVxuXG5mdW5jdGlvbiBzZXRzRXF1YWwoZmlyc3Q6IFNldDxzdHJpbmc+LCBzZWNvbmQ6IFNldDxzdHJpbmc+KSB7XG4gIHJldHVybiBmaXJzdC5zaXplID09PSBzZWNvbmQuc2l6ZSAmJiBbLi4uZmlyc3RdLmV2ZXJ5KChlOiBzdHJpbmcpID0+IHNlY29uZC5oYXMoZSkpO1xufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts new file mode 100644 index 0000000000000..3a0a7294db31d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts @@ -0,0 +1,350 @@ +/* eslint-disable no-console */ + +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +// eslint-disable-next-line import/no-extraneous-dependencies +import * as aws from 'aws-sdk'; +import { EksClient, ResourceEvent, ResourceHandler } from './common'; +import { compareLoggingProps } from './compareLogging'; +import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; + +const MAX_CLUSTER_NAME_LEN = 100; + +export class ClusterResourceHandler extends ResourceHandler { + public get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + + return this.physicalResourceId; + } + + private readonly newProps: aws.EKS.CreateClusterRequest; + private readonly oldProps: Partial; + + constructor(eks: EksClient, event: ResourceEvent) { + super(eks, event); + + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + + // ------ + // CREATE + // ------ + + protected async onCreate(): Promise { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + + const clusterName = this.newProps.name || this.generateClusterName(); + + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + + return { + PhysicalResourceId: resp.cluster.name, + }; + } + + protected async isCreateComplete() { + return this.isActive(); + } + + // ------ + // DELETE + // ------ + + protected async onDelete(): Promise { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } catch (e: any) { + if (!(e instanceof ResourceNotFoundException)) { + throw e; + } else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + + protected async isDeleteComplete(): Promise { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } catch (e: any) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + + console.log('describeCluster error:', e); + throw e; + } + + return { + IsComplete: false, + }; + } + + // ------ + // UPDATE + // ------ + + protected async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + + return this.onCreate(); + } + + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + + return this.updateClusterVersion(this.newProps.version); + } + + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + + if (updates.updateLogging || updates.updateAccess) { + const config: aws.EKS.UpdateClusterConfigRequest = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + }; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + + return { EksUpdateId: updateResponse.update?.id }; + } + + // no updates + return; + } + + protected async isUpdateComplete() { + console.log('isUpdateComplete'); + + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + + return this.isActive(); + } + + private async updateClusterVersion(newVersion: string) { + console.log(`updating cluster version to ${newVersion}`); + + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + + private async isActive(): Promise { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url + + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + + private async isEksUpdateComplete(eksUpdateId: string) { + this.log({ isEksUpdateComplete: eksUpdateId }); + + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + + this.log({ describeUpdateResponse }); + + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + + private generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} + +function parseProps(props: any): aws.EKS.CreateClusterRequest { + + const parsed = props?.Config ?? {}; + + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + + return parsed; + +} + +interface UpdateMap { + replaceName: boolean; // name + replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds + replaceRole: boolean; // roleArn + + updateVersion: boolean; // version + updateLogging: boolean; // logging + updateEncryption: boolean; // encryption (cannot be updated) + updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess +} + +function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: + JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: + newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} + +function setsEqual(first: Set, second: Set) { + return first.size === second.size && [...first].every((e: string) => second.has(e)); +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js new file mode 100644 index 0000000000000..ed1eab8530351 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FargateProfileResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const MAX_NAME_LEN = 63; +class FargateProfileResourceHandler extends common_1.ResourceHandler { + async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + const createFargateProfile = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + const deleteFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + return; + } + async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + async isCreateComplete() { + return this.isUpdateComplete(); + } + async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + /** + * Generates a fargate profile name. + */ + generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + async queryStatus() { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + const describeFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + try { + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + return status; + } + catch (describeFargateProfileError) { + if (describeFargateProfileError instanceof client_eks_1.ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} +exports.FargateProfileResourceHandler = FargateProfileResourceHandler; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsNkRBQTZEO0FBQzdELG9EQUFnRTtBQUVoRSxxQ0FBMkM7QUFFM0MsTUFBTSxZQUFZLEdBQUcsRUFBRSxDQUFDO0FBRXhCLE1BQWEs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O1xuICAgICAgdGhpcy5sb2coeyBkZXNjcmliZUZhcmdhdGVQcm9maWxlUmVzcG9uc2UgfSk7XG4gICAgICBjb25zdCBzdGF0dXMgPSBkZXNjcmliZUZhcmdhdGVQcm9maWxlUmVzcG9uc2UuZmFyZ2F0ZVByb2ZpbGU/LnN0YXR1cztcblxuICAgICAgaWYgKHN0YXR1cyA9PT0gJ0NSRUFURV9GQUlMRUQnIHx8IHN0YXR1cyA9PT0gJ0RFTEVURV9GQUlMRUQnKSB7XG4gICAgICAgIHRocm93IG5ldyBFcnJvcihzdGF0dXMpO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gc3RhdHVzO1xuICAgIH0gY2F0Y2ggKGRlc2NyaWJlRmFyZ2F0ZVByb2ZpbGVFcnJvcjogYW55KSB7XG4gICAgICBpZiAoZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yIGluc3RhbmNlb2YgUmVzb3VyY2VOb3RGb3VuZEV4Y2VwdGlvbikge1xuICAgICAgICB0aGlzLmxvZygncmVjZWl2ZWQgUmVzb3VyY2VOb3RGb3VuZEV4Y2VwdGlvbiwgdGhpcyBtZWFucyB0aGUgcHJvZmlsZSBoYXMgYmVlbiBkZWxldGVkIChvciBuZXZlciBleGlzdGVkKScpO1xuICAgICAgICByZXR1cm4gJ05PVF9GT1VORCc7XG4gICAgICB9XG5cbiAgICAgIHRoaXMubG9nKHsgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yIH0pO1xuICAgICAgdGhyb3cgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yO1xuICAgIH1cbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts new file mode 100644 index 0000000000000..16b9f9abfeb49 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts @@ -0,0 +1,121 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies +import { ResourceHandler } from './common'; + +const MAX_NAME_LEN = 63; + +export class FargateProfileResourceHandler extends ResourceHandler { + protected async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + + const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + + protected async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + + const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + + return; + } + + protected async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + + protected async isCreateComplete() { + return this.isUpdateComplete(); + } + + protected async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + + protected async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + + /** + * Generates a fargate profile name. + */ + private generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + private async queryStatus(): Promise { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + + const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + try { + + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + + return status; + } catch (describeFargateProfileError: any) { + if (describeFargateProfileError instanceof ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip index 93f7400e6f8c2..11112de67d5be 100644 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip new file mode 100644 index 0000000000000..90a8a2a6e2615 Binary files /dev/null and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/aws-cdk-eks-cluster-inference-test.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/aws-cdk-eks-cluster-inference-test.assets.json index f9b63e873f768..80966c0e0e6f7 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/aws-cdk-eks-cluster-inference-test.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/aws-cdk-eks-cluster-inference-test.assets.json @@ -27,15 +27,15 @@ } } }, - "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649": { + "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31": { "source": { - "path": "asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649", + "path": "asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip", + "objectKey": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -66,15 +66,15 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -105,7 +105,7 @@ } } }, - "34b23ebe2c96ab11af6be9fa220c5a794b14107883de85a1ab7d3d544a1447c9": { + "e5ed7b6d87b87380b6100ceee0132e754d89d873b4916aa2750159856f29aaf6": { "source": { "path": "awscdkeksclusterinferencetestawscdkawseksClusterResourceProviderFE14F3C4.nested.template.json", "packaging": "file" @@ -113,12 +113,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "34b23ebe2c96ab11af6be9fa220c5a794b14107883de85a1ab7d3d544a1447c9.json", + "objectKey": "e5ed7b6d87b87380b6100ceee0132e754d89d873b4916aa2750159856f29aaf6.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "1306e6285fc292b6cf0b99ad7685af7db62e104d61b7071787531c1fbddd2525": { + "e5bdf8c2538a6ea138b7601a9e793b272e1135eb5c21167277f404c9ff94ee2b": { "source": { "path": "awscdkeksclusterinferencetestawscdkawseksKubectlProviderB4348345.nested.template.json", "packaging": "file" @@ -126,12 +126,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "1306e6285fc292b6cf0b99ad7685af7db62e104d61b7071787531c1fbddd2525.json", + "objectKey": "e5bdf8c2538a6ea138b7601a9e793b272e1135eb5c21167277f404c9ff94ee2b.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "6bff4cdd4b29122392d5c57fb039379b577e2ac7f0c8623d5d4445384f7ad9df": { + "d8bc0e310478dae0984528243d9da20321bd9a24b42b03afbf4ec93c4af0d7e0": { "source": { "path": "aws-cdk-eks-cluster-inference-test.template.json", "packaging": "file" @@ -139,7 +139,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "6bff4cdd4b29122392d5c57fb039379b577e2ac7f0c8623d5d4445384f7ad9df.json", + "objectKey": "d8bc0e310478dae0984528243d9da20321bd9a24b42b03afbf4ec93c4af0d7e0.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/aws-cdk-eks-cluster-inference-test.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/aws-cdk-eks-cluster-inference-test.template.json index 8bb84e8c17cdd..cd28280524f06 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/aws-cdk-eks-cluster-inference-test.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/aws-cdk-eks-cluster-inference-test.template.json @@ -1623,7 +1623,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/34b23ebe2c96ab11af6be9fa220c5a794b14107883de85a1ab7d3d544a1447c9.json" + "/e5ed7b6d87b87380b6100ceee0132e754d89d873b4916aa2750159856f29aaf6.json" ] ] } @@ -1673,7 +1673,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/1306e6285fc292b6cf0b99ad7685af7db62e104d61b7071787531c1fbddd2525.json" + "/e5bdf8c2538a6ea138b7601a9e793b272e1135eb5c21167277f404c9ff94ee2b.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/awscdkeksclusterinferencetestawscdkawseksClusterResourceProviderFE14F3C4.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/awscdkeksclusterinferencetestawscdkawseksClusterResourceProviderFE14F3C4.nested.template.json index d8dc5573b8b05..1cde37e6bc25c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/awscdkeksclusterinferencetestawscdkawseksClusterResourceProviderFE14F3C4.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/awscdkeksclusterinferencetestawscdkawseksClusterResourceProviderFE14F3C4.nested.template.json @@ -50,7 +50,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "onEvent handler for EKS cluster resource provider", "Environment": { @@ -115,7 +115,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "isComplete handler for EKS cluster resource provider", "Environment": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/awscdkeksclusterinferencetestawscdkawseksKubectlProviderB4348345.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/awscdkeksclusterinferencetestawscdkawseksKubectlProviderB4348345.nested.template.json index 223775fdc659f..f9b5ae80b0840 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/awscdkeksclusterinferencetestawscdkawseksKubectlProviderB4348345.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/awscdkeksclusterinferencetestawscdkawseksKubectlProviderB4348345.nested.template.json @@ -49,7 +49,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/cdk.out index f0b901e7c06e5..560dae10d018f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"33.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/manifest.json index be30f242ba23f..c2cc1d3f3bd5f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/manifest.json @@ -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}/6bff4cdd4b29122392d5c57fb039379b577e2ac7f0c8623d5d4445384f7ad9df.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/d8bc0e310478dae0984528243d9da20321bd9a24b42b03afbf4ec93c4af0d7e0.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/tree.json index 8e8bcb286dbc1..3c1114efa218c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-inference.js.snapshot/tree.json @@ -697,7 +697,7 @@ }, "constructInfo": { "fqn": "@aws-cdk/lambda-layer-kubectl-v24.KubectlV24Layer", - "version": "2.0.229" + "version": "2.0.242" } }, "Cluster": { @@ -2355,7 +2355,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "onEvent handler for EKS cluster resource provider", "environment": { @@ -2487,7 +2487,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "isComplete handler for EKS cluster resource provider", "environment": { @@ -3393,7 +3393,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/34b23ebe2c96ab11af6be9fa220c5a794b14107883de85a1ab7d3d544a1447c9.json" + "/e5ed7b6d87b87380b6100ceee0132e754d89d873b4916aa2750159856f29aaf6.json" ] ] } @@ -3540,7 +3540,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -3904,7 +3904,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/1306e6285fc292b6cf0b99ad7685af7db62e104d61b7071787531c1fbddd2525.json" + "/e5bdf8c2538a6ea138b7601a9e793b272e1135eb5c21167277f404c9ff94ee2b.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.7705cc252ab1eeb629bb53e4d1ce98fb3340345a1efa3cc71fe96888849c67b5/.dockerignore b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.01ecf926c2e6a104a870f02a3baf41052ee5b8ec115433a56e6795dd11c73671/.dockerignore similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.7705cc252ab1eeb629bb53e4d1ce98fb3340345a1efa3cc71fe96888849c67b5/.dockerignore rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.01ecf926c2e6a104a870f02a3baf41052ee5b8ec115433a56e6795dd11c73671/.dockerignore diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.7705cc252ab1eeb629bb53e4d1ce98fb3340345a1efa3cc71fe96888849c67b5/Dockerfile b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.01ecf926c2e6a104a870f02a3baf41052ee5b8ec115433a56e6795dd11c73671/Dockerfile similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.7705cc252ab1eeb629bb53e4d1ce98fb3340345a1efa3cc71fe96888849c67b5/Dockerfile rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.01ecf926c2e6a104a870f02a3baf41052ee5b8ec115433a56e6795dd11c73671/Dockerfile diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.7705cc252ab1eeb629bb53e4d1ce98fb3340345a1efa3cc71fe96888849c67b5/package-lock.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.01ecf926c2e6a104a870f02a3baf41052ee5b8ec115433a56e6795dd11c73671/package-lock.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.7705cc252ab1eeb629bb53e4d1ce98fb3340345a1efa3cc71fe96888849c67b5/package-lock.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.01ecf926c2e6a104a870f02a3baf41052ee5b8ec115433a56e6795dd11c73671/package-lock.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.7705cc252ab1eeb629bb53e4d1ce98fb3340345a1efa3cc71fe96888849c67b5/package.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.01ecf926c2e6a104a870f02a3baf41052ee5b8ec115433a56e6795dd11c73671/package.json similarity index 79% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.7705cc252ab1eeb629bb53e4d1ce98fb3340345a1efa3cc71fe96888849c67b5/package.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.01ecf926c2e6a104a870f02a3baf41052ee5b8ec115433a56e6795dd11c73671/package.json index 7931e4aa1f62d..a3103400a8007 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.7705cc252ab1eeb629bb53e4d1ce98fb3340345a1efa3cc71fe96888849c67b5/package.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.01ecf926c2e6a104a870f02a3baf41052ee5b8ec115433a56e6795dd11c73671/package.json @@ -2,6 +2,6 @@ "name": "eks-service-account-sdk-call-integ-test", "private": "true", "dependencies": { - "aws-sdk": "^2.1379.0" + "aws-sdk": "^2.1414.0" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.7705cc252ab1eeb629bb53e4d1ce98fb3340345a1efa3cc71fe96888849c67b5/sdk-call.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.01ecf926c2e6a104a870f02a3baf41052ee5b8ec115433a56e6795dd11c73671/sdk-call.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.7705cc252ab1eeb629bb53e4d1ce98fb3340345a1efa3cc71fe96888849c67b5/sdk-call.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.01ecf926c2e6a104a870f02a3baf41052ee5b8ec115433a56e6795dd11c73671/sdk-call.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip deleted file mode 100644 index e6cb898734b43..0000000000000 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and /dev/null differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js deleted file mode 100644 index b89707a0a08e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js +++ /dev/null @@ -1,277 +0,0 @@ -"use strict"; -/* eslint-disable no-console */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ClusterResourceHandler = void 0; -const common_1 = require("./common"); -const compareLogging_1 = require("./compareLogging"); -const MAX_CLUSTER_NAME_LEN = 100; -class ClusterResourceHandler extends common_1.ResourceHandler { - get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - return this.physicalResourceId; - } - constructor(eks, event) { - super(eks, event); - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - // ------ - // CREATE - // ------ - async onCreate() { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - const clusterName = this.newProps.name || this.generateClusterName(); - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - return { - PhysicalResourceId: resp.cluster.name, - }; - } - async isCreateComplete() { - return this.isActive(); - } - // ------ - // DELETE - // ------ - async onDelete() { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } - catch (e) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } - else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - async isDeleteComplete() { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } - catch (e) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - console.log('describeCluster error:', e); - throw e; - } - return { - IsComplete: false, - }; - } - // ------ - // UPDATE - // ------ - async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - return this.onCreate(); - } - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - return this.updateClusterVersion(this.newProps.version); - } - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - if (updates.updateLogging || updates.updateAccess) { - const config = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - } - ; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - return { EksUpdateId: updateResponse.update?.id }; - } - // no updates - return; - } - async isUpdateComplete() { - console.log('isUpdateComplete'); - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - return this.isActive(); - } - async updateClusterVersion(newVersion) { - console.log(`updating cluster version to ${newVersion}`); - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - async isActive() { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } - else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } - else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - async isEksUpdateComplete(eksUpdateId) { - this.log({ isEksUpdateComplete: eksUpdateId }); - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - this.log({ describeUpdateResponse }); - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} -exports.ClusterResourceHandler = ClusterResourceHandler; -function parseProps(props) { - const parsed = props?.Config ?? {}; - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - return parsed; -} -function analyzeUpdate(oldProps, newProps) { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} -function setsEqual(first, second) { - return first.size === second.size && [...first].every((e) => second.has(e)); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBSy9CLHFDQUFxRTtBQUNyRSxxREFBdUQ7QUFHdkQsTUFBTSxvQkFBb0IsR0FBRyxHQUFHLENBQUM7QUFFakMsTUFBYSxzQkFBdUIsU0FBUSx3QkFBZTtJQUN6RCxJQUFXLFdBQVc7UUFDcEIsSUFBSSxDQUFDLElBQUksQ0FBQyxrQkFBa0IsRUFBRTtZQUM1QixNQUFNLElBQUksS0FBSyxDQUFDLDREQUE0RCxDQUFDLENBQUM7U0FDL0U7UUFFRCxPQUFPLElBQUksQ0FBQyxrQkFBa0IsQ0FBQztLQUNoQztJQUtELFlBQVksR0FBYyxFQUFFLEtBQW9CO1FBQzlDLEtBQUssQ0FBQyxHQUFHLEVBQUUsS0FBSyxDQUFDLENBQUM7UUFFbEIsSUFBSSxDQUFDLFFBQVEsR0FBRyxVQUFVLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO1FBQzFELElBQUksQ0FBQyxRQUFRLEdBQUcsS0FBSyxDQUFDLFdBQVcsS0FBSyxRQUFRLENBQUMsQ0FBQyxDQUFDLFVBQVUsQ0FBQyxLQUFLLENBQUMscUJBQXFCLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDO1FBQzlGLDhGQUE4RjtRQUM5RixNQUFNLFFBQVEsR0FBMEMsSUFBQSxvQ0FBbUIsRUFBQyxJQUFJLENBQUMsUUFBUSxFQUFFLElBQUksQ0FBQyxRQU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ibGljQWNjZXNzQ2lkcnMpLFxuICAgIHJlcGxhY2VSb2xlOiBuZXdQcm9wcy5yb2xlQXJuICE9PSBvbGRQcm9wcy5yb2xlQXJuLFxuICAgIHVwZGF0ZVZlcnNpb246IG5ld1Byb3BzLnZlcnNpb24gIT09IG9sZFByb3BzLnZlcnNpb24sXG4gICAgdXBkYXRlRW5jcnlwdGlvbjogSlNPTi5zdHJpbmdpZnkobmV3RW5jKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkRW5jKSxcbiAgICB1cGRhdGVMb2dnaW5nOiBKU09OLnN0cmluZ2lmeShuZXdQcm9wcy5sb2dnaW5nKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkUHJvcHMubG9nZ2luZyksXG4gIH07XG59XG5cbmZ1bmN0aW9uIHNldHNFcXVhbChmaXJzdDogU2V0PHN0cmluZz4sIHNlY29uZDogU2V0PHN0cmluZz4pIHtcbiAgcmV0dXJuIGZpcnN0LnNpemUgPT09IHNlY29uZC5zaXplICYmIFsuLi5maXJzdF0uZXZlcnkoKGU6IHN0cmluZykgPT4gc2Vjb25kLmhhcyhlKSk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts deleted file mode 100644 index c058e47b62c68..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts +++ /dev/null @@ -1,348 +0,0 @@ -/* eslint-disable no-console */ - -// eslint-disable-next-line import/no-extraneous-dependencies -// eslint-disable-next-line import/no-extraneous-dependencies -import * as aws from 'aws-sdk'; -import { EksClient, ResourceEvent, ResourceHandler } from './common'; -import { compareLoggingProps } from './compareLogging'; -import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; - -const MAX_CLUSTER_NAME_LEN = 100; - -export class ClusterResourceHandler extends ResourceHandler { - public get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - - return this.physicalResourceId; - } - - private readonly newProps: aws.EKS.CreateClusterRequest; - private readonly oldProps: Partial; - - constructor(eks: EksClient, event: ResourceEvent) { - super(eks, event); - - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - - // ------ - // CREATE - // ------ - - protected async onCreate(): Promise { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - - const clusterName = this.newProps.name || this.generateClusterName(); - - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - - return { - PhysicalResourceId: resp.cluster.name, - }; - } - - protected async isCreateComplete() { - return this.isActive(); - } - - // ------ - // DELETE - // ------ - - protected async onDelete(): Promise { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } catch (e: any) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - - protected async isDeleteComplete(): Promise { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } catch (e: any) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - - console.log('describeCluster error:', e); - throw e; - } - - return { - IsComplete: false, - }; - } - - // ------ - // UPDATE - // ------ - - protected async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - - return this.onCreate(); - } - - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - - return this.updateClusterVersion(this.newProps.version); - } - - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - - if (updates.updateLogging || updates.updateAccess) { - const config: aws.EKS.UpdateClusterConfigRequest = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - }; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - - return { EksUpdateId: updateResponse.update?.id }; - } - - // no updates - return; - } - - protected async isUpdateComplete() { - console.log('isUpdateComplete'); - - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - - return this.isActive(); - } - - private async updateClusterVersion(newVersion: string) { - console.log(`updating cluster version to ${newVersion}`); - - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - - private async isActive(): Promise { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url - - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - - private async isEksUpdateComplete(eksUpdateId: string) { - this.log({ isEksUpdateComplete: eksUpdateId }); - - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - - this.log({ describeUpdateResponse }); - - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - - private generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} - -function parseProps(props: any): aws.EKS.CreateClusterRequest { - - const parsed = props?.Config ?? {}; - - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - - return parsed; - -} - -interface UpdateMap { - replaceName: boolean; // name - replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds - replaceRole: boolean; // roleArn - - updateVersion: boolean; // version - updateLogging: boolean; // logging - updateEncryption: boolean; // encryption (cannot be updated) - updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess -} - -function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: - JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: - newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} - -function setsEqual(first: Set, second: Set) { - return first.size === second.size && [...first].every((e: string) => second.has(e)); -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js deleted file mode 100644 index 34ab6ff0ba0e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FargateProfileResourceHandler = void 0; -const common_1 = require("./common"); -const MAX_NAME_LEN = 63; -class FargateProfileResourceHandler extends common_1.ResourceHandler { - async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - const createFargateProfile = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - const deleteFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - return; - } - async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - async isCreateComplete() { - return this.isUpdateComplete(); - } - async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - /** - * Generates a fargate profile name. - */ - generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - async queryStatus() { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - const describeFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - try { - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - return status; - } - catch (describeFargateProfileError) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} -exports.FargateProfileResourceHandler = FargateProfileResourceHandler; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EscUNBQTJDO0FBRTNDLE1BQU0sWUFBWSxHQUFHLEVBQUUsQ0FBQztBQUV4QixNQUFhLDZC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pbGVSZXNwb25zZS5mYXJnYXRlUHJvZmlsZT8uc3RhdHVzO1xuXG4gICAgICBpZiAoc3RhdHVzID09PSAnQ1JFQVRFX0ZBSUxFRCcgfHwgc3RhdHVzID09PSAnREVMRVRFX0ZBSUxFRCcpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKHN0YXR1cyk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfSBjYXRjaCAoZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yOiBhbnkpIHtcbiAgICAgIGlmIChkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IuY29kZSA9PT0gJ1Jlc291cmNlTm90Rm91bmRFeGNlcHRpb24nKSB7XG4gICAgICAgIHRoaXMubG9nKCdyZWNlaXZlZCBSZXNvdXJjZU5vdEZvdW5kRXhjZXB0aW9uLCB0aGlzIG1lYW5zIHRoZSBwcm9maWxlIGhhcyBiZWVuIGRlbGV0ZWQgKG9yIG5ldmVyIGV4aXN0ZWQpJyk7XG4gICAgICAgIHJldHVybiAnTk9UX0ZPVU5EJztcbiAgICAgIH1cblxuICAgICAgdGhpcy5sb2coeyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IgfSk7XG4gICAgICB0aHJvdyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3I7XG4gICAgfVxuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts deleted file mode 100644 index 7db97a7f69d38..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts +++ /dev/null @@ -1,119 +0,0 @@ -import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies -import { ResourceHandler } from './common'; - -const MAX_NAME_LEN = 63; - -export class FargateProfileResourceHandler extends ResourceHandler { - protected async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - - const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - - protected async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - - const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - - return; - } - - protected async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - - protected async isCreateComplete() { - return this.isUpdateComplete(); - } - - protected async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - - protected async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - - /** - * Generates a fargate profile name. - */ - private generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - private async queryStatus(): Promise { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - - const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - try { - - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - - return status; - } catch (describeFargateProfileError: any) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js new file mode 100644 index 0000000000000..aefb970a3fe47 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js @@ -0,0 +1,280 @@ +"use strict"; +/* eslint-disable no-console */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClusterResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const compareLogging_1 = require("./compareLogging"); +const MAX_CLUSTER_NAME_LEN = 100; +class ClusterResourceHandler extends common_1.ResourceHandler { + get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + return this.physicalResourceId; + } + constructor(eks, event) { + super(eks, event); + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + // ------ + // CREATE + // ------ + async onCreate() { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + const clusterName = this.newProps.name || this.generateClusterName(); + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + return { + PhysicalResourceId: resp.cluster.name, + }; + } + async isCreateComplete() { + return this.isActive(); + } + // ------ + // DELETE + // ------ + async onDelete() { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } + catch (e) { + if (!(e instanceof client_eks_1.ResourceNotFoundException)) { + throw e; + } + else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + async isDeleteComplete() { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } + catch (e) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof client_eks_1.ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + console.log('describeCluster error:', e); + throw e; + } + return { + IsComplete: false, + }; + } + // ------ + // UPDATE + // ------ + async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + return this.onCreate(); + } + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + return this.updateClusterVersion(this.newProps.version); + } + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + if (updates.updateLogging || updates.updateAccess) { + const config = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + } + ; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + return { EksUpdateId: updateResponse.update?.id }; + } + // no updates + return; + } + async isUpdateComplete() { + console.log('isUpdateComplete'); + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + return this.isActive(); + } + async updateClusterVersion(newVersion) { + console.log(`updating cluster version to ${newVersion}`); + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + async isActive() { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } + else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } + else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + async isEksUpdateComplete(eksUpdateId) { + this.log({ isEksUpdateComplete: eksUpdateId }); + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + this.log({ describeUpdateResponse }); + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} +exports.ClusterResourceHandler = ClusterResourceHandler; +function parseProps(props) { + const parsed = props?.Config ?? {}; + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + return parsed; +} +function analyzeUpdate(oldProps, newProps) { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} +function setsEqual(first, second) { + return first.size === second.size && [...first].every((e) => second.has(e)); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBRS9CLDZEQUE2RDtBQUM3RCxvREFBZ0U7QUFHaEUscUNBQXFFO0FBQ3JFLHFEQUF1RDtBQUd2RCxNQUFNLG9CQUFvQixHQUFHLEdBQUcsQ0FBQztBQUVqQyxNQUFhLHNCQUF1QixTQUFRLHdCQUFlO0lBQ3pELElBQVcsV0FBVztRQUNwQixJQUFJLENBQUMsSUFBSSxDQUFDLGtCQUFrQixFQUFFO1lBQzVCLE1BQU0sSUFBSSxLQUFLLENBQUMsNERBQTRELENBQUMsQ0FBQztTQUMvRTtRQUVELE9BQU8sSUFBSSxDQUFDLGtCQUFrQixDQUFDO0tBQ2hDO0lBS0QsWUFBWSxHQUFjLEVBQUUsS0FBb0I7UUFDOUMsS0FBSyxDQUFDLEdBQUcsRUFBRSxLQUFLLENBQUMsQ0FBQztRQUVsQixJQUFJLENBQUMsUUFBUSxHQUFHLFVBQVUsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLENBQUM7UUFDMUQsSUFBSSxDQUFDLFFBQVEsR0FBRyxLQUFLLENBQUMsV0FBVyxLQUFLLFFBQVEsQ0FBQyxDQUFDLENBQUMsVUFBVSxDQUFDLEtBQUssQ0FBQyxxQkFBcUIsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUM7UUFDOUYsOEZBQThGO1FBQzlGLE1BQU0sUUFBUSxHQUEwQyxJQUFBLG9DQUFtQixFQUFDLElBQUksQ0FBQyxRQUFRLEVBQUUsSUFBSSxDQUFDLF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m9wcy5lbmRwb2ludFB1YmxpY0FjY2VzcyAhPT0gb2xkVnBjUHJvcHMuZW5kcG9pbnRQdWJsaWNBY2Nlc3MgfHxcbiAgICAgICFzZXRzRXF1YWwobmV3UHVibGljQWNjZXNzQ2lkcnMsIG9sZFB1YmxpY0FjY2Vzc0NpZHJzKSxcbiAgICByZXBsYWNlUm9sZTogbmV3UHJvcHMucm9sZUFybiAhPT0gb2xkUHJvcHMucm9sZUFybixcbiAgICB1cGRhdGVWZXJzaW9uOiBuZXdQcm9wcy52ZXJzaW9uICE9PSBvbGRQcm9wcy52ZXJzaW9uLFxuICAgIHVwZGF0ZUVuY3J5cHRpb246IEpTT04uc3RyaW5naWZ5KG5ld0VuYykgIT09IEpTT04uc3RyaW5naWZ5KG9sZEVuYyksXG4gICAgdXBkYXRlTG9nZ2luZzogSlNPTi5zdHJpbmdpZnkobmV3UHJvcHMubG9nZ2luZykgIT09IEpTT04uc3RyaW5naWZ5KG9sZFByb3BzLmxvZ2dpbmcpLFxuICB9O1xufVxuXG5mdW5jdGlvbiBzZXRzRXF1YWwoZmlyc3Q6IFNldDxzdHJpbmc+LCBzZWNvbmQ6IFNldDxzdHJpbmc+KSB7XG4gIHJldHVybiBmaXJzdC5zaXplID09PSBzZWNvbmQuc2l6ZSAmJiBbLi4uZmlyc3RdLmV2ZXJ5KChlOiBzdHJpbmcpID0+IHNlY29uZC5oYXMoZSkpO1xufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts new file mode 100644 index 0000000000000..3a0a7294db31d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts @@ -0,0 +1,350 @@ +/* eslint-disable no-console */ + +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +// eslint-disable-next-line import/no-extraneous-dependencies +import * as aws from 'aws-sdk'; +import { EksClient, ResourceEvent, ResourceHandler } from './common'; +import { compareLoggingProps } from './compareLogging'; +import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; + +const MAX_CLUSTER_NAME_LEN = 100; + +export class ClusterResourceHandler extends ResourceHandler { + public get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + + return this.physicalResourceId; + } + + private readonly newProps: aws.EKS.CreateClusterRequest; + private readonly oldProps: Partial; + + constructor(eks: EksClient, event: ResourceEvent) { + super(eks, event); + + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + + // ------ + // CREATE + // ------ + + protected async onCreate(): Promise { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + + const clusterName = this.newProps.name || this.generateClusterName(); + + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + + return { + PhysicalResourceId: resp.cluster.name, + }; + } + + protected async isCreateComplete() { + return this.isActive(); + } + + // ------ + // DELETE + // ------ + + protected async onDelete(): Promise { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } catch (e: any) { + if (!(e instanceof ResourceNotFoundException)) { + throw e; + } else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + + protected async isDeleteComplete(): Promise { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } catch (e: any) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + + console.log('describeCluster error:', e); + throw e; + } + + return { + IsComplete: false, + }; + } + + // ------ + // UPDATE + // ------ + + protected async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + + return this.onCreate(); + } + + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + + return this.updateClusterVersion(this.newProps.version); + } + + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + + if (updates.updateLogging || updates.updateAccess) { + const config: aws.EKS.UpdateClusterConfigRequest = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + }; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + + return { EksUpdateId: updateResponse.update?.id }; + } + + // no updates + return; + } + + protected async isUpdateComplete() { + console.log('isUpdateComplete'); + + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + + return this.isActive(); + } + + private async updateClusterVersion(newVersion: string) { + console.log(`updating cluster version to ${newVersion}`); + + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + + private async isActive(): Promise { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url + + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + + private async isEksUpdateComplete(eksUpdateId: string) { + this.log({ isEksUpdateComplete: eksUpdateId }); + + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + + this.log({ describeUpdateResponse }); + + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + + private generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} + +function parseProps(props: any): aws.EKS.CreateClusterRequest { + + const parsed = props?.Config ?? {}; + + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + + return parsed; + +} + +interface UpdateMap { + replaceName: boolean; // name + replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds + replaceRole: boolean; // roleArn + + updateVersion: boolean; // version + updateLogging: boolean; // logging + updateEncryption: boolean; // encryption (cannot be updated) + updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess +} + +function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: + JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: + newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} + +function setsEqual(first: Set, second: Set) { + return first.size === second.size && [...first].every((e: string) => second.has(e)); +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js new file mode 100644 index 0000000000000..ed1eab8530351 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FargateProfileResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const MAX_NAME_LEN = 63; +class FargateProfileResourceHandler extends common_1.ResourceHandler { + async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + const createFargateProfile = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + const deleteFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + return; + } + async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + async isCreateComplete() { + return this.isUpdateComplete(); + } + async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + /** + * Generates a fargate profile name. + */ + generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + async queryStatus() { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + const describeFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + try { + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + return status; + } + catch (describeFargateProfileError) { + if (describeFargateProfileError instanceof client_eks_1.ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} +exports.FargateProfileResourceHandler = FargateProfileResourceHandler; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsNkRBQTZEO0FBQzdELG9EQUFnRTtBQUVoRSxxQ0FBMkM7QUFFM0MsTUFBTSxZQUFZLEdBQUcsRUFBRSxDQUFDO0FBRXhCLE1BQWEsNkJBQThCLFNBQVEsd0JBQWU7SUFDdEQsS0FBSyxDQUFDLFFBQVE7UUFDdEIsTUFBTSxrQkFBa0IsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU0sQ0FBQyxrQkFBa0IsSUFBSSxJQUFJLENBQUMsbUJBQW1CLEVBQUUsQ0FBQztRQUVqSCxNQUFNLG9CQUFvQixHQUF3QztZQUNoRSxrQkFBa0I7WUFDbEIsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU07U0FDeEMsQ0FBQztRQUVGLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxvQkFBb0IsRUFBRSxDQUFDLENBQUM7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F0ZVByb2ZpbGVFcnJvcjogYW55KSB7XG4gICAgICBpZiAoZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yIGluc3RhbmNlb2YgUmVzb3VyY2VOb3RGb3VuZEV4Y2VwdGlvbikge1xuICAgICAgICB0aGlzLmxvZygncmVjZWl2ZWQgUmVzb3VyY2VOb3RGb3VuZEV4Y2VwdGlvbiwgdGhpcyBtZWFucyB0aGUgcHJvZmlsZSBoYXMgYmVlbiBkZWxldGVkIChvciBuZXZlciBleGlzdGVkKScpO1xuICAgICAgICByZXR1cm4gJ05PVF9GT1VORCc7XG4gICAgICB9XG5cbiAgICAgIHRoaXMubG9nKHsgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yIH0pO1xuICAgICAgdGhyb3cgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yO1xuICAgIH1cbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts new file mode 100644 index 0000000000000..16b9f9abfeb49 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts @@ -0,0 +1,121 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies +import { ResourceHandler } from './common'; + +const MAX_NAME_LEN = 63; + +export class FargateProfileResourceHandler extends ResourceHandler { + protected async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + + const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + + protected async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + + const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + + return; + } + + protected async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + + protected async isCreateComplete() { + return this.isUpdateComplete(); + } + + protected async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + + protected async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + + /** + * Generates a fargate profile name. + */ + private generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + private async queryStatus(): Promise { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + + const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + try { + + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + + return status; + } catch (describeFargateProfileError: any) { + if (describeFargateProfileError instanceof ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip index 93f7400e6f8c2..11112de67d5be 100644 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip new file mode 100644 index 0000000000000..90a8a2a6e2615 Binary files /dev/null and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/aws-eks-service-account-sdk-calls-test.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/aws-eks-service-account-sdk-calls-test.assets.json index e0bbf3c0956c1..1780ebeed3591 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/aws-eks-service-account-sdk-calls-test.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/aws-eks-service-account-sdk-calls-test.assets.json @@ -27,15 +27,15 @@ } } }, - "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649": { + "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31": { "source": { - "path": "asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649", + "path": "asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip", + "objectKey": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -66,15 +66,15 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -118,7 +118,7 @@ } } }, - "c137f19e0be8a660184453791ca2557a9b10cd95c8f80f49d567ebe02ae91960": { + "94cf94a2860df09befc13ff93aff19347688c348ef40686ad71e19b47417db03": { "source": { "path": "awseksserviceaccountsdkcallstestawscdkawseksClusterResourceProvider7862DD6A.nested.template.json", "packaging": "file" @@ -126,12 +126,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "c137f19e0be8a660184453791ca2557a9b10cd95c8f80f49d567ebe02ae91960.json", + "objectKey": "94cf94a2860df09befc13ff93aff19347688c348ef40686ad71e19b47417db03.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "362269bfad442962334d7d32024a418180a98ca81bd5e4352644f48362415c5b": { + "6f5e60f351acef96ab72b976a6a5e37f1e8577a01a2bb9c447d23f11514b3736": { "source": { "path": "awseksserviceaccountsdkcallstestawscdkawseksKubectlProvider62B779F7.nested.template.json", "packaging": "file" @@ -139,12 +139,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "362269bfad442962334d7d32024a418180a98ca81bd5e4352644f48362415c5b.json", + "objectKey": "6f5e60f351acef96ab72b976a6a5e37f1e8577a01a2bb9c447d23f11514b3736.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "4954b9921d31e9deca9df5cf7c5cb5e5f9f00eaa2c7cc9a797fa7f15e5e04d03": { + "ac84086766054536aeb02f965b1842e074474620564d8a5d571c1eaffde1dc94": { "source": { "path": "aws-eks-service-account-sdk-calls-test.template.json", "packaging": "file" @@ -152,21 +152,21 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "4954b9921d31e9deca9df5cf7c5cb5e5f9f00eaa2c7cc9a797fa7f15e5e04d03.json", + "objectKey": "ac84086766054536aeb02f965b1842e074474620564d8a5d571c1eaffde1dc94.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } } }, "dockerImages": { - "7705cc252ab1eeb629bb53e4d1ce98fb3340345a1efa3cc71fe96888849c67b5": { + "01ecf926c2e6a104a870f02a3baf41052ee5b8ec115433a56e6795dd11c73671": { "source": { - "directory": "asset.7705cc252ab1eeb629bb53e4d1ce98fb3340345a1efa3cc71fe96888849c67b5" + "directory": "asset.01ecf926c2e6a104a870f02a3baf41052ee5b8ec115433a56e6795dd11c73671" }, "destinations": { "current_account-current_region": { "repositoryName": "cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}", - "imageTag": "7705cc252ab1eeb629bb53e4d1ce98fb3340345a1efa3cc71fe96888849c67b5", + "imageTag": "01ecf926c2e6a104a870f02a3baf41052ee5b8ec115433a56e6795dd11c73671", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-image-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/aws-eks-service-account-sdk-calls-test.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/aws-eks-service-account-sdk-calls-test.template.json index 010804ee17e66..b6fe082d3952a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/aws-eks-service-account-sdk-calls-test.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/aws-eks-service-account-sdk-calls-test.template.json @@ -1139,9 +1139,9 @@ }, "\"}],\"image\":\"", { - "Fn::Sub": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:7705cc252ab1eeb629bb53e4d1ce98fb3340345a1efa3cc71fe96888849c67b5" + "Fn::Sub": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:01ecf926c2e6a104a870f02a3baf41052ee5b8ec115433a56e6795dd11c73671" }, - "\",\"imagePullPolicy\":\"Always\",\"name\":\"main\",\"resources\":{\"limits\":{\"cpu\":\"1500m\",\"memory\":\"2048Mi\"},\"requests\":{\"cpu\":\"1000m\",\"memory\":\"512Mi\"}},\"securityContext\":{\"allowPrivilegeEscalation\":false,\"privileged\":false,\"readOnlyRootFilesystem\":true,\"runAsNonRoot\":true,\"runAsUser\":1000}}],\"dnsPolicy\":\"ClusterFirst\",\"hostNetwork\":false,\"restartPolicy\":\"Always\",\"securityContext\":{\"fsGroupChangePolicy\":\"Always\",\"runAsNonRoot\":true},\"serviceAccountName\":\"awseksserviceaccountsdkcallstestclustermyserviceaccount6d090a02\",\"setHostnameAsFQDN\":false}}}}]" + "\",\"imagePullPolicy\":\"Always\",\"name\":\"main\",\"resources\":{\"limits\":{\"cpu\":\"1500m\",\"memory\":\"2048Mi\"},\"requests\":{\"cpu\":\"1000m\",\"memory\":\"512Mi\"}},\"securityContext\":{\"allowPrivilegeEscalation\":false,\"privileged\":false,\"readOnlyRootFilesystem\":true,\"runAsNonRoot\":true,\"runAsUser\":1000}}],\"dnsPolicy\":\"ClusterFirst\",\"hostNetwork\":false,\"restartPolicy\":\"Always\",\"securityContext\":{\"fsGroupChangePolicy\":\"Always\",\"runAsNonRoot\":true},\"serviceAccountName\":\"awseksserviceaccountsdkcallstestclustermyserviceaccount6d090a02\",\"setHostnameAsFQDN\":false,\"terminationGracePeriodSeconds\":30}}}}]" ] ] }, @@ -1185,7 +1185,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/c137f19e0be8a660184453791ca2557a9b10cd95c8f80f49d567ebe02ae91960.json" + "/94cf94a2860df09befc13ff93aff19347688c348ef40686ad71e19b47417db03.json" ] ] } @@ -1235,7 +1235,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/362269bfad442962334d7d32024a418180a98ca81bd5e4352644f48362415c5b.json" + "/6f5e60f351acef96ab72b976a6a5e37f1e8577a01a2bb9c447d23f11514b3736.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/awseksserviceaccountsdkcallstestawscdkawseksClusterResourceProvider7862DD6A.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/awseksserviceaccountsdkcallstestawscdkawseksClusterResourceProvider7862DD6A.nested.template.json index 78704294ea990..36fd4677baaf1 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/awseksserviceaccountsdkcallstestawscdkawseksClusterResourceProvider7862DD6A.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/awseksserviceaccountsdkcallstestawscdkawseksClusterResourceProvider7862DD6A.nested.template.json @@ -50,7 +50,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "onEvent handler for EKS cluster resource provider", "Environment": { @@ -115,7 +115,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "isComplete handler for EKS cluster resource provider", "Environment": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/awseksserviceaccountsdkcallstestawscdkawseksKubectlProvider62B779F7.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/awseksserviceaccountsdkcallstestawscdkawseksKubectlProvider62B779F7.nested.template.json index 15c4ca39a77b8..bef2ee11bc9b8 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/awseksserviceaccountsdkcallstestawscdkawseksKubectlProvider62B779F7.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/awseksserviceaccountsdkcallstestawscdkawseksKubectlProvider62B779F7.nested.template.json @@ -49,7 +49,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/cdk.out index f0b901e7c06e5..560dae10d018f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"33.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/manifest.json index e480b198d0dd9..29e63a155ac95 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/manifest.json @@ -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}/4954b9921d31e9deca9df5cf7c5cb5e5f9f00eaa2c7cc9a797fa7f15e5e04d03.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ac84086766054536aeb02f965b1842e074474620564d8a5d571c1eaffde1dc94.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/tree.json index e0fa2bd2b8791..6b0df8d1647bf 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-service-account-sdk-call.js.snapshot/tree.json @@ -723,7 +723,7 @@ }, "constructInfo": { "fqn": "@aws-cdk/lambda-layer-kubectl-v24.KubectlV24Layer", - "version": "2.0.229" + "version": "2.0.242" } }, "Cluster": { @@ -1733,7 +1733,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "onEvent handler for EKS cluster resource provider", "environment": { @@ -1865,7 +1865,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "isComplete handler for EKS cluster resource provider", "environment": { @@ -2771,7 +2771,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/c137f19e0be8a660184453791ca2557a9b10cd95c8f80f49d567ebe02ae91960.json" + "/94cf94a2860df09befc13ff93aff19347688c348ef40686ad71e19b47417db03.json" ] ] } @@ -2918,7 +2918,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -3282,7 +3282,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/362269bfad442962334d7d32024a418180a98ca81bd5e4352644f48362415c5b.json" + "/6f5e60f351acef96ab72b976a6a5e37f1e8577a01a2bb9c447d23f11514b3736.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip deleted file mode 100644 index e6cb898734b43..0000000000000 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and /dev/null differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js deleted file mode 100644 index b89707a0a08e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js +++ /dev/null @@ -1,277 +0,0 @@ -"use strict"; -/* eslint-disable no-console */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ClusterResourceHandler = void 0; -const common_1 = require("./common"); -const compareLogging_1 = require("./compareLogging"); -const MAX_CLUSTER_NAME_LEN = 100; -class ClusterResourceHandler extends common_1.ResourceHandler { - get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - return this.physicalResourceId; - } - constructor(eks, event) { - super(eks, event); - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - // ------ - // CREATE - // ------ - async onCreate() { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - const clusterName = this.newProps.name || this.generateClusterName(); - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - return { - PhysicalResourceId: resp.cluster.name, - }; - } - async isCreateComplete() { - return this.isActive(); - } - // ------ - // DELETE - // ------ - async onDelete() { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } - catch (e) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } - else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - async isDeleteComplete() { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } - catch (e) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - console.log('describeCluster error:', e); - throw e; - } - return { - IsComplete: false, - }; - } - // ------ - // UPDATE - // ------ - async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - return this.onCreate(); - } - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - return this.updateClusterVersion(this.newProps.version); - } - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - if (updates.updateLogging || updates.updateAccess) { - const config = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - } - ; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - return { EksUpdateId: updateResponse.update?.id }; - } - // no updates - return; - } - async isUpdateComplete() { - console.log('isUpdateComplete'); - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - return this.isActive(); - } - async updateClusterVersion(newVersion) { - console.log(`updating cluster version to ${newVersion}`); - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - async isActive() { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } - else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } - else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - async isEksUpdateComplete(eksUpdateId) { - this.log({ isEksUpdateComplete: eksUpdateId }); - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - this.log({ describeUpdateResponse }); - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} -exports.ClusterResourceHandler = ClusterResourceHandler; -function parseProps(props) { - const parsed = props?.Config ?? {}; - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - return parsed; -} -function analyzeUpdate(oldProps, newProps) { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} -function setsEqual(first, second) { - return first.size === second.size && [...first].every((e) => second.has(e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wZGF0ZVZlcnNpb246IG5ld1Byb3BzLnZlcnNpb24gIT09IG9sZFByb3BzLnZlcnNpb24sXG4gICAgdXBkYXRlRW5jcnlwdGlvbjogSlNPTi5zdHJpbmdpZnkobmV3RW5jKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkRW5jKSxcbiAgICB1cGRhdGVMb2dnaW5nOiBKU09OLnN0cmluZ2lmeShuZXdQcm9wcy5sb2dnaW5nKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkUHJvcHMubG9nZ2luZyksXG4gIH07XG59XG5cbmZ1bmN0aW9uIHNldHNFcXVhbChmaXJzdDogU2V0PHN0cmluZz4sIHNlY29uZDogU2V0PHN0cmluZz4pIHtcbiAgcmV0dXJuIGZpcnN0LnNpemUgPT09IHNlY29uZC5zaXplICYmIFsuLi5maXJzdF0uZXZlcnkoKGU6IHN0cmluZykgPT4gc2Vjb25kLmhhcyhlKSk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts deleted file mode 100644 index c058e47b62c68..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts +++ /dev/null @@ -1,348 +0,0 @@ -/* eslint-disable no-console */ - -// eslint-disable-next-line import/no-extraneous-dependencies -// eslint-disable-next-line import/no-extraneous-dependencies -import * as aws from 'aws-sdk'; -import { EksClient, ResourceEvent, ResourceHandler } from './common'; -import { compareLoggingProps } from './compareLogging'; -import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; - -const MAX_CLUSTER_NAME_LEN = 100; - -export class ClusterResourceHandler extends ResourceHandler { - public get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - - return this.physicalResourceId; - } - - private readonly newProps: aws.EKS.CreateClusterRequest; - private readonly oldProps: Partial; - - constructor(eks: EksClient, event: ResourceEvent) { - super(eks, event); - - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - - // ------ - // CREATE - // ------ - - protected async onCreate(): Promise { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - - const clusterName = this.newProps.name || this.generateClusterName(); - - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - - return { - PhysicalResourceId: resp.cluster.name, - }; - } - - protected async isCreateComplete() { - return this.isActive(); - } - - // ------ - // DELETE - // ------ - - protected async onDelete(): Promise { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } catch (e: any) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - - protected async isDeleteComplete(): Promise { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } catch (e: any) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - - console.log('describeCluster error:', e); - throw e; - } - - return { - IsComplete: false, - }; - } - - // ------ - // UPDATE - // ------ - - protected async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - - return this.onCreate(); - } - - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - - return this.updateClusterVersion(this.newProps.version); - } - - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - - if (updates.updateLogging || updates.updateAccess) { - const config: aws.EKS.UpdateClusterConfigRequest = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - }; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - - return { EksUpdateId: updateResponse.update?.id }; - } - - // no updates - return; - } - - protected async isUpdateComplete() { - console.log('isUpdateComplete'); - - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - - return this.isActive(); - } - - private async updateClusterVersion(newVersion: string) { - console.log(`updating cluster version to ${newVersion}`); - - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - - private async isActive(): Promise { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url - - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - - private async isEksUpdateComplete(eksUpdateId: string) { - this.log({ isEksUpdateComplete: eksUpdateId }); - - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - - this.log({ describeUpdateResponse }); - - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - - private generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} - -function parseProps(props: any): aws.EKS.CreateClusterRequest { - - const parsed = props?.Config ?? {}; - - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - - return parsed; - -} - -interface UpdateMap { - replaceName: boolean; // name - replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds - replaceRole: boolean; // roleArn - - updateVersion: boolean; // version - updateLogging: boolean; // logging - updateEncryption: boolean; // encryption (cannot be updated) - updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess -} - -function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: - JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: - newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} - -function setsEqual(first: Set, second: Set) { - return first.size === second.size && [...first].every((e: string) => second.has(e)); -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js deleted file mode 100644 index 34ab6ff0ba0e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FargateProfileResourceHandler = void 0; -const common_1 = require("./common"); -const MAX_NAME_LEN = 63; -class FargateProfileResourceHandler extends common_1.ResourceHandler { - async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - const createFargateProfile = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - const deleteFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - return; - } - async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - async isCreateComplete() { - return this.isUpdateComplete(); - } - async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - /** - * Generates a fargate profile name. - */ - generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - async queryStatus() { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - const describeFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - try { - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - return status; - } - catch (describeFargateProfileError) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} -exports.FargateProfileResourceHandler = FargateProfileResourceHandler; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EscUNBQTJDO0FBRTNDLE1BQU0sWUFBWSxHQUFHLEVBQUUsQ0FBQztBQUV4QixNQUFhLDZCQUE4QixTQUFRLHdCQUFlO0lBQ3RELEtBQUssQ0FBQyxRQUFRO1FBQ3RCLE1BQU0sa0JBQWtCLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUF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SUxFRCcpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKHN0YXR1cyk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfSBjYXRjaCAoZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yOiBhbnkpIHtcbiAgICAgIGlmIChkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IuY29kZSA9PT0gJ1Jlc291cmNlTm90Rm91bmRFeGNlcHRpb24nKSB7XG4gICAgICAgIHRoaXMubG9nKCdyZWNlaXZlZCBSZXNvdXJjZU5vdEZvdW5kRXhjZXB0aW9uLCB0aGlzIG1lYW5zIHRoZSBwcm9maWxlIGhhcyBiZWVuIGRlbGV0ZWQgKG9yIG5ldmVyIGV4aXN0ZWQpJyk7XG4gICAgICAgIHJldHVybiAnTk9UX0ZPVU5EJztcbiAgICAgIH1cblxuICAgICAgdGhpcy5sb2coeyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IgfSk7XG4gICAgICB0aHJvdyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3I7XG4gICAgfVxuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts deleted file mode 100644 index 7db97a7f69d38..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts +++ /dev/null @@ -1,119 +0,0 @@ -import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies -import { ResourceHandler } from './common'; - -const MAX_NAME_LEN = 63; - -export class FargateProfileResourceHandler extends ResourceHandler { - protected async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - - const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - - protected async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - - const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - - return; - } - - protected async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - - protected async isCreateComplete() { - return this.isUpdateComplete(); - } - - protected async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - - protected async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - - /** - * Generates a fargate profile name. - */ - private generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - private async queryStatus(): Promise { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - - const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - try { - - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - - return status; - } catch (describeFargateProfileError: any) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js new file mode 100644 index 0000000000000..aefb970a3fe47 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js @@ -0,0 +1,280 @@ +"use strict"; +/* eslint-disable no-console */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClusterResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const compareLogging_1 = require("./compareLogging"); +const MAX_CLUSTER_NAME_LEN = 100; +class ClusterResourceHandler extends common_1.ResourceHandler { + get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + return this.physicalResourceId; + } + constructor(eks, event) { + super(eks, event); + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + // ------ + // CREATE + // ------ + async onCreate() { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + const clusterName = this.newProps.name || this.generateClusterName(); + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + return { + PhysicalResourceId: resp.cluster.name, + }; + } + async isCreateComplete() { + return this.isActive(); + } + // ------ + // DELETE + // ------ + async onDelete() { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } + catch (e) { + if (!(e instanceof client_eks_1.ResourceNotFoundException)) { + throw e; + } + else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + async isDeleteComplete() { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } + catch (e) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof client_eks_1.ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + console.log('describeCluster error:', e); + throw e; + } + return { + IsComplete: false, + }; + } + // ------ + // UPDATE + // ------ + async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + return this.onCreate(); + } + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + return this.updateClusterVersion(this.newProps.version); + } + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + if (updates.updateLogging || updates.updateAccess) { + const config = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + } + ; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + return { EksUpdateId: updateResponse.update?.id }; + } + // no updates + return; + } + async isUpdateComplete() { + console.log('isUpdateComplete'); + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + return this.isActive(); + } + async updateClusterVersion(newVersion) { + console.log(`updating cluster version to ${newVersion}`); + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + async isActive() { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } + else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } + else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + async isEksUpdateComplete(eksUpdateId) { + this.log({ isEksUpdateComplete: eksUpdateId }); + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + this.log({ describeUpdateResponse }); + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} +exports.ClusterResourceHandler = ClusterResourceHandler; +function parseProps(props) { + const parsed = props?.Config ?? {}; + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + return parsed; +} +function analyzeUpdate(oldProps, newProps) { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} +function setsEqual(first, second) { + return first.size === second.size && [...first].every((e) => second.has(e)); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb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biAgICByZXBsYWNlUm9sZTogbmV3UHJvcHMucm9sZUFybiAhPT0gb2xkUHJvcHMucm9sZUFybixcbiAgICB1cGRhdGVWZXJzaW9uOiBuZXdQcm9wcy52ZXJzaW9uICE9PSBvbGRQcm9wcy52ZXJzaW9uLFxuICAgIHVwZGF0ZUVuY3J5cHRpb246IEpTT04uc3RyaW5naWZ5KG5ld0VuYykgIT09IEpTT04uc3RyaW5naWZ5KG9sZEVuYyksXG4gICAgdXBkYXRlTG9nZ2luZzogSlNPTi5zdHJpbmdpZnkobmV3UHJvcHMubG9nZ2luZykgIT09IEpTT04uc3RyaW5naWZ5KG9sZFByb3BzLmxvZ2dpbmcpLFxuICB9O1xufVxuXG5mdW5jdGlvbiBzZXRzRXF1YWwoZmlyc3Q6IFNldDxzdHJpbmc+LCBzZWNvbmQ6IFNldDxzdHJpbmc+KSB7XG4gIHJldHVybiBmaXJzdC5zaXplID09PSBzZWNvbmQuc2l6ZSAmJiBbLi4uZmlyc3RdLmV2ZXJ5KChlOiBzdHJpbmcpID0+IHNlY29uZC5oYXMoZSkpO1xufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts new file mode 100644 index 0000000000000..3a0a7294db31d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts @@ -0,0 +1,350 @@ +/* eslint-disable no-console */ + +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +// eslint-disable-next-line import/no-extraneous-dependencies +import * as aws from 'aws-sdk'; +import { EksClient, ResourceEvent, ResourceHandler } from './common'; +import { compareLoggingProps } from './compareLogging'; +import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; + +const MAX_CLUSTER_NAME_LEN = 100; + +export class ClusterResourceHandler extends ResourceHandler { + public get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + + return this.physicalResourceId; + } + + private readonly newProps: aws.EKS.CreateClusterRequest; + private readonly oldProps: Partial; + + constructor(eks: EksClient, event: ResourceEvent) { + super(eks, event); + + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + + // ------ + // CREATE + // ------ + + protected async onCreate(): Promise { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + + const clusterName = this.newProps.name || this.generateClusterName(); + + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + + return { + PhysicalResourceId: resp.cluster.name, + }; + } + + protected async isCreateComplete() { + return this.isActive(); + } + + // ------ + // DELETE + // ------ + + protected async onDelete(): Promise { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } catch (e: any) { + if (!(e instanceof ResourceNotFoundException)) { + throw e; + } else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + + protected async isDeleteComplete(): Promise { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } catch (e: any) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + + console.log('describeCluster error:', e); + throw e; + } + + return { + IsComplete: false, + }; + } + + // ------ + // UPDATE + // ------ + + protected async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + + return this.onCreate(); + } + + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + + return this.updateClusterVersion(this.newProps.version); + } + + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + + if (updates.updateLogging || updates.updateAccess) { + const config: aws.EKS.UpdateClusterConfigRequest = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + }; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + + return { EksUpdateId: updateResponse.update?.id }; + } + + // no updates + return; + } + + protected async isUpdateComplete() { + console.log('isUpdateComplete'); + + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + + return this.isActive(); + } + + private async updateClusterVersion(newVersion: string) { + console.log(`updating cluster version to ${newVersion}`); + + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + + private async isActive(): Promise { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url + + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + + private async isEksUpdateComplete(eksUpdateId: string) { + this.log({ isEksUpdateComplete: eksUpdateId }); + + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + + this.log({ describeUpdateResponse }); + + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + + private generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} + +function parseProps(props: any): aws.EKS.CreateClusterRequest { + + const parsed = props?.Config ?? {}; + + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + + return parsed; + +} + +interface UpdateMap { + replaceName: boolean; // name + replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds + replaceRole: boolean; // roleArn + + updateVersion: boolean; // version + updateLogging: boolean; // logging + updateEncryption: boolean; // encryption (cannot be updated) + updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess +} + +function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: + JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: + newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} + +function setsEqual(first: Set, second: Set) { + return first.size === second.size && [...first].every((e: string) => second.has(e)); +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js new file mode 100644 index 0000000000000..ed1eab8530351 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FargateProfileResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const MAX_NAME_LEN = 63; +class FargateProfileResourceHandler extends common_1.ResourceHandler { + async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + const createFargateProfile = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + const deleteFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + return; + } + async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + async isCreateComplete() { + return this.isUpdateComplete(); + } + async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + /** + * Generates a fargate profile name. + */ + generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + async queryStatus() { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + const describeFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + try { + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + return status; + } + catch (describeFargateProfileError) { + if (describeFargateProfileError instanceof client_eks_1.ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; +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pYmVGYXJnYXRlUHJvZmlsZUVycm9yIH0pO1xuICAgICAgdGhyb3cgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yO1xuICAgIH1cbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts new file mode 100644 index 0000000000000..16b9f9abfeb49 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts @@ -0,0 +1,121 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies +import { ResourceHandler } from './common'; + +const MAX_NAME_LEN = 63; + +export class FargateProfileResourceHandler extends ResourceHandler { + protected async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + + const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + + protected async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + + const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + + return; + } + + protected async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + + protected async isCreateComplete() { + return this.isUpdateComplete(); + } + + protected async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + + protected async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + + /** + * Generates a fargate profile name. + */ + private generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + private async queryStatus(): Promise { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + + const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + try { + + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + + return status; + } catch (describeFargateProfileError: any) { + if (describeFargateProfileError instanceof ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip index 93f7400e6f8c2..11112de67d5be 100644 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip new file mode 100644 index 0000000000000..90a8a2a6e2615 Binary files /dev/null and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/aws-cdk-eks-cluster-windows-ng-test.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/aws-cdk-eks-cluster-windows-ng-test.assets.json index ffd7b7f44b749..149ae3b30dd5b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/aws-cdk-eks-cluster-windows-ng-test.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/aws-cdk-eks-cluster-windows-ng-test.assets.json @@ -27,15 +27,15 @@ } } }, - "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649": { + "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31": { "source": { - "path": "asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649", + "path": "asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip", + "objectKey": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -66,20 +66,20 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "9bc5ed764d14a563b18739d104caa37c6f428a8e9e92d6d8e23b0d31178583f0": { + "ea3c47edd3a8683da80168e2de8b558340644249a4e9c26b3b88808181865fc0": { "source": { "path": "awscdkeksclusterwindowsngtestawscdkawseksClusterResourceProvider4BC96C9C.nested.template.json", "packaging": "file" @@ -87,12 +87,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "9bc5ed764d14a563b18739d104caa37c6f428a8e9e92d6d8e23b0d31178583f0.json", + "objectKey": "ea3c47edd3a8683da80168e2de8b558340644249a4e9c26b3b88808181865fc0.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "1576ef5893684923ec69c2fdf1a0e0064a31bb34f4c7680ea66d4df7bd5396c2": { + "e2110f9a37a30a01b5b912edd5b5ef0e512cfd48ccfece88df64ceafd420dcaa": { "source": { "path": "awscdkeksclusterwindowsngtestawscdkawseksKubectlProviderAC962C42.nested.template.json", "packaging": "file" @@ -100,12 +100,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "1576ef5893684923ec69c2fdf1a0e0064a31bb34f4c7680ea66d4df7bd5396c2.json", + "objectKey": "e2110f9a37a30a01b5b912edd5b5ef0e512cfd48ccfece88df64ceafd420dcaa.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "7329fb6712b5d0d06a0d8e8e2f7a0dcbd0f8217bd701303a00efaed369cbad4f": { + "0f3e9fc32fcf1490917da5352ae0f2fe268caf688ae73e02e94f1e5522579ad8": { "source": { "path": "aws-cdk-eks-cluster-windows-ng-test.template.json", "packaging": "file" @@ -113,7 +113,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "7329fb6712b5d0d06a0d8e8e2f7a0dcbd0f8217bd701303a00efaed369cbad4f.json", + "objectKey": "0f3e9fc32fcf1490917da5352ae0f2fe268caf688ae73e02e94f1e5522579ad8.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/aws-cdk-eks-cluster-windows-ng-test.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/aws-cdk-eks-cluster-windows-ng-test.template.json index 47bafe4d11ade..145560e15872b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/aws-cdk-eks-cluster-windows-ng-test.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/aws-cdk-eks-cluster-windows-ng-test.template.json @@ -1097,7 +1097,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/9bc5ed764d14a563b18739d104caa37c6f428a8e9e92d6d8e23b0d31178583f0.json" + "/ea3c47edd3a8683da80168e2de8b558340644249a4e9c26b3b88808181865fc0.json" ] ] } @@ -1147,7 +1147,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/1576ef5893684923ec69c2fdf1a0e0064a31bb34f4c7680ea66d4df7bd5396c2.json" + "/e2110f9a37a30a01b5b912edd5b5ef0e512cfd48ccfece88df64ceafd420dcaa.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/awscdkeksclusterwindowsngtestawscdkawseksClusterResourceProvider4BC96C9C.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/awscdkeksclusterwindowsngtestawscdkawseksClusterResourceProvider4BC96C9C.nested.template.json index f51b9f8511774..afb7be37d9f82 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/awscdkeksclusterwindowsngtestawscdkawseksClusterResourceProvider4BC96C9C.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/awscdkeksclusterwindowsngtestawscdkawseksClusterResourceProvider4BC96C9C.nested.template.json @@ -50,7 +50,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "onEvent handler for EKS cluster resource provider", "Environment": { @@ -115,7 +115,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "isComplete handler for EKS cluster resource provider", "Environment": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/awscdkeksclusterwindowsngtestawscdkawseksKubectlProviderAC962C42.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/awscdkeksclusterwindowsngtestawscdkawseksKubectlProviderAC962C42.nested.template.json index 23c80c87adabf..bc23eca0aecdb 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/awscdkeksclusterwindowsngtestawscdkawseksKubectlProviderAC962C42.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/awscdkeksclusterwindowsngtestawscdkawseksKubectlProviderAC962C42.nested.template.json @@ -49,7 +49,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/cdk.out index f0b901e7c06e5..560dae10d018f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"33.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/manifest.json index b9c78927152db..1896d5f3f7175 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/manifest.json @@ -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}/7329fb6712b5d0d06a0d8e8e2f7a0dcbd0f8217bd701303a00efaed369cbad4f.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/0f3e9fc32fcf1490917da5352ae0f2fe268caf688ae73e02e94f1e5522579ad8.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/tree.json index 6cfd2cbe10205..0401e82e4beda 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-windows-ng.js.snapshot/tree.json @@ -755,7 +755,7 @@ }, "constructInfo": { "fqn": "@aws-cdk/lambda-layer-kubectl-v24.KubectlV24Layer", - "version": "2.0.229" + "version": "2.0.242" } }, "Cluster": { @@ -1685,7 +1685,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "onEvent handler for EKS cluster resource provider", "environment": { @@ -1817,7 +1817,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "isComplete handler for EKS cluster resource provider", "environment": { @@ -2723,7 +2723,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/9bc5ed764d14a563b18739d104caa37c6f428a8e9e92d6d8e23b0d31178583f0.json" + "/ea3c47edd3a8683da80168e2de8b558340644249a4e9c26b3b88808181865fc0.json" ] ] } @@ -2870,7 +2870,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -3234,7 +3234,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/1576ef5893684923ec69c2fdf1a0e0064a31bb34f4c7680ea66d4df7bd5396c2.json" + "/e2110f9a37a30a01b5b912edd5b5ef0e512cfd48ccfece88df64ceafd420dcaa.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip deleted file mode 100644 index e6cb898734b43..0000000000000 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and /dev/null differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js deleted file mode 100644 index b89707a0a08e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js +++ /dev/null @@ -1,277 +0,0 @@ -"use strict"; -/* eslint-disable no-console */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ClusterResourceHandler = void 0; -const common_1 = require("./common"); -const compareLogging_1 = require("./compareLogging"); -const MAX_CLUSTER_NAME_LEN = 100; -class ClusterResourceHandler extends common_1.ResourceHandler { - get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - return this.physicalResourceId; - } - constructor(eks, event) { - super(eks, event); - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - // ------ - // CREATE - // ------ - async onCreate() { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - const clusterName = this.newProps.name || this.generateClusterName(); - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - return { - PhysicalResourceId: resp.cluster.name, - }; - } - async isCreateComplete() { - return this.isActive(); - } - // ------ - // DELETE - // ------ - async onDelete() { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } - catch (e) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } - else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - async isDeleteComplete() { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } - catch (e) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - console.log('describeCluster error:', e); - throw e; - } - return { - IsComplete: false, - }; - } - // ------ - // UPDATE - // ------ - async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - return this.onCreate(); - } - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - return this.updateClusterVersion(this.newProps.version); - } - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - if (updates.updateLogging || updates.updateAccess) { - const config = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - } - ; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - return { EksUpdateId: updateResponse.update?.id }; - } - // no updates - return; - } - async isUpdateComplete() { - console.log('isUpdateComplete'); - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - return this.isActive(); - } - async updateClusterVersion(newVersion) { - console.log(`updating cluster version to ${newVersion}`); - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - async isActive() { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } - else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } - else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - async isEksUpdateComplete(eksUpdateId) { - this.log({ isEksUpdateComplete: eksUpdateId }); - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - this.log({ describeUpdateResponse }); - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} -exports.ClusterResourceHandler = ClusterResourceHandler; -function parseProps(props) { - const parsed = props?.Config ?? {}; - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - return parsed; -} -function analyzeUpdate(oldProps, newProps) { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} -function setsEqual(first, second) { - return first.size === second.size && [...first].every((e) => second.has(e)); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBSy9CLHFDQUFxRTtBQUNyRSxxREFBdUQ7QUFHdkQsTUFBTSxvQkFBb0IsR0FBRyxHQUFHLENBQUM7QUFFakMsTUFBYSxzQkFBdUIsU0FBUSx3QkFBZTtJQUN6RCxJQUFXLFdBQVc7UUFDcEIsSUFBSSxDQUFDLElBQUksQ0FBQyxrQkFBa0IsRUFBRTtZQUM1QixNQUFNLElBQUksS0FBSyxDQUFDLDREQUE0RCxDQUFDLENBQUM7U0FDL0U7UUFFRCxPQUFPLElBQUksQ0FBQyxrQkFBa0IsQ0FBQztLQUNoQztJQUtELFlBQVksR0FBYyxFQUFFLEtBQW9CO1FBQzlDLEtBQUssQ0FBQyxHQUFHLEVBQUUsS0FBSyxDQUFDLENBQUM7UUFFbEIsSUFBSSxDQUFDLFFBQVEsR0FBRyxVQUFVLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO1FBQzFELElBQUksQ0FBQyxRQUFRLEdBQUcsS0FBSyxDQUFDLFdBQVcsS0FBSyxRQUFRLENBQUMsQ0FBQyxDQUFDLFVBQVUsQ0FBQyxLQUFLLENBQUMscUJBQXFCLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDO1FBQzlGLDhGQUE4RjtRQUM5RixNQUFNLFFBQVEsR0FBMEMsSUFBQSxvQ0FBbUIsRUFBQyxJQUFJLENBQUMsUUFBUSxFQUFFLElBQUksQ0FBQyxRQUFRLENBQUMsQ0FBQztRQ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MpLFxuICAgIHJlcGxhY2VSb2xlOiBuZXdQcm9wcy5yb2xlQXJuICE9PSBvbGRQcm9wcy5yb2xlQXJuLFxuICAgIHVwZGF0ZVZlcnNpb246IG5ld1Byb3BzLnZlcnNpb24gIT09IG9sZFByb3BzLnZlcnNpb24sXG4gICAgdXBkYXRlRW5jcnlwdGlvbjogSlNPTi5zdHJpbmdpZnkobmV3RW5jKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkRW5jKSxcbiAgICB1cGRhdGVMb2dnaW5nOiBKU09OLnN0cmluZ2lmeShuZXdQcm9wcy5sb2dnaW5nKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkUHJvcHMubG9nZ2luZyksXG4gIH07XG59XG5cbmZ1bmN0aW9uIHNldHNFcXVhbChmaXJzdDogU2V0PHN0cmluZz4sIHNlY29uZDogU2V0PHN0cmluZz4pIHtcbiAgcmV0dXJuIGZpcnN0LnNpemUgPT09IHNlY29uZC5zaXplICYmIFsuLi5maXJzdF0uZXZlcnkoKGU6IHN0cmluZykgPT4gc2Vjb25kLmhhcyhlKSk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts deleted file mode 100644 index c058e47b62c68..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts +++ /dev/null @@ -1,348 +0,0 @@ -/* eslint-disable no-console */ - -// eslint-disable-next-line import/no-extraneous-dependencies -// eslint-disable-next-line import/no-extraneous-dependencies -import * as aws from 'aws-sdk'; -import { EksClient, ResourceEvent, ResourceHandler } from './common'; -import { compareLoggingProps } from './compareLogging'; -import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; - -const MAX_CLUSTER_NAME_LEN = 100; - -export class ClusterResourceHandler extends ResourceHandler { - public get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - - return this.physicalResourceId; - } - - private readonly newProps: aws.EKS.CreateClusterRequest; - private readonly oldProps: Partial; - - constructor(eks: EksClient, event: ResourceEvent) { - super(eks, event); - - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - - // ------ - // CREATE - // ------ - - protected async onCreate(): Promise { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - - const clusterName = this.newProps.name || this.generateClusterName(); - - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - - return { - PhysicalResourceId: resp.cluster.name, - }; - } - - protected async isCreateComplete() { - return this.isActive(); - } - - // ------ - // DELETE - // ------ - - protected async onDelete(): Promise { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } catch (e: any) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - - protected async isDeleteComplete(): Promise { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } catch (e: any) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - - console.log('describeCluster error:', e); - throw e; - } - - return { - IsComplete: false, - }; - } - - // ------ - // UPDATE - // ------ - - protected async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - - return this.onCreate(); - } - - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - - return this.updateClusterVersion(this.newProps.version); - } - - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - - if (updates.updateLogging || updates.updateAccess) { - const config: aws.EKS.UpdateClusterConfigRequest = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - }; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - - return { EksUpdateId: updateResponse.update?.id }; - } - - // no updates - return; - } - - protected async isUpdateComplete() { - console.log('isUpdateComplete'); - - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - - return this.isActive(); - } - - private async updateClusterVersion(newVersion: string) { - console.log(`updating cluster version to ${newVersion}`); - - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - - private async isActive(): Promise { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url - - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - - private async isEksUpdateComplete(eksUpdateId: string) { - this.log({ isEksUpdateComplete: eksUpdateId }); - - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - - this.log({ describeUpdateResponse }); - - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - - private generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} - -function parseProps(props: any): aws.EKS.CreateClusterRequest { - - const parsed = props?.Config ?? {}; - - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - - return parsed; - -} - -interface UpdateMap { - replaceName: boolean; // name - replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds - replaceRole: boolean; // roleArn - - updateVersion: boolean; // version - updateLogging: boolean; // logging - updateEncryption: boolean; // encryption (cannot be updated) - updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess -} - -function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: - JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: - newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} - -function setsEqual(first: Set, second: Set) { - return first.size === second.size && [...first].every((e: string) => second.has(e)); -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js deleted file mode 100644 index 34ab6ff0ba0e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FargateProfileResourceHandler = void 0; -const common_1 = require("./common"); -const MAX_NAME_LEN = 63; -class FargateProfileResourceHandler extends common_1.ResourceHandler { - async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - const createFargateProfile = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - const deleteFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - return; - } - async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - async isCreateComplete() { - return this.isUpdateComplete(); - } - async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - /** - * Generates a fargate profile name. - */ - generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - async queryStatus() { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - const describeFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - try { - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - return status; - } - catch (describeFargateProfileError) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} -exports.FargateProfileResourceHandler = FargateProfileResourceHandler; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EscUNBQTJDO0FBRTNDLE1BQU0sWUFBWSxHQUFHLEVBQUUsQ0FBQztBQUV4QixNQUFhLDZCQUE4QixTQUFRLHdCQUFlO0lBQ3RELEtBQUssQ0FBQyxRQUFRO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XG4gICAgICBpZiAoc3RhdHVzID09PSAnQ1JFQVRFX0ZBSUxFRCcgfHwgc3RhdHVzID09PSAnREVMRVRFX0ZBSUxFRCcpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKHN0YXR1cyk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfSBjYXRjaCAoZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yOiBhbnkpIHtcbiAgICAgIGlmIChkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IuY29kZSA9PT0gJ1Jlc291cmNlTm90Rm91bmRFeGNlcHRpb24nKSB7XG4gICAgICAgIHRoaXMubG9nKCdyZWNlaXZlZCBSZXNvdXJjZU5vdEZvdW5kRXhjZXB0aW9uLCB0aGlzIG1lYW5zIHRoZSBwcm9maWxlIGhhcyBiZWVuIGRlbGV0ZWQgKG9yIG5ldmVyIGV4aXN0ZWQpJyk7XG4gICAgICAgIHJldHVybiAnTk9UX0ZPVU5EJztcbiAgICAgIH1cblxuICAgICAgdGhpcy5sb2coeyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IgfSk7XG4gICAgICB0aHJvdyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3I7XG4gICAgfVxuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts deleted file mode 100644 index 7db97a7f69d38..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts +++ /dev/null @@ -1,119 +0,0 @@ -import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies -import { ResourceHandler } from './common'; - -const MAX_NAME_LEN = 63; - -export class FargateProfileResourceHandler extends ResourceHandler { - protected async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - - const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - - protected async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - - const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - - return; - } - - protected async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - - protected async isCreateComplete() { - return this.isUpdateComplete(); - } - - protected async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - - protected async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - - /** - * Generates a fargate profile name. - */ - private generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - private async queryStatus(): Promise { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - - const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - try { - - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - - return status; - } catch (describeFargateProfileError: any) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js new file mode 100644 index 0000000000000..aefb970a3fe47 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js @@ -0,0 +1,280 @@ +"use strict"; +/* eslint-disable no-console */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClusterResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const compareLogging_1 = require("./compareLogging"); +const MAX_CLUSTER_NAME_LEN = 100; +class ClusterResourceHandler extends common_1.ResourceHandler { + get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + return this.physicalResourceId; + } + constructor(eks, event) { + super(eks, event); + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + // ------ + // CREATE + // ------ + async onCreate() { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + const clusterName = this.newProps.name || this.generateClusterName(); + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + return { + PhysicalResourceId: resp.cluster.name, + }; + } + async isCreateComplete() { + return this.isActive(); + } + // ------ + // DELETE + // ------ + async onDelete() { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } + catch (e) { + if (!(e instanceof client_eks_1.ResourceNotFoundException)) { + throw e; + } + else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + async isDeleteComplete() { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } + catch (e) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof client_eks_1.ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + console.log('describeCluster error:', e); + throw e; + } + return { + IsComplete: false, + }; + } + // ------ + // UPDATE + // ------ + async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + return this.onCreate(); + } + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + return this.updateClusterVersion(this.newProps.version); + } + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + if (updates.updateLogging || updates.updateAccess) { + const config = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + } + ; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + return { EksUpdateId: updateResponse.update?.id }; + } + // no updates + return; + } + async isUpdateComplete() { + console.log('isUpdateComplete'); + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + return this.isActive(); + } + async updateClusterVersion(newVersion) { + console.log(`updating cluster version to ${newVersion}`); + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + async isActive() { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } + else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } + else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + async isEksUpdateComplete(eksUpdateId) { + this.log({ isEksUpdateComplete: eksUpdateId }); + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + this.log({ describeUpdateResponse }); + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} +exports.ClusterResourceHandler = ClusterResourceHandler; +function parseProps(props) { + const parsed = props?.Config ?? {}; + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + return parsed; +} +function analyzeUpdate(oldProps, newProps) { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} +function setsEqual(first, second) { + return first.size === second.size && [...first].every((e) => second.has(e)); +} +//# sourceMappingURL=data:application/json;base64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XRzRXF1YWwobmV3UHVibGljQWNjZXNzQ2lkcnMsIG9sZFB1YmxpY0FjY2Vzc0NpZHJzKSxcbiAgICByZXBsYWNlUm9sZTogbmV3UHJvcHMucm9sZUFybiAhPT0gb2xkUHJvcHMucm9sZUFybixcbiAgICB1cGRhdGVWZXJzaW9uOiBuZXdQcm9wcy52ZXJzaW9uICE9PSBvbGRQcm9wcy52ZXJzaW9uLFxuICAgIHVwZGF0ZUVuY3J5cHRpb246IEpTT04uc3RyaW5naWZ5KG5ld0VuYykgIT09IEpTT04uc3RyaW5naWZ5KG9sZEVuYyksXG4gICAgdXBkYXRlTG9nZ2luZzogSlNPTi5zdHJpbmdpZnkobmV3UHJvcHMubG9nZ2luZykgIT09IEpTT04uc3RyaW5naWZ5KG9sZFByb3BzLmxvZ2dpbmcpLFxuICB9O1xufVxuXG5mdW5jdGlvbiBzZXRzRXF1YWwoZmlyc3Q6IFNldDxzdHJpbmc+LCBzZWNvbmQ6IFNldDxzdHJpbmc+KSB7XG4gIHJldHVybiBmaXJzdC5zaXplID09PSBzZWNvbmQuc2l6ZSAmJiBbLi4uZmlyc3RdLmV2ZXJ5KChlOiBzdHJpbmcpID0+IHNlY29uZC5oYXMoZSkpO1xufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts new file mode 100644 index 0000000000000..3a0a7294db31d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts @@ -0,0 +1,350 @@ +/* eslint-disable no-console */ + +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +// eslint-disable-next-line import/no-extraneous-dependencies +import * as aws from 'aws-sdk'; +import { EksClient, ResourceEvent, ResourceHandler } from './common'; +import { compareLoggingProps } from './compareLogging'; +import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; + +const MAX_CLUSTER_NAME_LEN = 100; + +export class ClusterResourceHandler extends ResourceHandler { + public get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + + return this.physicalResourceId; + } + + private readonly newProps: aws.EKS.CreateClusterRequest; + private readonly oldProps: Partial; + + constructor(eks: EksClient, event: ResourceEvent) { + super(eks, event); + + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + + // ------ + // CREATE + // ------ + + protected async onCreate(): Promise { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + + const clusterName = this.newProps.name || this.generateClusterName(); + + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + + return { + PhysicalResourceId: resp.cluster.name, + }; + } + + protected async isCreateComplete() { + return this.isActive(); + } + + // ------ + // DELETE + // ------ + + protected async onDelete(): Promise { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } catch (e: any) { + if (!(e instanceof ResourceNotFoundException)) { + throw e; + } else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + + protected async isDeleteComplete(): Promise { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } catch (e: any) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + + console.log('describeCluster error:', e); + throw e; + } + + return { + IsComplete: false, + }; + } + + // ------ + // UPDATE + // ------ + + protected async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + + return this.onCreate(); + } + + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + + return this.updateClusterVersion(this.newProps.version); + } + + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + + if (updates.updateLogging || updates.updateAccess) { + const config: aws.EKS.UpdateClusterConfigRequest = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + }; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + + return { EksUpdateId: updateResponse.update?.id }; + } + + // no updates + return; + } + + protected async isUpdateComplete() { + console.log('isUpdateComplete'); + + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + + return this.isActive(); + } + + private async updateClusterVersion(newVersion: string) { + console.log(`updating cluster version to ${newVersion}`); + + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + + private async isActive(): Promise { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url + + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + + private async isEksUpdateComplete(eksUpdateId: string) { + this.log({ isEksUpdateComplete: eksUpdateId }); + + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + + this.log({ describeUpdateResponse }); + + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + + private generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} + +function parseProps(props: any): aws.EKS.CreateClusterRequest { + + const parsed = props?.Config ?? {}; + + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + + return parsed; + +} + +interface UpdateMap { + replaceName: boolean; // name + replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds + replaceRole: boolean; // roleArn + + updateVersion: boolean; // version + updateLogging: boolean; // logging + updateEncryption: boolean; // encryption (cannot be updated) + updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess +} + +function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: + JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: + newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} + +function setsEqual(first: Set, second: Set) { + return first.size === second.size && [...first].every((e: string) => second.has(e)); +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js new file mode 100644 index 0000000000000..ed1eab8530351 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FargateProfileResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const MAX_NAME_LEN = 63; +class FargateProfileResourceHandler extends common_1.ResourceHandler { + async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + const createFargateProfile = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + const deleteFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + return; + } + async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + async isCreateComplete() { + return this.isUpdateComplete(); + } + async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + /** + * Generates a fargate profile name. + */ + generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + async queryStatus() { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + const describeFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + try { + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + return status; + } + catch (describeFargateProfileError) { + if (describeFargateProfileError instanceof client_eks_1.ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} +exports.FargateProfileResourceHandler = FargateProfileResourceHandler; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsNkRBQTZEO0FBQzdELG9EQUFnRTtBQUVoRSxxQ0FBMkM7QUFFM0MsTUFBTSxZQUFZLEdBQUcsRUFBRSxDQUFDO0FBRXhCLE1BQWEsNkJBQThCLFNBQVEsd0JBQWU7SUFDdEQsS0FBSyxDQUFDLFFBQVE7UUFDdEIsTUFBTSxrQkFBa0IsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU0sQ0FBQyxrQkFBa0IsSUFBSSxJQUFJLENBQUMsbUJBQW1CLEVBQUUsQ0FBQztRQUVqSCxNQUFNLG9CQUFvQixHQUF3QztZQUNoRSxrQkFBa0I7WUFDbEIsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU07U0FDeEMsQ0FBQztRQUVGLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxvQkFBb0IsRUFBRSxDQUFDLENBQUM7UUFDbkMsTUFBTSw0QkFBNEIsR0FBRyxNQUFNLElBQUksQ0FBQyxHQUFHLENBQUMsb0JBQW9CLENBQUMsb0JBQW9CLENBQUMsQ0FBQztRQUMvRixJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsNEJBQTRCLEVBQUUsQ0FBQyxDQUFDO1FBRTNDLElBQUksQ0FBQyw0QkFBNEIsQ0FBQyxjQUFjLEVBQUU7WUFDaEQsTUFBTSxJQUFJLEtBQUssQ0FBQyx1Q0FBdUMsQ0FBQyxDQUFDO1NBQzFEO1FBRUQsT0FBTztZQUNMLGtCQUFrQixFQUFFLDRCQUE0Q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AgIHRoaXMubG9nKHsgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yIH0pO1xuICAgICAgdGhyb3cgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yO1xuICAgIH1cbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts new file mode 100644 index 0000000000000..16b9f9abfeb49 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts @@ -0,0 +1,121 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies +import { ResourceHandler } from './common'; + +const MAX_NAME_LEN = 63; + +export class FargateProfileResourceHandler extends ResourceHandler { + protected async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + + const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + + protected async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + + const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + + return; + } + + protected async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + + protected async isCreateComplete() { + return this.isUpdateComplete(); + } + + protected async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + + protected async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + + /** + * Generates a fargate profile name. + */ + private generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + private async queryStatus(): Promise { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + + const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + try { + + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + + return status; + } catch (describeFargateProfileError: any) { + if (describeFargateProfileError instanceof ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip index 93f7400e6f8c2..11112de67d5be 100644 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip new file mode 100644 index 0000000000000..90a8a2a6e2615 Binary files /dev/null and b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/aws-cdk-eks-fargate-cluster-test.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/aws-cdk-eks-fargate-cluster-test.assets.json index db80bda33d664..f374c45c5fd59 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/aws-cdk-eks-fargate-cluster-test.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/aws-cdk-eks-fargate-cluster-test.assets.json @@ -27,15 +27,15 @@ } } }, - "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649": { + "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31": { "source": { - "path": "asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649", + "path": "asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip", + "objectKey": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -66,20 +66,20 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "82715ea785ee76101b617297033a4163e237c444a481a9ca9fde9c08dac51fd4": { + "02d6d3451012fee958d31d0cb1dd9b1512fa61ffdf8133c636c17264d43abb81": { "source": { "path": "awscdkeksfargateclustertestawscdkawseksClusterResourceProviderB8887E20.nested.template.json", "packaging": "file" @@ -87,12 +87,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "82715ea785ee76101b617297033a4163e237c444a481a9ca9fde9c08dac51fd4.json", + "objectKey": "02d6d3451012fee958d31d0cb1dd9b1512fa61ffdf8133c636c17264d43abb81.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "762af9a2a5af4cb340a1c0a540f210386fe9119cc7ba05dbfbc4391ae2fdeb1b": { + "1db955fe9d2a178468903f48964b1561f473ef2bf0a0dad20e3298dd7c49919d": { "source": { "path": "awscdkeksfargateclustertestawscdkawseksKubectlProviderB383571D.nested.template.json", "packaging": "file" @@ -100,12 +100,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "762af9a2a5af4cb340a1c0a540f210386fe9119cc7ba05dbfbc4391ae2fdeb1b.json", + "objectKey": "1db955fe9d2a178468903f48964b1561f473ef2bf0a0dad20e3298dd7c49919d.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "ccea78209a239e5b2b2eff39cd2ecda1cd511e7607042e9af07cca9e29561c5d": { + "5728ab4fe36994604bf0d53fc6bc0f811cf5521c77491bfeb2684e332899a827": { "source": { "path": "aws-cdk-eks-fargate-cluster-test.template.json", "packaging": "file" @@ -113,7 +113,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "ccea78209a239e5b2b2eff39cd2ecda1cd511e7607042e9af07cca9e29561c5d.json", + "objectKey": "5728ab4fe36994604bf0d53fc6bc0f811cf5521c77491bfeb2684e332899a827.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/aws-cdk-eks-fargate-cluster-test.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/aws-cdk-eks-fargate-cluster-test.template.json index e22c2b82fa7a0..0c673334fc138 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/aws-cdk-eks-fargate-cluster-test.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/aws-cdk-eks-fargate-cluster-test.template.json @@ -1027,7 +1027,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/82715ea785ee76101b617297033a4163e237c444a481a9ca9fde9c08dac51fd4.json" + "/02d6d3451012fee958d31d0cb1dd9b1512fa61ffdf8133c636c17264d43abb81.json" ] ] } @@ -1077,7 +1077,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/762af9a2a5af4cb340a1c0a540f210386fe9119cc7ba05dbfbc4391ae2fdeb1b.json" + "/1db955fe9d2a178468903f48964b1561f473ef2bf0a0dad20e3298dd7c49919d.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/awscdkeksfargateclustertestawscdkawseksClusterResourceProviderB8887E20.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/awscdkeksfargateclustertestawscdkawseksClusterResourceProviderB8887E20.nested.template.json index 6f3345cdb0ed0..6baa3023960d4 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/awscdkeksfargateclustertestawscdkawseksClusterResourceProviderB8887E20.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/awscdkeksfargateclustertestawscdkawseksClusterResourceProviderB8887E20.nested.template.json @@ -50,7 +50,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "onEvent handler for EKS cluster resource provider", "Environment": { @@ -115,7 +115,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "isComplete handler for EKS cluster resource provider", "Environment": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/awscdkeksfargateclustertestawscdkawseksKubectlProviderB383571D.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/awscdkeksfargateclustertestawscdkawseksKubectlProviderB383571D.nested.template.json index 120f348848e02..5e74ae2f4617e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/awscdkeksfargateclustertestawscdkawseksKubectlProviderB383571D.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/awscdkeksfargateclustertestawscdkawseksKubectlProviderB383571D.nested.template.json @@ -49,7 +49,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/cdk.out index f0b901e7c06e5..560dae10d018f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"33.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/manifest.json index 14c62f159fa2c..19f5ddd6d8ff0 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/manifest.json @@ -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}/ccea78209a239e5b2b2eff39cd2ecda1cd511e7607042e9af07cca9e29561c5d.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/5728ab4fe36994604bf0d53fc6bc0f811cf5521c77491bfeb2684e332899a827.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/tree.json index efdcfdcda5d0d..d76f63c5a15eb 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.fargate-cluster.js.snapshot/tree.json @@ -62,7 +62,7 @@ }, "constructInfo": { "fqn": "@aws-cdk/lambda-layer-kubectl-v24.KubectlV24Layer", - "version": "2.0.229" + "version": "2.0.242" } }, "FargateCluster": { @@ -1525,7 +1525,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "onEvent handler for EKS cluster resource provider", "environment": { @@ -1657,7 +1657,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "isComplete handler for EKS cluster resource provider", "environment": { @@ -2563,7 +2563,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/82715ea785ee76101b617297033a4163e237c444a481a9ca9fde9c08dac51fd4.json" + "/02d6d3451012fee958d31d0cb1dd9b1512fa61ffdf8133c636c17264d43abb81.json" ] ] } @@ -2710,7 +2710,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -3074,7 +3074,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/762af9a2a5af4cb340a1c0a540f210386fe9119cc7ba05dbfbc4391ae2fdeb1b.json" + "/1db955fe9d2a178468903f48964b1561f473ef2bf0a0dad20e3298dd7c49919d.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/sdk-call-integ-test-docker-app/app/package.json b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/sdk-call-integ-test-docker-app/app/package.json index 7931e4aa1f62d..a3103400a8007 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/sdk-call-integ-test-docker-app/app/package.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/sdk-call-integ-test-docker-app/app/package.json @@ -2,6 +2,6 @@ "name": "eks-service-account-sdk-call-integ-test", "private": "true", "dependencies": { - "aws-sdk": "^2.1379.0" + "aws-sdk": "^2.1414.0" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip deleted file mode 100644 index e6cb898734b43..0000000000000 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and /dev/null differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip new file mode 100644 index 0000000000000..90a8a2a6e2615 Binary files /dev/null and b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/manifest.json index 5398107aae56c..f1f50353b7737 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/manifest.json @@ -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}/d0eef97ee070fa9889bffb4a5eabb0236ab992df5f5101a670adf51466fd2fcf.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a07512233b475dff92d8c724e6ee3eef0adb41035c0e08ca7b802b412d7d3e5a.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -72,7 +72,10 @@ "/test-bucket-deployments-1/DeployWithInvalidation/AwsCliLayer/Resource": [ { "type": "aws:cdk:logicalId", - "data": "DeployWithInvalidationAwsCliLayerDEDD5787" + "data": "DeployWithInvalidationAwsCliLayerDEDD5787", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] } ], "/test-bucket-deployments-1/DeployWithInvalidation/CustomResource/Default": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/test-bucket-deployments-1.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/test-bucket-deployments-1.assets.json index f6420aad9405a..791daf2a281ab 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/test-bucket-deployments-1.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/test-bucket-deployments-1.assets.json @@ -14,15 +14,15 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -53,7 +53,7 @@ } } }, - "d0eef97ee070fa9889bffb4a5eabb0236ab992df5f5101a670adf51466fd2fcf": { + "a07512233b475dff92d8c724e6ee3eef0adb41035c0e08ca7b802b412d7d3e5a": { "source": { "path": "test-bucket-deployments-1.template.json", "packaging": "file" @@ -61,7 +61,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "d0eef97ee070fa9889bffb4a5eabb0236ab992df5f5101a670adf51466fd2fcf.json", + "objectKey": "a07512233b475dff92d8c724e6ee3eef0adb41035c0e08ca7b802b412d7d3e5a.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/test-bucket-deployments-1.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/test-bucket-deployments-1.template.json index 237230dc5fd08..cb756bc51c923 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/test-bucket-deployments-1.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/test-bucket-deployments-1.template.json @@ -200,7 +200,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/tree.json index 817274445b0f0..7c1802c81a736 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.js.snapshot/tree.json @@ -272,7 +272,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -632,7 +632,7 @@ "path": "TestBucketDeploymentInteg/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } }, "DeployAssert": { @@ -678,7 +678,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip deleted file mode 100644 index e6cb898734b43..0000000000000 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and /dev/null differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip new file mode 100644 index 0000000000000..90a8a2a6e2615 Binary files /dev/null and b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/manifest.json index 9d668bd95cfd2..471f7c8de1dc5 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/manifest.json @@ -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}/f8523dd040d4172b809ca0bb80e719d0ee009d01c40ace88fd3655a22a531cbf.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/e3ab32882fbc0e0c0f96de02a1c1a384d6e9efb5fbc479c5e3a9726c8c0ce531.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -66,7 +66,10 @@ "/test-bucket-deployment-deployed-bucket/DeployMe5/AwsCliLayer/Resource": [ { "type": "aws:cdk:logicalId", - "data": "DeployMe5AwsCliLayerF0F79631" + "data": "DeployMe5AwsCliLayerF0F79631", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] } ], "/test-bucket-deployment-deployed-bucket/DeployMe5/CustomResource/Default": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/test-bucket-deployment-deployed-bucket.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/test-bucket-deployment-deployed-bucket.assets.json index 758e1f771bbe1..5e8c9a5b84ec0 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/test-bucket-deployment-deployed-bucket.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/test-bucket-deployment-deployed-bucket.assets.json @@ -14,15 +14,15 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -53,7 +53,7 @@ } } }, - "f8523dd040d4172b809ca0bb80e719d0ee009d01c40ace88fd3655a22a531cbf": { + "e3ab32882fbc0e0c0f96de02a1c1a384d6e9efb5fbc479c5e3a9726c8c0ce531": { "source": { "path": "test-bucket-deployment-deployed-bucket.template.json", "packaging": "file" @@ -61,7 +61,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "f8523dd040d4172b809ca0bb80e719d0ee009d01c40ace88fd3655a22a531cbf.json", + "objectKey": "e3ab32882fbc0e0c0f96de02a1c1a384d6e9efb5fbc479c5e3a9726c8c0ce531.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/test-bucket-deployment-deployed-bucket.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/test-bucket-deployment-deployed-bucket.template.json index 76dd635b0fe6a..557a337bee2f3 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/test-bucket-deployment-deployed-bucket.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/test-bucket-deployment-deployed-bucket.template.json @@ -152,7 +152,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/tree.json index 281e47a5c1c69..d8ee1e8894927 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-deployed-bucket.js.snapshot/tree.json @@ -206,7 +206,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -582,7 +582,7 @@ "path": "integ-test-bucket-deployments/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } }, "DeployAssert": { @@ -628,7 +628,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip deleted file mode 100644 index e6cb898734b43..0000000000000 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and /dev/null differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip new file mode 100644 index 0000000000000..90a8a2a6e2615 Binary files /dev/null and b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/manifest.json index 3757b87bfbc7f..1dde8e9fdbd66 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/manifest.json @@ -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}/bc6ccdd430be60d1781903204cf2e3beb4fbe7a2eea344f63ca7c78ac115a0d0.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ef6a43e04be8ed68234d7466c7a9f93ff860cdd0db5780f23e9f4a8d3240271d.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -66,7 +66,10 @@ "/test-bucket-deployment-signobject/Deployment/AwsCliLayer/Resource": [ { "type": "aws:cdk:logicalId", - "data": "DeploymentAwsCliLayerB82B26A3" + "data": "DeploymentAwsCliLayerB82B26A3", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] } ], "/test-bucket-deployment-signobject/Deployment/CustomResource/Default": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/test-bucket-deployment-signobject.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/test-bucket-deployment-signobject.assets.json index 4befa87fbc59c..d1f4d8e0e9431 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/test-bucket-deployment-signobject.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/test-bucket-deployment-signobject.assets.json @@ -14,15 +14,15 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -53,7 +53,7 @@ } } }, - "bc6ccdd430be60d1781903204cf2e3beb4fbe7a2eea344f63ca7c78ac115a0d0": { + "ef6a43e04be8ed68234d7466c7a9f93ff860cdd0db5780f23e9f4a8d3240271d": { "source": { "path": "test-bucket-deployment-signobject.template.json", "packaging": "file" @@ -61,7 +61,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "bc6ccdd430be60d1781903204cf2e3beb4fbe7a2eea344f63ca7c78ac115a0d0.json", + "objectKey": "ef6a43e04be8ed68234d7466c7a9f93ff860cdd0db5780f23e9f4a8d3240271d.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/test-bucket-deployment-signobject.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/test-bucket-deployment-signobject.template.json index 158fe7b33e2f6..93bc5eb1fb187 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/test-bucket-deployment-signobject.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/test-bucket-deployment-signobject.template.json @@ -178,7 +178,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/tree.json index 8fba4e128c6a0..33eb87c1facc3 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-signcontent.js.snapshot/tree.json @@ -232,7 +232,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -584,7 +584,7 @@ "path": "integ-test-bucket-deployments/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } }, "DeployAssert": { @@ -630,7 +630,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip deleted file mode 100644 index e6cb898734b43..0000000000000 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and /dev/null differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.33cc97057bd20e4d2a8b75b52dc72cad7a3b45d78fa06a008ae302ab17b2075f.bundle/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.31dc77c600dd475c9b26f5702fabd7508d84bec599ba5b973691d69745c7b775.bundle/index.js similarity index 96% rename from packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.33cc97057bd20e4d2a8b75b52dc72cad7a3b45d78fa06a008ae302ab17b2075f.bundle/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.31dc77c600dd475c9b26f5702fabd7508d84bec599ba5b973691d69745c7b775.bundle/index.js index aeb0f3c9b006f..e2e00806fdc40 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.33cc97057bd20e4d2a8b75b52dc72cad7a3b45d78fa06a008ae302ab17b2075f.bundle/index.js +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.31dc77c600dd475c9b26f5702fabd7508d84bec599ba5b973691d69745c7b775.bundle/index.js @@ -54,12 +54,12 @@ var Matcher, MatchResult; var init_matcher = __esm({ "../../aws-cdk-lib/assertions/lib/matcher.ts"() { "use strict"; - Matcher = class { + Matcher = class _Matcher { /** * Check whether the provided object is a subtype of the `IMatcher`. */ static isMatcher(x) { - return x && x instanceof Matcher; + return x && x instanceof _Matcher; } }; MatchResult = class { @@ -1747,7 +1747,7 @@ var require_httpRequest = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HttpRequest = void 0; - var HttpRequest = class { + var HttpRequest = class _HttpRequest { constructor(options) { this.method = options.method || "GET"; this.hostname = options.hostname || "localhost"; @@ -1768,7 +1768,7 @@ var require_httpRequest = __commonJS({ return "method" in req && "protocol" in req && "hostname" in req && "path" in req && typeof req["query"] === "object" && typeof req["headers"] === "object"; } clone() { - const cloned = new HttpRequest({ + const cloned = new _HttpRequest({ ...this, headers: { ...this.headers } }); @@ -2008,12 +2008,12 @@ var require_ProviderError = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ProviderError = void 0; - var ProviderError = class extends Error { + var ProviderError = class _ProviderError extends Error { constructor(message, tryNextLink = true) { super(message); this.tryNextLink = tryNextLink; this.name = "ProviderError"; - Object.setPrototypeOf(this, ProviderError.prototype); + Object.setPrototypeOf(this, _ProviderError.prototype); } static from(error, tryNextLink = true) { return Object.assign(new this(error.message, tryNextLink), error); @@ -2030,12 +2030,12 @@ var require_CredentialsProviderError = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.CredentialsProviderError = void 0; var ProviderError_1 = require_ProviderError(); - var CredentialsProviderError = class extends ProviderError_1.ProviderError { + var CredentialsProviderError = class _CredentialsProviderError extends ProviderError_1.ProviderError { constructor(message, tryNextLink = true) { super(message, tryNextLink); this.tryNextLink = tryNextLink; this.name = "CredentialsProviderError"; - Object.setPrototypeOf(this, CredentialsProviderError.prototype); + Object.setPrototypeOf(this, _CredentialsProviderError.prototype); } }; exports.CredentialsProviderError = CredentialsProviderError; @@ -2049,12 +2049,12 @@ var require_TokenProviderError = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.TokenProviderError = void 0; var ProviderError_1 = require_ProviderError(); - var TokenProviderError = class extends ProviderError_1.ProviderError { + var TokenProviderError = class _TokenProviderError extends ProviderError_1.ProviderError { constructor(message, tryNextLink = true) { super(message, tryNextLink); this.tryNextLink = tryNextLink; this.name = "TokenProviderError"; - Object.setPrototypeOf(this, TokenProviderError.prototype); + Object.setPrototypeOf(this, _TokenProviderError.prototype); } }; exports.TokenProviderError = TokenProviderError; @@ -3111,7 +3111,7 @@ var require_Int64 = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.Int64 = void 0; var util_hex_encoding_1 = require_dist_cjs8(); - var Int64 = class { + var Int64 = class _Int64 { constructor(bytes) { this.bytes = bytes; if (bytes.byteLength !== 8) { @@ -3129,7 +3129,7 @@ var require_Int64 = __commonJS({ if (number < 0) { negate(bytes); } - return new Int64(bytes); + return new _Int64(bytes); } valueOf() { const bytes = this.bytes.slice(0); @@ -4774,6 +4774,18 @@ var require_partition = __commonJS({ } }); +// ../../../node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/isIpAddress.js +var require_isIpAddress = __commonJS({ + "../../../node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/isIpAddress.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isIpAddress = void 0; + var IP_V4_REGEX = new RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`); + var isIpAddress = (value) => IP_V4_REGEX.test(value) || value.startsWith("[") && value.endsWith("]"); + exports.isIpAddress = isIpAddress; + } +}); + // ../../../node_modules/@aws-sdk/util-endpoints/dist-cjs/debug/debugId.js var require_debugId = __commonJS({ "../../../node_modules/@aws-sdk/util-endpoints/dist-cjs/debug/debugId.js"(exports) { @@ -4888,18 +4900,6 @@ var require_types2 = __commonJS({ } }); -// ../../../node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/isIpAddress.js -var require_isIpAddress = __commonJS({ - "../../../node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/isIpAddress.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isIpAddress = void 0; - var IP_V4_REGEX = new RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`); - var isIpAddress = (value) => IP_V4_REGEX.test(value) || value.startsWith("[") && value.endsWith("]"); - exports.isIpAddress = isIpAddress; - } -}); - // ../../../node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/isValidHostLabel.js var require_isValidHostLabel = __commonJS({ "../../../node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/isValidHostLabel.js"(exports) { @@ -5096,11 +5096,10 @@ var require_auth2 = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HttpAuthLocation = void 0; - var HttpAuthLocation; - (function(HttpAuthLocation2) { - HttpAuthLocation2["HEADER"] = "header"; - HttpAuthLocation2["QUERY"] = "query"; - })(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); + var types_1 = require_dist_cjs(); + Object.defineProperty(exports, "HttpAuthLocation", { enumerable: true, get: function() { + return types_1.HttpAuthLocation; + } }); } }); @@ -5136,39 +5135,11 @@ var require_command2 = __commonJS({ } }); -// ../../../node_modules/@aws-sdk/types/dist-cjs/connection/config.js -var require_config2 = __commonJS({ - "../../../node_modules/@aws-sdk/types/dist-cjs/connection/config.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - } -}); - -// ../../../node_modules/@aws-sdk/types/dist-cjs/connection/manager.js -var require_manager2 = __commonJS({ - "../../../node_modules/@aws-sdk/types/dist-cjs/connection/manager.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - } -}); - -// ../../../node_modules/@aws-sdk/types/dist-cjs/connection/pool.js -var require_pool2 = __commonJS({ - "../../../node_modules/@aws-sdk/types/dist-cjs/connection/pool.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - } -}); - -// ../../../node_modules/@aws-sdk/types/dist-cjs/connection/index.js +// ../../../node_modules/@aws-sdk/types/dist-cjs/connection.js var require_connection2 = __commonJS({ - "../../../node_modules/@aws-sdk/types/dist-cjs/connection/index.js"(exports) { + "../../../node_modules/@aws-sdk/types/dist-cjs/connection.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - tslib_1.__exportStar(require_config2(), exports); - tslib_1.__exportStar(require_manager2(), exports); - tslib_1.__exportStar(require_pool2(), exports); } }); @@ -5216,11 +5187,10 @@ var require_endpoint2 = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EndpointURLScheme = void 0; - var EndpointURLScheme; - (function(EndpointURLScheme2) { - EndpointURLScheme2["HTTP"] = "http"; - EndpointURLScheme2["HTTPS"] = "https"; - })(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); + var types_1 = require_dist_cjs(); + Object.defineProperty(exports, "EndpointURLScheme", { enumerable: true, get: function() { + return types_1.EndpointURLScheme; + } }); } }); @@ -5396,12 +5366,10 @@ var require_transfer2 = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RequestHandlerProtocol = void 0; - var RequestHandlerProtocol; - (function(RequestHandlerProtocol2) { - RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; - })(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); + var types_1 = require_dist_cjs(); + Object.defineProperty(exports, "RequestHandlerProtocol", { enumerable: true, get: function() { + return types_1.RequestHandlerProtocol; + } }); } }); @@ -6019,6 +5987,7 @@ var require_dist_cjs18 = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); tslib_1.__exportStar(require_partition(), exports); + tslib_1.__exportStar(require_isIpAddress(), exports); tslib_1.__exportStar(require_resolveEndpoint(), exports); tslib_1.__exportStar(require_types2(), exports); } @@ -6282,7 +6251,7 @@ var require_endpointsConfig = __commonJS({ }); // ../../../node_modules/@smithy/config-resolver/dist-cjs/regionConfig/config.js -var require_config3 = __commonJS({ +var require_config2 = __commonJS({ "../../../node_modules/@smithy/config-resolver/dist-cjs/regionConfig/config.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -6366,7 +6335,7 @@ var require_regionConfig = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - tslib_1.__exportStar(require_config3(), exports); + tslib_1.__exportStar(require_config2(), exports); tslib_1.__exportStar(require_resolveRegionConfig(), exports); } }); @@ -6697,9 +6666,9 @@ var require_getEndpointFromInstructions = __commonJS({ } }); -// ../../../node_modules/@smithy/querystring-parser/dist-cjs/index.js +// ../../../node_modules/@smithy/middleware-endpoint/node_modules/@smithy/querystring-parser/dist-cjs/index.js var require_dist_cjs23 = __commonJS({ - "../../../node_modules/@smithy/querystring-parser/dist-cjs/index.js"(exports) { + "../../../node_modules/@smithy/middleware-endpoint/node_modules/@smithy/querystring-parser/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parseQueryString = void 0; @@ -6728,9 +6697,9 @@ var require_dist_cjs23 = __commonJS({ } }); -// ../../../node_modules/@smithy/url-parser/dist-cjs/index.js +// ../../../node_modules/@smithy/middleware-endpoint/node_modules/@smithy/url-parser/dist-cjs/index.js var require_dist_cjs24 = __commonJS({ - "../../../node_modules/@smithy/url-parser/dist-cjs/index.js"(exports) { + "../../../node_modules/@smithy/middleware-endpoint/node_modules/@smithy/url-parser/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parseUrl = void 0; @@ -6818,9 +6787,9 @@ var require_endpointMiddleware = __commonJS({ } }); -// ../../../node_modules/@smithy/middleware-serde/dist-cjs/deserializerMiddleware.js +// ../../../node_modules/@smithy/middleware-endpoint/node_modules/@smithy/middleware-serde/dist-cjs/deserializerMiddleware.js var require_deserializerMiddleware = __commonJS({ - "../../../node_modules/@smithy/middleware-serde/dist-cjs/deserializerMiddleware.js"(exports) { + "../../../node_modules/@smithy/middleware-endpoint/node_modules/@smithy/middleware-serde/dist-cjs/deserializerMiddleware.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.deserializerMiddleware = void 0; @@ -6847,9 +6816,9 @@ var require_deserializerMiddleware = __commonJS({ } }); -// ../../../node_modules/@smithy/middleware-serde/dist-cjs/serializerMiddleware.js +// ../../../node_modules/@smithy/middleware-endpoint/node_modules/@smithy/middleware-serde/dist-cjs/serializerMiddleware.js var require_serializerMiddleware = __commonJS({ - "../../../node_modules/@smithy/middleware-serde/dist-cjs/serializerMiddleware.js"(exports) { + "../../../node_modules/@smithy/middleware-endpoint/node_modules/@smithy/middleware-serde/dist-cjs/serializerMiddleware.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.serializerMiddleware = void 0; @@ -6869,9 +6838,9 @@ var require_serializerMiddleware = __commonJS({ } }); -// ../../../node_modules/@smithy/middleware-serde/dist-cjs/serdePlugin.js +// ../../../node_modules/@smithy/middleware-endpoint/node_modules/@smithy/middleware-serde/dist-cjs/serdePlugin.js var require_serdePlugin = __commonJS({ - "../../../node_modules/@smithy/middleware-serde/dist-cjs/serdePlugin.js"(exports) { + "../../../node_modules/@smithy/middleware-endpoint/node_modules/@smithy/middleware-serde/dist-cjs/serdePlugin.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSerdePlugin = exports.serializerMiddlewareOption = exports.deserializerMiddlewareOption = void 0; @@ -6901,9 +6870,9 @@ var require_serdePlugin = __commonJS({ } }); -// ../../../node_modules/@smithy/middleware-serde/dist-cjs/index.js +// ../../../node_modules/@smithy/middleware-endpoint/node_modules/@smithy/middleware-serde/dist-cjs/index.js var require_dist_cjs25 = __commonJS({ - "../../../node_modules/@smithy/middleware-serde/dist-cjs/index.js"(exports) { + "../../../node_modules/@smithy/middleware-endpoint/node_modules/@smithy/middleware-serde/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); @@ -6941,13 +6910,39 @@ var require_getEndpointPlugin = __commonJS({ } }); +// ../../../node_modules/@smithy/middleware-endpoint/node_modules/@smithy/util-middleware/dist-cjs/normalizeProvider.js +var require_normalizeProvider2 = __commonJS({ + "../../../node_modules/@smithy/middleware-endpoint/node_modules/@smithy/util-middleware/dist-cjs/normalizeProvider.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.normalizeProvider = void 0; + var normalizeProvider = (input) => { + if (typeof input === "function") + return input; + const promisified = Promise.resolve(input); + return () => promisified; + }; + exports.normalizeProvider = normalizeProvider; + } +}); + +// ../../../node_modules/@smithy/middleware-endpoint/node_modules/@smithy/util-middleware/dist-cjs/index.js +var require_dist_cjs26 = __commonJS({ + "../../../node_modules/@smithy/middleware-endpoint/node_modules/@smithy/util-middleware/dist-cjs/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + tslib_1.__exportStar(require_normalizeProvider2(), exports); + } +}); + // ../../../node_modules/@smithy/middleware-endpoint/dist-cjs/resolveEndpointConfig.js var require_resolveEndpointConfig = __commonJS({ "../../../node_modules/@smithy/middleware-endpoint/dist-cjs/resolveEndpointConfig.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.resolveEndpointConfig = void 0; - var util_middleware_1 = require_dist_cjs10(); + var util_middleware_1 = require_dist_cjs26(); var toEndpointV1_1 = require_toEndpointV1(); var resolveEndpointConfig = (input) => { var _a, _b, _c; @@ -6977,7 +6972,7 @@ var require_types3 = __commonJS({ }); // ../../../node_modules/@smithy/middleware-endpoint/dist-cjs/index.js -var require_dist_cjs26 = __commonJS({ +var require_dist_cjs27 = __commonJS({ "../../../node_modules/@smithy/middleware-endpoint/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -6991,7 +6986,7 @@ var require_dist_cjs26 = __commonJS({ }); // ../../../node_modules/@smithy/util-retry/dist-cjs/config.js -var require_config4 = __commonJS({ +var require_config3 = __commonJS({ "../../../node_modules/@smithy/util-retry/dist-cjs/config.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -7036,14 +7031,14 @@ var require_constants3 = __commonJS({ "TooManyRequestsException", "TransactionInProgressException" ]; - exports.TRANSIENT_ERROR_CODES = ["AbortError", "TimeoutError", "RequestTimeout", "RequestTimeoutException"]; + exports.TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"]; exports.TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504]; exports.NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"]; } }); // ../../../node_modules/@smithy/service-error-classification/dist-cjs/index.js -var require_dist_cjs27 = __commonJS({ +var require_dist_cjs28 = __commonJS({ "../../../node_modules/@smithy/service-error-classification/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -7084,7 +7079,7 @@ var require_DefaultRateLimiter = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DefaultRateLimiter = void 0; - var service_error_classification_1 = require_dist_cjs27(); + var service_error_classification_1 = require_dist_cjs28(); var DefaultRateLimiter = class { constructor(options) { var _a, _b, _c, _d, _e; @@ -7246,163 +7241,714 @@ var require_defaultRetryToken = __commonJS({ getRetryCost }; }; - exports.createDefaultRetryToken = createDefaultRetryToken; + exports.createDefaultRetryToken = createDefaultRetryToken; + } +}); + +// ../../../node_modules/@smithy/util-retry/dist-cjs/StandardRetryStrategy.js +var require_StandardRetryStrategy = __commonJS({ + "../../../node_modules/@smithy/util-retry/dist-cjs/StandardRetryStrategy.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.StandardRetryStrategy = void 0; + var config_1 = require_config3(); + var constants_1 = require_constants4(); + var defaultRetryBackoffStrategy_1 = require_defaultRetryBackoffStrategy(); + var defaultRetryToken_1 = require_defaultRetryToken(); + var StandardRetryStrategy = class { + constructor(maxAttempts) { + this.maxAttempts = maxAttempts; + this.mode = config_1.RETRY_MODES.STANDARD; + this.capacity = constants_1.INITIAL_RETRY_TOKENS; + this.retryBackoffStrategy = (0, defaultRetryBackoffStrategy_1.getDefaultRetryBackoffStrategy)(); + this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts; + } + async acquireInitialRetryToken(retryTokenScope) { + return (0, defaultRetryToken_1.createDefaultRetryToken)({ + retryDelay: constants_1.DEFAULT_RETRY_DELAY_BASE, + retryCount: 0 + }); + } + async refreshRetryTokenForRetry(token, errorInfo) { + const maxAttempts = await this.getMaxAttempts(); + if (this.shouldRetry(token, errorInfo, maxAttempts)) { + const errorType = errorInfo.errorType; + this.retryBackoffStrategy.setDelayBase(errorType === "THROTTLING" ? constants_1.THROTTLING_RETRY_DELAY_BASE : constants_1.DEFAULT_RETRY_DELAY_BASE); + const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount()); + const retryDelay = errorInfo.retryAfterHint ? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType) : delayFromErrorType; + const capacityCost = this.getCapacityCost(errorType); + this.capacity -= capacityCost; + return (0, defaultRetryToken_1.createDefaultRetryToken)({ + retryDelay, + retryCount: token.getRetryCount() + 1, + retryCost: capacityCost + }); + } + throw new Error("No retry token available"); + } + recordSuccess(token) { + var _a; + this.capacity = Math.max(constants_1.INITIAL_RETRY_TOKENS, this.capacity + ((_a = token.getRetryCost()) !== null && _a !== void 0 ? _a : constants_1.NO_RETRY_INCREMENT)); + } + getCapacity() { + return this.capacity; + } + async getMaxAttempts() { + try { + return await this.maxAttemptsProvider(); + } catch (error) { + console.warn(`Max attempts provider could not resolve. Using default of ${config_1.DEFAULT_MAX_ATTEMPTS}`); + return config_1.DEFAULT_MAX_ATTEMPTS; + } + } + shouldRetry(tokenToRenew, errorInfo, maxAttempts) { + const attempts = tokenToRenew.getRetryCount() + 1; + return attempts < maxAttempts && this.capacity >= this.getCapacityCost(errorInfo.errorType) && this.isRetryableError(errorInfo.errorType); + } + getCapacityCost(errorType) { + return errorType === "TRANSIENT" ? constants_1.TIMEOUT_RETRY_COST : constants_1.RETRY_COST; + } + isRetryableError(errorType) { + return errorType === "THROTTLING" || errorType === "TRANSIENT"; + } + }; + exports.StandardRetryStrategy = StandardRetryStrategy; + } +}); + +// ../../../node_modules/@smithy/util-retry/dist-cjs/AdaptiveRetryStrategy.js +var require_AdaptiveRetryStrategy = __commonJS({ + "../../../node_modules/@smithy/util-retry/dist-cjs/AdaptiveRetryStrategy.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AdaptiveRetryStrategy = void 0; + var config_1 = require_config3(); + var DefaultRateLimiter_1 = require_DefaultRateLimiter(); + var StandardRetryStrategy_1 = require_StandardRetryStrategy(); + var AdaptiveRetryStrategy = class { + constructor(maxAttemptsProvider, options) { + this.maxAttemptsProvider = maxAttemptsProvider; + this.mode = config_1.RETRY_MODES.ADAPTIVE; + const { rateLimiter } = options !== null && options !== void 0 ? options : {}; + this.rateLimiter = rateLimiter !== null && rateLimiter !== void 0 ? rateLimiter : new DefaultRateLimiter_1.DefaultRateLimiter(); + this.standardRetryStrategy = new StandardRetryStrategy_1.StandardRetryStrategy(maxAttemptsProvider); + } + async acquireInitialRetryToken(retryTokenScope) { + await this.rateLimiter.getSendToken(); + return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); + } + async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { + this.rateLimiter.updateClientSendingRate(errorInfo); + return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo); + } + recordSuccess(token) { + this.rateLimiter.updateClientSendingRate({}); + this.standardRetryStrategy.recordSuccess(token); + } + }; + exports.AdaptiveRetryStrategy = AdaptiveRetryStrategy; + } +}); + +// ../../../node_modules/@smithy/util-retry/dist-cjs/ConfiguredRetryStrategy.js +var require_ConfiguredRetryStrategy = __commonJS({ + "../../../node_modules/@smithy/util-retry/dist-cjs/ConfiguredRetryStrategy.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ConfiguredRetryStrategy = void 0; + var constants_1 = require_constants4(); + var StandardRetryStrategy_1 = require_StandardRetryStrategy(); + var ConfiguredRetryStrategy = class extends StandardRetryStrategy_1.StandardRetryStrategy { + constructor(maxAttempts, computeNextBackoffDelay = constants_1.DEFAULT_RETRY_DELAY_BASE) { + super(typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts); + if (typeof computeNextBackoffDelay === "number") { + this.computeNextBackoffDelay = () => computeNextBackoffDelay; + } else { + this.computeNextBackoffDelay = computeNextBackoffDelay; + } + } + async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { + const token = await super.refreshRetryTokenForRetry(tokenToRenew, errorInfo); + token.getRetryDelay = () => this.computeNextBackoffDelay(token.getRetryCount()); + return token; + } + }; + exports.ConfiguredRetryStrategy = ConfiguredRetryStrategy; + } +}); + +// ../../../node_modules/@smithy/util-retry/dist-cjs/types.js +var require_types4 = __commonJS({ + "../../../node_modules/@smithy/util-retry/dist-cjs/types.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/util-retry/dist-cjs/index.js +var require_dist_cjs29 = __commonJS({ + "../../../node_modules/@smithy/util-retry/dist-cjs/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + tslib_1.__exportStar(require_AdaptiveRetryStrategy(), exports); + tslib_1.__exportStar(require_ConfiguredRetryStrategy(), exports); + tslib_1.__exportStar(require_DefaultRateLimiter(), exports); + tslib_1.__exportStar(require_StandardRetryStrategy(), exports); + tslib_1.__exportStar(require_config3(), exports); + tslib_1.__exportStar(require_constants4(), exports); + tslib_1.__exportStar(require_types4(), exports); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/abort.js +var require_abort3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/abort.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/auth.js +var require_auth3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/auth.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.HttpAuthLocation = void 0; + var HttpAuthLocation; + (function(HttpAuthLocation2) { + HttpAuthLocation2["HEADER"] = "header"; + HttpAuthLocation2["QUERY"] = "query"; + })(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/checksum.js +var require_checksum3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/checksum.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/client.js +var require_client3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/client.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/command.js +var require_command3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/command.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/connection/config.js +var require_config4 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/connection/config.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/connection/manager.js +var require_manager2 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/connection/manager.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/connection/pool.js +var require_pool2 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/connection/pool.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/connection/index.js +var require_connection3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/connection/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + tslib_1.__exportStar(require_config4(), exports); + tslib_1.__exportStar(require_manager2(), exports); + tslib_1.__exportStar(require_pool2(), exports); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/crypto.js +var require_crypto3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/crypto.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/encode.js +var require_encode3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/encode.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/endpoint.js +var require_endpoint3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/endpoint.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.EndpointURLScheme = void 0; + var EndpointURLScheme; + (function(EndpointURLScheme2) { + EndpointURLScheme2["HTTP"] = "http"; + EndpointURLScheme2["HTTPS"] = "https"; + })(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/endpoints/EndpointRuleObject.js +var require_EndpointRuleObject3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/endpoints/EndpointRuleObject.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/endpoints/ErrorRuleObject.js +var require_ErrorRuleObject3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/endpoints/ErrorRuleObject.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/endpoints/RuleSetObject.js +var require_RuleSetObject3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/endpoints/RuleSetObject.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/endpoints/shared.js +var require_shared3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/endpoints/shared.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/endpoints/TreeRuleObject.js +var require_TreeRuleObject3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/endpoints/TreeRuleObject.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/endpoints/index.js +var require_endpoints2 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/endpoints/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + tslib_1.__exportStar(require_EndpointRuleObject3(), exports); + tslib_1.__exportStar(require_ErrorRuleObject3(), exports); + tslib_1.__exportStar(require_RuleSetObject3(), exports); + tslib_1.__exportStar(require_shared3(), exports); + tslib_1.__exportStar(require_TreeRuleObject3(), exports); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/eventStream.js +var require_eventStream3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/eventStream.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/http.js +var require_http3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/http.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.FieldPosition = void 0; + var FieldPosition; + (function(FieldPosition2) { + FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; + FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; + })(FieldPosition = exports.FieldPosition || (exports.FieldPosition = {})); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/identity/awsCredentialIdentity.js +var require_awsCredentialIdentity2 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/identity/awsCredentialIdentity.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/identity/identity.js +var require_identity4 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/identity/identity.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/identity/index.js +var require_identity5 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/identity/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + tslib_1.__exportStar(require_awsCredentialIdentity2(), exports); + tslib_1.__exportStar(require_identity4(), exports); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/logger.js +var require_logger3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/logger.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/middleware.js +var require_middleware3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/middleware.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/pagination.js +var require_pagination3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/pagination.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/profile.js +var require_profile3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/profile.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/response.js +var require_response3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/response.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/retry.js +var require_retry3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/retry.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/serde.js +var require_serde3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/serde.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/shapes.js +var require_shapes3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/shapes.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/signature.js +var require_signature3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/signature.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/stream.js +var require_stream3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/stream.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/transfer.js +var require_transfer3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/transfer.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.RequestHandlerProtocol = void 0; + var RequestHandlerProtocol; + (function(RequestHandlerProtocol2) { + RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; + })(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/uri.js +var require_uri3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/uri.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/util.js +var require_util3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/util.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/waiter.js +var require_waiter3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/waiter.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/index.js +var require_dist_cjs30 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/types/dist-cjs/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + tslib_1.__exportStar(require_abort3(), exports); + tslib_1.__exportStar(require_auth3(), exports); + tslib_1.__exportStar(require_checksum3(), exports); + tslib_1.__exportStar(require_client3(), exports); + tslib_1.__exportStar(require_command3(), exports); + tslib_1.__exportStar(require_connection3(), exports); + tslib_1.__exportStar(require_crypto3(), exports); + tslib_1.__exportStar(require_encode3(), exports); + tslib_1.__exportStar(require_endpoint3(), exports); + tslib_1.__exportStar(require_endpoints2(), exports); + tslib_1.__exportStar(require_eventStream3(), exports); + tslib_1.__exportStar(require_http3(), exports); + tslib_1.__exportStar(require_identity5(), exports); + tslib_1.__exportStar(require_logger3(), exports); + tslib_1.__exportStar(require_middleware3(), exports); + tslib_1.__exportStar(require_pagination3(), exports); + tslib_1.__exportStar(require_profile3(), exports); + tslib_1.__exportStar(require_response3(), exports); + tslib_1.__exportStar(require_retry3(), exports); + tslib_1.__exportStar(require_serde3(), exports); + tslib_1.__exportStar(require_shapes3(), exports); + tslib_1.__exportStar(require_signature3(), exports); + tslib_1.__exportStar(require_stream3(), exports); + tslib_1.__exportStar(require_transfer3(), exports); + tslib_1.__exportStar(require_uri3(), exports); + tslib_1.__exportStar(require_util3(), exports); + tslib_1.__exportStar(require_waiter3(), exports); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/protocol-http/dist-cjs/Field.js +var require_Field2 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/protocol-http/dist-cjs/Field.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Field = void 0; + var types_1 = require_dist_cjs30(); + var Field = class { + constructor({ name, kind = types_1.FieldPosition.HEADER, values = [] }) { + this.name = name; + this.kind = kind; + this.values = values; + } + add(value) { + this.values.push(value); + } + set(values) { + this.values = values; + } + remove(value) { + this.values = this.values.filter((v) => v !== value); + } + toString() { + return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", "); + } + get() { + return this.values; + } + }; + exports.Field = Field; } }); -// ../../../node_modules/@smithy/util-retry/dist-cjs/StandardRetryStrategy.js -var require_StandardRetryStrategy = __commonJS({ - "../../../node_modules/@smithy/util-retry/dist-cjs/StandardRetryStrategy.js"(exports) { +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/protocol-http/dist-cjs/Fields.js +var require_Fields2 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/protocol-http/dist-cjs/Fields.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.StandardRetryStrategy = void 0; - var config_1 = require_config4(); - var constants_1 = require_constants4(); - var defaultRetryBackoffStrategy_1 = require_defaultRetryBackoffStrategy(); - var defaultRetryToken_1 = require_defaultRetryToken(); - var StandardRetryStrategy = class { - constructor(maxAttempts) { - this.maxAttempts = maxAttempts; - this.mode = config_1.RETRY_MODES.STANDARD; - this.capacity = constants_1.INITIAL_RETRY_TOKENS; - this.retryBackoffStrategy = (0, defaultRetryBackoffStrategy_1.getDefaultRetryBackoffStrategy)(); - this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts; - } - async acquireInitialRetryToken(retryTokenScope) { - return (0, defaultRetryToken_1.createDefaultRetryToken)({ - retryDelay: constants_1.DEFAULT_RETRY_DELAY_BASE, - retryCount: 0 - }); - } - async refreshRetryTokenForRetry(token, errorInfo) { - const maxAttempts = await this.getMaxAttempts(); - if (this.shouldRetry(token, errorInfo, maxAttempts)) { - const errorType = errorInfo.errorType; - this.retryBackoffStrategy.setDelayBase(errorType === "THROTTLING" ? constants_1.THROTTLING_RETRY_DELAY_BASE : constants_1.DEFAULT_RETRY_DELAY_BASE); - const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount()); - const retryDelay = errorInfo.retryAfterHint ? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType) : delayFromErrorType; - const capacityCost = this.getCapacityCost(errorType); - this.capacity -= capacityCost; - return (0, defaultRetryToken_1.createDefaultRetryToken)({ - retryDelay, - retryCount: token.getRetryCount() + 1, - retryCost: capacityCost - }); - } - throw new Error("No retry token available"); - } - recordSuccess(token) { - var _a; - this.capacity = Math.max(constants_1.INITIAL_RETRY_TOKENS, this.capacity + ((_a = token.getRetryCost()) !== null && _a !== void 0 ? _a : constants_1.NO_RETRY_INCREMENT)); - } - getCapacity() { - return this.capacity; + exports.Fields = void 0; + var Fields = class { + constructor({ fields = [], encoding = "utf-8" }) { + this.entries = {}; + fields.forEach(this.setField.bind(this)); + this.encoding = encoding; } - async getMaxAttempts() { - try { - return await this.maxAttemptsProvider(); - } catch (error) { - console.warn(`Max attempts provider could not resolve. Using default of ${config_1.DEFAULT_MAX_ATTEMPTS}`); - return config_1.DEFAULT_MAX_ATTEMPTS; - } + setField(field) { + this.entries[field.name.toLowerCase()] = field; } - shouldRetry(tokenToRenew, errorInfo, maxAttempts) { - const attempts = tokenToRenew.getRetryCount() + 1; - return attempts < maxAttempts && this.capacity >= this.getCapacityCost(errorInfo.errorType) && this.isRetryableError(errorInfo.errorType); + getField(name) { + return this.entries[name.toLowerCase()]; } - getCapacityCost(errorType) { - return errorType === "TRANSIENT" ? constants_1.TIMEOUT_RETRY_COST : constants_1.RETRY_COST; + removeField(name) { + delete this.entries[name.toLowerCase()]; } - isRetryableError(errorType) { - return errorType === "THROTTLING" || errorType === "TRANSIENT"; + getByType(kind) { + return Object.values(this.entries).filter((field) => field.kind === kind); } }; - exports.StandardRetryStrategy = StandardRetryStrategy; + exports.Fields = Fields; } }); -// ../../../node_modules/@smithy/util-retry/dist-cjs/AdaptiveRetryStrategy.js -var require_AdaptiveRetryStrategy = __commonJS({ - "../../../node_modules/@smithy/util-retry/dist-cjs/AdaptiveRetryStrategy.js"(exports) { +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/protocol-http/dist-cjs/httpHandler.js +var require_httpHandler2 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/protocol-http/dist-cjs/httpHandler.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.AdaptiveRetryStrategy = void 0; - var config_1 = require_config4(); - var DefaultRateLimiter_1 = require_DefaultRateLimiter(); - var StandardRetryStrategy_1 = require_StandardRetryStrategy(); - var AdaptiveRetryStrategy = class { - constructor(maxAttemptsProvider, options) { - this.maxAttemptsProvider = maxAttemptsProvider; - this.mode = config_1.RETRY_MODES.ADAPTIVE; - const { rateLimiter } = options !== null && options !== void 0 ? options : {}; - this.rateLimiter = rateLimiter !== null && rateLimiter !== void 0 ? rateLimiter : new DefaultRateLimiter_1.DefaultRateLimiter(); - this.standardRetryStrategy = new StandardRetryStrategy_1.StandardRetryStrategy(maxAttemptsProvider); - } - async acquireInitialRetryToken(retryTokenScope) { - await this.rateLimiter.getSendToken(); - return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/protocol-http/dist-cjs/httpRequest.js +var require_httpRequest2 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/protocol-http/dist-cjs/httpRequest.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.HttpRequest = void 0; + var HttpRequest = class _HttpRequest { + constructor(options) { + this.method = options.method || "GET"; + this.hostname = options.hostname || "localhost"; + this.port = options.port; + this.query = options.query || {}; + this.headers = options.headers || {}; + this.body = options.body; + this.protocol = options.protocol ? options.protocol.slice(-1) !== ":" ? `${options.protocol}:` : options.protocol : "https:"; + this.path = options.path ? options.path.charAt(0) !== "/" ? `/${options.path}` : options.path : "/"; + this.username = options.username; + this.password = options.password; + this.fragment = options.fragment; } - async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { - this.rateLimiter.updateClientSendingRate(errorInfo); - return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo); + static isInstance(request2) { + if (!request2) + return false; + const req = request2; + return "method" in req && "protocol" in req && "hostname" in req && "path" in req && typeof req["query"] === "object" && typeof req["headers"] === "object"; } - recordSuccess(token) { - this.rateLimiter.updateClientSendingRate({}); - this.standardRetryStrategy.recordSuccess(token); + clone() { + const cloned = new _HttpRequest({ + ...this, + headers: { ...this.headers } + }); + if (cloned.query) + cloned.query = cloneQuery(cloned.query); + return cloned; } }; - exports.AdaptiveRetryStrategy = AdaptiveRetryStrategy; + exports.HttpRequest = HttpRequest; + function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param + }; + }, {}); + } } }); -// ../../../node_modules/@smithy/util-retry/dist-cjs/ConfiguredRetryStrategy.js -var require_ConfiguredRetryStrategy = __commonJS({ - "../../../node_modules/@smithy/util-retry/dist-cjs/ConfiguredRetryStrategy.js"(exports) { +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/protocol-http/dist-cjs/httpResponse.js +var require_httpResponse2 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/protocol-http/dist-cjs/httpResponse.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.ConfiguredRetryStrategy = void 0; - var constants_1 = require_constants4(); - var StandardRetryStrategy_1 = require_StandardRetryStrategy(); - var ConfiguredRetryStrategy = class extends StandardRetryStrategy_1.StandardRetryStrategy { - constructor(maxAttempts, computeNextBackoffDelay = constants_1.DEFAULT_RETRY_DELAY_BASE) { - super(typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts); - if (typeof computeNextBackoffDelay === "number") { - this.computeNextBackoffDelay = () => computeNextBackoffDelay; - } else { - this.computeNextBackoffDelay = computeNextBackoffDelay; - } + exports.HttpResponse = void 0; + var HttpResponse = class { + constructor(options) { + this.statusCode = options.statusCode; + this.reason = options.reason; + this.headers = options.headers || {}; + this.body = options.body; } - async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { - const token = await super.refreshRetryTokenForRetry(tokenToRenew, errorInfo); - token.getRetryDelay = () => this.computeNextBackoffDelay(token.getRetryCount()); - return token; + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; } }; - exports.ConfiguredRetryStrategy = ConfiguredRetryStrategy; + exports.HttpResponse = HttpResponse; } }); -// ../../../node_modules/@smithy/util-retry/dist-cjs/types.js -var require_types4 = __commonJS({ - "../../../node_modules/@smithy/util-retry/dist-cjs/types.js"(exports) { +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/protocol-http/dist-cjs/isValidHostname.js +var require_isValidHostname2 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/protocol-http/dist-cjs/isValidHostname.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isValidHostname = void 0; + function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); + } + exports.isValidHostname = isValidHostname; + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/protocol-http/dist-cjs/types.js +var require_types5 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/protocol-http/dist-cjs/types.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); } }); -// ../../../node_modules/@smithy/util-retry/dist-cjs/index.js -var require_dist_cjs28 = __commonJS({ - "../../../node_modules/@smithy/util-retry/dist-cjs/index.js"(exports) { +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/protocol-http/dist-cjs/index.js +var require_dist_cjs31 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/protocol-http/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - tslib_1.__exportStar(require_AdaptiveRetryStrategy(), exports); - tslib_1.__exportStar(require_ConfiguredRetryStrategy(), exports); - tslib_1.__exportStar(require_DefaultRateLimiter(), exports); - tslib_1.__exportStar(require_StandardRetryStrategy(), exports); - tslib_1.__exportStar(require_config4(), exports); - tslib_1.__exportStar(require_constants4(), exports); - tslib_1.__exportStar(require_types4(), exports); + tslib_1.__exportStar(require_Field2(), exports); + tslib_1.__exportStar(require_Fields2(), exports); + tslib_1.__exportStar(require_httpHandler2(), exports); + tslib_1.__exportStar(require_httpRequest2(), exports); + tslib_1.__exportStar(require_httpResponse2(), exports); + tslib_1.__exportStar(require_isValidHostname2(), exports); + tslib_1.__exportStar(require_types5(), exports); } }); @@ -7745,7 +8291,7 @@ var require_defaultRetryQuota = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getDefaultRetryQuota = void 0; - var util_retry_1 = require_dist_cjs28(); + var util_retry_1 = require_dist_cjs29(); var getDefaultRetryQuota = (initialRetryTokens, options) => { var _a, _b, _c; const MAX_CAPACITY = initialRetryTokens; @@ -7783,7 +8329,7 @@ var require_delayDecider = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.defaultDelayDecider = void 0; - var util_retry_1 = require_dist_cjs28(); + var util_retry_1 = require_dist_cjs29(); var defaultDelayDecider = (delayBase, attempts) => Math.floor(Math.min(util_retry_1.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); exports.defaultDelayDecider = defaultDelayDecider; } @@ -7795,7 +8341,7 @@ var require_retryDecider = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.defaultRetryDecider = void 0; - var service_error_classification_1 = require_dist_cjs27(); + var service_error_classification_1 = require_dist_cjs28(); var defaultRetryDecider = (error) => { if (!error) { return false; @@ -7807,7 +8353,7 @@ var require_retryDecider = __commonJS({ }); // ../../../node_modules/@smithy/middleware-retry/dist-cjs/util.js -var require_util3 = __commonJS({ +var require_util4 = __commonJS({ "../../../node_modules/@smithy/middleware-retry/dist-cjs/util.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -7831,14 +8377,14 @@ var require_StandardRetryStrategy2 = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StandardRetryStrategy = void 0; - var protocol_http_1 = require_dist_cjs2(); - var service_error_classification_1 = require_dist_cjs27(); - var util_retry_1 = require_dist_cjs28(); + var protocol_http_1 = require_dist_cjs31(); + var service_error_classification_1 = require_dist_cjs28(); + var util_retry_1 = require_dist_cjs29(); var uuid_1 = (init_esm_node(), __toCommonJS(esm_node_exports)); var defaultRetryQuota_1 = require_defaultRetryQuota(); var delayDecider_1 = require_delayDecider(); var retryDecider_1 = require_retryDecider(); - var util_1 = require_util3(); + var util_1 = require_util4(); var StandardRetryStrategy = class { constructor(maxAttemptsProvider, options) { var _a, _b, _c; @@ -7930,7 +8476,7 @@ var require_AdaptiveRetryStrategy2 = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AdaptiveRetryStrategy = void 0; - var util_retry_1 = require_dist_cjs28(); + var util_retry_1 = require_dist_cjs29(); var StandardRetryStrategy_1 = require_StandardRetryStrategy2(); var AdaptiveRetryStrategy = class extends StandardRetryStrategy_1.StandardRetryStrategy { constructor(maxAttemptsProvider, options) { @@ -7954,14 +8500,40 @@ var require_AdaptiveRetryStrategy2 = __commonJS({ } }); +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/util-middleware/dist-cjs/normalizeProvider.js +var require_normalizeProvider3 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/util-middleware/dist-cjs/normalizeProvider.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.normalizeProvider = void 0; + var normalizeProvider = (input) => { + if (typeof input === "function") + return input; + const promisified = Promise.resolve(input); + return () => promisified; + }; + exports.normalizeProvider = normalizeProvider; + } +}); + +// ../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/util-middleware/dist-cjs/index.js +var require_dist_cjs32 = __commonJS({ + "../../../node_modules/@smithy/middleware-retry/node_modules/@smithy/util-middleware/dist-cjs/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + tslib_1.__exportStar(require_normalizeProvider3(), exports); + } +}); + // ../../../node_modules/@smithy/middleware-retry/dist-cjs/configurations.js var require_configurations2 = __commonJS({ "../../../node_modules/@smithy/middleware-retry/dist-cjs/configurations.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NODE_RETRY_MODE_CONFIG_OPTIONS = exports.CONFIG_RETRY_MODE = exports.ENV_RETRY_MODE = exports.resolveRetryConfig = exports.NODE_MAX_ATTEMPT_CONFIG_OPTIONS = exports.CONFIG_MAX_ATTEMPTS = exports.ENV_MAX_ATTEMPTS = void 0; - var util_middleware_1 = require_dist_cjs10(); - var util_retry_1 = require_dist_cjs28(); + var util_middleware_1 = require_dist_cjs32(); + var util_retry_1 = require_dist_cjs29(); exports.ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; exports.CONFIG_MAX_ATTEMPTS = "max_attempts"; exports.NODE_MAX_ATTEMPT_CONFIG_OPTIONS = { @@ -8023,8 +8595,8 @@ var require_omitRetryHeadersMiddleware = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getOmitRetryHeadersPlugin = exports.omitRetryHeadersMiddlewareOptions = exports.omitRetryHeadersMiddleware = void 0; - var protocol_http_1 = require_dist_cjs2(); - var util_retry_1 = require_dist_cjs28(); + var protocol_http_1 = require_dist_cjs31(); + var util_retry_1 = require_dist_cjs29(); var omitRetryHeadersMiddleware = () => (next) => async (args) => { const { request: request2 } = args; if (protocol_http_1.HttpRequest.isInstance(request2)) { @@ -8056,11 +8628,11 @@ var require_retryMiddleware = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getRetryAfterHint = exports.getRetryPlugin = exports.retryMiddlewareOptions = exports.retryMiddleware = void 0; - var protocol_http_1 = require_dist_cjs2(); - var service_error_classification_1 = require_dist_cjs27(); - var util_retry_1 = require_dist_cjs28(); + var protocol_http_1 = require_dist_cjs31(); + var service_error_classification_1 = require_dist_cjs28(); + var util_retry_1 = require_dist_cjs29(); var uuid_1 = (init_esm_node(), __toCommonJS(esm_node_exports)); - var util_1 = require_util3(); + var util_1 = require_util4(); var retryMiddleware = (options) => (next, context) => async (args) => { let retryStrategy = await options.retryStrategy(); const maxAttempts = await options.maxAttempts(); @@ -8162,7 +8734,7 @@ var require_retryMiddleware = __commonJS({ }); // ../../../node_modules/@smithy/middleware-retry/dist-cjs/index.js -var require_dist_cjs29 = __commonJS({ +var require_dist_cjs33 = __commonJS({ "../../../node_modules/@smithy/middleware-retry/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -8422,7 +8994,7 @@ var require_MiddlewareStack = __commonJS({ }); // ../../../node_modules/@smithy/middleware-stack/dist-cjs/index.js -var require_dist_cjs30 = __commonJS({ +var require_dist_cjs34 = __commonJS({ "../../../node_modules/@smithy/middleware-stack/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -8432,12 +9004,12 @@ var require_dist_cjs30 = __commonJS({ }); // ../../../node_modules/@smithy/smithy-client/dist-cjs/client.js -var require_client3 = __commonJS({ +var require_client4 = __commonJS({ "../../../node_modules/@smithy/smithy-client/dist-cjs/client.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Client = void 0; - var middleware_stack_1 = require_dist_cjs30(); + var middleware_stack_1 = require_dist_cjs34(); var Client = class { constructor(config) { this.middlewareStack = (0, middleware_stack_1.constructStack)(); @@ -8498,7 +9070,7 @@ var require_toBase64 = __commonJS({ }); // ../../../node_modules/@smithy/util-base64/dist-cjs/index.js -var require_dist_cjs31 = __commonJS({ +var require_dist_cjs35 = __commonJS({ "../../../node_modules/@smithy/util-base64/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -8514,7 +9086,7 @@ var require_transforms = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.transformFromString = exports.transformToString = void 0; - var util_base64_1 = require_dist_cjs31(); + var util_base64_1 = require_dist_cjs35(); var util_utf8_1 = require_dist_cjs13(); var Uint8ArrayBlobAdapter_1 = require_Uint8ArrayBlobAdapter(); function transformToString(payload, encoding = "utf-8") { @@ -8541,7 +9113,7 @@ var require_Uint8ArrayBlobAdapter = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.Uint8ArrayBlobAdapter = void 0; var transforms_1 = require_transforms(); - var Uint8ArrayBlobAdapter = class extends Uint8Array { + var Uint8ArrayBlobAdapter = class _Uint8ArrayBlobAdapter extends Uint8Array { static fromString(source, encoding = "utf-8") { switch (typeof source) { case "string": @@ -8551,7 +9123,7 @@ var require_Uint8ArrayBlobAdapter = __commonJS({ } } static mutate(source) { - Object.setPrototypeOf(source, Uint8ArrayBlobAdapter.prototype); + Object.setPrototypeOf(source, _Uint8ArrayBlobAdapter.prototype); return source; } transformToString(encoding = "utf-8") { @@ -8601,7 +9173,7 @@ var require_getAwsChunkedEncodingStream = __commonJS({ }); // ../../../node_modules/@smithy/querystring-builder/dist-cjs/index.js -var require_dist_cjs32 = __commonJS({ +var require_dist_cjs36 = __commonJS({ "../../../node_modules/@smithy/querystring-builder/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -8778,7 +9350,7 @@ var require_node_http_handler = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.NodeHttpHandler = exports.DEFAULT_REQUEST_TIMEOUT = void 0; var protocol_http_1 = require_dist_cjs2(); - var querystring_builder_1 = require_dist_cjs32(); + var querystring_builder_1 = require_dist_cjs36(); var http_1 = require("http"); var https_1 = require("https"); var constants_1 = require_constants5(); @@ -9051,7 +9623,7 @@ var require_node_http2_handler = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.NodeHttp2Handler = void 0; var protocol_http_1 = require_dist_cjs2(); - var querystring_builder_1 = require_dist_cjs32(); + var querystring_builder_1 = require_dist_cjs36(); var http2_1 = require("http2"); var get_transformed_headers_1 = require_get_transformed_headers(); var node_http2_connection_manager_1 = require_node_http2_connection_manager(); @@ -9239,7 +9811,7 @@ var require_stream_collector = __commonJS({ }); // ../../../node_modules/@smithy/node-http-handler/dist-cjs/index.js -var require_dist_cjs33 = __commonJS({ +var require_dist_cjs37 = __commonJS({ "../../../node_modules/@smithy/node-http-handler/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -9256,7 +9828,7 @@ var require_sdk_stream_mixin = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.sdkStreamMixin = void 0; - var node_http_handler_1 = require_dist_cjs33(); + var node_http_handler_1 = require_dist_cjs37(); var util_buffer_from_1 = require_dist_cjs12(); var stream_1 = require("stream"); var util_1 = require("util"); @@ -9306,7 +9878,7 @@ var require_sdk_stream_mixin = __commonJS({ }); // ../../../node_modules/@smithy/util-stream/dist-cjs/index.js -var require_dist_cjs34 = __commonJS({ +var require_dist_cjs38 = __commonJS({ "../../../node_modules/@smithy/util-stream/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -9323,7 +9895,7 @@ var require_collect_stream_body = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.collectBody = void 0; - var util_stream_1 = require_dist_cjs34(); + var util_stream_1 = require_dist_cjs38(); var collectBody = async (streamBody = new Uint8Array(), context) => { if (streamBody instanceof Uint8Array) { return util_stream_1.Uint8ArrayBlobAdapter.mutate(streamBody); @@ -9339,12 +9911,12 @@ var require_collect_stream_body = __commonJS({ }); // ../../../node_modules/@smithy/smithy-client/dist-cjs/command.js -var require_command3 = __commonJS({ +var require_command4 = __commonJS({ "../../../node_modules/@smithy/smithy-client/dist-cjs/command.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Command = void 0; - var middleware_stack_1 = require_dist_cjs30(); + var middleware_stack_1 = require_dist_cjs34(); var Command = class { constructor() { this.middlewareStack = (0, middleware_stack_1.constructStack)(); @@ -9849,10 +10421,10 @@ var require_exceptions = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.decorateServiceException = exports.ServiceException = void 0; - var ServiceException = class extends Error { + var ServiceException = class _ServiceException extends Error { constructor(options) { super(options.message); - Object.setPrototypeOf(this, ServiceException.prototype); + Object.setPrototypeOf(this, _ServiceException.prototype); this.name = options.name; this.$fault = options.$fault; this.$metadata = options.$metadata; @@ -10032,7 +10604,7 @@ var require_lazy_json = __commonJS({ } }); Object.setPrototypeOf(exports.StringWrapper, String); - var LazyJsonString = class extends exports.StringWrapper { + var LazyJsonString = class _LazyJsonString extends exports.StringWrapper { deserializeJSON() { return JSON.parse(super.toString()); } @@ -10040,12 +10612,12 @@ var require_lazy_json = __commonJS({ return super.toString(); } static fromObject(object) { - if (object instanceof LazyJsonString) { + if (object instanceof _LazyJsonString) { return object; } else if (object instanceof String || typeof object === "string") { - return new LazyJsonString(object); + return new _LazyJsonString(object); } - return new LazyJsonString(JSON.stringify(object)); + return new _LazyJsonString(JSON.stringify(object)); } }; exports.LazyJsonString = LazyJsonString; @@ -10262,15 +10834,15 @@ var require_split_every = __commonJS({ }); // ../../../node_modules/@smithy/smithy-client/dist-cjs/index.js -var require_dist_cjs35 = __commonJS({ +var require_dist_cjs39 = __commonJS({ "../../../node_modules/@smithy/smithy-client/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); tslib_1.__exportStar(require_NoOpLogger(), exports); - tslib_1.__exportStar(require_client3(), exports); + tslib_1.__exportStar(require_client4(), exports); tslib_1.__exportStar(require_collect_stream_body(), exports); - tslib_1.__exportStar(require_command3(), exports); + tslib_1.__exportStar(require_command4(), exports); tslib_1.__exportStar(require_constants6(), exports); tslib_1.__exportStar(require_create_aggregated_client(), exports); tslib_1.__exportStar(require_date_utils(), exports); @@ -10315,7 +10887,7 @@ var require_package = __commonJS({ module2.exports = { name: "@aws-sdk/client-sfn", description: "AWS SDK for JavaScript Sfn Client for Node.js, Browser and React Native", - version: "3.363.0", + version: "3.370.0", scripts: { build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "tsc -p tsconfig.cjs.json", @@ -10335,43 +10907,42 @@ var require_package = __commonJS({ dependencies: { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/client-sts": "3.363.0", - "@aws-sdk/credential-provider-node": "3.363.0", - "@aws-sdk/middleware-host-header": "3.363.0", - "@aws-sdk/middleware-logger": "3.363.0", - "@aws-sdk/middleware-recursion-detection": "3.363.0", - "@aws-sdk/middleware-signing": "3.363.0", - "@aws-sdk/middleware-user-agent": "3.363.0", - "@aws-sdk/types": "3.357.0", - "@aws-sdk/util-endpoints": "3.357.0", - "@aws-sdk/util-user-agent-browser": "3.363.0", - "@aws-sdk/util-user-agent-node": "3.363.0", + "@aws-sdk/client-sts": "3.370.0", + "@aws-sdk/credential-provider-node": "3.370.0", + "@aws-sdk/middleware-host-header": "3.370.0", + "@aws-sdk/middleware-logger": "3.370.0", + "@aws-sdk/middleware-recursion-detection": "3.370.0", + "@aws-sdk/middleware-signing": "3.370.0", + "@aws-sdk/middleware-user-agent": "3.370.0", + "@aws-sdk/types": "3.370.0", + "@aws-sdk/util-endpoints": "3.370.0", + "@aws-sdk/util-user-agent-browser": "3.370.0", + "@aws-sdk/util-user-agent-node": "3.370.0", "@smithy/config-resolver": "^1.0.1", "@smithy/fetch-http-handler": "^1.0.1", "@smithy/hash-node": "^1.0.1", "@smithy/invalid-dependency": "^1.0.1", "@smithy/middleware-content-length": "^1.0.1", - "@smithy/middleware-endpoint": "^1.0.1", - "@smithy/middleware-retry": "^1.0.2", + "@smithy/middleware-endpoint": "^1.0.2", + "@smithy/middleware-retry": "^1.0.3", "@smithy/middleware-serde": "^1.0.1", "@smithy/middleware-stack": "^1.0.1", "@smithy/node-config-provider": "^1.0.1", "@smithy/node-http-handler": "^1.0.2", - "@smithy/protocol-http": "^1.0.1", + "@smithy/protocol-http": "^1.1.0", "@smithy/smithy-client": "^1.0.3", - "@smithy/types": "^1.0.0", + "@smithy/types": "^1.1.0", "@smithy/url-parser": "^1.0.1", "@smithy/util-base64": "^1.0.1", "@smithy/util-body-length-browser": "^1.0.1", "@smithy/util-body-length-node": "^1.0.1", "@smithy/util-defaults-mode-browser": "^1.0.1", "@smithy/util-defaults-mode-node": "^1.0.1", - "@smithy/util-retry": "^1.0.2", + "@smithy/util-retry": "^1.0.3", "@smithy/util-utf8": "^1.0.1", tslib: "^2.5.0" }, devDependencies: { - "@aws-sdk/service-client-documentation-generator": "3.310.0", "@smithy/service-client-documentation-generator": "^1.0.1", "@tsconfig/node14": "1.0.3", "@types/node": "^14.14.31", @@ -10416,7 +10987,7 @@ var require_package = __commonJS({ }); // ../../../node_modules/@aws-sdk/middleware-sdk-sts/dist-cjs/index.js -var require_dist_cjs36 = __commonJS({ +var require_dist_cjs40 = __commonJS({ "../../../node_modules/@aws-sdk/middleware-sdk-sts/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -10455,7 +11026,7 @@ var require_package2 = __commonJS({ module2.exports = { name: "@aws-sdk/client-sts", description: "AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native", - version: "3.363.0", + version: "3.370.0", scripts: { build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "tsc -p tsconfig.cjs.json", @@ -10477,30 +11048,30 @@ var require_package2 = __commonJS({ dependencies: { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/credential-provider-node": "3.363.0", - "@aws-sdk/middleware-host-header": "3.363.0", - "@aws-sdk/middleware-logger": "3.363.0", - "@aws-sdk/middleware-recursion-detection": "3.363.0", - "@aws-sdk/middleware-sdk-sts": "3.363.0", - "@aws-sdk/middleware-signing": "3.363.0", - "@aws-sdk/middleware-user-agent": "3.363.0", - "@aws-sdk/types": "3.357.0", - "@aws-sdk/util-endpoints": "3.357.0", - "@aws-sdk/util-user-agent-browser": "3.363.0", - "@aws-sdk/util-user-agent-node": "3.363.0", + "@aws-sdk/credential-provider-node": "3.370.0", + "@aws-sdk/middleware-host-header": "3.370.0", + "@aws-sdk/middleware-logger": "3.370.0", + "@aws-sdk/middleware-recursion-detection": "3.370.0", + "@aws-sdk/middleware-sdk-sts": "3.370.0", + "@aws-sdk/middleware-signing": "3.370.0", + "@aws-sdk/middleware-user-agent": "3.370.0", + "@aws-sdk/types": "3.370.0", + "@aws-sdk/util-endpoints": "3.370.0", + "@aws-sdk/util-user-agent-browser": "3.370.0", + "@aws-sdk/util-user-agent-node": "3.370.0", "@smithy/config-resolver": "^1.0.1", "@smithy/fetch-http-handler": "^1.0.1", "@smithy/hash-node": "^1.0.1", "@smithy/invalid-dependency": "^1.0.1", "@smithy/middleware-content-length": "^1.0.1", - "@smithy/middleware-endpoint": "^1.0.1", - "@smithy/middleware-retry": "^1.0.1", + "@smithy/middleware-endpoint": "^1.0.2", + "@smithy/middleware-retry": "^1.0.3", "@smithy/middleware-serde": "^1.0.1", "@smithy/middleware-stack": "^1.0.1", "@smithy/node-config-provider": "^1.0.1", - "@smithy/node-http-handler": "^1.0.1", + "@smithy/node-http-handler": "^1.0.2", "@smithy/protocol-http": "^1.1.0", - "@smithy/smithy-client": "^1.0.2", + "@smithy/smithy-client": "^1.0.3", "@smithy/types": "^1.1.0", "@smithy/url-parser": "^1.0.1", "@smithy/util-base64": "^1.0.1", @@ -10508,13 +11079,12 @@ var require_package2 = __commonJS({ "@smithy/util-body-length-node": "^1.0.1", "@smithy/util-defaults-mode-browser": "^1.0.1", "@smithy/util-defaults-mode-node": "^1.0.1", - "@smithy/util-retry": "^1.0.1", + "@smithy/util-retry": "^1.0.3", "@smithy/util-utf8": "^1.0.1", "fast-xml-parser": "4.2.5", tslib: "^2.5.0" }, devDependencies: { - "@aws-sdk/service-client-documentation-generator": "3.310.0", "@smithy/service-client-documentation-generator": "^1.0.1", "@tsconfig/node14": "1.0.3", "@types/node": "^14.14.31", @@ -10558,20 +11128,115 @@ var require_package2 = __commonJS({ } }); +// ../../../node_modules/@smithy/middleware-serde/dist-cjs/deserializerMiddleware.js +var require_deserializerMiddleware2 = __commonJS({ + "../../../node_modules/@smithy/middleware-serde/dist-cjs/deserializerMiddleware.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.deserializerMiddleware = void 0; + var deserializerMiddleware = (options, deserializer) => (next, context) => async (args) => { + const { response } = await next(args); + try { + const parsed = await deserializer(response, options); + return { + response, + output: parsed + }; + } catch (error) { + Object.defineProperty(error, "$response", { + value: response + }); + if (!("$metadata" in error)) { + const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; + error.message += "\n " + hint; + } + throw error; + } + }; + exports.deserializerMiddleware = deserializerMiddleware; + } +}); + +// ../../../node_modules/@smithy/middleware-serde/dist-cjs/serializerMiddleware.js +var require_serializerMiddleware2 = __commonJS({ + "../../../node_modules/@smithy/middleware-serde/dist-cjs/serializerMiddleware.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.serializerMiddleware = void 0; + var serializerMiddleware = (options, serializer) => (next, context) => async (args) => { + var _a; + const endpoint = ((_a = context.endpointV2) === null || _a === void 0 ? void 0 : _a.url) && options.urlParser ? async () => options.urlParser(context.endpointV2.url) : options.endpoint; + if (!endpoint) { + throw new Error("No valid endpoint provider available."); + } + const request2 = await serializer(args.input, { ...options, endpoint }); + return next({ + ...args, + request: request2 + }); + }; + exports.serializerMiddleware = serializerMiddleware; + } +}); + +// ../../../node_modules/@smithy/middleware-serde/dist-cjs/serdePlugin.js +var require_serdePlugin2 = __commonJS({ + "../../../node_modules/@smithy/middleware-serde/dist-cjs/serdePlugin.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getSerdePlugin = exports.serializerMiddlewareOption = exports.deserializerMiddlewareOption = void 0; + var deserializerMiddleware_1 = require_deserializerMiddleware2(); + var serializerMiddleware_1 = require_serializerMiddleware2(); + exports.deserializerMiddlewareOption = { + name: "deserializerMiddleware", + step: "deserialize", + tags: ["DESERIALIZER"], + override: true + }; + exports.serializerMiddlewareOption = { + name: "serializerMiddleware", + step: "serialize", + tags: ["SERIALIZER"], + override: true + }; + function getSerdePlugin(config, serializer, deserializer) { + return { + applyToStack: (commandStack) => { + commandStack.add((0, deserializerMiddleware_1.deserializerMiddleware)(config, deserializer), exports.deserializerMiddlewareOption); + commandStack.add((0, serializerMiddleware_1.serializerMiddleware)(config, serializer), exports.serializerMiddlewareOption); + } + }; + } + exports.getSerdePlugin = getSerdePlugin; + } +}); + +// ../../../node_modules/@smithy/middleware-serde/dist-cjs/index.js +var require_dist_cjs41 = __commonJS({ + "../../../node_modules/@smithy/middleware-serde/dist-cjs/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + tslib_1.__exportStar(require_deserializerMiddleware2(), exports); + tslib_1.__exportStar(require_serdePlugin2(), exports); + tslib_1.__exportStar(require_serializerMiddleware2(), exports); + } +}); + // ../../../node_modules/@aws-sdk/client-sts/dist-cjs/models/STSServiceException.js var require_STSServiceException = __commonJS({ "../../../node_modules/@aws-sdk/client-sts/dist-cjs/models/STSServiceException.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.STSServiceException = exports.__ServiceException = void 0; - var smithy_client_1 = require_dist_cjs35(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "__ServiceException", { enumerable: true, get: function() { return smithy_client_1.ServiceException; } }); - var STSServiceException = class extends smithy_client_1.ServiceException { + var STSServiceException = class _STSServiceException extends smithy_client_1.ServiceException { constructor(options) { super(options); - Object.setPrototypeOf(this, STSServiceException.prototype); + Object.setPrototypeOf(this, _STSServiceException.prototype); } }; exports.STSServiceException = STSServiceException; @@ -10584,9 +11249,9 @@ var require_models_0 = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetSessionTokenResponseFilterSensitiveLog = exports.GetFederationTokenResponseFilterSensitiveLog = exports.AssumeRoleWithWebIdentityResponseFilterSensitiveLog = exports.AssumeRoleWithWebIdentityRequestFilterSensitiveLog = exports.AssumeRoleWithSAMLResponseFilterSensitiveLog = exports.AssumeRoleWithSAMLRequestFilterSensitiveLog = exports.AssumeRoleResponseFilterSensitiveLog = exports.CredentialsFilterSensitiveLog = exports.InvalidAuthorizationMessageException = exports.IDPCommunicationErrorException = exports.InvalidIdentityTokenException = exports.IDPRejectedClaimException = exports.RegionDisabledException = exports.PackedPolicyTooLargeException = exports.MalformedPolicyDocumentException = exports.ExpiredTokenException = void 0; - var smithy_client_1 = require_dist_cjs35(); + var smithy_client_1 = require_dist_cjs39(); var STSServiceException_1 = require_STSServiceException(); - var ExpiredTokenException = class extends STSServiceException_1.STSServiceException { + var ExpiredTokenException = class _ExpiredTokenException extends STSServiceException_1.STSServiceException { constructor(opts) { super({ name: "ExpiredTokenException", @@ -10595,11 +11260,11 @@ var require_models_0 = __commonJS({ }); this.name = "ExpiredTokenException"; this.$fault = "client"; - Object.setPrototypeOf(this, ExpiredTokenException.prototype); + Object.setPrototypeOf(this, _ExpiredTokenException.prototype); } }; exports.ExpiredTokenException = ExpiredTokenException; - var MalformedPolicyDocumentException = class extends STSServiceException_1.STSServiceException { + var MalformedPolicyDocumentException = class _MalformedPolicyDocumentException extends STSServiceException_1.STSServiceException { constructor(opts) { super({ name: "MalformedPolicyDocumentException", @@ -10608,11 +11273,11 @@ var require_models_0 = __commonJS({ }); this.name = "MalformedPolicyDocumentException"; this.$fault = "client"; - Object.setPrototypeOf(this, MalformedPolicyDocumentException.prototype); + Object.setPrototypeOf(this, _MalformedPolicyDocumentException.prototype); } }; exports.MalformedPolicyDocumentException = MalformedPolicyDocumentException; - var PackedPolicyTooLargeException = class extends STSServiceException_1.STSServiceException { + var PackedPolicyTooLargeException = class _PackedPolicyTooLargeException extends STSServiceException_1.STSServiceException { constructor(opts) { super({ name: "PackedPolicyTooLargeException", @@ -10621,11 +11286,11 @@ var require_models_0 = __commonJS({ }); this.name = "PackedPolicyTooLargeException"; this.$fault = "client"; - Object.setPrototypeOf(this, PackedPolicyTooLargeException.prototype); + Object.setPrototypeOf(this, _PackedPolicyTooLargeException.prototype); } }; exports.PackedPolicyTooLargeException = PackedPolicyTooLargeException; - var RegionDisabledException = class extends STSServiceException_1.STSServiceException { + var RegionDisabledException = class _RegionDisabledException extends STSServiceException_1.STSServiceException { constructor(opts) { super({ name: "RegionDisabledException", @@ -10634,11 +11299,11 @@ var require_models_0 = __commonJS({ }); this.name = "RegionDisabledException"; this.$fault = "client"; - Object.setPrototypeOf(this, RegionDisabledException.prototype); + Object.setPrototypeOf(this, _RegionDisabledException.prototype); } }; exports.RegionDisabledException = RegionDisabledException; - var IDPRejectedClaimException = class extends STSServiceException_1.STSServiceException { + var IDPRejectedClaimException = class _IDPRejectedClaimException extends STSServiceException_1.STSServiceException { constructor(opts) { super({ name: "IDPRejectedClaimException", @@ -10647,11 +11312,11 @@ var require_models_0 = __commonJS({ }); this.name = "IDPRejectedClaimException"; this.$fault = "client"; - Object.setPrototypeOf(this, IDPRejectedClaimException.prototype); + Object.setPrototypeOf(this, _IDPRejectedClaimException.prototype); } }; exports.IDPRejectedClaimException = IDPRejectedClaimException; - var InvalidIdentityTokenException = class extends STSServiceException_1.STSServiceException { + var InvalidIdentityTokenException = class _InvalidIdentityTokenException extends STSServiceException_1.STSServiceException { constructor(opts) { super({ name: "InvalidIdentityTokenException", @@ -10660,11 +11325,11 @@ var require_models_0 = __commonJS({ }); this.name = "InvalidIdentityTokenException"; this.$fault = "client"; - Object.setPrototypeOf(this, InvalidIdentityTokenException.prototype); + Object.setPrototypeOf(this, _InvalidIdentityTokenException.prototype); } }; exports.InvalidIdentityTokenException = InvalidIdentityTokenException; - var IDPCommunicationErrorException = class extends STSServiceException_1.STSServiceException { + var IDPCommunicationErrorException = class _IDPCommunicationErrorException extends STSServiceException_1.STSServiceException { constructor(opts) { super({ name: "IDPCommunicationErrorException", @@ -10673,11 +11338,11 @@ var require_models_0 = __commonJS({ }); this.name = "IDPCommunicationErrorException"; this.$fault = "client"; - Object.setPrototypeOf(this, IDPCommunicationErrorException.prototype); + Object.setPrototypeOf(this, _IDPCommunicationErrorException.prototype); } }; exports.IDPCommunicationErrorException = IDPCommunicationErrorException; - var InvalidAuthorizationMessageException = class extends STSServiceException_1.STSServiceException { + var InvalidAuthorizationMessageException = class _InvalidAuthorizationMessageException extends STSServiceException_1.STSServiceException { constructor(opts) { super({ name: "InvalidAuthorizationMessageException", @@ -10686,7 +11351,7 @@ var require_models_0 = __commonJS({ }); this.name = "InvalidAuthorizationMessageException"; this.$fault = "client"; - Object.setPrototypeOf(this, InvalidAuthorizationMessageException.prototype); + Object.setPrototypeOf(this, _InvalidAuthorizationMessageException.prototype); } }; exports.InvalidAuthorizationMessageException = InvalidAuthorizationMessageException; @@ -10734,7 +11399,7 @@ var require_models_0 = __commonJS({ }); // ../../../node_modules/fast-xml-parser/src/util.js -var require_util4 = __commonJS({ +var require_util5 = __commonJS({ "../../../node_modules/fast-xml-parser/src/util.js"(exports) { "use strict"; var nameStartChar = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; @@ -10796,7 +11461,7 @@ var require_util4 = __commonJS({ var require_validator = __commonJS({ "../../../node_modules/fast-xml-parser/src/validator.js"(exports) { "use strict"; - var util = require_util4(); + var util = require_util5(); var defaultOptions = { allowBooleanAttributes: false, //A tag can have attributes without any value @@ -11191,7 +11856,7 @@ var require_xmlNode = __commonJS({ // ../../../node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js var require_DocTypeReader = __commonJS({ "../../../node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"(exports, module2) { - var util = require_util4(); + var util = require_util5(); function readDocType(xmlData, i) { const entities = {}; if (xmlData[i + 3] === "O" && xmlData[i + 4] === "C" && xmlData[i + 5] === "T" && xmlData[i + 6] === "Y" && xmlData[i + 7] === "P" && xmlData[i + 8] === "E") { @@ -11398,7 +12063,7 @@ var require_strnum = __commonJS({ var require_OrderedObjParser = __commonJS({ "../../../node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"(exports, module2) { "use strict"; - var util = require_util4(); + var util = require_util5(); var xmlNode = require_xmlNode(); var readDocType = require_DocTypeReader(); var toNumber = require_strnum(); @@ -12419,7 +13084,7 @@ var require_Aws_query = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.de_GetSessionTokenCommand = exports.de_GetFederationTokenCommand = exports.de_GetCallerIdentityCommand = exports.de_GetAccessKeyInfoCommand = exports.de_DecodeAuthorizationMessageCommand = exports.de_AssumeRoleWithWebIdentityCommand = exports.de_AssumeRoleWithSAMLCommand = exports.de_AssumeRoleCommand = exports.se_GetSessionTokenCommand = exports.se_GetFederationTokenCommand = exports.se_GetCallerIdentityCommand = exports.se_GetAccessKeyInfoCommand = exports.se_DecodeAuthorizationMessageCommand = exports.se_AssumeRoleWithWebIdentityCommand = exports.se_AssumeRoleWithSAMLCommand = exports.se_AssumeRoleCommand = void 0; var protocol_http_1 = require_dist_cjs2(); - var smithy_client_1 = require_dist_cjs35(); + var smithy_client_1 = require_dist_cjs39(); var fast_xml_parser_1 = require_fxp(); var models_0_1 = require_models_0(); var STSServiceException_1 = require_STSServiceException(); @@ -13416,15 +14081,15 @@ var require_AssumeRoleCommand = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.AssumeRoleCommand = exports.$Command = void 0; var middleware_signing_1 = require_dist_cjs16(); - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_0(); var Aws_query_1 = require_Aws_query(); - var AssumeRoleCommand = class extends smithy_client_1.Command { + var AssumeRoleCommand = class _AssumeRoleCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, @@ -13440,7 +14105,7 @@ var require_AssumeRoleCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, AssumeRoleCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _AssumeRoleCommand.getEndpointParameterInstructions())); this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; @@ -13473,15 +14138,15 @@ var require_AssumeRoleWithWebIdentityCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AssumeRoleWithWebIdentityCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_0(); var Aws_query_1 = require_Aws_query(); - var AssumeRoleWithWebIdentityCommand = class extends smithy_client_1.Command { + var AssumeRoleWithWebIdentityCommand = class _AssumeRoleWithWebIdentityCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, @@ -13497,7 +14162,7 @@ var require_AssumeRoleWithWebIdentityCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, AssumeRoleWithWebIdentityCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _AssumeRoleWithWebIdentityCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "STSClient"; @@ -13635,7 +14300,7 @@ var require_fromEnv = __commonJS({ }); // ../../../node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js -var require_dist_cjs37 = __commonJS({ +var require_dist_cjs42 = __commonJS({ "../../../node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -13917,7 +14582,7 @@ var require_parseKnownFiles = __commonJS({ }); // ../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/types.js -var require_types5 = __commonJS({ +var require_types6 = __commonJS({ "../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/types.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -13925,7 +14590,7 @@ var require_types5 = __commonJS({ }); // ../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js -var require_dist_cjs38 = __commonJS({ +var require_dist_cjs43 = __commonJS({ "../../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -13937,12 +14602,12 @@ var require_dist_cjs38 = __commonJS({ tslib_1.__exportStar(require_loadSharedConfigFiles(), exports); tslib_1.__exportStar(require_loadSsoSessionData(), exports); tslib_1.__exportStar(require_parseKnownFiles(), exports); - tslib_1.__exportStar(require_types5(), exports); + tslib_1.__exportStar(require_types6(), exports); } }); // ../../../node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/httpRequest.js -var require_httpRequest2 = __commonJS({ +var require_httpRequest3 = __commonJS({ "../../../node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/httpRequest.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -14020,7 +14685,7 @@ var require_RemoteProviderInit = __commonJS({ }); // ../../../node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/retry.js -var require_retry3 = __commonJS({ +var require_retry4 = __commonJS({ "../../../node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/retry.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -14044,10 +14709,10 @@ var require_fromContainerMetadata = __commonJS({ exports.fromContainerMetadata = exports.ENV_CMDS_AUTH_TOKEN = exports.ENV_CMDS_RELATIVE_URI = exports.ENV_CMDS_FULL_URI = void 0; var property_provider_1 = require_dist_cjs6(); var url_1 = require("url"); - var httpRequest_1 = require_httpRequest2(); + var httpRequest_1 = require_httpRequest3(); var ImdsCredentials_1 = require_ImdsCredentials(); var RemoteProviderInit_1 = require_RemoteProviderInit(); - var retry_1 = require_retry3(); + var retry_1 = require_retry4(); exports.ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; exports.ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; exports.ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; @@ -14139,7 +14804,7 @@ var require_fromSharedConfigFiles = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.fromSharedConfigFiles = void 0; var property_provider_1 = require_dist_cjs6(); - var shared_ini_file_loader_1 = require_dist_cjs38(); + var shared_ini_file_loader_1 = require_dist_cjs43(); var fromSharedConfigFiles = (configSelector, { preferredFile = "config", ...init } = {}) => async () => { const profile = (0, shared_ini_file_loader_1.getProfileName)(init); const { configFile, credentialsFile } = await (0, shared_ini_file_loader_1.loadSharedConfigFiles)(init); @@ -14189,7 +14854,7 @@ var require_configLoader = __commonJS({ }); // ../../../node_modules/@smithy/node-config-provider/dist-cjs/index.js -var require_dist_cjs39 = __commonJS({ +var require_dist_cjs44 = __commonJS({ "../../../node_modules/@smithy/node-config-provider/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -14198,6 +14863,65 @@ var require_dist_cjs39 = __commonJS({ } }); +// ../../../node_modules/@smithy/querystring-parser/dist-cjs/index.js +var require_dist_cjs45 = __commonJS({ + "../../../node_modules/@smithy/querystring-parser/dist-cjs/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.parseQueryString = void 0; + function parseQueryString(querystring) { + const query = {}; + querystring = querystring.replace(/^\?/, ""); + if (querystring) { + for (const pair of querystring.split("&")) { + let [key, value = null] = pair.split("="); + key = decodeURIComponent(key); + if (value) { + value = decodeURIComponent(value); + } + if (!(key in query)) { + query[key] = value; + } else if (Array.isArray(query[key])) { + query[key].push(value); + } else { + query[key] = [query[key], value]; + } + } + } + return query; + } + exports.parseQueryString = parseQueryString; + } +}); + +// ../../../node_modules/@smithy/url-parser/dist-cjs/index.js +var require_dist_cjs46 = __commonJS({ + "../../../node_modules/@smithy/url-parser/dist-cjs/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.parseUrl = void 0; + var querystring_parser_1 = require_dist_cjs45(); + var parseUrl = (url2) => { + if (typeof url2 === "string") { + return (0, exports.parseUrl)(new URL(url2)); + } + const { hostname, pathname, port, protocol, search } = url2; + let query; + if (search) { + query = (0, querystring_parser_1.parseQueryString)(search); + } + return { + hostname, + port: port ? parseInt(port) : void 0, + protocol, + path: pathname, + query + }; + }; + exports.parseUrl = parseUrl; + } +}); + // ../../../node_modules/@smithy/credential-provider-imds/dist-cjs/config/Endpoint.js var require_Endpoint = __commonJS({ "../../../node_modules/@smithy/credential-provider-imds/dist-cjs/config/Endpoint.js"(exports) { @@ -14265,8 +14989,8 @@ var require_getInstanceMetadataEndpoint = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getInstanceMetadataEndpoint = void 0; - var node_config_provider_1 = require_dist_cjs39(); - var url_parser_1 = require_dist_cjs24(); + var node_config_provider_1 = require_dist_cjs44(); + var url_parser_1 = require_dist_cjs46(); var Endpoint_1 = require_Endpoint(); var EndpointConfigOptions_1 = require_EndpointConfigOptions(); var EndpointMode_1 = require_EndpointMode(); @@ -14353,10 +15077,10 @@ var require_fromInstanceMetadata = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.fromInstanceMetadata = void 0; var property_provider_1 = require_dist_cjs6(); - var httpRequest_1 = require_httpRequest2(); + var httpRequest_1 = require_httpRequest3(); var ImdsCredentials_1 = require_ImdsCredentials(); var RemoteProviderInit_1 = require_RemoteProviderInit(); - var retry_1 = require_retry3(); + var retry_1 = require_retry4(); var getInstanceMetadataEndpoint_1 = require_getInstanceMetadataEndpoint(); var staticStabilityProvider_1 = require_staticStabilityProvider(); var IMDS_PATH = "/latest/meta-data/iam/security-credentials/"; @@ -14443,7 +15167,7 @@ var require_fromInstanceMetadata = __commonJS({ }); // ../../../node_modules/@smithy/credential-provider-imds/dist-cjs/types.js -var require_types6 = __commonJS({ +var require_types7 = __commonJS({ "../../../node_modules/@smithy/credential-provider-imds/dist-cjs/types.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -14451,7 +15175,7 @@ var require_types6 = __commonJS({ }); // ../../../node_modules/@smithy/credential-provider-imds/dist-cjs/index.js -var require_dist_cjs40 = __commonJS({ +var require_dist_cjs47 = __commonJS({ "../../../node_modules/@smithy/credential-provider-imds/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -14460,8 +15184,8 @@ var require_dist_cjs40 = __commonJS({ tslib_1.__exportStar(require_fromContainerMetadata(), exports); tslib_1.__exportStar(require_fromInstanceMetadata(), exports); tslib_1.__exportStar(require_RemoteProviderInit(), exports); - tslib_1.__exportStar(require_types6(), exports); - var httpRequest_1 = require_httpRequest2(); + tslib_1.__exportStar(require_types7(), exports); + var httpRequest_1 = require_httpRequest3(); Object.defineProperty(exports, "httpRequest", { enumerable: true, get: function() { return httpRequest_1.httpRequest; } }); @@ -14478,8 +15202,8 @@ var require_resolveCredentialSource = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.resolveCredentialSource = void 0; - var credential_provider_env_1 = require_dist_cjs37(); - var credential_provider_imds_1 = require_dist_cjs40(); + var credential_provider_env_1 = require_dist_cjs42(); + var credential_provider_imds_1 = require_dist_cjs47(); var property_provider_1 = require_dist_cjs6(); var resolveCredentialSource = (credentialSource, profileName) => { const sourceProvidersMap = { @@ -14504,7 +15228,7 @@ var require_resolveAssumeRoleCredentials = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.resolveAssumeRoleCredentials = exports.isAssumeRoleProfile = void 0; var property_provider_1 = require_dist_cjs6(); - var shared_ini_file_loader_1 = require_dist_cjs38(); + var shared_ini_file_loader_1 = require_dist_cjs43(); var resolveCredentialSource_1 = require_resolveCredentialSource(); var resolveProfileData_1 = require_resolveProfileData(); var isAssumeRoleProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 && ["undefined", "string"].indexOf(typeof arg.external_id) > -1 && ["undefined", "string"].indexOf(typeof arg.mfa_serial) > -1 && (isAssumeRoleWithSourceProfile(arg) || isAssumeRoleWithProviderProfile(arg)); @@ -14620,7 +15344,7 @@ var require_fromProcess = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fromProcess = void 0; - var shared_ini_file_loader_1 = require_dist_cjs38(); + var shared_ini_file_loader_1 = require_dist_cjs43(); var resolveProcessCredentials_1 = require_resolveProcessCredentials(); var fromProcess = (init = {}) => async () => { const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init); @@ -14631,7 +15355,7 @@ var require_fromProcess = __commonJS({ }); // ../../../node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js -var require_dist_cjs41 = __commonJS({ +var require_dist_cjs48 = __commonJS({ "../../../node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -14646,7 +15370,7 @@ var require_resolveProcessCredentials2 = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.resolveProcessCredentials = exports.isProcessProfile = void 0; - var credential_provider_process_1 = require_dist_cjs41(); + var credential_provider_process_1 = require_dist_cjs48(); var isProcessProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string"; exports.isProcessProfile = isProcessProfile; var resolveProcessCredentials = async (options, profile) => (0, credential_provider_process_1.fromProcess)({ @@ -14692,7 +15416,7 @@ var require_package3 = __commonJS({ module2.exports = { name: "@aws-sdk/client-sso", description: "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native", - version: "3.363.0", + version: "3.370.0", scripts: { build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "tsc -p tsconfig.cjs.json", @@ -14712,40 +15436,39 @@ var require_package3 = __commonJS({ dependencies: { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/middleware-host-header": "3.363.0", - "@aws-sdk/middleware-logger": "3.363.0", - "@aws-sdk/middleware-recursion-detection": "3.363.0", - "@aws-sdk/middleware-user-agent": "3.363.0", - "@aws-sdk/types": "3.357.0", - "@aws-sdk/util-endpoints": "3.357.0", - "@aws-sdk/util-user-agent-browser": "3.363.0", - "@aws-sdk/util-user-agent-node": "3.363.0", + "@aws-sdk/middleware-host-header": "3.370.0", + "@aws-sdk/middleware-logger": "3.370.0", + "@aws-sdk/middleware-recursion-detection": "3.370.0", + "@aws-sdk/middleware-user-agent": "3.370.0", + "@aws-sdk/types": "3.370.0", + "@aws-sdk/util-endpoints": "3.370.0", + "@aws-sdk/util-user-agent-browser": "3.370.0", + "@aws-sdk/util-user-agent-node": "3.370.0", "@smithy/config-resolver": "^1.0.1", "@smithy/fetch-http-handler": "^1.0.1", "@smithy/hash-node": "^1.0.1", "@smithy/invalid-dependency": "^1.0.1", "@smithy/middleware-content-length": "^1.0.1", - "@smithy/middleware-endpoint": "^1.0.1", - "@smithy/middleware-retry": "^1.0.2", + "@smithy/middleware-endpoint": "^1.0.2", + "@smithy/middleware-retry": "^1.0.3", "@smithy/middleware-serde": "^1.0.1", "@smithy/middleware-stack": "^1.0.1", "@smithy/node-config-provider": "^1.0.1", "@smithy/node-http-handler": "^1.0.2", - "@smithy/protocol-http": "^1.0.1", + "@smithy/protocol-http": "^1.1.0", "@smithy/smithy-client": "^1.0.3", - "@smithy/types": "^1.0.0", + "@smithy/types": "^1.1.0", "@smithy/url-parser": "^1.0.1", "@smithy/util-base64": "^1.0.1", "@smithy/util-body-length-browser": "^1.0.1", "@smithy/util-body-length-node": "^1.0.1", "@smithy/util-defaults-mode-browser": "^1.0.1", "@smithy/util-defaults-mode-node": "^1.0.1", - "@smithy/util-retry": "^1.0.2", + "@smithy/util-retry": "^1.0.3", "@smithy/util-utf8": "^1.0.1", tslib: "^2.5.0" }, devDependencies: { - "@aws-sdk/service-client-documentation-generator": "3.310.0", "@smithy/service-client-documentation-generator": "^1.0.1", "@tsconfig/node14": "1.0.3", "@types/node": "^14.14.31", @@ -14810,12 +15533,12 @@ var require_is_crt_available = __commonJS({ }); // ../../../node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js -var require_dist_cjs42 = __commonJS({ +var require_dist_cjs49 = __commonJS({ "../../../node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.defaultUserAgent = exports.UA_APP_ID_INI_NAME = exports.UA_APP_ID_ENV_NAME = void 0; - var node_config_provider_1 = require_dist_cjs39(); + var node_config_provider_1 = require_dist_cjs44(); var os_1 = require("os"); var process_1 = require("process"); var is_crt_available_1 = require_is_crt_available(); @@ -14858,7 +15581,7 @@ var require_dist_cjs42 = __commonJS({ }); // ../../../node_modules/@smithy/hash-node/dist-cjs/index.js -var require_dist_cjs43 = __commonJS({ +var require_dist_cjs50 = __commonJS({ "../../../node_modules/@smithy/hash-node/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -14928,7 +15651,7 @@ var require_calculateBodyLength = __commonJS({ }); // ../../../node_modules/@smithy/util-body-length-node/dist-cjs/index.js -var require_dist_cjs44 = __commonJS({ +var require_dist_cjs51 = __commonJS({ "../../../node_modules/@smithy/util-body-length-node/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -14991,9 +15714,9 @@ var require_runtimeConfig_shared = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getRuntimeConfig = void 0; - var smithy_client_1 = require_dist_cjs35(); - var url_parser_1 = require_dist_cjs24(); - var util_base64_1 = require_dist_cjs31(); + var smithy_client_1 = require_dist_cjs39(); + var url_parser_1 = require_dist_cjs46(); + var util_base64_1 = require_dist_cjs35(); var util_utf8_1 = require_dist_cjs13(); var endpointResolver_1 = require_endpointResolver(); var getRuntimeConfig = (config) => ({ @@ -15054,8 +15777,8 @@ var require_resolveDefaultsModeConfig = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.resolveDefaultsModeConfig = void 0; var config_resolver_1 = require_dist_cjs21(); - var credential_provider_imds_1 = require_dist_cjs40(); - var node_config_provider_1 = require_dist_cjs39(); + var credential_provider_imds_1 = require_dist_cjs47(); + var node_config_provider_1 = require_dist_cjs44(); var property_provider_1 = require_dist_cjs6(); var constants_1 = require_constants7(); var defaultsModeConfig_1 = require_defaultsModeConfig(); @@ -15109,7 +15832,7 @@ var require_resolveDefaultsModeConfig = __commonJS({ }); // ../../../node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js -var require_dist_cjs45 = __commonJS({ +var require_dist_cjs52 = __commonJS({ "../../../node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -15126,18 +15849,18 @@ var require_runtimeConfig = __commonJS({ exports.getRuntimeConfig = void 0; var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var package_json_1 = tslib_1.__importDefault(require_package3()); - var util_user_agent_node_1 = require_dist_cjs42(); + var util_user_agent_node_1 = require_dist_cjs49(); var config_resolver_1 = require_dist_cjs21(); - var hash_node_1 = require_dist_cjs43(); - var middleware_retry_1 = require_dist_cjs29(); - var node_config_provider_1 = require_dist_cjs39(); - var node_http_handler_1 = require_dist_cjs33(); - var util_body_length_node_1 = require_dist_cjs44(); - var util_retry_1 = require_dist_cjs28(); + var hash_node_1 = require_dist_cjs50(); + var middleware_retry_1 = require_dist_cjs33(); + var node_config_provider_1 = require_dist_cjs44(); + var node_http_handler_1 = require_dist_cjs37(); + var util_body_length_node_1 = require_dist_cjs51(); + var util_retry_1 = require_dist_cjs29(); var runtimeConfig_shared_1 = require_runtimeConfig_shared(); - var smithy_client_1 = require_dist_cjs35(); - var util_defaults_mode_node_1 = require_dist_cjs45(); - var smithy_client_2 = require_dist_cjs35(); + var smithy_client_1 = require_dist_cjs39(); + var util_defaults_mode_node_1 = require_dist_cjs52(); + var smithy_client_2 = require_dist_cjs39(); var getRuntimeConfig = (config) => { (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); @@ -15179,9 +15902,9 @@ var require_SSOClient = __commonJS({ var middleware_user_agent_1 = require_dist_cjs19(); var config_resolver_1 = require_dist_cjs21(); var middleware_content_length_1 = require_dist_cjs22(); - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_retry_1 = require_dist_cjs29(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_retry_1 = require_dist_cjs33(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "__Client", { enumerable: true, get: function() { return smithy_client_1.Client; } }); @@ -15219,14 +15942,14 @@ var require_SSOServiceException = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SSOServiceException = exports.__ServiceException = void 0; - var smithy_client_1 = require_dist_cjs35(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "__ServiceException", { enumerable: true, get: function() { return smithy_client_1.ServiceException; } }); - var SSOServiceException = class extends smithy_client_1.ServiceException { + var SSOServiceException = class _SSOServiceException extends smithy_client_1.ServiceException { constructor(options) { super(options); - Object.setPrototypeOf(this, SSOServiceException.prototype); + Object.setPrototypeOf(this, _SSOServiceException.prototype); } }; exports.SSOServiceException = SSOServiceException; @@ -15239,9 +15962,9 @@ var require_models_02 = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LogoutRequestFilterSensitiveLog = exports.ListAccountsRequestFilterSensitiveLog = exports.ListAccountRolesRequestFilterSensitiveLog = exports.GetRoleCredentialsResponseFilterSensitiveLog = exports.RoleCredentialsFilterSensitiveLog = exports.GetRoleCredentialsRequestFilterSensitiveLog = exports.UnauthorizedException = exports.TooManyRequestsException = exports.ResourceNotFoundException = exports.InvalidRequestException = void 0; - var smithy_client_1 = require_dist_cjs35(); + var smithy_client_1 = require_dist_cjs39(); var SSOServiceException_1 = require_SSOServiceException(); - var InvalidRequestException = class extends SSOServiceException_1.SSOServiceException { + var InvalidRequestException = class _InvalidRequestException extends SSOServiceException_1.SSOServiceException { constructor(opts) { super({ name: "InvalidRequestException", @@ -15250,11 +15973,11 @@ var require_models_02 = __commonJS({ }); this.name = "InvalidRequestException"; this.$fault = "client"; - Object.setPrototypeOf(this, InvalidRequestException.prototype); + Object.setPrototypeOf(this, _InvalidRequestException.prototype); } }; exports.InvalidRequestException = InvalidRequestException; - var ResourceNotFoundException = class extends SSOServiceException_1.SSOServiceException { + var ResourceNotFoundException = class _ResourceNotFoundException extends SSOServiceException_1.SSOServiceException { constructor(opts) { super({ name: "ResourceNotFoundException", @@ -15263,11 +15986,11 @@ var require_models_02 = __commonJS({ }); this.name = "ResourceNotFoundException"; this.$fault = "client"; - Object.setPrototypeOf(this, ResourceNotFoundException.prototype); + Object.setPrototypeOf(this, _ResourceNotFoundException.prototype); } }; exports.ResourceNotFoundException = ResourceNotFoundException; - var TooManyRequestsException = class extends SSOServiceException_1.SSOServiceException { + var TooManyRequestsException = class _TooManyRequestsException extends SSOServiceException_1.SSOServiceException { constructor(opts) { super({ name: "TooManyRequestsException", @@ -15276,11 +15999,11 @@ var require_models_02 = __commonJS({ }); this.name = "TooManyRequestsException"; this.$fault = "client"; - Object.setPrototypeOf(this, TooManyRequestsException.prototype); + Object.setPrototypeOf(this, _TooManyRequestsException.prototype); } }; exports.TooManyRequestsException = TooManyRequestsException; - var UnauthorizedException = class extends SSOServiceException_1.SSOServiceException { + var UnauthorizedException = class _UnauthorizedException extends SSOServiceException_1.SSOServiceException { constructor(opts) { super({ name: "UnauthorizedException", @@ -15289,7 +16012,7 @@ var require_models_02 = __commonJS({ }); this.name = "UnauthorizedException"; this.$fault = "client"; - Object.setPrototypeOf(this, UnauthorizedException.prototype); + Object.setPrototypeOf(this, _UnauthorizedException.prototype); } }; exports.UnauthorizedException = UnauthorizedException; @@ -15334,7 +16057,7 @@ var require_Aws_restJson1 = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.de_LogoutCommand = exports.de_ListAccountsCommand = exports.de_ListAccountRolesCommand = exports.de_GetRoleCredentialsCommand = exports.se_LogoutCommand = exports.se_ListAccountsCommand = exports.se_ListAccountRolesCommand = exports.se_GetRoleCredentialsCommand = void 0; var protocol_http_1 = require_dist_cjs2(); - var smithy_client_1 = require_dist_cjs35(); + var smithy_client_1 = require_dist_cjs39(); var models_0_1 = require_models_02(); var SSOServiceException_1 = require_SSOServiceException(); var se_GetRoleCredentialsCommand = async (input, context) => { @@ -15702,15 +16425,15 @@ var require_GetRoleCredentialsCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetRoleCredentialsCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_02(); var Aws_restJson1_1 = require_Aws_restJson1(); - var GetRoleCredentialsCommand = class extends smithy_client_1.Command { + var GetRoleCredentialsCommand = class _GetRoleCredentialsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -15725,7 +16448,7 @@ var require_GetRoleCredentialsCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetRoleCredentialsCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _GetRoleCredentialsCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SSOClient"; @@ -15757,15 +16480,15 @@ var require_ListAccountRolesCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ListAccountRolesCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_02(); var Aws_restJson1_1 = require_Aws_restJson1(); - var ListAccountRolesCommand = class extends smithy_client_1.Command { + var ListAccountRolesCommand = class _ListAccountRolesCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -15780,7 +16503,7 @@ var require_ListAccountRolesCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListAccountRolesCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _ListAccountRolesCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SSOClient"; @@ -15812,15 +16535,15 @@ var require_ListAccountsCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ListAccountsCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_02(); var Aws_restJson1_1 = require_Aws_restJson1(); - var ListAccountsCommand = class extends smithy_client_1.Command { + var ListAccountsCommand = class _ListAccountsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -15835,7 +16558,7 @@ var require_ListAccountsCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListAccountsCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _ListAccountsCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SSOClient"; @@ -15867,15 +16590,15 @@ var require_LogoutCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LogoutCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_02(); var Aws_restJson1_1 = require_Aws_restJson1(); - var LogoutCommand = class extends smithy_client_1.Command { + var LogoutCommand = class _LogoutCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -15890,7 +16613,7 @@ var require_LogoutCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, LogoutCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _LogoutCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SSOClient"; @@ -15922,7 +16645,7 @@ var require_SSO = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SSO = void 0; - var smithy_client_1 = require_dist_cjs35(); + var smithy_client_1 = require_dist_cjs39(); var GetRoleCredentialsCommand_1 = require_GetRoleCredentialsCommand(); var ListAccountRolesCommand_1 = require_ListAccountRolesCommand(); var ListAccountsCommand_1 = require_ListAccountsCommand(); @@ -16031,7 +16754,7 @@ var require_ListAccountsPaginator = __commonJS({ }); // ../../../node_modules/@aws-sdk/client-sso/dist-cjs/pagination/index.js -var require_pagination3 = __commonJS({ +var require_pagination4 = __commonJS({ "../../../node_modules/@aws-sdk/client-sso/dist-cjs/pagination/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -16053,7 +16776,7 @@ var require_models = __commonJS({ }); // ../../../node_modules/@aws-sdk/client-sso/dist-cjs/index.js -var require_dist_cjs46 = __commonJS({ +var require_dist_cjs53 = __commonJS({ "../../../node_modules/@aws-sdk/client-sso/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -16062,7 +16785,7 @@ var require_dist_cjs46 = __commonJS({ tslib_1.__exportStar(require_SSOClient(), exports); tslib_1.__exportStar(require_SSO(), exports); tslib_1.__exportStar(require_commands(), exports); - tslib_1.__exportStar(require_pagination3(), exports); + tslib_1.__exportStar(require_pagination4(), exports); tslib_1.__exportStar(require_models(), exports); var SSOServiceException_1 = require_SSOServiceException(); Object.defineProperty(exports, "SSOServiceException", { enumerable: true, get: function() { @@ -16106,7 +16829,7 @@ var require_package4 = __commonJS({ module2.exports = { name: "@aws-sdk/client-sso-oidc", description: "AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native", - version: "3.363.0", + version: "3.370.0", scripts: { build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "tsc -p tsconfig.cjs.json", @@ -16126,40 +16849,39 @@ var require_package4 = __commonJS({ dependencies: { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/middleware-host-header": "3.363.0", - "@aws-sdk/middleware-logger": "3.363.0", - "@aws-sdk/middleware-recursion-detection": "3.363.0", - "@aws-sdk/middleware-user-agent": "3.363.0", - "@aws-sdk/types": "3.357.0", - "@aws-sdk/util-endpoints": "3.357.0", - "@aws-sdk/util-user-agent-browser": "3.363.0", - "@aws-sdk/util-user-agent-node": "3.363.0", + "@aws-sdk/middleware-host-header": "3.370.0", + "@aws-sdk/middleware-logger": "3.370.0", + "@aws-sdk/middleware-recursion-detection": "3.370.0", + "@aws-sdk/middleware-user-agent": "3.370.0", + "@aws-sdk/types": "3.370.0", + "@aws-sdk/util-endpoints": "3.370.0", + "@aws-sdk/util-user-agent-browser": "3.370.0", + "@aws-sdk/util-user-agent-node": "3.370.0", "@smithy/config-resolver": "^1.0.1", "@smithy/fetch-http-handler": "^1.0.1", "@smithy/hash-node": "^1.0.1", "@smithy/invalid-dependency": "^1.0.1", "@smithy/middleware-content-length": "^1.0.1", - "@smithy/middleware-endpoint": "^1.0.1", - "@smithy/middleware-retry": "^1.0.2", + "@smithy/middleware-endpoint": "^1.0.2", + "@smithy/middleware-retry": "^1.0.3", "@smithy/middleware-serde": "^1.0.1", "@smithy/middleware-stack": "^1.0.1", "@smithy/node-config-provider": "^1.0.1", "@smithy/node-http-handler": "^1.0.2", - "@smithy/protocol-http": "^1.0.1", + "@smithy/protocol-http": "^1.1.0", "@smithy/smithy-client": "^1.0.3", - "@smithy/types": "^1.0.0", + "@smithy/types": "^1.1.0", "@smithy/url-parser": "^1.0.1", "@smithy/util-base64": "^1.0.1", "@smithy/util-body-length-browser": "^1.0.1", "@smithy/util-body-length-node": "^1.0.1", "@smithy/util-defaults-mode-browser": "^1.0.1", "@smithy/util-defaults-mode-node": "^1.0.1", - "@smithy/util-retry": "^1.0.2", + "@smithy/util-retry": "^1.0.3", "@smithy/util-utf8": "^1.0.1", tslib: "^2.5.0" }, devDependencies: { - "@aws-sdk/service-client-documentation-generator": "3.310.0", "@smithy/service-client-documentation-generator": "^1.0.1", "@tsconfig/node14": "1.0.3", "@types/node": "^14.14.31", @@ -16257,9 +16979,9 @@ var require_runtimeConfig_shared2 = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getRuntimeConfig = void 0; - var smithy_client_1 = require_dist_cjs35(); - var url_parser_1 = require_dist_cjs24(); - var util_base64_1 = require_dist_cjs31(); + var smithy_client_1 = require_dist_cjs39(); + var url_parser_1 = require_dist_cjs46(); + var util_base64_1 = require_dist_cjs35(); var util_utf8_1 = require_dist_cjs13(); var endpointResolver_1 = require_endpointResolver2(); var getRuntimeConfig = (config) => ({ @@ -16286,18 +17008,18 @@ var require_runtimeConfig2 = __commonJS({ exports.getRuntimeConfig = void 0; var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var package_json_1 = tslib_1.__importDefault(require_package4()); - var util_user_agent_node_1 = require_dist_cjs42(); + var util_user_agent_node_1 = require_dist_cjs49(); var config_resolver_1 = require_dist_cjs21(); - var hash_node_1 = require_dist_cjs43(); - var middleware_retry_1 = require_dist_cjs29(); - var node_config_provider_1 = require_dist_cjs39(); - var node_http_handler_1 = require_dist_cjs33(); - var util_body_length_node_1 = require_dist_cjs44(); - var util_retry_1 = require_dist_cjs28(); + var hash_node_1 = require_dist_cjs50(); + var middleware_retry_1 = require_dist_cjs33(); + var node_config_provider_1 = require_dist_cjs44(); + var node_http_handler_1 = require_dist_cjs37(); + var util_body_length_node_1 = require_dist_cjs51(); + var util_retry_1 = require_dist_cjs29(); var runtimeConfig_shared_1 = require_runtimeConfig_shared2(); - var smithy_client_1 = require_dist_cjs35(); - var util_defaults_mode_node_1 = require_dist_cjs45(); - var smithy_client_2 = require_dist_cjs35(); + var smithy_client_1 = require_dist_cjs39(); + var util_defaults_mode_node_1 = require_dist_cjs52(); + var smithy_client_2 = require_dist_cjs39(); var getRuntimeConfig = (config) => { (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); @@ -16339,9 +17061,9 @@ var require_SSOOIDCClient = __commonJS({ var middleware_user_agent_1 = require_dist_cjs19(); var config_resolver_1 = require_dist_cjs21(); var middleware_content_length_1 = require_dist_cjs22(); - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_retry_1 = require_dist_cjs29(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_retry_1 = require_dist_cjs33(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "__Client", { enumerable: true, get: function() { return smithy_client_1.Client; } }); @@ -16379,14 +17101,14 @@ var require_SSOOIDCServiceException = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SSOOIDCServiceException = exports.__ServiceException = void 0; - var smithy_client_1 = require_dist_cjs35(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "__ServiceException", { enumerable: true, get: function() { return smithy_client_1.ServiceException; } }); - var SSOOIDCServiceException = class extends smithy_client_1.ServiceException { + var SSOOIDCServiceException = class _SSOOIDCServiceException extends smithy_client_1.ServiceException { constructor(options) { super(options); - Object.setPrototypeOf(this, SSOOIDCServiceException.prototype); + Object.setPrototypeOf(this, _SSOOIDCServiceException.prototype); } }; exports.SSOOIDCServiceException = SSOOIDCServiceException; @@ -16400,7 +17122,7 @@ var require_models_03 = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.InvalidClientMetadataException = exports.UnsupportedGrantTypeException = exports.UnauthorizedClientException = exports.SlowDownException = exports.InvalidScopeException = exports.InvalidRequestException = exports.InvalidGrantException = exports.InvalidClientException = exports.InternalServerException = exports.ExpiredTokenException = exports.AuthorizationPendingException = exports.AccessDeniedException = void 0; var SSOOIDCServiceException_1 = require_SSOOIDCServiceException(); - var AccessDeniedException = class extends SSOOIDCServiceException_1.SSOOIDCServiceException { + var AccessDeniedException = class _AccessDeniedException extends SSOOIDCServiceException_1.SSOOIDCServiceException { constructor(opts) { super({ name: "AccessDeniedException", @@ -16409,13 +17131,13 @@ var require_models_03 = __commonJS({ }); this.name = "AccessDeniedException"; this.$fault = "client"; - Object.setPrototypeOf(this, AccessDeniedException.prototype); + Object.setPrototypeOf(this, _AccessDeniedException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; exports.AccessDeniedException = AccessDeniedException; - var AuthorizationPendingException = class extends SSOOIDCServiceException_1.SSOOIDCServiceException { + var AuthorizationPendingException = class _AuthorizationPendingException extends SSOOIDCServiceException_1.SSOOIDCServiceException { constructor(opts) { super({ name: "AuthorizationPendingException", @@ -16424,13 +17146,13 @@ var require_models_03 = __commonJS({ }); this.name = "AuthorizationPendingException"; this.$fault = "client"; - Object.setPrototypeOf(this, AuthorizationPendingException.prototype); + Object.setPrototypeOf(this, _AuthorizationPendingException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; exports.AuthorizationPendingException = AuthorizationPendingException; - var ExpiredTokenException = class extends SSOOIDCServiceException_1.SSOOIDCServiceException { + var ExpiredTokenException = class _ExpiredTokenException extends SSOOIDCServiceException_1.SSOOIDCServiceException { constructor(opts) { super({ name: "ExpiredTokenException", @@ -16439,13 +17161,13 @@ var require_models_03 = __commonJS({ }); this.name = "ExpiredTokenException"; this.$fault = "client"; - Object.setPrototypeOf(this, ExpiredTokenException.prototype); + Object.setPrototypeOf(this, _ExpiredTokenException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; exports.ExpiredTokenException = ExpiredTokenException; - var InternalServerException = class extends SSOOIDCServiceException_1.SSOOIDCServiceException { + var InternalServerException = class _InternalServerException extends SSOOIDCServiceException_1.SSOOIDCServiceException { constructor(opts) { super({ name: "InternalServerException", @@ -16454,13 +17176,13 @@ var require_models_03 = __commonJS({ }); this.name = "InternalServerException"; this.$fault = "server"; - Object.setPrototypeOf(this, InternalServerException.prototype); + Object.setPrototypeOf(this, _InternalServerException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; exports.InternalServerException = InternalServerException; - var InvalidClientException = class extends SSOOIDCServiceException_1.SSOOIDCServiceException { + var InvalidClientException = class _InvalidClientException extends SSOOIDCServiceException_1.SSOOIDCServiceException { constructor(opts) { super({ name: "InvalidClientException", @@ -16469,13 +17191,13 @@ var require_models_03 = __commonJS({ }); this.name = "InvalidClientException"; this.$fault = "client"; - Object.setPrototypeOf(this, InvalidClientException.prototype); + Object.setPrototypeOf(this, _InvalidClientException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; exports.InvalidClientException = InvalidClientException; - var InvalidGrantException = class extends SSOOIDCServiceException_1.SSOOIDCServiceException { + var InvalidGrantException = class _InvalidGrantException extends SSOOIDCServiceException_1.SSOOIDCServiceException { constructor(opts) { super({ name: "InvalidGrantException", @@ -16484,13 +17206,13 @@ var require_models_03 = __commonJS({ }); this.name = "InvalidGrantException"; this.$fault = "client"; - Object.setPrototypeOf(this, InvalidGrantException.prototype); + Object.setPrototypeOf(this, _InvalidGrantException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; exports.InvalidGrantException = InvalidGrantException; - var InvalidRequestException = class extends SSOOIDCServiceException_1.SSOOIDCServiceException { + var InvalidRequestException = class _InvalidRequestException extends SSOOIDCServiceException_1.SSOOIDCServiceException { constructor(opts) { super({ name: "InvalidRequestException", @@ -16499,13 +17221,13 @@ var require_models_03 = __commonJS({ }); this.name = "InvalidRequestException"; this.$fault = "client"; - Object.setPrototypeOf(this, InvalidRequestException.prototype); + Object.setPrototypeOf(this, _InvalidRequestException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; exports.InvalidRequestException = InvalidRequestException; - var InvalidScopeException = class extends SSOOIDCServiceException_1.SSOOIDCServiceException { + var InvalidScopeException = class _InvalidScopeException extends SSOOIDCServiceException_1.SSOOIDCServiceException { constructor(opts) { super({ name: "InvalidScopeException", @@ -16514,13 +17236,13 @@ var require_models_03 = __commonJS({ }); this.name = "InvalidScopeException"; this.$fault = "client"; - Object.setPrototypeOf(this, InvalidScopeException.prototype); + Object.setPrototypeOf(this, _InvalidScopeException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; exports.InvalidScopeException = InvalidScopeException; - var SlowDownException = class extends SSOOIDCServiceException_1.SSOOIDCServiceException { + var SlowDownException = class _SlowDownException extends SSOOIDCServiceException_1.SSOOIDCServiceException { constructor(opts) { super({ name: "SlowDownException", @@ -16529,13 +17251,13 @@ var require_models_03 = __commonJS({ }); this.name = "SlowDownException"; this.$fault = "client"; - Object.setPrototypeOf(this, SlowDownException.prototype); + Object.setPrototypeOf(this, _SlowDownException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; exports.SlowDownException = SlowDownException; - var UnauthorizedClientException = class extends SSOOIDCServiceException_1.SSOOIDCServiceException { + var UnauthorizedClientException = class _UnauthorizedClientException extends SSOOIDCServiceException_1.SSOOIDCServiceException { constructor(opts) { super({ name: "UnauthorizedClientException", @@ -16544,13 +17266,13 @@ var require_models_03 = __commonJS({ }); this.name = "UnauthorizedClientException"; this.$fault = "client"; - Object.setPrototypeOf(this, UnauthorizedClientException.prototype); + Object.setPrototypeOf(this, _UnauthorizedClientException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; exports.UnauthorizedClientException = UnauthorizedClientException; - var UnsupportedGrantTypeException = class extends SSOOIDCServiceException_1.SSOOIDCServiceException { + var UnsupportedGrantTypeException = class _UnsupportedGrantTypeException extends SSOOIDCServiceException_1.SSOOIDCServiceException { constructor(opts) { super({ name: "UnsupportedGrantTypeException", @@ -16559,13 +17281,13 @@ var require_models_03 = __commonJS({ }); this.name = "UnsupportedGrantTypeException"; this.$fault = "client"; - Object.setPrototypeOf(this, UnsupportedGrantTypeException.prototype); + Object.setPrototypeOf(this, _UnsupportedGrantTypeException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; exports.UnsupportedGrantTypeException = UnsupportedGrantTypeException; - var InvalidClientMetadataException = class extends SSOOIDCServiceException_1.SSOOIDCServiceException { + var InvalidClientMetadataException = class _InvalidClientMetadataException extends SSOOIDCServiceException_1.SSOOIDCServiceException { constructor(opts) { super({ name: "InvalidClientMetadataException", @@ -16574,7 +17296,7 @@ var require_models_03 = __commonJS({ }); this.name = "InvalidClientMetadataException"; this.$fault = "client"; - Object.setPrototypeOf(this, InvalidClientMetadataException.prototype); + Object.setPrototypeOf(this, _InvalidClientMetadataException.prototype); this.error = opts.error; this.error_description = opts.error_description; } @@ -16590,7 +17312,7 @@ var require_Aws_restJson12 = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.de_StartDeviceAuthorizationCommand = exports.de_RegisterClientCommand = exports.de_CreateTokenCommand = exports.se_StartDeviceAuthorizationCommand = exports.se_RegisterClientCommand = exports.se_CreateTokenCommand = void 0; var protocol_http_1 = require_dist_cjs2(); - var smithy_client_1 = require_dist_cjs35(); + var smithy_client_1 = require_dist_cjs39(); var models_0_1 = require_models_03(); var SSOOIDCServiceException_1 = require_SSOOIDCServiceException(); var se_CreateTokenCommand = async (input, context) => { @@ -17059,14 +17781,14 @@ var require_CreateTokenCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CreateTokenCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_restJson1_1 = require_Aws_restJson12(); - var CreateTokenCommand = class extends smithy_client_1.Command { + var CreateTokenCommand = class _CreateTokenCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -17081,7 +17803,7 @@ var require_CreateTokenCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, CreateTokenCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _CreateTokenCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SSOOIDCClient"; @@ -17113,14 +17835,14 @@ var require_RegisterClientCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RegisterClientCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_restJson1_1 = require_Aws_restJson12(); - var RegisterClientCommand = class extends smithy_client_1.Command { + var RegisterClientCommand = class _RegisterClientCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -17135,7 +17857,7 @@ var require_RegisterClientCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, RegisterClientCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _RegisterClientCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SSOOIDCClient"; @@ -17167,14 +17889,14 @@ var require_StartDeviceAuthorizationCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StartDeviceAuthorizationCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_restJson1_1 = require_Aws_restJson12(); - var StartDeviceAuthorizationCommand = class extends smithy_client_1.Command { + var StartDeviceAuthorizationCommand = class _StartDeviceAuthorizationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -17189,7 +17911,7 @@ var require_StartDeviceAuthorizationCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, StartDeviceAuthorizationCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _StartDeviceAuthorizationCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SSOOIDCClient"; @@ -17221,7 +17943,7 @@ var require_SSOOIDC = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SSOOIDC = void 0; - var smithy_client_1 = require_dist_cjs35(); + var smithy_client_1 = require_dist_cjs39(); var CreateTokenCommand_1 = require_CreateTokenCommand(); var RegisterClientCommand_1 = require_RegisterClientCommand(); var StartDeviceAuthorizationCommand_1 = require_StartDeviceAuthorizationCommand(); @@ -17261,7 +17983,7 @@ var require_models2 = __commonJS({ }); // ../../../node_modules/@aws-sdk/client-sso-oidc/dist-cjs/index.js -var require_dist_cjs47 = __commonJS({ +var require_dist_cjs54 = __commonJS({ "../../../node_modules/@aws-sdk/client-sso-oidc/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -17284,7 +18006,7 @@ var require_getSsoOidcClient = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSsoOidcClient = void 0; - var client_sso_oidc_1 = require_dist_cjs47(); + var client_sso_oidc_1 = require_dist_cjs54(); var ssoOidcClientsHash = {}; var getSsoOidcClient = (ssoRegion) => { if (ssoOidcClientsHash[ssoRegion]) { @@ -17304,7 +18026,7 @@ var require_getNewSsoOidcToken = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getNewSsoOidcToken = void 0; - var client_sso_oidc_1 = require_dist_cjs47(); + var client_sso_oidc_1 = require_dist_cjs54(); var getSsoOidcClient_1 = require_getSsoOidcClient(); var getNewSsoOidcToken = (ssoToken, ssoRegion) => { const ssoOidcClient = (0, getSsoOidcClient_1.getSsoOidcClient)(ssoRegion); @@ -17359,7 +18081,7 @@ var require_writeSSOTokenToFile = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.writeSSOTokenToFile = void 0; - var shared_ini_file_loader_1 = require_dist_cjs38(); + var shared_ini_file_loader_1 = require_dist_cjs43(); var fs_1 = require("fs"); var { writeFile } = fs_1.promises; var writeSSOTokenToFile = (id, ssoToken) => { @@ -17378,7 +18100,7 @@ var require_fromSso = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.fromSso = void 0; var property_provider_1 = require_dist_cjs6(); - var shared_ini_file_loader_1 = require_dist_cjs38(); + var shared_ini_file_loader_1 = require_dist_cjs43(); var constants_1 = require_constants8(); var getNewSsoOidcToken_1 = require_getNewSsoOidcToken(); var validateTokenExpiry_1 = require_validateTokenExpiry(); @@ -17488,7 +18210,7 @@ var require_nodeProvider = __commonJS({ }); // ../../../node_modules/@aws-sdk/token-providers/dist-cjs/index.js -var require_dist_cjs48 = __commonJS({ +var require_dist_cjs55 = __commonJS({ "../../../node_modules/@aws-sdk/token-providers/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -17505,10 +18227,10 @@ var require_resolveSSOCredentials = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.resolveSSOCredentials = void 0; - var client_sso_1 = require_dist_cjs46(); - var token_providers_1 = require_dist_cjs48(); + var client_sso_1 = require_dist_cjs53(); + var token_providers_1 = require_dist_cjs55(); var property_provider_1 = require_dist_cjs6(); - var shared_ini_file_loader_1 = require_dist_cjs38(); + var shared_ini_file_loader_1 = require_dist_cjs43(); var EXPIRE_WINDOW_MS = 15 * 60 * 1e3; var SHOULD_FAIL_CREDENTIAL_CHAIN = false; var resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, profile }) => { @@ -17582,7 +18304,7 @@ var require_fromSSO = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.fromSSO = void 0; var property_provider_1 = require_dist_cjs6(); - var shared_ini_file_loader_1 = require_dist_cjs38(); + var shared_ini_file_loader_1 = require_dist_cjs43(); var isSsoProfile_1 = require_isSsoProfile(); var resolveSSOCredentials_1 = require_resolveSSOCredentials(); var validateSsoProfile_1 = require_validateSsoProfile(); @@ -17640,7 +18362,7 @@ var require_fromSSO = __commonJS({ }); // ../../../node_modules/@aws-sdk/credential-provider-sso/dist-cjs/types.js -var require_types7 = __commonJS({ +var require_types8 = __commonJS({ "../../../node_modules/@aws-sdk/credential-provider-sso/dist-cjs/types.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -17648,14 +18370,14 @@ var require_types7 = __commonJS({ }); // ../../../node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js -var require_dist_cjs49 = __commonJS({ +var require_dist_cjs56 = __commonJS({ "../../../node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); tslib_1.__exportStar(require_fromSSO(), exports); tslib_1.__exportStar(require_isSsoProfile(), exports); - tslib_1.__exportStar(require_types7(), exports); + tslib_1.__exportStar(require_types8(), exports); tslib_1.__exportStar(require_validateSsoProfile(), exports); } }); @@ -17666,8 +18388,8 @@ var require_resolveSsoCredentials = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.resolveSsoCredentials = exports.isSsoProfile = void 0; - var credential_provider_sso_1 = require_dist_cjs49(); - var credential_provider_sso_2 = require_dist_cjs49(); + var credential_provider_sso_1 = require_dist_cjs56(); + var credential_provider_sso_2 = require_dist_cjs56(); Object.defineProperty(exports, "isSsoProfile", { enumerable: true, get: function() { return credential_provider_sso_2.isSsoProfile; } }); @@ -17760,7 +18482,7 @@ var require_fromTokenFile = __commonJS({ }); // ../../../node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js -var require_dist_cjs50 = __commonJS({ +var require_dist_cjs57 = __commonJS({ "../../../node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -17776,7 +18498,7 @@ var require_resolveWebIdentityCredentials = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.resolveWebIdentityCredentials = exports.isWebIdentityProfile = void 0; - var credential_provider_web_identity_1 = require_dist_cjs50(); + var credential_provider_web_identity_1 = require_dist_cjs57(); var isWebIdentityProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.web_identity_token_file === "string" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1; exports.isWebIdentityProfile = isWebIdentityProfile; var resolveWebIdentityCredentials = async (profile, options) => (0, credential_provider_web_identity_1.fromTokenFile)({ @@ -17833,7 +18555,7 @@ var require_fromIni = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fromIni = void 0; - var shared_ini_file_loader_1 = require_dist_cjs38(); + var shared_ini_file_loader_1 = require_dist_cjs43(); var resolveProfileData_1 = require_resolveProfileData(); var fromIni = (init = {}) => async () => { const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init); @@ -17844,7 +18566,7 @@ var require_fromIni = __commonJS({ }); // ../../../node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js -var require_dist_cjs51 = __commonJS({ +var require_dist_cjs58 = __commonJS({ "../../../node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -17859,7 +18581,7 @@ var require_remoteProvider = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.remoteProvider = exports.ENV_IMDS_DISABLED = void 0; - var credential_provider_imds_1 = require_dist_cjs40(); + var credential_provider_imds_1 = require_dist_cjs47(); var property_provider_1 = require_dist_cjs6(); exports.ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; var remoteProvider = (init) => { @@ -17883,13 +18605,13 @@ var require_defaultProvider = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.defaultProvider = void 0; - var credential_provider_env_1 = require_dist_cjs37(); - var credential_provider_ini_1 = require_dist_cjs51(); - var credential_provider_process_1 = require_dist_cjs41(); - var credential_provider_sso_1 = require_dist_cjs49(); - var credential_provider_web_identity_1 = require_dist_cjs50(); + var credential_provider_env_1 = require_dist_cjs42(); + var credential_provider_ini_1 = require_dist_cjs58(); + var credential_provider_process_1 = require_dist_cjs48(); + var credential_provider_sso_1 = require_dist_cjs56(); + var credential_provider_web_identity_1 = require_dist_cjs57(); var property_provider_1 = require_dist_cjs6(); - var shared_ini_file_loader_1 = require_dist_cjs38(); + var shared_ini_file_loader_1 = require_dist_cjs43(); var remoteProvider_1 = require_remoteProvider(); var defaultProvider = (init = {}) => (0, property_provider_1.memoize)((0, property_provider_1.chain)(...init.profile || process.env[shared_ini_file_loader_1.ENV_PROFILE] ? [] : [(0, credential_provider_env_1.fromEnv)()], (0, credential_provider_sso_1.fromSSO)(init), (0, credential_provider_ini_1.fromIni)(init), (0, credential_provider_process_1.fromProcess)(init), (0, credential_provider_web_identity_1.fromTokenFile)(init), (0, remoteProvider_1.remoteProvider)(init), async () => { throw new property_provider_1.CredentialsProviderError("Could not load credentials from any providers", false); @@ -17899,7 +18621,7 @@ var require_defaultProvider = __commonJS({ }); // ../../../node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js -var require_dist_cjs52 = __commonJS({ +var require_dist_cjs59 = __commonJS({ "../../../node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -17979,9 +18701,9 @@ var require_runtimeConfig_shared3 = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getRuntimeConfig = void 0; - var smithy_client_1 = require_dist_cjs35(); - var url_parser_1 = require_dist_cjs24(); - var util_base64_1 = require_dist_cjs31(); + var smithy_client_1 = require_dist_cjs39(); + var url_parser_1 = require_dist_cjs46(); + var util_base64_1 = require_dist_cjs35(); var util_utf8_1 = require_dist_cjs13(); var endpointResolver_1 = require_endpointResolver3(); var getRuntimeConfig = (config) => ({ @@ -18009,19 +18731,19 @@ var require_runtimeConfig3 = __commonJS({ var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var package_json_1 = tslib_1.__importDefault(require_package2()); var defaultStsRoleAssumers_1 = require_defaultStsRoleAssumers(); - var credential_provider_node_1 = require_dist_cjs52(); - var util_user_agent_node_1 = require_dist_cjs42(); + var credential_provider_node_1 = require_dist_cjs59(); + var util_user_agent_node_1 = require_dist_cjs49(); var config_resolver_1 = require_dist_cjs21(); - var hash_node_1 = require_dist_cjs43(); - var middleware_retry_1 = require_dist_cjs29(); - var node_config_provider_1 = require_dist_cjs39(); - var node_http_handler_1 = require_dist_cjs33(); - var util_body_length_node_1 = require_dist_cjs44(); - var util_retry_1 = require_dist_cjs28(); + var hash_node_1 = require_dist_cjs50(); + var middleware_retry_1 = require_dist_cjs33(); + var node_config_provider_1 = require_dist_cjs44(); + var node_http_handler_1 = require_dist_cjs37(); + var util_body_length_node_1 = require_dist_cjs51(); + var util_retry_1 = require_dist_cjs29(); var runtimeConfig_shared_1 = require_runtimeConfig_shared3(); - var smithy_client_1 = require_dist_cjs35(); - var util_defaults_mode_node_1 = require_dist_cjs45(); - var smithy_client_2 = require_dist_cjs35(); + var smithy_client_1 = require_dist_cjs39(); + var util_defaults_mode_node_1 = require_dist_cjs52(); + var smithy_client_2 = require_dist_cjs39(); var getRuntimeConfig = (config) => { (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); @@ -18061,19 +18783,19 @@ var require_STSClient = __commonJS({ var middleware_host_header_1 = require_dist_cjs3(); var middleware_logger_1 = require_dist_cjs4(); var middleware_recursion_detection_1 = require_dist_cjs5(); - var middleware_sdk_sts_1 = require_dist_cjs36(); + var middleware_sdk_sts_1 = require_dist_cjs40(); var middleware_user_agent_1 = require_dist_cjs19(); var config_resolver_1 = require_dist_cjs21(); var middleware_content_length_1 = require_dist_cjs22(); - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_retry_1 = require_dist_cjs29(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_retry_1 = require_dist_cjs33(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "__Client", { enumerable: true, get: function() { return smithy_client_1.Client; } }); var EndpointParameters_1 = require_EndpointParameters2(); var runtimeConfig_1 = require_runtimeConfig3(); - var STSClient = class extends smithy_client_1.Client { + var STSClient = class _STSClient extends smithy_client_1.Client { constructor(configuration) { const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration); const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0); @@ -18081,7 +18803,7 @@ var require_STSClient = __commonJS({ const _config_3 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_2); const _config_4 = (0, middleware_retry_1.resolveRetryConfig)(_config_3); const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4); - const _config_6 = (0, middleware_sdk_sts_1.resolveStsAuthConfig)(_config_5, { stsClientCtor: STSClient }); + const _config_6 = (0, middleware_sdk_sts_1.resolveStsAuthConfig)(_config_5, { stsClientCtor: _STSClient }); const _config_7 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_6); super(_config_7); this.config = _config_7; @@ -18106,15 +18828,15 @@ var require_AssumeRoleWithSAMLCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AssumeRoleWithSAMLCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_0(); var Aws_query_1 = require_Aws_query(); - var AssumeRoleWithSAMLCommand = class extends smithy_client_1.Command { + var AssumeRoleWithSAMLCommand = class _AssumeRoleWithSAMLCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, @@ -18130,7 +18852,7 @@ var require_AssumeRoleWithSAMLCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, AssumeRoleWithSAMLCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _AssumeRoleWithSAMLCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "STSClient"; @@ -18163,14 +18885,14 @@ var require_DecodeAuthorizationMessageCommand = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.DecodeAuthorizationMessageCommand = exports.$Command = void 0; var middleware_signing_1 = require_dist_cjs16(); - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_query_1 = require_Aws_query(); - var DecodeAuthorizationMessageCommand = class extends smithy_client_1.Command { + var DecodeAuthorizationMessageCommand = class _DecodeAuthorizationMessageCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, @@ -18186,7 +18908,7 @@ var require_DecodeAuthorizationMessageCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DecodeAuthorizationMessageCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _DecodeAuthorizationMessageCommand.getEndpointParameterInstructions())); this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; @@ -18220,14 +18942,14 @@ var require_GetAccessKeyInfoCommand = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.GetAccessKeyInfoCommand = exports.$Command = void 0; var middleware_signing_1 = require_dist_cjs16(); - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_query_1 = require_Aws_query(); - var GetAccessKeyInfoCommand = class extends smithy_client_1.Command { + var GetAccessKeyInfoCommand = class _GetAccessKeyInfoCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, @@ -18243,7 +18965,7 @@ var require_GetAccessKeyInfoCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetAccessKeyInfoCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _GetAccessKeyInfoCommand.getEndpointParameterInstructions())); this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; @@ -18277,14 +18999,14 @@ var require_GetCallerIdentityCommand = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.GetCallerIdentityCommand = exports.$Command = void 0; var middleware_signing_1 = require_dist_cjs16(); - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_query_1 = require_Aws_query(); - var GetCallerIdentityCommand = class extends smithy_client_1.Command { + var GetCallerIdentityCommand = class _GetCallerIdentityCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, @@ -18300,7 +19022,7 @@ var require_GetCallerIdentityCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetCallerIdentityCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _GetCallerIdentityCommand.getEndpointParameterInstructions())); this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; @@ -18334,15 +19056,15 @@ var require_GetFederationTokenCommand = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.GetFederationTokenCommand = exports.$Command = void 0; var middleware_signing_1 = require_dist_cjs16(); - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_0(); var Aws_query_1 = require_Aws_query(); - var GetFederationTokenCommand = class extends smithy_client_1.Command { + var GetFederationTokenCommand = class _GetFederationTokenCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, @@ -18358,7 +19080,7 @@ var require_GetFederationTokenCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetFederationTokenCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _GetFederationTokenCommand.getEndpointParameterInstructions())); this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; @@ -18392,15 +19114,15 @@ var require_GetSessionTokenCommand = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.GetSessionTokenCommand = exports.$Command = void 0; var middleware_signing_1 = require_dist_cjs16(); - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_0(); var Aws_query_1 = require_Aws_query(); - var GetSessionTokenCommand = class extends smithy_client_1.Command { + var GetSessionTokenCommand = class _GetSessionTokenCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, @@ -18416,7 +19138,7 @@ var require_GetSessionTokenCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetSessionTokenCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _GetSessionTokenCommand.getEndpointParameterInstructions())); this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; @@ -18449,7 +19171,7 @@ var require_STS = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.STS = void 0; - var smithy_client_1 = require_dist_cjs35(); + var smithy_client_1 = require_dist_cjs39(); var AssumeRoleCommand_1 = require_AssumeRoleCommand(); var AssumeRoleWithSAMLCommand_1 = require_AssumeRoleWithSAMLCommand(); var AssumeRoleWithWebIdentityCommand_1 = require_AssumeRoleWithWebIdentityCommand(); @@ -18538,7 +19260,7 @@ var require_defaultRoleAssumers = __commonJS({ }); // ../../../node_modules/@aws-sdk/client-sts/dist-cjs/index.js -var require_dist_cjs53 = __commonJS({ +var require_dist_cjs60 = __commonJS({ "../../../node_modules/@aws-sdk/client-sts/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -18612,9 +19334,9 @@ var require_runtimeConfig_shared4 = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getRuntimeConfig = void 0; - var smithy_client_1 = require_dist_cjs35(); - var url_parser_1 = require_dist_cjs24(); - var util_base64_1 = require_dist_cjs31(); + var smithy_client_1 = require_dist_cjs39(); + var url_parser_1 = require_dist_cjs46(); + var util_base64_1 = require_dist_cjs35(); var util_utf8_1 = require_dist_cjs13(); var endpointResolver_1 = require_endpointResolver4(); var getRuntimeConfig = (config) => ({ @@ -18641,20 +19363,20 @@ var require_runtimeConfig4 = __commonJS({ exports.getRuntimeConfig = void 0; var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var package_json_1 = tslib_1.__importDefault(require_package()); - var client_sts_1 = require_dist_cjs53(); - var credential_provider_node_1 = require_dist_cjs52(); - var util_user_agent_node_1 = require_dist_cjs42(); + var client_sts_1 = require_dist_cjs60(); + var credential_provider_node_1 = require_dist_cjs59(); + var util_user_agent_node_1 = require_dist_cjs49(); var config_resolver_1 = require_dist_cjs21(); - var hash_node_1 = require_dist_cjs43(); - var middleware_retry_1 = require_dist_cjs29(); - var node_config_provider_1 = require_dist_cjs39(); - var node_http_handler_1 = require_dist_cjs33(); - var util_body_length_node_1 = require_dist_cjs44(); - var util_retry_1 = require_dist_cjs28(); + var hash_node_1 = require_dist_cjs50(); + var middleware_retry_1 = require_dist_cjs33(); + var node_config_provider_1 = require_dist_cjs44(); + var node_http_handler_1 = require_dist_cjs37(); + var util_body_length_node_1 = require_dist_cjs51(); + var util_retry_1 = require_dist_cjs29(); var runtimeConfig_shared_1 = require_runtimeConfig_shared4(); - var smithy_client_1 = require_dist_cjs35(); - var util_defaults_mode_node_1 = require_dist_cjs45(); - var smithy_client_2 = require_dist_cjs35(); + var smithy_client_1 = require_dist_cjs39(); + var util_defaults_mode_node_1 = require_dist_cjs52(); + var smithy_client_2 = require_dist_cjs39(); var getRuntimeConfig = (config) => { (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); @@ -18698,9 +19420,9 @@ var require_SFNClient = __commonJS({ var middleware_user_agent_1 = require_dist_cjs19(); var config_resolver_1 = require_dist_cjs21(); var middleware_content_length_1 = require_dist_cjs22(); - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_retry_1 = require_dist_cjs29(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_retry_1 = require_dist_cjs33(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "__Client", { enumerable: true, get: function() { return smithy_client_1.Client; } }); @@ -18740,14 +19462,14 @@ var require_SFNServiceException = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SFNServiceException = exports.__ServiceException = void 0; - var smithy_client_1 = require_dist_cjs35(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "__ServiceException", { enumerable: true, get: function() { return smithy_client_1.ServiceException; } }); - var SFNServiceException = class extends smithy_client_1.ServiceException { + var SFNServiceException = class _SFNServiceException extends smithy_client_1.ServiceException { constructor(options) { super(options); - Object.setPrototypeOf(this, SFNServiceException.prototype); + Object.setPrototypeOf(this, _SFNServiceException.prototype); } }; exports.SFNServiceException = SFNServiceException; @@ -18761,9 +19483,9 @@ var require_models_04 = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.ExecutionStartedEventDetailsFilterSensitiveLog = exports.ExecutionFailedEventDetailsFilterSensitiveLog = exports.ExecutionAbortedEventDetailsFilterSensitiveLog = exports.GetActivityTaskOutputFilterSensitiveLog = exports.DescribeStateMachineForExecutionOutputFilterSensitiveLog = exports.DescribeStateMachineAliasOutputFilterSensitiveLog = exports.DescribeStateMachineOutputFilterSensitiveLog = exports.DescribeExecutionOutputFilterSensitiveLog = exports.CreateStateMachineAliasInputFilterSensitiveLog = exports.CreateStateMachineInputFilterSensitiveLog = exports.ActivityTimedOutEventDetailsFilterSensitiveLog = exports.ActivitySucceededEventDetailsFilterSensitiveLog = exports.ActivityScheduleFailedEventDetailsFilterSensitiveLog = exports.ActivityScheduledEventDetailsFilterSensitiveLog = exports.ActivityFailedEventDetailsFilterSensitiveLog = exports.MissingRequiredParameter = exports.SyncExecutionStatus = exports.InvalidExecutionInput = exports.ExecutionLimitExceeded = exports.ExecutionAlreadyExists = exports.InvalidOutput = exports.TaskTimedOut = exports.TaskDoesNotExist = exports.InvalidToken = exports.HistoryEventType = exports.StateMachineDoesNotExist = exports.StateMachineStatus = exports.MapRunStatus = exports.ExecutionDoesNotExist = exports.ExecutionStatus = exports.ServiceQuotaExceededException = exports.ResourceNotFound = exports.ValidationException = exports.ValidationExceptionReason = exports.StateMachineTypeNotSupported = exports.StateMachineLimitExceeded = exports.StateMachineDeleting = exports.StateMachineAlreadyExists = exports.InvalidTracingConfiguration = exports.InvalidLoggingConfiguration = exports.InvalidDefinition = exports.InvalidArn = exports.StateMachineType = exports.LogLevel = exports.ConflictException = exports.TooManyTags = exports.InvalidName = exports.ActivityWorkerLimitExceeded = exports.ActivityLimitExceeded = exports.ActivityDoesNotExist = void 0; exports.UpdateStateMachineAliasInputFilterSensitiveLog = exports.UpdateStateMachineInputFilterSensitiveLog = exports.StopExecutionInputFilterSensitiveLog = exports.StartSyncExecutionOutputFilterSensitiveLog = exports.StartSyncExecutionInputFilterSensitiveLog = exports.StartExecutionInputFilterSensitiveLog = exports.SendTaskSuccessInputFilterSensitiveLog = exports.SendTaskFailureInputFilterSensitiveLog = exports.PublishStateMachineVersionInputFilterSensitiveLog = exports.GetExecutionHistoryOutputFilterSensitiveLog = exports.HistoryEventFilterSensitiveLog = exports.TaskTimedOutEventDetailsFilterSensitiveLog = exports.TaskSucceededEventDetailsFilterSensitiveLog = exports.TaskSubmittedEventDetailsFilterSensitiveLog = exports.TaskSubmitFailedEventDetailsFilterSensitiveLog = exports.TaskStartFailedEventDetailsFilterSensitiveLog = exports.TaskScheduledEventDetailsFilterSensitiveLog = exports.TaskFailedEventDetailsFilterSensitiveLog = exports.StateExitedEventDetailsFilterSensitiveLog = exports.StateEnteredEventDetailsFilterSensitiveLog = exports.MapRunFailedEventDetailsFilterSensitiveLog = exports.LambdaFunctionTimedOutEventDetailsFilterSensitiveLog = exports.LambdaFunctionSucceededEventDetailsFilterSensitiveLog = exports.LambdaFunctionStartFailedEventDetailsFilterSensitiveLog = exports.LambdaFunctionScheduleFailedEventDetailsFilterSensitiveLog = exports.LambdaFunctionScheduledEventDetailsFilterSensitiveLog = exports.LambdaFunctionFailedEventDetailsFilterSensitiveLog = exports.ExecutionTimedOutEventDetailsFilterSensitiveLog = exports.ExecutionSucceededEventDetailsFilterSensitiveLog = void 0; - var smithy_client_1 = require_dist_cjs35(); + var smithy_client_1 = require_dist_cjs39(); var SFNServiceException_1 = require_SFNServiceException(); - var ActivityDoesNotExist = class extends SFNServiceException_1.SFNServiceException { + var ActivityDoesNotExist = class _ActivityDoesNotExist extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "ActivityDoesNotExist", @@ -18772,11 +19494,11 @@ var require_models_04 = __commonJS({ }); this.name = "ActivityDoesNotExist"; this.$fault = "client"; - Object.setPrototypeOf(this, ActivityDoesNotExist.prototype); + Object.setPrototypeOf(this, _ActivityDoesNotExist.prototype); } }; exports.ActivityDoesNotExist = ActivityDoesNotExist; - var ActivityLimitExceeded = class extends SFNServiceException_1.SFNServiceException { + var ActivityLimitExceeded = class _ActivityLimitExceeded extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "ActivityLimitExceeded", @@ -18785,11 +19507,11 @@ var require_models_04 = __commonJS({ }); this.name = "ActivityLimitExceeded"; this.$fault = "client"; - Object.setPrototypeOf(this, ActivityLimitExceeded.prototype); + Object.setPrototypeOf(this, _ActivityLimitExceeded.prototype); } }; exports.ActivityLimitExceeded = ActivityLimitExceeded; - var ActivityWorkerLimitExceeded = class extends SFNServiceException_1.SFNServiceException { + var ActivityWorkerLimitExceeded = class _ActivityWorkerLimitExceeded extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "ActivityWorkerLimitExceeded", @@ -18798,11 +19520,11 @@ var require_models_04 = __commonJS({ }); this.name = "ActivityWorkerLimitExceeded"; this.$fault = "client"; - Object.setPrototypeOf(this, ActivityWorkerLimitExceeded.prototype); + Object.setPrototypeOf(this, _ActivityWorkerLimitExceeded.prototype); } }; exports.ActivityWorkerLimitExceeded = ActivityWorkerLimitExceeded; - var InvalidName = class extends SFNServiceException_1.SFNServiceException { + var InvalidName = class _InvalidName extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "InvalidName", @@ -18811,11 +19533,11 @@ var require_models_04 = __commonJS({ }); this.name = "InvalidName"; this.$fault = "client"; - Object.setPrototypeOf(this, InvalidName.prototype); + Object.setPrototypeOf(this, _InvalidName.prototype); } }; exports.InvalidName = InvalidName; - var TooManyTags = class extends SFNServiceException_1.SFNServiceException { + var TooManyTags = class _TooManyTags extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "TooManyTags", @@ -18824,12 +19546,12 @@ var require_models_04 = __commonJS({ }); this.name = "TooManyTags"; this.$fault = "client"; - Object.setPrototypeOf(this, TooManyTags.prototype); + Object.setPrototypeOf(this, _TooManyTags.prototype); this.resourceName = opts.resourceName; } }; exports.TooManyTags = TooManyTags; - var ConflictException = class extends SFNServiceException_1.SFNServiceException { + var ConflictException = class _ConflictException extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "ConflictException", @@ -18838,7 +19560,7 @@ var require_models_04 = __commonJS({ }); this.name = "ConflictException"; this.$fault = "client"; - Object.setPrototypeOf(this, ConflictException.prototype); + Object.setPrototypeOf(this, _ConflictException.prototype); } }; exports.ConflictException = ConflictException; @@ -18852,7 +19574,7 @@ var require_models_04 = __commonJS({ EXPRESS: "EXPRESS", STANDARD: "STANDARD" }; - var InvalidArn = class extends SFNServiceException_1.SFNServiceException { + var InvalidArn = class _InvalidArn extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "InvalidArn", @@ -18861,11 +19583,11 @@ var require_models_04 = __commonJS({ }); this.name = "InvalidArn"; this.$fault = "client"; - Object.setPrototypeOf(this, InvalidArn.prototype); + Object.setPrototypeOf(this, _InvalidArn.prototype); } }; exports.InvalidArn = InvalidArn; - var InvalidDefinition = class extends SFNServiceException_1.SFNServiceException { + var InvalidDefinition = class _InvalidDefinition extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "InvalidDefinition", @@ -18874,11 +19596,11 @@ var require_models_04 = __commonJS({ }); this.name = "InvalidDefinition"; this.$fault = "client"; - Object.setPrototypeOf(this, InvalidDefinition.prototype); + Object.setPrototypeOf(this, _InvalidDefinition.prototype); } }; exports.InvalidDefinition = InvalidDefinition; - var InvalidLoggingConfiguration = class extends SFNServiceException_1.SFNServiceException { + var InvalidLoggingConfiguration = class _InvalidLoggingConfiguration extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "InvalidLoggingConfiguration", @@ -18887,11 +19609,11 @@ var require_models_04 = __commonJS({ }); this.name = "InvalidLoggingConfiguration"; this.$fault = "client"; - Object.setPrototypeOf(this, InvalidLoggingConfiguration.prototype); + Object.setPrototypeOf(this, _InvalidLoggingConfiguration.prototype); } }; exports.InvalidLoggingConfiguration = InvalidLoggingConfiguration; - var InvalidTracingConfiguration = class extends SFNServiceException_1.SFNServiceException { + var InvalidTracingConfiguration = class _InvalidTracingConfiguration extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "InvalidTracingConfiguration", @@ -18900,11 +19622,11 @@ var require_models_04 = __commonJS({ }); this.name = "InvalidTracingConfiguration"; this.$fault = "client"; - Object.setPrototypeOf(this, InvalidTracingConfiguration.prototype); + Object.setPrototypeOf(this, _InvalidTracingConfiguration.prototype); } }; exports.InvalidTracingConfiguration = InvalidTracingConfiguration; - var StateMachineAlreadyExists = class extends SFNServiceException_1.SFNServiceException { + var StateMachineAlreadyExists = class _StateMachineAlreadyExists extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "StateMachineAlreadyExists", @@ -18913,11 +19635,11 @@ var require_models_04 = __commonJS({ }); this.name = "StateMachineAlreadyExists"; this.$fault = "client"; - Object.setPrototypeOf(this, StateMachineAlreadyExists.prototype); + Object.setPrototypeOf(this, _StateMachineAlreadyExists.prototype); } }; exports.StateMachineAlreadyExists = StateMachineAlreadyExists; - var StateMachineDeleting = class extends SFNServiceException_1.SFNServiceException { + var StateMachineDeleting = class _StateMachineDeleting extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "StateMachineDeleting", @@ -18926,11 +19648,11 @@ var require_models_04 = __commonJS({ }); this.name = "StateMachineDeleting"; this.$fault = "client"; - Object.setPrototypeOf(this, StateMachineDeleting.prototype); + Object.setPrototypeOf(this, _StateMachineDeleting.prototype); } }; exports.StateMachineDeleting = StateMachineDeleting; - var StateMachineLimitExceeded = class extends SFNServiceException_1.SFNServiceException { + var StateMachineLimitExceeded = class _StateMachineLimitExceeded extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "StateMachineLimitExceeded", @@ -18939,11 +19661,11 @@ var require_models_04 = __commonJS({ }); this.name = "StateMachineLimitExceeded"; this.$fault = "client"; - Object.setPrototypeOf(this, StateMachineLimitExceeded.prototype); + Object.setPrototypeOf(this, _StateMachineLimitExceeded.prototype); } }; exports.StateMachineLimitExceeded = StateMachineLimitExceeded; - var StateMachineTypeNotSupported = class extends SFNServiceException_1.SFNServiceException { + var StateMachineTypeNotSupported = class _StateMachineTypeNotSupported extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "StateMachineTypeNotSupported", @@ -18952,7 +19674,7 @@ var require_models_04 = __commonJS({ }); this.name = "StateMachineTypeNotSupported"; this.$fault = "client"; - Object.setPrototypeOf(this, StateMachineTypeNotSupported.prototype); + Object.setPrototypeOf(this, _StateMachineTypeNotSupported.prototype); } }; exports.StateMachineTypeNotSupported = StateMachineTypeNotSupported; @@ -18962,7 +19684,7 @@ var require_models_04 = __commonJS({ INVALID_ROUTING_CONFIGURATION: "INVALID_ROUTING_CONFIGURATION", MISSING_REQUIRED_PARAMETER: "MISSING_REQUIRED_PARAMETER" }; - var ValidationException = class extends SFNServiceException_1.SFNServiceException { + var ValidationException = class _ValidationException extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "ValidationException", @@ -18971,12 +19693,12 @@ var require_models_04 = __commonJS({ }); this.name = "ValidationException"; this.$fault = "client"; - Object.setPrototypeOf(this, ValidationException.prototype); + Object.setPrototypeOf(this, _ValidationException.prototype); this.reason = opts.reason; } }; exports.ValidationException = ValidationException; - var ResourceNotFound = class extends SFNServiceException_1.SFNServiceException { + var ResourceNotFound = class _ResourceNotFound extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "ResourceNotFound", @@ -18985,12 +19707,12 @@ var require_models_04 = __commonJS({ }); this.name = "ResourceNotFound"; this.$fault = "client"; - Object.setPrototypeOf(this, ResourceNotFound.prototype); + Object.setPrototypeOf(this, _ResourceNotFound.prototype); this.resourceName = opts.resourceName; } }; exports.ResourceNotFound = ResourceNotFound; - var ServiceQuotaExceededException = class extends SFNServiceException_1.SFNServiceException { + var ServiceQuotaExceededException = class _ServiceQuotaExceededException extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "ServiceQuotaExceededException", @@ -18999,7 +19721,7 @@ var require_models_04 = __commonJS({ }); this.name = "ServiceQuotaExceededException"; this.$fault = "client"; - Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype); + Object.setPrototypeOf(this, _ServiceQuotaExceededException.prototype); } }; exports.ServiceQuotaExceededException = ServiceQuotaExceededException; @@ -19010,7 +19732,7 @@ var require_models_04 = __commonJS({ SUCCEEDED: "SUCCEEDED", TIMED_OUT: "TIMED_OUT" }; - var ExecutionDoesNotExist = class extends SFNServiceException_1.SFNServiceException { + var ExecutionDoesNotExist = class _ExecutionDoesNotExist extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "ExecutionDoesNotExist", @@ -19019,7 +19741,7 @@ var require_models_04 = __commonJS({ }); this.name = "ExecutionDoesNotExist"; this.$fault = "client"; - Object.setPrototypeOf(this, ExecutionDoesNotExist.prototype); + Object.setPrototypeOf(this, _ExecutionDoesNotExist.prototype); } }; exports.ExecutionDoesNotExist = ExecutionDoesNotExist; @@ -19033,7 +19755,7 @@ var require_models_04 = __commonJS({ ACTIVE: "ACTIVE", DELETING: "DELETING" }; - var StateMachineDoesNotExist = class extends SFNServiceException_1.SFNServiceException { + var StateMachineDoesNotExist = class _StateMachineDoesNotExist extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "StateMachineDoesNotExist", @@ -19042,7 +19764,7 @@ var require_models_04 = __commonJS({ }); this.name = "StateMachineDoesNotExist"; this.$fault = "client"; - Object.setPrototypeOf(this, StateMachineDoesNotExist.prototype); + Object.setPrototypeOf(this, _StateMachineDoesNotExist.prototype); } }; exports.StateMachineDoesNotExist = StateMachineDoesNotExist; @@ -19107,7 +19829,7 @@ var require_models_04 = __commonJS({ WaitStateEntered: "WaitStateEntered", WaitStateExited: "WaitStateExited" }; - var InvalidToken = class extends SFNServiceException_1.SFNServiceException { + var InvalidToken = class _InvalidToken extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "InvalidToken", @@ -19116,11 +19838,11 @@ var require_models_04 = __commonJS({ }); this.name = "InvalidToken"; this.$fault = "client"; - Object.setPrototypeOf(this, InvalidToken.prototype); + Object.setPrototypeOf(this, _InvalidToken.prototype); } }; exports.InvalidToken = InvalidToken; - var TaskDoesNotExist = class extends SFNServiceException_1.SFNServiceException { + var TaskDoesNotExist = class _TaskDoesNotExist extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "TaskDoesNotExist", @@ -19129,11 +19851,11 @@ var require_models_04 = __commonJS({ }); this.name = "TaskDoesNotExist"; this.$fault = "client"; - Object.setPrototypeOf(this, TaskDoesNotExist.prototype); + Object.setPrototypeOf(this, _TaskDoesNotExist.prototype); } }; exports.TaskDoesNotExist = TaskDoesNotExist; - var TaskTimedOut = class extends SFNServiceException_1.SFNServiceException { + var TaskTimedOut = class _TaskTimedOut extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "TaskTimedOut", @@ -19142,11 +19864,11 @@ var require_models_04 = __commonJS({ }); this.name = "TaskTimedOut"; this.$fault = "client"; - Object.setPrototypeOf(this, TaskTimedOut.prototype); + Object.setPrototypeOf(this, _TaskTimedOut.prototype); } }; exports.TaskTimedOut = TaskTimedOut; - var InvalidOutput = class extends SFNServiceException_1.SFNServiceException { + var InvalidOutput = class _InvalidOutput extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "InvalidOutput", @@ -19155,11 +19877,11 @@ var require_models_04 = __commonJS({ }); this.name = "InvalidOutput"; this.$fault = "client"; - Object.setPrototypeOf(this, InvalidOutput.prototype); + Object.setPrototypeOf(this, _InvalidOutput.prototype); } }; exports.InvalidOutput = InvalidOutput; - var ExecutionAlreadyExists = class extends SFNServiceException_1.SFNServiceException { + var ExecutionAlreadyExists = class _ExecutionAlreadyExists extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "ExecutionAlreadyExists", @@ -19168,11 +19890,11 @@ var require_models_04 = __commonJS({ }); this.name = "ExecutionAlreadyExists"; this.$fault = "client"; - Object.setPrototypeOf(this, ExecutionAlreadyExists.prototype); + Object.setPrototypeOf(this, _ExecutionAlreadyExists.prototype); } }; exports.ExecutionAlreadyExists = ExecutionAlreadyExists; - var ExecutionLimitExceeded = class extends SFNServiceException_1.SFNServiceException { + var ExecutionLimitExceeded = class _ExecutionLimitExceeded extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "ExecutionLimitExceeded", @@ -19181,11 +19903,11 @@ var require_models_04 = __commonJS({ }); this.name = "ExecutionLimitExceeded"; this.$fault = "client"; - Object.setPrototypeOf(this, ExecutionLimitExceeded.prototype); + Object.setPrototypeOf(this, _ExecutionLimitExceeded.prototype); } }; exports.ExecutionLimitExceeded = ExecutionLimitExceeded; - var InvalidExecutionInput = class extends SFNServiceException_1.SFNServiceException { + var InvalidExecutionInput = class _InvalidExecutionInput extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "InvalidExecutionInput", @@ -19194,7 +19916,7 @@ var require_models_04 = __commonJS({ }); this.name = "InvalidExecutionInput"; this.$fault = "client"; - Object.setPrototypeOf(this, InvalidExecutionInput.prototype); + Object.setPrototypeOf(this, _InvalidExecutionInput.prototype); } }; exports.InvalidExecutionInput = InvalidExecutionInput; @@ -19203,7 +19925,7 @@ var require_models_04 = __commonJS({ SUCCEEDED: "SUCCEEDED", TIMED_OUT: "TIMED_OUT" }; - var MissingRequiredParameter = class extends SFNServiceException_1.SFNServiceException { + var MissingRequiredParameter = class _MissingRequiredParameter extends SFNServiceException_1.SFNServiceException { constructor(opts) { super({ name: "MissingRequiredParameter", @@ -19212,7 +19934,7 @@ var require_models_04 = __commonJS({ }); this.name = "MissingRequiredParameter"; this.$fault = "client"; - Object.setPrototypeOf(this, MissingRequiredParameter.prototype); + Object.setPrototypeOf(this, _MissingRequiredParameter.prototype); } }; exports.MissingRequiredParameter = MissingRequiredParameter; @@ -19550,7 +20272,7 @@ var require_Aws_json1_0 = __commonJS({ exports.de_ListActivitiesCommand = exports.de_GetExecutionHistoryCommand = exports.de_GetActivityTaskCommand = exports.de_DescribeStateMachineForExecutionCommand = exports.de_DescribeStateMachineAliasCommand = exports.de_DescribeStateMachineCommand = exports.de_DescribeMapRunCommand = exports.de_DescribeExecutionCommand = exports.de_DescribeActivityCommand = exports.de_DeleteStateMachineVersionCommand = exports.de_DeleteStateMachineAliasCommand = exports.de_DeleteStateMachineCommand = exports.de_DeleteActivityCommand = exports.de_CreateStateMachineAliasCommand = exports.de_CreateStateMachineCommand = exports.de_CreateActivityCommand = exports.se_UpdateStateMachineAliasCommand = exports.se_UpdateStateMachineCommand = exports.se_UpdateMapRunCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_StopExecutionCommand = exports.se_StartSyncExecutionCommand = exports.se_StartExecutionCommand = exports.se_SendTaskSuccessCommand = exports.se_SendTaskHeartbeatCommand = exports.se_SendTaskFailureCommand = exports.se_PublishStateMachineVersionCommand = exports.se_ListTagsForResourceCommand = exports.se_ListStateMachineVersionsCommand = exports.se_ListStateMachinesCommand = exports.se_ListStateMachineAliasesCommand = exports.se_ListMapRunsCommand = exports.se_ListExecutionsCommand = exports.se_ListActivitiesCommand = exports.se_GetExecutionHistoryCommand = exports.se_GetActivityTaskCommand = exports.se_DescribeStateMachineForExecutionCommand = exports.se_DescribeStateMachineAliasCommand = exports.se_DescribeStateMachineCommand = exports.se_DescribeMapRunCommand = exports.se_DescribeExecutionCommand = exports.se_DescribeActivityCommand = exports.se_DeleteStateMachineVersionCommand = exports.se_DeleteStateMachineAliasCommand = exports.se_DeleteStateMachineCommand = exports.se_DeleteActivityCommand = exports.se_CreateStateMachineAliasCommand = exports.se_CreateStateMachineCommand = exports.se_CreateActivityCommand = void 0; exports.de_UpdateStateMachineAliasCommand = exports.de_UpdateStateMachineCommand = exports.de_UpdateMapRunCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_StopExecutionCommand = exports.de_StartSyncExecutionCommand = exports.de_StartExecutionCommand = exports.de_SendTaskSuccessCommand = exports.de_SendTaskHeartbeatCommand = exports.de_SendTaskFailureCommand = exports.de_PublishStateMachineVersionCommand = exports.de_ListTagsForResourceCommand = exports.de_ListStateMachineVersionsCommand = exports.de_ListStateMachinesCommand = exports.de_ListStateMachineAliasesCommand = exports.de_ListMapRunsCommand = exports.de_ListExecutionsCommand = void 0; var protocol_http_1 = require_dist_cjs2(); - var smithy_client_1 = require_dist_cjs35(); + var smithy_client_1 = require_dist_cjs39(); var models_0_1 = require_models_04(); var SFNServiceException_1 = require_SFNServiceException(); var se_CreateActivityCommand = async (input, context) => { @@ -21854,14 +22576,14 @@ var require_CreateActivityCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CreateActivityCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_json1_0_1 = require_Aws_json1_0(); - var CreateActivityCommand = class extends smithy_client_1.Command { + var CreateActivityCommand = class _CreateActivityCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -21876,7 +22598,7 @@ var require_CreateActivityCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, CreateActivityCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _CreateActivityCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -21908,15 +22630,15 @@ var require_CreateStateMachineAliasCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CreateStateMachineAliasCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_04(); var Aws_json1_0_1 = require_Aws_json1_0(); - var CreateStateMachineAliasCommand = class extends smithy_client_1.Command { + var CreateStateMachineAliasCommand = class _CreateStateMachineAliasCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -21931,7 +22653,7 @@ var require_CreateStateMachineAliasCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, CreateStateMachineAliasCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _CreateStateMachineAliasCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -21963,15 +22685,15 @@ var require_CreateStateMachineCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CreateStateMachineCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_04(); var Aws_json1_0_1 = require_Aws_json1_0(); - var CreateStateMachineCommand = class extends smithy_client_1.Command { + var CreateStateMachineCommand = class _CreateStateMachineCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -21986,7 +22708,7 @@ var require_CreateStateMachineCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, CreateStateMachineCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _CreateStateMachineCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -22018,14 +22740,14 @@ var require_DeleteActivityCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DeleteActivityCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_json1_0_1 = require_Aws_json1_0(); - var DeleteActivityCommand = class extends smithy_client_1.Command { + var DeleteActivityCommand = class _DeleteActivityCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -22040,7 +22762,7 @@ var require_DeleteActivityCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DeleteActivityCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _DeleteActivityCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -22072,14 +22794,14 @@ var require_DeleteStateMachineAliasCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DeleteStateMachineAliasCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_json1_0_1 = require_Aws_json1_0(); - var DeleteStateMachineAliasCommand = class extends smithy_client_1.Command { + var DeleteStateMachineAliasCommand = class _DeleteStateMachineAliasCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -22094,7 +22816,7 @@ var require_DeleteStateMachineAliasCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DeleteStateMachineAliasCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _DeleteStateMachineAliasCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -22126,14 +22848,14 @@ var require_DeleteStateMachineCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DeleteStateMachineCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_json1_0_1 = require_Aws_json1_0(); - var DeleteStateMachineCommand = class extends smithy_client_1.Command { + var DeleteStateMachineCommand = class _DeleteStateMachineCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -22148,7 +22870,7 @@ var require_DeleteStateMachineCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DeleteStateMachineCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _DeleteStateMachineCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -22180,14 +22902,14 @@ var require_DeleteStateMachineVersionCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DeleteStateMachineVersionCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_json1_0_1 = require_Aws_json1_0(); - var DeleteStateMachineVersionCommand = class extends smithy_client_1.Command { + var DeleteStateMachineVersionCommand = class _DeleteStateMachineVersionCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -22202,7 +22924,7 @@ var require_DeleteStateMachineVersionCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DeleteStateMachineVersionCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _DeleteStateMachineVersionCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -22234,14 +22956,14 @@ var require_DescribeActivityCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DescribeActivityCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_json1_0_1 = require_Aws_json1_0(); - var DescribeActivityCommand = class extends smithy_client_1.Command { + var DescribeActivityCommand = class _DescribeActivityCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -22256,7 +22978,7 @@ var require_DescribeActivityCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DescribeActivityCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _DescribeActivityCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -22288,15 +23010,15 @@ var require_DescribeExecutionCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DescribeExecutionCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_04(); var Aws_json1_0_1 = require_Aws_json1_0(); - var DescribeExecutionCommand = class extends smithy_client_1.Command { + var DescribeExecutionCommand = class _DescribeExecutionCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -22311,7 +23033,7 @@ var require_DescribeExecutionCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DescribeExecutionCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _DescribeExecutionCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -22343,14 +23065,14 @@ var require_DescribeMapRunCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DescribeMapRunCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_json1_0_1 = require_Aws_json1_0(); - var DescribeMapRunCommand = class extends smithy_client_1.Command { + var DescribeMapRunCommand = class _DescribeMapRunCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -22365,7 +23087,7 @@ var require_DescribeMapRunCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DescribeMapRunCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _DescribeMapRunCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -22397,15 +23119,15 @@ var require_DescribeStateMachineAliasCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DescribeStateMachineAliasCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_04(); var Aws_json1_0_1 = require_Aws_json1_0(); - var DescribeStateMachineAliasCommand = class extends smithy_client_1.Command { + var DescribeStateMachineAliasCommand = class _DescribeStateMachineAliasCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -22420,7 +23142,7 @@ var require_DescribeStateMachineAliasCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DescribeStateMachineAliasCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _DescribeStateMachineAliasCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -22452,15 +23174,15 @@ var require_DescribeStateMachineCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DescribeStateMachineCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_04(); var Aws_json1_0_1 = require_Aws_json1_0(); - var DescribeStateMachineCommand = class extends smithy_client_1.Command { + var DescribeStateMachineCommand = class _DescribeStateMachineCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -22475,7 +23197,7 @@ var require_DescribeStateMachineCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DescribeStateMachineCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _DescribeStateMachineCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -22507,15 +23229,15 @@ var require_DescribeStateMachineForExecutionCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DescribeStateMachineForExecutionCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_04(); var Aws_json1_0_1 = require_Aws_json1_0(); - var DescribeStateMachineForExecutionCommand = class extends smithy_client_1.Command { + var DescribeStateMachineForExecutionCommand = class _DescribeStateMachineForExecutionCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -22530,7 +23252,7 @@ var require_DescribeStateMachineForExecutionCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DescribeStateMachineForExecutionCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _DescribeStateMachineForExecutionCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -22562,15 +23284,15 @@ var require_GetActivityTaskCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetActivityTaskCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_04(); var Aws_json1_0_1 = require_Aws_json1_0(); - var GetActivityTaskCommand = class extends smithy_client_1.Command { + var GetActivityTaskCommand = class _GetActivityTaskCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -22585,7 +23307,7 @@ var require_GetActivityTaskCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetActivityTaskCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _GetActivityTaskCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -22617,15 +23339,15 @@ var require_GetExecutionHistoryCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetExecutionHistoryCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_04(); var Aws_json1_0_1 = require_Aws_json1_0(); - var GetExecutionHistoryCommand = class extends smithy_client_1.Command { + var GetExecutionHistoryCommand = class _GetExecutionHistoryCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -22640,7 +23362,7 @@ var require_GetExecutionHistoryCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetExecutionHistoryCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _GetExecutionHistoryCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -22672,14 +23394,14 @@ var require_ListActivitiesCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ListActivitiesCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_json1_0_1 = require_Aws_json1_0(); - var ListActivitiesCommand = class extends smithy_client_1.Command { + var ListActivitiesCommand = class _ListActivitiesCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -22694,7 +23416,7 @@ var require_ListActivitiesCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListActivitiesCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _ListActivitiesCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -22726,14 +23448,14 @@ var require_ListExecutionsCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ListExecutionsCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_json1_0_1 = require_Aws_json1_0(); - var ListExecutionsCommand = class extends smithy_client_1.Command { + var ListExecutionsCommand = class _ListExecutionsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -22748,7 +23470,7 @@ var require_ListExecutionsCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListExecutionsCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _ListExecutionsCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -22780,14 +23502,14 @@ var require_ListMapRunsCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ListMapRunsCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_json1_0_1 = require_Aws_json1_0(); - var ListMapRunsCommand = class extends smithy_client_1.Command { + var ListMapRunsCommand = class _ListMapRunsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -22802,7 +23524,7 @@ var require_ListMapRunsCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListMapRunsCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _ListMapRunsCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -22834,14 +23556,14 @@ var require_ListStateMachineAliasesCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ListStateMachineAliasesCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_json1_0_1 = require_Aws_json1_0(); - var ListStateMachineAliasesCommand = class extends smithy_client_1.Command { + var ListStateMachineAliasesCommand = class _ListStateMachineAliasesCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -22856,7 +23578,7 @@ var require_ListStateMachineAliasesCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListStateMachineAliasesCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _ListStateMachineAliasesCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -22888,14 +23610,14 @@ var require_ListStateMachinesCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ListStateMachinesCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_json1_0_1 = require_Aws_json1_0(); - var ListStateMachinesCommand = class extends smithy_client_1.Command { + var ListStateMachinesCommand = class _ListStateMachinesCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -22910,7 +23632,7 @@ var require_ListStateMachinesCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListStateMachinesCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _ListStateMachinesCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -22942,14 +23664,14 @@ var require_ListStateMachineVersionsCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ListStateMachineVersionsCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_json1_0_1 = require_Aws_json1_0(); - var ListStateMachineVersionsCommand = class extends smithy_client_1.Command { + var ListStateMachineVersionsCommand = class _ListStateMachineVersionsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -22964,7 +23686,7 @@ var require_ListStateMachineVersionsCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListStateMachineVersionsCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _ListStateMachineVersionsCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -22996,14 +23718,14 @@ var require_ListTagsForResourceCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ListTagsForResourceCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_json1_0_1 = require_Aws_json1_0(); - var ListTagsForResourceCommand = class extends smithy_client_1.Command { + var ListTagsForResourceCommand = class _ListTagsForResourceCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -23018,7 +23740,7 @@ var require_ListTagsForResourceCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListTagsForResourceCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _ListTagsForResourceCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -23050,15 +23772,15 @@ var require_PublishStateMachineVersionCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PublishStateMachineVersionCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_04(); var Aws_json1_0_1 = require_Aws_json1_0(); - var PublishStateMachineVersionCommand = class extends smithy_client_1.Command { + var PublishStateMachineVersionCommand = class _PublishStateMachineVersionCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -23073,7 +23795,7 @@ var require_PublishStateMachineVersionCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, PublishStateMachineVersionCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _PublishStateMachineVersionCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -23105,15 +23827,15 @@ var require_SendTaskFailureCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SendTaskFailureCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_04(); var Aws_json1_0_1 = require_Aws_json1_0(); - var SendTaskFailureCommand = class extends smithy_client_1.Command { + var SendTaskFailureCommand = class _SendTaskFailureCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -23128,7 +23850,7 @@ var require_SendTaskFailureCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, SendTaskFailureCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _SendTaskFailureCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -23160,14 +23882,14 @@ var require_SendTaskHeartbeatCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SendTaskHeartbeatCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_json1_0_1 = require_Aws_json1_0(); - var SendTaskHeartbeatCommand = class extends smithy_client_1.Command { + var SendTaskHeartbeatCommand = class _SendTaskHeartbeatCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -23182,7 +23904,7 @@ var require_SendTaskHeartbeatCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, SendTaskHeartbeatCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _SendTaskHeartbeatCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -23214,15 +23936,15 @@ var require_SendTaskSuccessCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SendTaskSuccessCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_04(); var Aws_json1_0_1 = require_Aws_json1_0(); - var SendTaskSuccessCommand = class extends smithy_client_1.Command { + var SendTaskSuccessCommand = class _SendTaskSuccessCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -23237,7 +23959,7 @@ var require_SendTaskSuccessCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, SendTaskSuccessCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _SendTaskSuccessCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -23269,15 +23991,15 @@ var require_StartExecutionCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StartExecutionCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_04(); var Aws_json1_0_1 = require_Aws_json1_0(); - var StartExecutionCommand = class extends smithy_client_1.Command { + var StartExecutionCommand = class _StartExecutionCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -23292,7 +24014,7 @@ var require_StartExecutionCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, StartExecutionCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _StartExecutionCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -23324,15 +24046,15 @@ var require_StartSyncExecutionCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StartSyncExecutionCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_04(); var Aws_json1_0_1 = require_Aws_json1_0(); - var StartSyncExecutionCommand = class extends smithy_client_1.Command { + var StartSyncExecutionCommand = class _StartSyncExecutionCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -23347,7 +24069,7 @@ var require_StartSyncExecutionCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, StartSyncExecutionCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _StartSyncExecutionCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -23379,15 +24101,15 @@ var require_StopExecutionCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StopExecutionCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_04(); var Aws_json1_0_1 = require_Aws_json1_0(); - var StopExecutionCommand = class extends smithy_client_1.Command { + var StopExecutionCommand = class _StopExecutionCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -23402,7 +24124,7 @@ var require_StopExecutionCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, StopExecutionCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _StopExecutionCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -23434,14 +24156,14 @@ var require_TagResourceCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TagResourceCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_json1_0_1 = require_Aws_json1_0(); - var TagResourceCommand = class extends smithy_client_1.Command { + var TagResourceCommand = class _TagResourceCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -23456,7 +24178,7 @@ var require_TagResourceCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, TagResourceCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _TagResourceCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -23488,14 +24210,14 @@ var require_UntagResourceCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UntagResourceCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_json1_0_1 = require_Aws_json1_0(); - var UntagResourceCommand = class extends smithy_client_1.Command { + var UntagResourceCommand = class _UntagResourceCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -23510,7 +24232,7 @@ var require_UntagResourceCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, UntagResourceCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _UntagResourceCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -23542,14 +24264,14 @@ var require_UpdateMapRunCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UpdateMapRunCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var Aws_json1_0_1 = require_Aws_json1_0(); - var UpdateMapRunCommand = class extends smithy_client_1.Command { + var UpdateMapRunCommand = class _UpdateMapRunCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -23564,7 +24286,7 @@ var require_UpdateMapRunCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, UpdateMapRunCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _UpdateMapRunCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -23596,15 +24318,15 @@ var require_UpdateStateMachineAliasCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UpdateStateMachineAliasCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_04(); var Aws_json1_0_1 = require_Aws_json1_0(); - var UpdateStateMachineAliasCommand = class extends smithy_client_1.Command { + var UpdateStateMachineAliasCommand = class _UpdateStateMachineAliasCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -23619,7 +24341,7 @@ var require_UpdateStateMachineAliasCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, UpdateStateMachineAliasCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _UpdateStateMachineAliasCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -23651,15 +24373,15 @@ var require_UpdateStateMachineCommand = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UpdateStateMachineCommand = exports.$Command = void 0; - var middleware_endpoint_1 = require_dist_cjs26(); - var middleware_serde_1 = require_dist_cjs25(); - var smithy_client_1 = require_dist_cjs35(); + var middleware_endpoint_1 = require_dist_cjs27(); + var middleware_serde_1 = require_dist_cjs41(); + var smithy_client_1 = require_dist_cjs39(); Object.defineProperty(exports, "$Command", { enumerable: true, get: function() { return smithy_client_1.Command; } }); var models_0_1 = require_models_04(); var Aws_json1_0_1 = require_Aws_json1_0(); - var UpdateStateMachineCommand = class extends smithy_client_1.Command { + var UpdateStateMachineCommand = class _UpdateStateMachineCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, @@ -23674,7 +24396,7 @@ var require_UpdateStateMachineCommand = __commonJS({ } resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, UpdateStateMachineCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, _UpdateStateMachineCommand.getEndpointParameterInstructions())); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "SFNClient"; @@ -23706,7 +24428,7 @@ var require_SFN = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SFN = void 0; - var smithy_client_1 = require_dist_cjs35(); + var smithy_client_1 = require_dist_cjs39(); var CreateActivityCommand_1 = require_CreateActivityCommand(); var CreateStateMachineAliasCommand_1 = require_CreateStateMachineAliasCommand(); var CreateStateMachineCommand_1 = require_CreateStateMachineCommand(); @@ -24007,7 +24729,7 @@ var require_ListStateMachinesPaginator = __commonJS({ }); // ../../../node_modules/@aws-sdk/client-sfn/dist-cjs/pagination/index.js -var require_pagination4 = __commonJS({ +var require_pagination5 = __commonJS({ "../../../node_modules/@aws-sdk/client-sfn/dist-cjs/pagination/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -24032,7 +24754,7 @@ var require_models4 = __commonJS({ }); // ../../../node_modules/@aws-sdk/client-sfn/dist-cjs/index.js -var require_dist_cjs54 = __commonJS({ +var require_dist_cjs61 = __commonJS({ "../../../node_modules/@aws-sdk/client-sfn/dist-cjs/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -24041,7 +24763,7 @@ var require_dist_cjs54 = __commonJS({ tslib_1.__exportStar(require_SFNClient(), exports); tslib_1.__exportStar(require_SFN(), exports); tslib_1.__exportStar(require_commands4(), exports); - tslib_1.__exportStar(require_pagination4(), exports); + tslib_1.__exportStar(require_pagination5(), exports); tslib_1.__exportStar(require_models4(), exports); var SFNServiceException_1 = require_SFNServiceException(); Object.defineProperty(exports, "SFNServiceException", { enumerable: true, get: function() { @@ -29533,9 +30255,9 @@ var require_encoding = __commonJS({ } }); -// ../../../node_modules/node-fetch/lib/index.js +// node_modules/node-fetch/lib/index.js var require_lib4 = __commonJS({ - "../../../node_modules/node-fetch/lib/index.js"(exports, module2) { + "node_modules/node-fetch/lib/index.js"(exports, module2) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function _interopDefault(ex) { @@ -29550,7 +30272,7 @@ var require_lib4 = __commonJS({ var Readable = Stream.Readable; var BUFFER = Symbol("buffer"); var TYPE = Symbol("type"); - var Blob = class { + var Blob = class _Blob { constructor() { this[TYPE] = ""; const blobParts = arguments[0]; @@ -29569,7 +30291,7 @@ var require_lib4 = __commonJS({ buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); } else if (element instanceof ArrayBuffer) { buffer = Buffer.from(element); - } else if (element instanceof Blob) { + } else if (element instanceof _Blob) { buffer = element[BUFFER]; } else { buffer = Buffer.from(typeof element === "string" ? element : String(element)); @@ -29631,7 +30353,7 @@ var require_lib4 = __commonJS({ const span = Math.max(relativeEnd - relativeStart, 0); const buffer = this[BUFFER]; const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); - const blob = new Blob([], { type: arguments[2] }); + const blob = new _Blob([], { type: arguments[2] }); blob[BUFFER] = slicedBuffer; return blob; } @@ -30008,7 +30730,7 @@ var require_lib4 = __commonJS({ return void 0; } var MAP = Symbol("map"); - var Headers = class { + var Headers = class _Headers { /** * Headers class * @@ -30018,7 +30740,7 @@ var require_lib4 = __commonJS({ constructor() { let init = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0; this[MAP] = /* @__PURE__ */ Object.create(null); - if (init instanceof Headers) { + if (init instanceof _Headers) { const rawHeaders = init.raw(); const headerNames = Object.keys(rawHeaders); for (const headerName of headerNames) { @@ -30287,7 +31009,7 @@ var require_lib4 = __commonJS({ } var INTERNALS$1 = Symbol("Response internals"); var STATUS_CODES = http.STATUS_CODES; - var Response2 = class { + var Response2 = class _Response { constructor() { let body = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null; let opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; @@ -30335,7 +31057,7 @@ var require_lib4 = __commonJS({ * @return Response */ clone() { - return new Response2(clone(this), { + return new _Response(clone(this), { url: this.url, status: this.status, statusText: this.statusText, @@ -30379,7 +31101,7 @@ var require_lib4 = __commonJS({ const proto = signal && typeof signal === "object" && Object.getPrototypeOf(signal); return !!(proto && proto.constructor.name === "AbortSignal"); } - var Request = class { + var Request = class _Request { constructor(input) { let init = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; let parsedURL; @@ -30449,7 +31171,7 @@ var require_lib4 = __commonJS({ * @return Request */ clone() { - return new Request(this); + return new _Request(this); } }; Body.mixIn(Request.prototype); @@ -30750,7 +31472,7 @@ var require_lib4 = __commonJS({ const headers = response.headers; if (headers["transfer-encoding"] === "chunked" && !headers["content-length"]) { response.once("close", function(hadError) { - const hasDataListener = socket.listenerCount("data") > 0; + const hasDataListener = socket && socket.listenerCount("data") > 0; if (hasDataListener && !hadError) { const err = new Error("Premature close"); err.code = "ERR_STREAM_PREMATURE_CLOSE"; @@ -31314,12 +32036,11 @@ var import_helpers_internal = __toESM(require_helpers_internal()); // lib/assertions/providers/lambda-handler/base.ts var https = __toESM(require("https")); var url = __toESM(require("url")); -var import_client_sfn = __toESM(require_dist_cjs54()); +var import_client_sfn = __toESM(require_dist_cjs61()); var CustomResourceHandler = class { constructor(event, context) { this.event = event; this.context = context; - this.timedOut = false; this.timeout = setTimeout(async () => { await this.respond({ status: "FAILED", @@ -31331,6 +32052,9 @@ var CustomResourceHandler = class { this.event = event; this.physicalResourceId = extractPhysicalResourceId(event); } + physicalResourceId; + timeout; + timedOut = false; /** * Handles executing the custom resource event. If `stateMachineArn` is present * in the props then trigger the waiter statemachine @@ -31464,6 +32188,7 @@ var AssertionHandler = class extends CustomResourceHandler { } }; var MatchCreator = class { + parsedObj; constructor(obj) { this.parsedObj = { matcher: obj diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip new file mode 100644 index 0000000000000..90a8a2a6e2615 Binary files /dev/null and b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/cdk.out index f0b901e7c06e5..560dae10d018f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"33.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/integtestbucketdeploymentsDefaultTestDeployAssertCF25A2DF.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/integtestbucketdeploymentsDefaultTestDeployAssertCF25A2DF.assets.json index d951927b7cd18..9736848e5a3ff 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/integtestbucketdeploymentsDefaultTestDeployAssertCF25A2DF.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/integtestbucketdeploymentsDefaultTestDeployAssertCF25A2DF.assets.json @@ -1,20 +1,20 @@ { "version": "32.0.0", "files": { - "33cc97057bd20e4d2a8b75b52dc72cad7a3b45d78fa06a008ae302ab17b2075f": { + "31dc77c600dd475c9b26f5702fabd7508d84bec599ba5b973691d69745c7b775": { "source": { - "path": "asset.33cc97057bd20e4d2a8b75b52dc72cad7a3b45d78fa06a008ae302ab17b2075f.bundle", + "path": "asset.31dc77c600dd475c9b26f5702fabd7508d84bec599ba5b973691d69745c7b775.bundle", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "33cc97057bd20e4d2a8b75b52dc72cad7a3b45d78fa06a008ae302ab17b2075f.zip", + "objectKey": "31dc77c600dd475c9b26f5702fabd7508d84bec599ba5b973691d69745c7b775.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "ed008f9ad946c63c446d9e928c3b44575812ae5baf41f95afdbca047cd039381": { + "5303ed1ee65aa74eefaaf9e2f9142c6a959a40534ed56308bb41ec1ca8a72ef4": { "source": { "path": "integtestbucketdeploymentsDefaultTestDeployAssertCF25A2DF.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "ed008f9ad946c63c446d9e928c3b44575812ae5baf41f95afdbca047cd039381.json", + "objectKey": "5303ed1ee65aa74eefaaf9e2f9142c6a959a40534ed56308bb41ec1ca8a72ef4.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/integtestbucketdeploymentsDefaultTestDeployAssertCF25A2DF.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/integtestbucketdeploymentsDefaultTestDeployAssertCF25A2DF.template.json index af302eb58b3e8..0962ac0553b5a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/integtestbucketdeploymentsDefaultTestDeployAssertCF25A2DF.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/integtestbucketdeploymentsDefaultTestDeployAssertCF25A2DF.template.json @@ -27,7 +27,7 @@ } }, "flattenResponse": "false", - "salt": "1689711396269" + "salt": "1689749620143" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -91,7 +91,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "33cc97057bd20e4d2a8b75b52dc72cad7a3b45d78fa06a008ae302ab17b2075f.zip" + "S3Key": "31dc77c600dd475c9b26f5702fabd7508d84bec599ba5b973691d69745c7b775.zip" }, "Timeout": 120, "Handler": "index.handler", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/manifest.json index 0287b7bfa611d..667a3aee49e4e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/manifest.json @@ -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}/80f43f6b3b34fefa1ee2d8889ca3fc369530080f6fa4f91138bd94ce37560521.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a86d053bab0407628216427dab50f7580efe548c7e19be16b0592ace19ac5ae2.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -66,7 +66,10 @@ "/test-bucket-deployments-2/DeployMe/AwsCliLayer/Resource": [ { "type": "aws:cdk:logicalId", - "data": "DeployMeAwsCliLayer5F9219E9" + "data": "DeployMeAwsCliLayer5F9219E9", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] } ], "/test-bucket-deployments-2/DeployMe/CustomResource/Default": [ @@ -234,7 +237,10 @@ "/test-bucket-deployments-2/DeployMeWithEfsStorage/AwsCliLayer/Resource": [ { "type": "aws:cdk:logicalId", - "data": "DeployMeWithEfsStorageAwsCliLayer1619A3EE" + "data": "DeployMeWithEfsStorageAwsCliLayer1619A3EE", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] } ], "/test-bucket-deployments-2/DeployMeWithEfsStorage/CustomResource-c8e45d2d82aec23f89c7172e7e6f994ff3d9c444fa/Default": [ @@ -324,7 +330,10 @@ "/test-bucket-deployments-2/DeployWithPrefix/AwsCliLayer/Resource": [ { "type": "aws:cdk:logicalId", - "data": "DeployWithPrefixAwsCliLayerC9DDB597" + "data": "DeployWithPrefixAwsCliLayerC9DDB597", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] } ], "/test-bucket-deployments-2/DeployWithPrefix/CustomResource/Default": [ @@ -354,7 +363,10 @@ "/test-bucket-deployments-2/DeployWithMetadata/AwsCliLayer/Resource": [ { "type": "aws:cdk:logicalId", - "data": "DeployWithMetadataAwsCliLayer2C774B41" + "data": "DeployWithMetadataAwsCliLayer2C774B41", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] } ], "/test-bucket-deployments-2/DeployWithMetadata/CustomResource/Default": [ @@ -366,7 +378,10 @@ "/test-bucket-deployments-2/DeployMeWithoutDeletingFilesOnDestination/AwsCliLayer/Resource": [ { "type": "aws:cdk:logicalId", - "data": "DeployMeWithoutDeletingFilesOnDestinationAwsCliLayer4D54C41C" + "data": "DeployMeWithoutDeletingFilesOnDestinationAwsCliLayer4D54C41C", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] } ], "/test-bucket-deployments-2/DeployMeWithoutDeletingFilesOnDestination/CustomResource/Default": [ @@ -378,7 +393,10 @@ "/test-bucket-deployments-2/DeployMeWithExcludedFilesOnDestination/AwsCliLayer/Resource": [ { "type": "aws:cdk:logicalId", - "data": "DeployMeWithExcludedFilesOnDestinationAwsCliLayer68F5E11D" + "data": "DeployMeWithExcludedFilesOnDestinationAwsCliLayer68F5E11D", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] } ], "/test-bucket-deployments-2/DeployMeWithExcludedFilesOnDestination/CustomResource/Default": [ @@ -408,7 +426,10 @@ "/test-bucket-deployments-2/DeployMeWithoutExtractingFilesOnDestination/AwsCliLayer/Resource": [ { "type": "aws:cdk:logicalId", - "data": "DeployMeWithoutExtractingFilesOnDestinationAwsCliLayerC65F79D8" + "data": "DeployMeWithoutExtractingFilesOnDestinationAwsCliLayerC65F79D8", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] } ], "/test-bucket-deployments-2/DeployMeWithoutExtractingFilesOnDestination/CustomResource/Default": [ @@ -438,7 +459,10 @@ "/test-bucket-deployments-2/DeployMe5/AwsCliLayer/Resource": [ { "type": "aws:cdk:logicalId", - "data": "DeployMe5AwsCliLayerF0F79631" + "data": "DeployMe5AwsCliLayerF0F79631", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] } ], "/test-bucket-deployments-2/DeployMe5/CustomResource/Default": [ @@ -484,7 +508,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}/ed008f9ad946c63c446d9e928c3b44575812ae5baf41f95afdbca047cd039381.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/5303ed1ee65aa74eefaaf9e2f9142c6a959a40534ed56308bb41ec1ca8a72ef4.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/test-bucket-deployments-2.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/test-bucket-deployments-2.assets.json index d2c1e480eb026..1ac0930dc9283 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/test-bucket-deployments-2.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/test-bucket-deployments-2.assets.json @@ -14,15 +14,15 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -79,7 +79,7 @@ } } }, - "80f43f6b3b34fefa1ee2d8889ca3fc369530080f6fa4f91138bd94ce37560521": { + "a86d053bab0407628216427dab50f7580efe548c7e19be16b0592ace19ac5ae2": { "source": { "path": "test-bucket-deployments-2.template.json", "packaging": "file" @@ -87,7 +87,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "80f43f6b3b34fefa1ee2d8889ca3fc369530080f6fa4f91138bd94ce37560521.json", + "objectKey": "a86d053bab0407628216427dab50f7580efe548c7e19be16b0592ace19ac5ae2.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/test-bucket-deployments-2.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/test-bucket-deployments-2.template.json index 9c8948b77a8c5..b2cfc0604c585 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/test-bucket-deployments-2.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/test-bucket-deployments-2.template.json @@ -167,7 +167,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } @@ -835,7 +835,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" }, @@ -1460,7 +1460,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } @@ -1586,7 +1586,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } @@ -1633,7 +1633,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } @@ -1671,7 +1671,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } @@ -1799,7 +1799,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } @@ -1925,7 +1925,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/tree.json index 0f079760f1a53..62aeb900d633f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/tree.json @@ -221,7 +221,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -1305,7 +1305,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -2135,7 +2135,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -2373,7 +2373,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -2491,7 +2491,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -2609,7 +2609,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -2847,7 +2847,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -3085,7 +3085,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip deleted file mode 100644 index e6cb898734b43..0000000000000 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and /dev/null differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.6412a5f4524c6b41d26fbeee226c68c2dad735393940a51008d77e6f8b1038f5.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.6412a5f4524c6b41d26fbeee226c68c2dad735393940a51008d77e6f8b1038f5.json deleted file mode 100644 index 9785ab36f253f..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.6412a5f4524c6b41d26fbeee226c68c2dad735393940a51008d77e6f8b1038f5.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "AWSTemplateFormatVersion" : "2010-09-09", - - "Description" : "AWS Service Catalog sample template. Creates an Amazon EC2 instance running the Amazon Linux AMI. The AMI is chosen based on the region in which the stack is run. This example creates an EC2 security group for the instance to give you SSH access. **WARNING** This template creates an Amazon EC2 instance. You will be billed for the AWS resources used if you create a stack from this template.", - - "Parameters" : { - "KeyName": { - "Description" : "Name of an existing EC2 key pair for SSH access to the EC2 instance.", - "Type": "AWS::EC2::KeyPair::KeyName" - }, - - "InstanceType" : { - "Description" : "EC2 instance type.", - "Type" : "String", - "Default" : "t2.micro", - "AllowedValues" : [ "t2.micro", "t2.small", "t2.medium"] - }, - - "SSHLocation" : { - "Description" : "The IP address range that can SSH to the EC2 instance.", - "Type": "String", - "MinLength": "9", - "MaxLength": "18", - "Default": "0.0.0.0/0", - "AllowedPattern": "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})", - "ConstraintDescription": "Must be a valid IP CIDR range of the form x.x.x.x/x." - } - }, - - "Metadata" : { - "AWS::CloudFormation::Interface" : { - "ParameterGroups" : [{ - "Label" : {"default": "Instance configuration"}, - "Parameters" : ["InstanceType"] - },{ - "Label" : {"default": "Security configuration"}, - "Parameters" : ["KeyName", "SSHLocation"] - }], - "ParameterLabels" : { - "InstanceType": {"default": "Server size:"}, - "KeyName": {"default": "Key pair:"}, - "SSHLocation": {"default": "CIDR range:"} - } - } - }, - - "Mappings" : { - "AWSRegionArch2AMI" : { - "us-east-1" : { "HVM64" : "ami-08842d60" }, - "us-west-2" : { "HVM64" : "ami-8786c6b7" }, - "us-west-1" : { "HVM64" : "ami-cfa8a18a" }, - "eu-west-1" : { "HVM64" : "ami-748e2903" }, - "ap-southeast-1" : { "HVM64" : "ami-d6e1c584" }, - "ap-northeast-1" : { "HVM64" : "ami-35072834" }, - "ap-southeast-2" : { "HVM64" : "ami-fd4724c7" }, - "sa-east-1" : { "HVM64" : "ami-956cc688" }, - "cn-north-1" : { "HVM64" : "ami-ac57c595" }, - "eu-central-1" : { "HVM64" : "ami-b43503a9" } - } - - }, - - "Resources" : { - "EC2Instance" : { - "Type" : "AWS::EC2::Instance", - "Properties" : { - "InstanceType" : { "Ref" : "InstanceType" }, - "SecurityGroups" : [ { "Ref" : "InstanceSecurityGroup" } ], - "KeyName" : { "Ref" : "KeyName" }, - "ImageId" : { "Fn::FindInMap" : [ "AWSRegionArch2AMI", { "Ref" : "AWS::Region" }, "HVM64" ] } - } - }, - - "InstanceSecurityGroup" : { - "Type" : "AWS::EC2::SecurityGroup", - "Properties" : { - "GroupDescription" : "Enable SSH access via port 22", - "SecurityGroupIngress" : [ { - "IpProtocol" : "tcp", - "FromPort" : "22", - "ToPort" : "22", - "CidrIp" : { "Ref" : "SSHLocation"} - } ] - } - } - }, - - "Outputs" : { - "PublicDNSName" : { - "Description" : "Public DNS name of the new EC2 instance", - "Value" : { "Fn::GetAtt" : [ "EC2Instance", "PublicDnsName" ] } - }, - "PublicIPAddress" : { - "Description" : "Public IP address of the new EC2 instance", - "Value" : { "Fn::GetAtt" : [ "EC2Instance", "PublicIp" ] } - } - } -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.89c643a8a6c919d906e0b1cb079b0c5e131cf3cc19c05126f90fc118647fb08c/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.89c643a8a6c919d906e0b1cb079b0c5e131cf3cc19c05126f90fc118647fb08c/index.js deleted file mode 100644 index b9e3b71c939ea..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.89c643a8a6c919d906e0b1cb079b0c5e131cf3cc19c05126f90fc118647fb08c/index.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";var C=Object.create;var c=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var A=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var L=(t,e)=>{for(var s in e)c(t,s,{get:e[s],enumerable:!0})},d=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of w(e))!P.call(t,o)&&o!==s&&c(t,o,{get:()=>e[o],enumerable:!(r=f(e,o))||r.enumerable});return t};var l=(t,e,s)=>(s=t!=null?C(A(t)):{},d(e||!t||!t.__esModule?c(s,"default",{value:t,enumerable:!0}):s,t)),k=t=>d(c({},"__esModule",{value:!0}),t);var _={};L(_,{autoDeleteHandler:()=>g,handler:()=>O});module.exports=k(_);var h=require("@aws-sdk/client-s3");var m=l(require("https")),R=l(require("url")),a={sendHttpRequest:T,log:B,includeStackTraces:!0,userHandlerIndex:"./index"},p="AWSCDK::CustomResourceProviderFramework::CREATE_FAILED",D="AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID";function y(t){return async(e,s)=>{let r={...e,ResponseURL:"..."};if(a.log(JSON.stringify(r,void 0,2)),e.RequestType==="Delete"&&e.PhysicalResourceId===p){a.log("ignoring DELETE event caused by a failed CREATE event"),await i("SUCCESS",e);return}try{let o=await t(r,s),n=b(e,o);await i("SUCCESS",n)}catch(o){let n={...e,Reason:a.includeStackTraces?o.stack:o.message};n.PhysicalResourceId||(e.RequestType==="Create"?(a.log("CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored"),n.PhysicalResourceId=p):a.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify(e)}`)),await i("FAILED",n)}}}function b(t,e={}){let s=e.PhysicalResourceId??t.PhysicalResourceId??t.RequestId;if(t.RequestType==="Delete"&&s!==t.PhysicalResourceId)throw new Error(`DELETE: cannot change the physical resource ID from "${t.PhysicalResourceId}" to "${e.PhysicalResourceId}" during deletion`);return{...t,...e,PhysicalResourceId:s}}async function i(t,e){let s={Status:t,Reason:e.Reason??t,StackId:e.StackId,RequestId:e.RequestId,PhysicalResourceId:e.PhysicalResourceId||D,LogicalResourceId:e.LogicalResourceId,NoEcho:e.NoEcho,Data:e.Data};a.log("submit response to cloudformation",s);let r=JSON.stringify(s),o=R.parse(e.ResponseURL),n={hostname:o.hostname,path:o.path,method:"PUT",headers:{"content-type":"","content-length":Buffer.byteLength(r,"utf8")}};await x({attempts:5,sleep:1e3},a.sendHttpRequest)(n,r)}async function T(t,e){return new Promise((s,r)=>{try{let o=m.request(t,n=>s());o.on("error",r),o.write(e),o.end()}catch(o){r(o)}})}function B(t,...e){console.log(t,...e)}function x(t,e){return async(...s)=>{let r=t.attempts,o=t.sleep;for(;;)try{return await e(...s)}catch(n){if(r--<=0)throw n;await H(Math.floor(Math.random()*o)),o*=2}}}async function H(t){return new Promise(e=>setTimeout(e,t))}var E="aws-cdk:auto-delete-objects",u=new h.S3({}),O=y(g);async function g(t){switch(t.RequestType){case"Create":return;case"Update":return F(t);case"Delete":return S(t.ResourceProperties?.BucketName)}}async function F(t){let e=t,s=e.OldResourceProperties?.BucketName,r=e.ResourceProperties?.BucketName;if(r!=null&&s!=null&&r!==s)return S(s)}async function I(t){let e=await u.listObjectVersions({Bucket:t}),s=[...e.Versions??[],...e.DeleteMarkers??[]];if(s.length===0)return;let r=s.map(o=>({Key:o.Key,VersionId:o.VersionId}));await u.deleteObjects({Bucket:t,Delete:{Objects:r}}),e?.IsTruncated&&await I(t)}async function S(t){if(!t)throw new Error("No BucketName was provided.");if(!await N(t)){process.stdout.write(`Bucket does not have '${E}' tag, skipping cleaning. -`);return}try{await I(t)}catch(e){if(e.code!=="NoSuchBucket")throw e}}async function N(t){return(await u.getBucketTagging({Bucket:t})).TagSet?.some(s=>s.Key===E&&s.Value==="true")}0&&(module.exports={autoDeleteHandler,handler}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd/index.py b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd/index.py deleted file mode 100644 index 95c458826a0b0..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd/index.py +++ /dev/null @@ -1,319 +0,0 @@ -import contextlib -import json -import logging -import os -import shutil -import subprocess -import tempfile -from urllib.request import Request, urlopen -from uuid import uuid4 -from zipfile import ZipFile - -import boto3 - -logger = logging.getLogger() -logger.setLevel(logging.INFO) - -cloudfront = boto3.client('cloudfront') -s3 = boto3.client('s3') - -CFN_SUCCESS = "SUCCESS" -CFN_FAILED = "FAILED" -ENV_KEY_MOUNT_PATH = "MOUNT_PATH" -ENV_KEY_SKIP_CLEANUP = "SKIP_CLEANUP" - -AWS_CLI_CONFIG_FILE = "/tmp/aws_cli_config" -CUSTOM_RESOURCE_OWNER_TAG = "aws-cdk:cr-owned" - -os.putenv('AWS_CONFIG_FILE', AWS_CLI_CONFIG_FILE) - -def handler(event, context): - - def cfn_error(message=None): - logger.error("| cfn_error: %s" % message) - cfn_send(event, context, CFN_FAILED, reason=message, physicalResourceId=event.get('PhysicalResourceId', None)) - - - try: - # We are not logging ResponseURL as this is a pre-signed S3 URL, and could be used to tamper - # with the response CloudFormation sees from this Custom Resource execution. - logger.info({ key:value for (key, value) in event.items() if key != 'ResponseURL'}) - - # cloudformation request type (create/update/delete) - request_type = event['RequestType'] - - # extract resource properties - props = event['ResourceProperties'] - old_props = event.get('OldResourceProperties', {}) - physical_id = event.get('PhysicalResourceId', None) - - try: - source_bucket_names = props['SourceBucketNames'] - source_object_keys = props['SourceObjectKeys'] - source_markers = props.get('SourceMarkers', None) - dest_bucket_name = props['DestinationBucketName'] - dest_bucket_prefix = props.get('DestinationBucketKeyPrefix', '') - extract = props.get('Extract', 'true') == 'true' - retain_on_delete = props.get('RetainOnDelete', "true") == "true" - distribution_id = props.get('DistributionId', '') - user_metadata = props.get('UserMetadata', {}) - system_metadata = props.get('SystemMetadata', {}) - prune = props.get('Prune', 'true').lower() == 'true' - exclude = props.get('Exclude', []) - include = props.get('Include', []) - sign_content = props.get('SignContent', 'false').lower() == 'true' - - # backwards compatibility - if "SourceMarkers" is not specified, - # assume all sources have an empty market map - if source_markers is None: - source_markers = [{} for i in range(len(source_bucket_names))] - - default_distribution_path = dest_bucket_prefix - if not default_distribution_path.endswith("/"): - default_distribution_path += "/" - if not default_distribution_path.startswith("/"): - default_distribution_path = "/" + default_distribution_path - default_distribution_path += "*" - - distribution_paths = props.get('DistributionPaths', [default_distribution_path]) - except KeyError as e: - cfn_error("missing request resource property %s. props: %s" % (str(e), props)) - return - - # configure aws cli options after resetting back to the defaults for each request - if os.path.exists(AWS_CLI_CONFIG_FILE): - os.remove(AWS_CLI_CONFIG_FILE) - if sign_content: - aws_command("configure", "set", "default.s3.payload_signing_enabled", "true") - - # treat "/" as if no prefix was specified - if dest_bucket_prefix == "/": - dest_bucket_prefix = "" - - s3_source_zips = list(map(lambda name, key: "s3://%s/%s" % (name, key), source_bucket_names, source_object_keys)) - s3_dest = "s3://%s/%s" % (dest_bucket_name, dest_bucket_prefix) - old_s3_dest = "s3://%s/%s" % (old_props.get("DestinationBucketName", ""), old_props.get("DestinationBucketKeyPrefix", "")) - - - # obviously this is not - if old_s3_dest == "s3:///": - old_s3_dest = None - - logger.info("| s3_dest: %s" % s3_dest) - logger.info("| old_s3_dest: %s" % old_s3_dest) - - # if we are creating a new resource, allocate a physical id for it - # otherwise, we expect physical id to be relayed by cloudformation - if request_type == "Create": - physical_id = "aws.cdk.s3deployment.%s" % str(uuid4()) - else: - if not physical_id: - cfn_error("invalid request: request type is '%s' but 'PhysicalResourceId' is not defined" % request_type) - return - - # delete or create/update (only if "retain_on_delete" is false) - if request_type == "Delete" and not retain_on_delete: - if not bucket_owned(dest_bucket_name, dest_bucket_prefix): - aws_command("s3", "rm", s3_dest, "--recursive") - - # if we are updating without retention and the destination changed, delete first - if request_type == "Update" and not retain_on_delete and old_s3_dest != s3_dest: - if not old_s3_dest: - logger.warn("cannot delete old resource without old resource properties") - return - - aws_command("s3", "rm", old_s3_dest, "--recursive") - - if request_type == "Update" or request_type == "Create": - s3_deploy(s3_source_zips, s3_dest, user_metadata, system_metadata, prune, exclude, include, source_markers, extract) - - if distribution_id: - cloudfront_invalidate(distribution_id, distribution_paths) - - cfn_send(event, context, CFN_SUCCESS, physicalResourceId=physical_id, responseData={ - # Passing through the ARN sequences dependencees on the deployment - 'DestinationBucketArn': props.get('DestinationBucketArn'), - 'SourceObjectKeys': props.get('SourceObjectKeys'), - }) - except KeyError as e: - cfn_error("invalid request. Missing key %s" % str(e)) - except Exception as e: - logger.exception(e) - cfn_error(str(e)) - -#--------------------------------------------------------------------------------------------------- -# populate all files from s3_source_zips to a destination bucket -def s3_deploy(s3_source_zips, s3_dest, user_metadata, system_metadata, prune, exclude, include, source_markers, extract): - # list lengths are equal - if len(s3_source_zips) != len(source_markers): - raise Exception("'source_markers' and 's3_source_zips' must be the same length") - - # create a temporary working directory in /tmp or if enabled an attached efs volume - if ENV_KEY_MOUNT_PATH in os.environ: - workdir = os.getenv(ENV_KEY_MOUNT_PATH) + "/" + str(uuid4()) - os.mkdir(workdir) - else: - workdir = tempfile.mkdtemp() - - logger.info("| workdir: %s" % workdir) - - # create a directory into which we extract the contents of the zip file - contents_dir=os.path.join(workdir, 'contents') - os.mkdir(contents_dir) - - try: - # download the archive from the source and extract to "contents" - for i in range(len(s3_source_zips)): - s3_source_zip = s3_source_zips[i] - markers = source_markers[i] - - if extract: - archive=os.path.join(workdir, str(uuid4())) - logger.info("archive: %s" % archive) - aws_command("s3", "cp", s3_source_zip, archive) - logger.info("| extracting archive to: %s\n" % contents_dir) - logger.info("| markers: %s" % markers) - extract_and_replace_markers(archive, contents_dir, markers) - else: - logger.info("| copying archive to: %s\n" % contents_dir) - aws_command("s3", "cp", s3_source_zip, contents_dir) - - # sync from "contents" to destination - - s3_command = ["s3", "sync"] - - if prune: - s3_command.append("--delete") - - if exclude: - for filter in exclude: - s3_command.extend(["--exclude", filter]) - - if include: - for filter in include: - s3_command.extend(["--include", filter]) - - s3_command.extend([contents_dir, s3_dest]) - s3_command.extend(create_metadata_args(user_metadata, system_metadata)) - aws_command(*s3_command) - finally: - if not os.getenv(ENV_KEY_SKIP_CLEANUP): - shutil.rmtree(workdir) - -#--------------------------------------------------------------------------------------------------- -# invalidate files in the CloudFront distribution edge caches -def cloudfront_invalidate(distribution_id, distribution_paths): - invalidation_resp = cloudfront.create_invalidation( - DistributionId=distribution_id, - InvalidationBatch={ - 'Paths': { - 'Quantity': len(distribution_paths), - 'Items': distribution_paths - }, - 'CallerReference': str(uuid4()), - }) - # by default, will wait up to 10 minutes - cloudfront.get_waiter('invalidation_completed').wait( - DistributionId=distribution_id, - Id=invalidation_resp['Invalidation']['Id']) - -#--------------------------------------------------------------------------------------------------- -# set metadata -def create_metadata_args(raw_user_metadata, raw_system_metadata): - if len(raw_user_metadata) == 0 and len(raw_system_metadata) == 0: - return [] - - format_system_metadata_key = lambda k: k.lower() - format_user_metadata_key = lambda k: k.lower() - - system_metadata = { format_system_metadata_key(k): v for k, v in raw_system_metadata.items() } - user_metadata = { format_user_metadata_key(k): v for k, v in raw_user_metadata.items() } - - flatten = lambda l: [item for sublist in l for item in sublist] - system_args = flatten([[f"--{k}", v] for k, v in system_metadata.items()]) - user_args = ["--metadata", json.dumps(user_metadata, separators=(',', ':'))] if len(user_metadata) > 0 else [] - - return system_args + user_args + ["--metadata-directive", "REPLACE"] - -#--------------------------------------------------------------------------------------------------- -# executes an "aws" cli command -def aws_command(*args): - aws="/opt/awscli/aws" # from AwsCliLayer - logger.info("| aws %s" % ' '.join(args)) - subprocess.check_call([aws] + list(args)) - -#--------------------------------------------------------------------------------------------------- -# sends a response to cloudformation -def cfn_send(event, context, responseStatus, responseData={}, physicalResourceId=None, noEcho=False, reason=None): - - responseUrl = event['ResponseURL'] - - responseBody = {} - responseBody['Status'] = responseStatus - responseBody['Reason'] = reason or ('See the details in CloudWatch Log Stream: ' + context.log_stream_name) - responseBody['PhysicalResourceId'] = physicalResourceId or context.log_stream_name - responseBody['StackId'] = event['StackId'] - responseBody['RequestId'] = event['RequestId'] - responseBody['LogicalResourceId'] = event['LogicalResourceId'] - responseBody['NoEcho'] = noEcho - responseBody['Data'] = responseData - - body = json.dumps(responseBody) - logger.info("| response body:\n" + body) - - headers = { - 'content-type' : '', - 'content-length' : str(len(body)) - } - - try: - request = Request(responseUrl, method='PUT', data=bytes(body.encode('utf-8')), headers=headers) - with contextlib.closing(urlopen(request)) as response: - logger.info("| status code: " + response.reason) - except Exception as e: - logger.error("| unable to send response to CloudFormation") - logger.exception(e) - - -#--------------------------------------------------------------------------------------------------- -# check if bucket is owned by a custom resource -# if it is then we don't want to delete content -def bucket_owned(bucketName, keyPrefix): - tag = CUSTOM_RESOURCE_OWNER_TAG - if keyPrefix != "": - tag = tag + ':' + keyPrefix - try: - request = s3.get_bucket_tagging( - Bucket=bucketName, - ) - return any((x["Key"].startswith(tag)) for x in request["TagSet"]) - except Exception as e: - logger.info("| error getting tags from bucket") - logger.exception(e) - return False - -# extract archive and replace markers in output files -def extract_and_replace_markers(archive, contents_dir, markers): - with ZipFile(archive, "r") as zip: - zip.extractall(contents_dir) - - # replace markers for this source - for file in zip.namelist(): - file_path = os.path.join(contents_dir, file) - if os.path.isdir(file_path): continue - replace_markers(file_path, markers) - -def replace_markers(filename, markers): - # convert the dict of string markers to binary markers - replace_tokens = dict([(k.encode('utf-8'), v.encode('utf-8')) for k, v in markers.items()]) - - outfile = filename + '.new' - with open(filename, 'rb') as fi, open(outfile, 'wb') as fo: - for line in fi: - for token in replace_tokens: - line = line.replace(token, replace_tokens[token]) - fo.write(line) - - # # delete the original file and rename the new one to the original - os.remove(filename) - os.rename(outfile, filename) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.b59f768286e16b69628bb23b9c1a1f07300a24101b8979d8e2a94ff1ab03d09e.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.b59f768286e16b69628bb23b9c1a1f07300a24101b8979d8e2a94ff1ab03d09e.json deleted file mode 100644 index 69c3138be93f4..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.b59f768286e16b69628bb23b9c1a1f07300a24101b8979d8e2a94ff1ab03d09e.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "AWSTemplateFormatVersion" : "2010-09-09", - - "Description" : "AWS Service Catalog sample template. Creates an Amazon EC2 instance running the Amazon Linux AMI. The AMI is chosen based on the region in which the stack is run. This example creates an EC2 security group for the instance to give you SSH access. **WARNING** This template creates an Amazon EC2 instance. You will be billed for the AWS resources used if you create a stack from this template.", - - "Parameters" : { - "KeyName": { - "Description" : "Name of an existing EC2 key pair for SSH access to the EC2 instance.", - "Type": "AWS::EC2::KeyPair::KeyName" - }, - - "InstanceType" : { - "Description" : "EC2 instance type.", - "Type" : "String", - "Default" : "t2.micro", - "AllowedValues" : [ "t2.micro", "t2.small", "t2.medium", "m3.medium", "m3.large", "m3.xlarge", "m3.2xlarge" ] - }, - - "SSHLocation" : { - "Description" : "The IP address range that can SSH to the EC2 instance.", - "Type": "String", - "MinLength": "9", - "MaxLength": "18", - "Default": "0.0.0.0/0", - "AllowedPattern": "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})", - "ConstraintDescription": "Must be a valid IP CIDR range of the form x.x.x.x/x." - } - }, - - "Metadata" : { - "AWS::CloudFormation::Interface" : { - "ParameterGroups" : [{ - "Label" : {"default": "Instance configuration"}, - "Parameters" : ["InstanceType"] - },{ - "Label" : {"default": "Security configuration"}, - "Parameters" : ["KeyName", "SSHLocation"] - }], - "ParameterLabels" : { - "InstanceType": {"default": "Server size:"}, - "KeyName": {"default": "Key pair:"}, - "SSHLocation": {"default": "CIDR range:"} - } - } - }, - - "Mappings" : { - "AWSRegionArch2AMI" : { - "us-east-1" : { "HVM64" : "ami-08842d60" }, - "us-west-2" : { "HVM64" : "ami-8786c6b7" }, - "us-west-1" : { "HVM64" : "ami-cfa8a18a" }, - "eu-west-1" : { "HVM64" : "ami-748e2903" }, - "ap-southeast-1" : { "HVM64" : "ami-d6e1c584" }, - "ap-northeast-1" : { "HVM64" : "ami-35072834" }, - "ap-southeast-2" : { "HVM64" : "ami-fd4724c7" }, - "sa-east-1" : { "HVM64" : "ami-956cc688" }, - "cn-north-1" : { "HVM64" : "ami-ac57c595" }, - "eu-central-1" : { "HVM64" : "ami-b43503a9" } - } - - }, - - "Resources" : { - "EC2Instance" : { - "Type" : "AWS::EC2::Instance", - "Properties" : { - "InstanceType" : { "Ref" : "InstanceType" }, - "SecurityGroups" : [ { "Ref" : "InstanceSecurityGroup" } ], - "KeyName" : { "Ref" : "KeyName" }, - "ImageId" : { "Fn::FindInMap" : [ "AWSRegionArch2AMI", { "Ref" : "AWS::Region" }, "HVM64" ] } - } - }, - - "InstanceSecurityGroup" : { - "Type" : "AWS::EC2::SecurityGroup", - "Properties" : { - "GroupDescription" : "Enable SSH access via port 22", - "SecurityGroupIngress" : [ { - "IpProtocol" : "tcp", - "FromPort" : "22", - "ToPort" : "22", - "CidrIp" : { "Ref" : "SSHLocation"} - } ] - } - } - }, - - "Outputs" : { - "PublicDNSName" : { - "Description" : "Public DNS name of the new EC2 instance", - "Value" : { "Fn::GetAtt" : [ "EC2Instance", "PublicDnsName" ] } - }, - "PublicIPAddress" : { - "Description" : "Public IP address of the new EC2 instance", - "Value" : { "Fn::GetAtt" : [ "EC2Instance", "PublicIp" ] } - } - } -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2.d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2/index.py b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2.d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2/index.py deleted file mode 100644 index 105bdadc3c1a8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2.d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2/index.py +++ /dev/null @@ -1,7 +0,0 @@ -import json - -def handler(event, context): - return { - 'statusCode': 200, - 'body': json.dumps('Hello from Lambda!') - } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2/index.py b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2/index.py deleted file mode 100644 index 105bdadc3c1a8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2/index.py +++ /dev/null @@ -1,7 +0,0 @@ -import json - -def handler(event, context): - return { - 'statusCode': 200, - 'body': json.dumps('Hello from Lambda!') - } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d.e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d/index.py b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d.e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d/index.py deleted file mode 100644 index 059c625350f79..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d.e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d/index.py +++ /dev/null @@ -1,7 +0,0 @@ -import json - -def handler(event, context): - return { - 'statusCode': 200, - 'body': json.dumps('Hello from Lambda again!') - } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d/index.py b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d/index.py deleted file mode 100644 index 059c625350f79..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/asset.e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d/index.py +++ /dev/null @@ -1,7 +0,0 @@ -import json - -def handler(event, context): - return { - 'statusCode': 200, - 'body': json.dumps('Hello from Lambda again!') - } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/cdk.out index f0b901e7c06e5..560dae10d018f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"33.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ-servicecatalog-product.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ-servicecatalog-product.assets.json index 975ffe71b5920..b98049f6d6851 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ-servicecatalog-product.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ-servicecatalog-product.assets.json @@ -15,43 +15,43 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", - "packaging": "file" + "path": "asset.d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2", + "packaging": "zip" }, "destinations": { "12345678-test-region": { "bucketName": "cdk-hnb659fds-assets-12345678-test-region", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2.zip", "region": "test-region", "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" } } }, - "9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd", - "packaging": "zip" + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", + "packaging": "file" }, "destinations": { "12345678-test-region": { "bucketName": "cdk-hnb659fds-assets-12345678-test-region", - "objectKey": "9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "region": "test-region", "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" } } }, - "d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2": { + "9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd": { "source": { - "path": "asset.d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2.d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2", + "path": "asset.9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd", "packaging": "zip" }, "destinations": { "12345678-test-region": { "bucketName": "cdk-hnb659fds-assets-12345678-test-region", - "objectKey": "d3833f63e813b3a96ea04c8c50ca98209330867f5f6ac358efca11f85a3476c2.zip", + "objectKey": "9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd.zip", "region": "test-region", "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" } @@ -59,7 +59,7 @@ }, "e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d": { "source": { - "path": "asset.e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d.e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d", + "path": "asset.e2204c9fddfc339ea362dec9143b4c22f883d4c18dd38c456f8f6a7161c1073d", "packaging": "zip" }, "destinations": { @@ -127,7 +127,7 @@ } } }, - "1369a801095f54b3149cd0e371681ec233462da8695077839ea1eec10cd6ac12": { + "7b427ecf2a5ad77dcd6e59a02ee68620f5d6a0639f3d25654750279e5531aa9b": { "source": { "path": "integ-servicecatalog-product.template.json", "packaging": "file" @@ -135,7 +135,7 @@ "destinations": { "12345678-test-region": { "bucketName": "cdk-hnb659fds-assets-12345678-test-region", - "objectKey": "1369a801095f54b3149cd0e371681ec233462da8695077839ea1eec10cd6ac12.json", + "objectKey": "7b427ecf2a5ad77dcd6e59a02ee68620f5d6a0639f3d25654750279e5531aa9b.json", "region": "test-region", "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ-servicecatalog-product.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ-servicecatalog-product.template.json index e53243a47c3aa..6b4288635390d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ-servicecatalog-product.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ-servicecatalog-product.template.json @@ -169,7 +169,7 @@ "Properties": { "Content": { "S3Bucket": "cdk-hnb659fds-assets-12345678-test-region", - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ.json index 3faba734289e4..a5ec5b0717d9a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/integ.json @@ -7,6 +7,7 @@ "integ-servicecatalog-product" ], "diffAssets": true, + "stackUpdateWorkflow": false, "assertionStack": "integ-product/DefaultTest/DeployAssert", "assertionStackName": "integproductDefaultTestDeployAssertEB23E2A9" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/manifest.json index 28f47dd57ea6d..3e8a001f96b5a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-deploy-role-12345678-test-region", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-cfn-exec-role-12345678-test-region", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-12345678-test-region/1369a801095f54b3149cd0e371681ec233462da8695077839ea1eec10cd6ac12.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-12345678-test-region/7b427ecf2a5ad77dcd6e59a02ee68620f5d6a0639f3d25654750279e5531aa9b.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -78,7 +78,10 @@ "/integ-servicecatalog-product/AssetsBucketDeployment/AwsCliLayer/Resource": [ { "type": "aws:cdk:logicalId", - "data": "AssetsBucketDeploymentAwsCliLayer9BCEE17F" + "data": "AssetsBucketDeploymentAwsCliLayer9BCEE17F", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] } ], "/integ-servicecatalog-product/AssetsBucketDeployment/CustomResource/Default": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/tree.json index 0ffe018ad6562..b91047cd647ec 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.js.snapshot/tree.json @@ -435,6 +435,14 @@ "version": "0.0.0" } }, + "ParentAssetBucket": { + "id": "ParentAssetBucket", + "path": "integ-servicecatalog-product/S3AssetProduct/ParentAssetBucket", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.BucketBase", + "version": "0.0.0" + } + }, "HelloHandler2": { "id": "HelloHandler2", "path": "integ-servicecatalog-product/S3AssetProduct/HelloHandler2", @@ -601,7 +609,7 @@ "aws:cdk:cloudformation:props": { "content": { "s3Bucket": "cdk-hnb659fds-assets-12345678-test-region", - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -625,32 +633,6 @@ "version": "0.0.0" } }, - "Asset1": { - "id": "Asset1", - "path": "integ-servicecatalog-product/AssetsBucketDeployment/Asset1", - "children": { - "Stage": { - "id": "Stage", - "path": "integ-servicecatalog-product/AssetsBucketDeployment/Asset1/Stage", - "constructInfo": { - "fqn": "aws-cdk-lib.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "integ-servicecatalog-product/AssetsBucketDeployment/Asset1/AssetBucket", - "constructInfo": { - "fqn": "aws-cdk-lib.aws_s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_s3_assets.Asset", - "version": "0.0.0" - } - }, "CustomResource": { "id": "CustomResource", "path": "integ-servicecatalog-product/AssetsBucketDeployment/CustomResource", @@ -668,32 +650,6 @@ "fqn": "aws-cdk-lib.CustomResource", "version": "0.0.0" } - }, - "Asset2": { - "id": "Asset2", - "path": "integ-servicecatalog-product/AssetsBucketDeployment/Asset2", - "children": { - "Stage": { - "id": "Stage", - "path": "integ-servicecatalog-product/AssetsBucketDeployment/Asset2/Stage", - "constructInfo": { - "fqn": "aws-cdk-lib.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "integ-servicecatalog-product/AssetsBucketDeployment/Asset2/AssetBucket", - "constructInfo": { - "fqn": "aws-cdk-lib.aws_s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_s3_assets.Asset", - "version": "0.0.0" - } } }, "constructInfo": { @@ -939,13 +895,13 @@ "id": "TestProduct", "path": "integ-servicecatalog-product/TestProduct", "children": { - "Template29445a0ba87d": { - "id": "Template29445a0ba87d", - "path": "integ-servicecatalog-product/TestProduct/Template29445a0ba87d", + "Template06ffb84e3067": { + "id": "Template06ffb84e3067", + "path": "integ-servicecatalog-product/TestProduct/Template06ffb84e3067", "children": { "Stage": { "id": "Stage", - "path": "integ-servicecatalog-product/TestProduct/Template29445a0ba87d/Stage", + "path": "integ-servicecatalog-product/TestProduct/Template06ffb84e3067/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -953,7 +909,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "integ-servicecatalog-product/TestProduct/Template29445a0ba87d/AssetBucket", + "path": "integ-servicecatalog-product/TestProduct/Template06ffb84e3067/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -965,13 +921,13 @@ "version": "0.0.0" } }, - "Template2c1881ac7bbc": { - "id": "Template2c1881ac7bbc", - "path": "integ-servicecatalog-product/TestProduct/Template2c1881ac7bbc", + "Template9b4aaeebb3fd": { + "id": "Template9b4aaeebb3fd", + "path": "integ-servicecatalog-product/TestProduct/Template9b4aaeebb3fd", "children": { "Stage": { "id": "Stage", - "path": "integ-servicecatalog-product/TestProduct/Template2c1881ac7bbc/Stage", + "path": "integ-servicecatalog-product/TestProduct/Template9b4aaeebb3fd/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -979,7 +935,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "integ-servicecatalog-product/TestProduct/Template2c1881ac7bbc/AssetBucket", + "path": "integ-servicecatalog-product/TestProduct/Template9b4aaeebb3fd/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.ts index eddbf879283aa..9e8e1d36d8381 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-servicecatalog/test/integ.product.ts @@ -12,7 +12,7 @@ import { ProductStackHistory, ProductStackProps } from 'aws-cdk-lib/aws-servicec * * 1. Deploy the stack: ``` - $ cdk deploy --app "node integ.product.js" integ-servicecatalog-product + $ CDK_DEFAULT_ACCOUNT= CDK_DEFAULT_REGION= cdk deploy --app "node integ.product.js" integ-servicecatalog-product ``` * * 2. Obtain IAM Principal ARN that will provision product. @@ -149,6 +149,7 @@ new IntegTest(app, 'integ-product', { testCases: [stack], diffAssets: true, enableLookups: true, + stackUpdateWorkflow: false, }); portfolio.addProduct(product); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip deleted file mode 100644 index e6cb898734b43..0000000000000 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and /dev/null differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js deleted file mode 100644 index b89707a0a08e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js +++ /dev/null @@ -1,277 +0,0 @@ -"use strict"; -/* eslint-disable no-console */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ClusterResourceHandler = void 0; -const common_1 = require("./common"); -const compareLogging_1 = require("./compareLogging"); -const MAX_CLUSTER_NAME_LEN = 100; -class ClusterResourceHandler extends common_1.ResourceHandler { - get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - return this.physicalResourceId; - } - constructor(eks, event) { - super(eks, event); - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - // ------ - // CREATE - // ------ - async onCreate() { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - const clusterName = this.newProps.name || this.generateClusterName(); - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - return { - PhysicalResourceId: resp.cluster.name, - }; - } - async isCreateComplete() { - return this.isActive(); - } - // ------ - // DELETE - // ------ - async onDelete() { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } - catch (e) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } - else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - async isDeleteComplete() { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } - catch (e) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - console.log('describeCluster error:', e); - throw e; - } - return { - IsComplete: false, - }; - } - // ------ - // UPDATE - // ------ - async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - return this.onCreate(); - } - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - return this.updateClusterVersion(this.newProps.version); - } - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - if (updates.updateLogging || updates.updateAccess) { - const config = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - } - ; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - return { EksUpdateId: updateResponse.update?.id }; - } - // no updates - return; - } - async isUpdateComplete() { - console.log('isUpdateComplete'); - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - return this.isActive(); - } - async updateClusterVersion(newVersion) { - console.log(`updating cluster version to ${newVersion}`); - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - async isActive() { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } - else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } - else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - async isEksUpdateComplete(eksUpdateId) { - this.log({ isEksUpdateComplete: eksUpdateId }); - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - this.log({ describeUpdateResponse }); - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} -exports.ClusterResourceHandler = ClusterResourceHandler; -function parseProps(props) { - const parsed = props?.Config ?? {}; - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - return parsed; -} -function analyzeUpdate(oldProps, newProps) { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} -function setsEqual(first, second) { - return first.size === second.size && [...first].every((e) => second.has(e)); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBSy9CLHFDQUFxRTtBQUNyRSxxREFBdUQ7QUFHdkQsTUFBTSxvQkFBb0IsR0FBRyxHQUFHLENBQUM7QUFFakMsTUFBYSxzQkFBdUIsU0FBUSx3QkFBZTtJQUN6RCxJQUFXLFdBQVc7UUFDcEIsSUFBSSxDQUFDLElBQUksQ0FBQyxrQkFBa0IsRUFBRTtZQUM1QixNQUFNLElBQUksS0FBSyxDQUFDLDREQUE0RCxDQUFDLENBQUM7U0FDL0U7UUFFRCxPQUFPLElBQUksQ0FBQyxrQkFBa0IsQ0FBQztLQUNoQztJQUtELFlBQVksR0FBYyxFQUFFLEtBQW9CO1FBQzlDLEtBQUssQ0FBQyxHQUFHLEVBQUUsS0FBSyxDQUFDLENBQUM7UUFFbEIsSUFBSSxDQUFDLFFBQVEsR0FBRyxVQUFVLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO1FBQzFELElBQUksQ0FBQyxRQUFRLEdBQUcsS0FBSyxDQUFDLFdBQVcsS0FBSy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zICE9PSBvbGRWcGNQcm9wcy5lbmRwb2ludFByaXZhdGVBY2Nlc3MgfHxcbiAgICAgIG5ld1ZwY1Byb3BzLmVuZHBvaW50UHVibGljQWNjZXNzICE9PSBvbGRWcGNQcm9wcy5lbmRwb2ludFB1YmxpY0FjY2VzcyB8fFxuICAgICAgIXNldHNFcXVhbChuZXdQdWJsaWNBY2Nlc3NDaWRycywgb2xkUHVibGljQWNjZXNzQ2lkcnMpLFxuICAgIHJlcGxhY2VSb2xlOiBuZXdQcm9wcy5yb2xlQXJuICE9PSBvbGRQcm9wcy5yb2xlQXJuLFxuICAgIHVwZGF0ZVZlcnNpb246IG5ld1Byb3BzLnZlcnNpb24gIT09IG9sZFByb3BzLnZlcnNpb24sXG4gICAgdXBkYXRlRW5jcnlwdGlvbjogSlNPTi5zdHJpbmdpZnkobmV3RW5jKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkRW5jKSxcbiAgICB1cGRhdGVMb2dnaW5nOiBKU09OLnN0cmluZ2lmeShuZXdQcm9wcy5sb2dnaW5nKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkUHJvcHMubG9nZ2luZyksXG4gIH07XG59XG5cbmZ1bmN0aW9uIHNldHNFcXVhbChmaXJzdDogU2V0PHN0cmluZz4sIHNlY29uZDogU2V0PHN0cmluZz4pIHtcbiAgcmV0dXJuIGZpcnN0LnNpemUgPT09IHNlY29uZC5zaXplICYmIFsuLi5maXJzdF0uZXZlcnkoKGU6IHN0cmluZykgPT4gc2Vjb25kLmhhcyhlKSk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts deleted file mode 100644 index c058e47b62c68..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts +++ /dev/null @@ -1,348 +0,0 @@ -/* eslint-disable no-console */ - -// eslint-disable-next-line import/no-extraneous-dependencies -// eslint-disable-next-line import/no-extraneous-dependencies -import * as aws from 'aws-sdk'; -import { EksClient, ResourceEvent, ResourceHandler } from './common'; -import { compareLoggingProps } from './compareLogging'; -import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; - -const MAX_CLUSTER_NAME_LEN = 100; - -export class ClusterResourceHandler extends ResourceHandler { - public get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - - return this.physicalResourceId; - } - - private readonly newProps: aws.EKS.CreateClusterRequest; - private readonly oldProps: Partial; - - constructor(eks: EksClient, event: ResourceEvent) { - super(eks, event); - - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - - // ------ - // CREATE - // ------ - - protected async onCreate(): Promise { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - - const clusterName = this.newProps.name || this.generateClusterName(); - - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - - return { - PhysicalResourceId: resp.cluster.name, - }; - } - - protected async isCreateComplete() { - return this.isActive(); - } - - // ------ - // DELETE - // ------ - - protected async onDelete(): Promise { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } catch (e: any) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - - protected async isDeleteComplete(): Promise { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } catch (e: any) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - - console.log('describeCluster error:', e); - throw e; - } - - return { - IsComplete: false, - }; - } - - // ------ - // UPDATE - // ------ - - protected async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - - return this.onCreate(); - } - - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - - return this.updateClusterVersion(this.newProps.version); - } - - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - - if (updates.updateLogging || updates.updateAccess) { - const config: aws.EKS.UpdateClusterConfigRequest = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - }; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - - return { EksUpdateId: updateResponse.update?.id }; - } - - // no updates - return; - } - - protected async isUpdateComplete() { - console.log('isUpdateComplete'); - - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - - return this.isActive(); - } - - private async updateClusterVersion(newVersion: string) { - console.log(`updating cluster version to ${newVersion}`); - - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - - private async isActive(): Promise { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url - - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - - private async isEksUpdateComplete(eksUpdateId: string) { - this.log({ isEksUpdateComplete: eksUpdateId }); - - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - - this.log({ describeUpdateResponse }); - - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - - private generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} - -function parseProps(props: any): aws.EKS.CreateClusterRequest { - - const parsed = props?.Config ?? {}; - - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - - return parsed; - -} - -interface UpdateMap { - replaceName: boolean; // name - replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds - replaceRole: boolean; // roleArn - - updateVersion: boolean; // version - updateLogging: boolean; // logging - updateEncryption: boolean; // encryption (cannot be updated) - updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess -} - -function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: - JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: - newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} - -function setsEqual(first: Set, second: Set) { - return first.size === second.size && [...first].every((e: string) => second.has(e)); -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js deleted file mode 100644 index 34ab6ff0ba0e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FargateProfileResourceHandler = void 0; -const common_1 = require("./common"); -const MAX_NAME_LEN = 63; -class FargateProfileResourceHandler extends common_1.ResourceHandler { - async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - const createFargateProfile = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - const deleteFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - return; - } - async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - async isCreateComplete() { - return this.isUpdateComplete(); - } - async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - /** - * Generates a fargate profile name. - */ - generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - async queryStatus() { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - const describeFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - try { - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - return status; - } - catch (describeFargateProfileError) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} -exports.FargateProfileResourceHandler = FargateProfileResourceHandler; -//# sourceMappingURL=data:application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GF3YWl0IHRoaXMuZWtzLmRlc2NyaWJlRmFyZ2F0ZVByb2ZpbGUoZGVzY3JpYmVGYXJnYXRlUHJvZmlsZSk7XG4gICAgICB0aGlzLmxvZyh7IGRlc2NyaWJlRmFyZ2F0ZVByb2ZpbGVSZXNwb25zZSB9KTtcbiAgICAgIGNvbnN0IHN0YXR1cyA9IGRlc2NyaWJlRmFyZ2F0ZVByb2ZpbGVSZXNwb25zZS5mYXJnYXRlUHJvZmlsZT8uc3RhdHVzO1xuXG4gICAgICBpZiAoc3RhdHVzID09PSAnQ1JFQVRFX0ZBSUxFRCcgfHwgc3RhdHVzID09PSAnREVMRVRFX0ZBSUxFRCcpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKHN0YXR1cyk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfSBjYXRjaCAoZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yOiBhbnkpIHtcbiAgICAgIGlmIChkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IuY29kZSA9PT0gJ1Jlc291cmNlTm90Rm91bmRFeGNlcHRpb24nKSB7XG4gICAgICAgIHRoaXMubG9nKCdyZWNlaXZlZCBSZXNvdXJjZU5vdEZvdW5kRXhjZXB0aW9uLCB0aGlzIG1lYW5zIHRoZSBwcm9maWxlIGhhcyBiZWVuIGRlbGV0ZWQgKG9yIG5ldmVyIGV4aXN0ZWQpJyk7XG4gICAgICAgIHJldHVybiAnTk9UX0ZPVU5EJztcbiAgICAgIH1cblxuICAgICAgdGhpcy5sb2coeyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IgfSk7XG4gICAgICB0aHJvdyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3I7XG4gICAgfVxuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts deleted file mode 100644 index 7db97a7f69d38..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts +++ /dev/null @@ -1,119 +0,0 @@ -import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies -import { ResourceHandler } from './common'; - -const MAX_NAME_LEN = 63; - -export class FargateProfileResourceHandler extends ResourceHandler { - protected async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - - const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - - protected async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - - const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - - return; - } - - protected async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - - protected async isCreateComplete() { - return this.isUpdateComplete(); - } - - protected async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - - protected async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - - /** - * Generates a fargate profile name. - */ - private generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - private async queryStatus(): Promise { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - - const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - try { - - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - - return status; - } catch (describeFargateProfileError: any) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js new file mode 100644 index 0000000000000..aefb970a3fe47 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js @@ -0,0 +1,280 @@ +"use strict"; +/* eslint-disable no-console */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClusterResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const compareLogging_1 = require("./compareLogging"); +const MAX_CLUSTER_NAME_LEN = 100; +class ClusterResourceHandler extends common_1.ResourceHandler { + get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + return this.physicalResourceId; + } + constructor(eks, event) { + super(eks, event); + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + // ------ + // CREATE + // ------ + async onCreate() { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + const clusterName = this.newProps.name || this.generateClusterName(); + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + return { + PhysicalResourceId: resp.cluster.name, + }; + } + async isCreateComplete() { + return this.isActive(); + } + // ------ + // DELETE + // ------ + async onDelete() { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } + catch (e) { + if (!(e instanceof client_eks_1.ResourceNotFoundException)) { + throw e; + } + else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + async isDeleteComplete() { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } + catch (e) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof client_eks_1.ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + console.log('describeCluster error:', e); + throw e; + } + return { + IsComplete: false, + }; + } + // ------ + // UPDATE + // ------ + async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + return this.onCreate(); + } + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + return this.updateClusterVersion(this.newProps.version); + } + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + if (updates.updateLogging || updates.updateAccess) { + const config = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + } + ; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + return { EksUpdateId: updateResponse.update?.id }; + } + // no updates + return; + } + async isUpdateComplete() { + console.log('isUpdateComplete'); + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + return this.isActive(); + } + async updateClusterVersion(newVersion) { + console.log(`updating cluster version to ${newVersion}`); + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + async isActive() { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } + else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } + else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + async isEksUpdateComplete(eksUpdateId) { + this.log({ isEksUpdateComplete: eksUpdateId }); + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + this.log({ describeUpdateResponse }); + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} +exports.ClusterResourceHandler = ClusterResourceHandler; +function parseProps(props) { + const parsed = props?.Config ?? {}; + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + return parsed; +} +function analyzeUpdate(oldProps, newProps) { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} +function setsEqual(first, second) { + return first.size === second.size && [...first].every((e) => second.has(e)); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBRS9CLDZEQUE2RDtBQUM3RCxvREFBZ0U7QUFHaEUscUNBQXFFO0FBQ3JFLHFEQUF1RDtBQUd2RCxNQUFNLG9CQUFvQixHQUFHLEdBQUcsQ0FBQztBQUVqQyxNQUFhLHNCQUF1QixTQUFRLHdCQUFlO0lBQ3pELElBQVcsV0FBVztRQUNwQixJQUFJLENBQUMsSUFBSSxDQUFDLGtCQUFrQixFQUFFO1lBQzVCLE1BQU0sSUFBSSxLQUFLLENBQUMsNERBQTRELENBQUMsQ0FBQztTQUMvRTtRQUVELE9BQU8sSUFBSSxDQUFDLGtCQUFrQixDQUFDO0tBQ2hDO0lBS0QsWUFBWSxHQUFjLEVBQUUsS0FBb0I7UUFDOUMsS0FBSyxDQUFDLEdBQUcsRUFBRSxLQUFLLENBQUMsQ0FBQztRQUVsQixJQUFJLENBQUMsUUFBUSxHQUFHLFVBQVUsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLENBQUM7UUFDMUQsSUFBSSxDQUFDLFFBQVEsR0FBRyxLQUFLLENBQUMsV0FBVyxLQUF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0cmluZ2lmeShvbGRWcGNQcm9wcy5zZWN1cml0eUdyb3VwSWRzPy5zb3J0KCkpLFxuICAgIHVwZGF0ZUFjY2VzczpcbiAgICAgIG5ld1ZwY1Byb3BzLmVuZHBvaW50UHJpdmF0ZUFjY2VzcyAhPT0gb2xkVnBjUHJvcHMuZW5kcG9pbnRQcml2YXRlQWNjZXNzIHx8XG4gICAgICBuZXdWcGNQcm9wcy5lbmRwb2ludFB1YmxpY0FjY2VzcyAhPT0gb2xkVnBjUHJvcHMuZW5kcG9pbnRQdWJsaWNBY2Nlc3MgfHxcbiAgICAgICFzZXRzRXF1YWwobmV3UHVibGljQWNjZXNzQ2lkcnMsIG9sZFB1YmxpY0FjY2Vzc0NpZHJzKSxcbiAgICByZXBsYWNlUm9sZTogbmV3UHJvcHMucm9sZUFybiAhPT0gb2xkUHJvcHMucm9sZUFybixcbiAgICB1cGRhdGVWZXJzaW9uOiBuZXdQcm9wcy52ZXJzaW9uICE9PSBvbGRQcm9wcy52ZXJzaW9uLFxuICAgIHVwZGF0ZUVuY3J5cHRpb246IEpTT04uc3RyaW5naWZ5KG5ld0VuYykgIT09IEpTT04uc3RyaW5naWZ5KG9sZEVuYyksXG4gICAgdXBkYXRlTG9nZ2luZzogSlNPTi5zdHJpbmdpZnkobmV3UHJvcHMubG9nZ2luZykgIT09IEpTT04uc3RyaW5naWZ5KG9sZFByb3BzLmxvZ2dpbmcpLFxuICB9O1xufVxuXG5mdW5jdGlvbiBzZXRzRXF1YWwoZmlyc3Q6IFNldDxzdHJpbmc+LCBzZWNvbmQ6IFNldDxzdHJpbmc+KSB7XG4gIHJldHVybiBmaXJzdC5zaXplID09PSBzZWNvbmQuc2l6ZSAmJiBbLi4uZmlyc3RdLmV2ZXJ5KChlOiBzdHJpbmcpID0+IHNlY29uZC5oYXMoZSkpO1xufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts new file mode 100644 index 0000000000000..3a0a7294db31d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts @@ -0,0 +1,350 @@ +/* eslint-disable no-console */ + +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +// eslint-disable-next-line import/no-extraneous-dependencies +import * as aws from 'aws-sdk'; +import { EksClient, ResourceEvent, ResourceHandler } from './common'; +import { compareLoggingProps } from './compareLogging'; +import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; + +const MAX_CLUSTER_NAME_LEN = 100; + +export class ClusterResourceHandler extends ResourceHandler { + public get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + + return this.physicalResourceId; + } + + private readonly newProps: aws.EKS.CreateClusterRequest; + private readonly oldProps: Partial; + + constructor(eks: EksClient, event: ResourceEvent) { + super(eks, event); + + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + + // ------ + // CREATE + // ------ + + protected async onCreate(): Promise { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + + const clusterName = this.newProps.name || this.generateClusterName(); + + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + + return { + PhysicalResourceId: resp.cluster.name, + }; + } + + protected async isCreateComplete() { + return this.isActive(); + } + + // ------ + // DELETE + // ------ + + protected async onDelete(): Promise { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } catch (e: any) { + if (!(e instanceof ResourceNotFoundException)) { + throw e; + } else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + + protected async isDeleteComplete(): Promise { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } catch (e: any) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + + console.log('describeCluster error:', e); + throw e; + } + + return { + IsComplete: false, + }; + } + + // ------ + // UPDATE + // ------ + + protected async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + + return this.onCreate(); + } + + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + + return this.updateClusterVersion(this.newProps.version); + } + + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + + if (updates.updateLogging || updates.updateAccess) { + const config: aws.EKS.UpdateClusterConfigRequest = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + }; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + + return { EksUpdateId: updateResponse.update?.id }; + } + + // no updates + return; + } + + protected async isUpdateComplete() { + console.log('isUpdateComplete'); + + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + + return this.isActive(); + } + + private async updateClusterVersion(newVersion: string) { + console.log(`updating cluster version to ${newVersion}`); + + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + + private async isActive(): Promise { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url + + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + + private async isEksUpdateComplete(eksUpdateId: string) { + this.log({ isEksUpdateComplete: eksUpdateId }); + + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + + this.log({ describeUpdateResponse }); + + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + + private generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} + +function parseProps(props: any): aws.EKS.CreateClusterRequest { + + const parsed = props?.Config ?? {}; + + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + + return parsed; + +} + +interface UpdateMap { + replaceName: boolean; // name + replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds + replaceRole: boolean; // roleArn + + updateVersion: boolean; // version + updateLogging: boolean; // logging + updateEncryption: boolean; // encryption (cannot be updated) + updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess +} + +function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: + JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: + newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} + +function setsEqual(first: Set, second: Set) { + return first.size === second.size && [...first].every((e: string) => second.has(e)); +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js new file mode 100644 index 0000000000000..ed1eab8530351 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FargateProfileResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const MAX_NAME_LEN = 63; +class FargateProfileResourceHandler extends common_1.ResourceHandler { + async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + const createFargateProfile = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + const deleteFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + return; + } + async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + async isCreateComplete() { + return this.isUpdateComplete(); + } + async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + /** + * Generates a fargate profile name. + */ + generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + async queryStatus() { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + const describeFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + try { + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + return status; + } + catch (describeFargateProfileError) { + if (describeFargateProfileError instanceof client_eks_1.ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} +exports.FargateProfileResourceHandler = FargateProfileResourceHandler; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsNkRBQTZEO0FBQzdELG9EQUFnRTtBQUVoRSxxQ0FBMkM7QUFFM0MsTUFBTSxZQUFZLEdBQUcsRUFBRSxDQUFDO0FBRXhCLE1BQWEsNkJBQThCLFNBQVEsd0JBQWU7SUFDdEQsS0FBSyxDQUFDLFFBQVE7UUFDdEIsTUFBTSxrQkFBa0IsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU0sQ0FBQyxrQkFBa0IsSUFBSSxJQUFJLENBQUMs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ztcblxuICAgICAgaWYgKHN0YXR1cyA9PT0gJ0NSRUFURV9GQUlMRUQnIHx8IHN0YXR1cyA9PT0gJ0RFTEVURV9GQUlMRUQnKSB7XG4gICAgICAgIHRocm93IG5ldyBFcnJvcihzdGF0dXMpO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gc3RhdHVzO1xuICAgIH0gY2F0Y2ggKGRlc2NyaWJlRmFyZ2F0ZVByb2ZpbGVFcnJvcjogYW55KSB7XG4gICAgICBpZiAoZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yIGluc3RhbmNlb2YgUmVzb3VyY2VOb3RGb3VuZEV4Y2VwdGlvbikge1xuICAgICAgICB0aGlzLmxvZygncmVjZWl2ZWQgUmVzb3VyY2VOb3RGb3VuZEV4Y2VwdGlvbiwgdGhpcyBtZWFucyB0aGUgcHJvZmlsZSBoYXMgYmVlbiBkZWxldGVkIChvciBuZXZlciBleGlzdGVkKScpO1xuICAgICAgICByZXR1cm4gJ05PVF9GT1VORCc7XG4gICAgICB9XG5cbiAgICAgIHRoaXMubG9nKHsgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yIH0pO1xuICAgICAgdGhyb3cgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yO1xuICAgIH1cbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts new file mode 100644 index 0000000000000..16b9f9abfeb49 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts @@ -0,0 +1,121 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies +import { ResourceHandler } from './common'; + +const MAX_NAME_LEN = 63; + +export class FargateProfileResourceHandler extends ResourceHandler { + protected async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + + const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + + protected async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + + const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + + return; + } + + protected async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + + protected async isCreateComplete() { + return this.isUpdateComplete(); + } + + protected async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + + protected async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + + /** + * Generates a fargate profile name. + */ + private generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + private async queryStatus(): Promise { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + + const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + try { + + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + + return status; + } catch (describeFargateProfileError: any) { + if (describeFargateProfileError instanceof ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip new file mode 100644 index 0000000000000..90a8a2a6e2615 Binary files /dev/null and b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/aws-stepfunctions-tasks-eks-call-integ-test.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/aws-stepfunctions-tasks-eks-call-integ-test.assets.json index 759a141c976e2..7e65b99f70261 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/aws-stepfunctions-tasks-eks-call-integ-test.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/aws-stepfunctions-tasks-eks-call-integ-test.assets.json @@ -14,15 +14,15 @@ } } }, - "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649": { + "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31": { "source": { - "path": "asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649", + "path": "asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip", + "objectKey": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -53,15 +53,15 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -79,7 +79,7 @@ } } }, - "17bbe2f9506dfe9022408968431aa5cd7914eb5c62ca37a7bd9fb8952738167b": { + "b68a6a69d0da24e76a7a62cf86179bf06cea38f4e67ad638604c6f5cfed111a1": { "source": { "path": "awsstepfunctionstasksekscallintegtestawscdkawseksClusterResourceProvider412BC189.nested.template.json", "packaging": "file" @@ -87,12 +87,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "17bbe2f9506dfe9022408968431aa5cd7914eb5c62ca37a7bd9fb8952738167b.json", + "objectKey": "b68a6a69d0da24e76a7a62cf86179bf06cea38f4e67ad638604c6f5cfed111a1.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "fa84415288d6bec8fb026e8e09ecc944dc0fc76fe0d58aadb5d8e8df3a7351bc": { + "0457e9dadb1598a90dbdd45a0fca6e6f77ac3dc6d5db8327a094e4cb235bf3c0": { "source": { "path": "awsstepfunctionstasksekscallintegtestawscdkawseksKubectlProvider65D285A0.nested.template.json", "packaging": "file" @@ -100,12 +100,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "fa84415288d6bec8fb026e8e09ecc944dc0fc76fe0d58aadb5d8e8df3a7351bc.json", + "objectKey": "0457e9dadb1598a90dbdd45a0fca6e6f77ac3dc6d5db8327a094e4cb235bf3c0.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "f040ffff650d9ac471762cdf138cc4cd6263be25cc9e8fb0a64116e3a23accd0": { + "83cab5fc521b04b09223a736a1c0418eccbd1cd117bcec92d8a14a6272296a5c": { "source": { "path": "aws-stepfunctions-tasks-eks-call-integ-test.template.json", "packaging": "file" @@ -113,7 +113,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "f040ffff650d9ac471762cdf138cc4cd6263be25cc9e8fb0a64116e3a23accd0.json", + "objectKey": "83cab5fc521b04b09223a736a1c0418eccbd1cd117bcec92d8a14a6272296a5c.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/aws-stepfunctions-tasks-eks-call-integ-test.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/aws-stepfunctions-tasks-eks-call-integ-test.template.json index c43a3ee94a224..40e630d27de7c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/aws-stepfunctions-tasks-eks-call-integ-test.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/aws-stepfunctions-tasks-eks-call-integ-test.template.json @@ -1068,7 +1068,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/17bbe2f9506dfe9022408968431aa5cd7914eb5c62ca37a7bd9fb8952738167b.json" + "/b68a6a69d0da24e76a7a62cf86179bf06cea38f4e67ad638604c6f5cfed111a1.json" ] ] } @@ -1115,7 +1115,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/fa84415288d6bec8fb026e8e09ecc944dc0fc76fe0d58aadb5d8e8df3a7351bc.json" + "/0457e9dadb1598a90dbdd45a0fca6e6f77ac3dc6d5db8327a094e4cb235bf3c0.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/awsstepfunctionstasksekscallintegtestawscdkawseksClusterResourceProvider412BC189.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/awsstepfunctionstasksekscallintegtestawscdkawseksClusterResourceProvider412BC189.nested.template.json index b84a9ddc06a85..e98fabfa827e1 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/awsstepfunctionstasksekscallintegtestawscdkawseksClusterResourceProvider412BC189.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/awsstepfunctionstasksekscallintegtestawscdkawseksClusterResourceProvider412BC189.nested.template.json @@ -50,7 +50,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "onEvent handler for EKS cluster resource provider", "Environment": { @@ -115,7 +115,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "isComplete handler for EKS cluster resource provider", "Environment": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/awsstepfunctionstasksekscallintegtestawscdkawseksKubectlProvider65D285A0.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/awsstepfunctionstasksekscallintegtestawscdkawseksKubectlProvider65D285A0.nested.template.json index e0a3df43ef033..2332e7caf21f9 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/awsstepfunctionstasksekscallintegtestawscdkawseksKubectlProvider65D285A0.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/awsstepfunctionstasksekscallintegtestawscdkawseksKubectlProvider65D285A0.nested.template.json @@ -49,7 +49,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/cdk.out index f0b901e7c06e5..560dae10d018f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"33.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/manifest.json index a29f0f70d7977..d040566838e3e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/manifest.json @@ -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}/f040ffff650d9ac471762cdf138cc4cd6263be25cc9e8fb0a64116e3a23accd0.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/83cab5fc521b04b09223a736a1c0418eccbd1cd117bcec92d8a14a6272296a5c.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/tree.json index 4342c59f9906e..7602a92ece127 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/eks/integ.call.js.snapshot/tree.json @@ -1538,7 +1538,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "onEvent handler for EKS cluster resource provider", "environment": { @@ -1670,7 +1670,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "isComplete handler for EKS cluster resource provider", "environment": { @@ -2576,7 +2576,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/17bbe2f9506dfe9022408968431aa5cd7914eb5c62ca37a7bd9fb8952738167b.json" + "/b68a6a69d0da24e76a7a62cf86179bf06cea38f4e67ad638604c6f5cfed111a1.json" ] ] } @@ -2723,7 +2723,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -3132,7 +3132,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/fa84415288d6bec8fb026e8e09ecc944dc0fc76fe0d58aadb5d8e8df3a7351bc.json" + "/0457e9dadb1598a90dbdd45a0fca6e6f77ac3dc6d5db8327a094e4cb235bf3c0.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip deleted file mode 100644 index e6cb898734b43..0000000000000 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and /dev/null differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js deleted file mode 100644 index b89707a0a08e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js +++ /dev/null @@ -1,277 +0,0 @@ -"use strict"; -/* eslint-disable no-console */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ClusterResourceHandler = void 0; -const common_1 = require("./common"); -const compareLogging_1 = require("./compareLogging"); -const MAX_CLUSTER_NAME_LEN = 100; -class ClusterResourceHandler extends common_1.ResourceHandler { - get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - return this.physicalResourceId; - } - constructor(eks, event) { - super(eks, event); - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - // ------ - // CREATE - // ------ - async onCreate() { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - const clusterName = this.newProps.name || this.generateClusterName(); - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - return { - PhysicalResourceId: resp.cluster.name, - }; - } - async isCreateComplete() { - return this.isActive(); - } - // ------ - // DELETE - // ------ - async onDelete() { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } - catch (e) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } - else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - async isDeleteComplete() { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } - catch (e) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - console.log('describeCluster error:', e); - throw e; - } - return { - IsComplete: false, - }; - } - // ------ - // UPDATE - // ------ - async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - return this.onCreate(); - } - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - return this.updateClusterVersion(this.newProps.version); - } - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - if (updates.updateLogging || updates.updateAccess) { - const config = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - } - ; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - return { EksUpdateId: updateResponse.update?.id }; - } - // no updates - return; - } - async isUpdateComplete() { - console.log('isUpdateComplete'); - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - return this.isActive(); - } - async updateClusterVersion(newVersion) { - console.log(`updating cluster version to ${newVersion}`); - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - async isActive() { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } - else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } - else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - async isEksUpdateComplete(eksUpdateId) { - this.log({ isEksUpdateComplete: eksUpdateId }); - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - this.log({ describeUpdateResponse }); - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} -exports.ClusterResourceHandler = ClusterResourceHandler; -function parseProps(props) { - const parsed = props?.Config ?? {}; - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - return parsed; -} -function analyzeUpdate(oldProps, newProps) { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} -function setsEqual(first, second) { - return first.size === second.size && [...first].every((e) => second.has(e)); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBSy9CLHFDQUFxRTtBQUNyRSxxREFBdUQ7QUFHdkQsTUFBTSxvQkFBb0IsR0FBRyxHQUFHLENBQUM7QUFFakMsTUFBYSxzQkFBdUIsU0FBUSx3QkFBZTtJQUN6RCxJQUFXLFdBQVc7UUFDcEIsSUFBSSxDQUFDLElBQUksQ0FBQyxrQkFBa0IsRUFBRTtZQUM1QixNQUFNLElBQUksS0FBSyxDQUFDLDREQUE0RCxDQUFDLENBQUM7U0FDL0U7UUFFRCxPQUFPLElBQUksQ0FBQyxrQkFBa0IsQ0FBQztLQUNoQztJQUtELFlBQVksR0FBYyxFQUFFLEtBQW9CO1FBQzlDLEtBQUssQ0FBQyxHQUFHLEVBQUUsS0FBSyxDQUFDLENBQUM7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cnQoKSkgIT09IEpTT04uc3RyaW5naWZ5KG9sZFZwY1Byb3BzLnNlY3VyaXR5R3JvdXBJZHM/LnNvcnQoKSksXG4gICAgdXBkYXRlQWNjZXNzOlxuICAgICAgbmV3VnBjUHJvcHMuZW5kcG9pbnRQcml2YXRlQWNjZXNzICE9PSBvbGRWcGNQcm9wcy5lbmRwb2ludFByaXZhdGVBY2Nlc3MgfHxcbiAgICAgIG5ld1ZwY1Byb3BzLmVuZHBvaW50UHVibGljQWNjZXNzICE9PSBvbGRWcGNQcm9wcy5lbmRwb2ludFB1YmxpY0FjY2VzcyB8fFxuICAgICAgIXNldHNFcXVhbChuZXdQdWJsaWNBY2Nlc3NDaWRycywgb2xkUHVibGljQWNjZXNzQ2lkcnMpLFxuICAgIHJlcGxhY2VSb2xlOiBuZXdQcm9wcy5yb2xlQXJuICE9PSBvbGRQcm9wcy5yb2xlQXJuLFxuICAgIHVwZGF0ZVZlcnNpb246IG5ld1Byb3BzLnZlcnNpb24gIT09IG9sZFByb3BzLnZlcnNpb24sXG4gICAgdXBkYXRlRW5jcnlwdGlvbjogSlNPTi5zdHJpbmdpZnkobmV3RW5jKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkRW5jKSxcbiAgICB1cGRhdGVMb2dnaW5nOiBKU09OLnN0cmluZ2lmeShuZXdQcm9wcy5sb2dnaW5nKSAhPT0gSlNPTi5zdHJpbmdpZnkob2xkUHJvcHMubG9nZ2luZyksXG4gIH07XG59XG5cbmZ1bmN0aW9uIHNldHNFcXVhbChmaXJzdDogU2V0PHN0cmluZz4sIHNlY29uZDogU2V0PHN0cmluZz4pIHtcbiAgcmV0dXJuIGZpcnN0LnNpemUgPT09IHNlY29uZC5zaXplICYmIFsuLi5maXJzdF0uZXZlcnkoKGU6IHN0cmluZykgPT4gc2Vjb25kLmhhcyhlKSk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts deleted file mode 100644 index c058e47b62c68..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts +++ /dev/null @@ -1,348 +0,0 @@ -/* eslint-disable no-console */ - -// eslint-disable-next-line import/no-extraneous-dependencies -// eslint-disable-next-line import/no-extraneous-dependencies -import * as aws from 'aws-sdk'; -import { EksClient, ResourceEvent, ResourceHandler } from './common'; -import { compareLoggingProps } from './compareLogging'; -import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; - -const MAX_CLUSTER_NAME_LEN = 100; - -export class ClusterResourceHandler extends ResourceHandler { - public get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - - return this.physicalResourceId; - } - - private readonly newProps: aws.EKS.CreateClusterRequest; - private readonly oldProps: Partial; - - constructor(eks: EksClient, event: ResourceEvent) { - super(eks, event); - - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - - // ------ - // CREATE - // ------ - - protected async onCreate(): Promise { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - - const clusterName = this.newProps.name || this.generateClusterName(); - - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - - return { - PhysicalResourceId: resp.cluster.name, - }; - } - - protected async isCreateComplete() { - return this.isActive(); - } - - // ------ - // DELETE - // ------ - - protected async onDelete(): Promise { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } catch (e: any) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - - protected async isDeleteComplete(): Promise { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } catch (e: any) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - - console.log('describeCluster error:', e); - throw e; - } - - return { - IsComplete: false, - }; - } - - // ------ - // UPDATE - // ------ - - protected async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - - return this.onCreate(); - } - - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - - return this.updateClusterVersion(this.newProps.version); - } - - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - - if (updates.updateLogging || updates.updateAccess) { - const config: aws.EKS.UpdateClusterConfigRequest = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - }; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - - return { EksUpdateId: updateResponse.update?.id }; - } - - // no updates - return; - } - - protected async isUpdateComplete() { - console.log('isUpdateComplete'); - - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - - return this.isActive(); - } - - private async updateClusterVersion(newVersion: string) { - console.log(`updating cluster version to ${newVersion}`); - - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - - private async isActive(): Promise { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url - - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - - private async isEksUpdateComplete(eksUpdateId: string) { - this.log({ isEksUpdateComplete: eksUpdateId }); - - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - - this.log({ describeUpdateResponse }); - - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - - private generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} - -function parseProps(props: any): aws.EKS.CreateClusterRequest { - - const parsed = props?.Config ?? {}; - - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - - return parsed; - -} - -interface UpdateMap { - replaceName: boolean; // name - replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds - replaceRole: boolean; // roleArn - - updateVersion: boolean; // version - updateLogging: boolean; // logging - updateEncryption: boolean; // encryption (cannot be updated) - updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess -} - -function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: - JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: - newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} - -function setsEqual(first: Set, second: Set) { - return first.size === second.size && [...first].every((e: string) => second.has(e)); -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js deleted file mode 100644 index 34ab6ff0ba0e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FargateProfileResourceHandler = void 0; -const common_1 = require("./common"); -const MAX_NAME_LEN = 63; -class FargateProfileResourceHandler extends common_1.ResourceHandler { - async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - const createFargateProfile = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - const deleteFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - return; - } - async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - async isCreateComplete() { - return this.isUpdateComplete(); - } - async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - /** - * Generates a fargate profile name. - */ - generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - async queryStatus() { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - const describeFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - try { - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - return status; - } - catch (describeFargateProfileError) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} -exports.FargateProfileResourceHandler = FargateProfileResourceHandler; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EscUNBQTJDO0FBRTNDLE1BQU0sWUFBWSxHQUFHLEVBQUUsQ0FBQztBQUV4QixNQUFhLDZCQUE4QixTQUFRLHdCQUFlO0lBQ3RELEtBQUssQ0FBQyxRQUFRO1FBQ3RCLE1BQU0sa0JBQWtCLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNLENBQUMsa0JBQWtCLElBQUksSUFBSSxDQUFDLG1CQUFtQixFQUFFLENBQUM7UUFFakgsTUFBTSxvQkFBb0IsR0FBd0M7WUFDaEUsa0JBQWtCO1lBQ2xCLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNO1NBQ3hDLENBQUM7UUFFRixJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsb0JBQW9CLEVBQUUsQ0FBQyxDQUFDO1FBQ25DLE1BQU0sNEJBQTRCLEdBQUcsTUFBTSxJQUFJLENBQUMsR0FBRyxDQUFDLG9CQUFvQixDQUFDLG9CQUFvQixDQUFDLENBQUM7UUFDL0YsSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLDRCQUE0QixFQUFFLENBQUMsQ0FBQztRQUUzQyxJQUFJLENBQUMsNEJBQTRCLENBQUMsY0FBY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ICAgdGhpcy5sb2coeyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IgfSk7XG4gICAgICB0aHJvdyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3I7XG4gICAgfVxuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts deleted file mode 100644 index 7db97a7f69d38..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts +++ /dev/null @@ -1,119 +0,0 @@ -import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies -import { ResourceHandler } from './common'; - -const MAX_NAME_LEN = 63; - -export class FargateProfileResourceHandler extends ResourceHandler { - protected async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - - const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - - protected async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - - const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - - return; - } - - protected async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - - protected async isCreateComplete() { - return this.isUpdateComplete(); - } - - protected async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - - protected async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - - /** - * Generates a fargate profile name. - */ - private generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - private async queryStatus(): Promise { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - - const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - try { - - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - - return status; - } catch (describeFargateProfileError: any) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js new file mode 100644 index 0000000000000..aefb970a3fe47 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js @@ -0,0 +1,280 @@ +"use strict"; +/* eslint-disable no-console */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClusterResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const compareLogging_1 = require("./compareLogging"); +const MAX_CLUSTER_NAME_LEN = 100; +class ClusterResourceHandler extends common_1.ResourceHandler { + get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + return this.physicalResourceId; + } + constructor(eks, event) { + super(eks, event); + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + // ------ + // CREATE + // ------ + async onCreate() { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + const clusterName = this.newProps.name || this.generateClusterName(); + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + return { + PhysicalResourceId: resp.cluster.name, + }; + } + async isCreateComplete() { + return this.isActive(); + } + // ------ + // DELETE + // ------ + async onDelete() { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } + catch (e) { + if (!(e instanceof client_eks_1.ResourceNotFoundException)) { + throw e; + } + else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + async isDeleteComplete() { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } + catch (e) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof client_eks_1.ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + console.log('describeCluster error:', e); + throw e; + } + return { + IsComplete: false, + }; + } + // ------ + // UPDATE + // ------ + async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + return this.onCreate(); + } + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + return this.updateClusterVersion(this.newProps.version); + } + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + if (updates.updateLogging || updates.updateAccess) { + const config = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + } + ; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + return { EksUpdateId: updateResponse.update?.id }; + } + // no updates + return; + } + async isUpdateComplete() { + console.log('isUpdateComplete'); + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + return this.isActive(); + } + async updateClusterVersion(newVersion) { + console.log(`updating cluster version to ${newVersion}`); + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + async isActive() { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } + else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } + else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + async isEksUpdateComplete(eksUpdateId) { + this.log({ isEksUpdateComplete: eksUpdateId }); + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + this.log({ describeUpdateResponse }); + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} +exports.ClusterResourceHandler = ClusterResourceHandler; +function parseProps(props) { + const parsed = props?.Config ?? {}; + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + return parsed; +} +function analyzeUpdate(oldProps, newProps) { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} +function setsEqual(first, second) { + return first.size === second.size && [...first].every((e) => second.has(e)); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBRS9CLDZEQUE2RDtBQUM3RCxvREFBZ0U7QUFHaEUscUNBQXFFO0FBQ3JFLHFEQUF1RDtBQUd2RCxNQUFNLG9CQUFvQixHQUFHLEdBQUcsQ0FBQztBQUVqQyxNQUFhLHNCQUF1QixTQUFRLHdCQUFlO0lBQ3pELElBQVcsV0FBVztRQUNwQixJQUFJLENBQUMsSUFBSSxDQUFDLGtCQUFrQixFQUFFO1lBQzVCLE1BQU0sSUFB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c3RyaW5naWZ5KG9sZFByb3BzLmxvZ2dpbmcpLFxuICB9O1xufVxuXG5mdW5jdGlvbiBzZXRzRXF1YWwoZmlyc3Q6IFNldDxzdHJpbmc+LCBzZWNvbmQ6IFNldDxzdHJpbmc+KSB7XG4gIHJldHVybiBmaXJzdC5zaXplID09PSBzZWNvbmQuc2l6ZSAmJiBbLi4uZmlyc3RdLmV2ZXJ5KChlOiBzdHJpbmcpID0+IHNlY29uZC5oYXMoZSkpO1xufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts new file mode 100644 index 0000000000000..3a0a7294db31d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts @@ -0,0 +1,350 @@ +/* eslint-disable no-console */ + +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +// eslint-disable-next-line import/no-extraneous-dependencies +import * as aws from 'aws-sdk'; +import { EksClient, ResourceEvent, ResourceHandler } from './common'; +import { compareLoggingProps } from './compareLogging'; +import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; + +const MAX_CLUSTER_NAME_LEN = 100; + +export class ClusterResourceHandler extends ResourceHandler { + public get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + + return this.physicalResourceId; + } + + private readonly newProps: aws.EKS.CreateClusterRequest; + private readonly oldProps: Partial; + + constructor(eks: EksClient, event: ResourceEvent) { + super(eks, event); + + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + + // ------ + // CREATE + // ------ + + protected async onCreate(): Promise { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + + const clusterName = this.newProps.name || this.generateClusterName(); + + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + + return { + PhysicalResourceId: resp.cluster.name, + }; + } + + protected async isCreateComplete() { + return this.isActive(); + } + + // ------ + // DELETE + // ------ + + protected async onDelete(): Promise { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } catch (e: any) { + if (!(e instanceof ResourceNotFoundException)) { + throw e; + } else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + + protected async isDeleteComplete(): Promise { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } catch (e: any) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + + console.log('describeCluster error:', e); + throw e; + } + + return { + IsComplete: false, + }; + } + + // ------ + // UPDATE + // ------ + + protected async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + + return this.onCreate(); + } + + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + + return this.updateClusterVersion(this.newProps.version); + } + + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + + if (updates.updateLogging || updates.updateAccess) { + const config: aws.EKS.UpdateClusterConfigRequest = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + }; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + + return { EksUpdateId: updateResponse.update?.id }; + } + + // no updates + return; + } + + protected async isUpdateComplete() { + console.log('isUpdateComplete'); + + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + + return this.isActive(); + } + + private async updateClusterVersion(newVersion: string) { + console.log(`updating cluster version to ${newVersion}`); + + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + + private async isActive(): Promise { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url + + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + + private async isEksUpdateComplete(eksUpdateId: string) { + this.log({ isEksUpdateComplete: eksUpdateId }); + + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + + this.log({ describeUpdateResponse }); + + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + + private generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} + +function parseProps(props: any): aws.EKS.CreateClusterRequest { + + const parsed = props?.Config ?? {}; + + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + + return parsed; + +} + +interface UpdateMap { + replaceName: boolean; // name + replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds + replaceRole: boolean; // roleArn + + updateVersion: boolean; // version + updateLogging: boolean; // logging + updateEncryption: boolean; // encryption (cannot be updated) + updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess +} + +function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: + JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: + newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} + +function setsEqual(first: Set, second: Set) { + return first.size === second.size && [...first].every((e: string) => second.has(e)); +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js new file mode 100644 index 0000000000000..ed1eab8530351 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FargateProfileResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const MAX_NAME_LEN = 63; +class FargateProfileResourceHandler extends common_1.ResourceHandler { + async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + const createFargateProfile = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + const deleteFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + return; + } + async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + async isCreateComplete() { + return this.isUpdateComplete(); + } + async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + /** + * Generates a fargate profile name. + */ + generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + async queryStatus() { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + const describeFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + try { + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + return status; + } + catch (describeFargateProfileError) { + if (describeFargateProfileError instanceof client_eks_1.ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} +exports.FargateProfileResourceHandler = FargateProfileResourceHandler; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsNkRBQTZEO0FBQzdELG9EQUFnRTtBQUVoRSxxQ0FBMkM7QUFFM0MsTUFBTSxZQUFZLEdBQUcsRUFBRSxDQUFDO0FBRXhCLE1BQWEsNkJBQThCLFNBQVEsd0JBQWU7SUFDdEQsS0FBSyxDQUFDLFFBQVE7UUFDdEIsTUFBTSxrQkFBa0IsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU0sQ0FBQyxrQkFBa0IsSUFBSSxJQUFJLENBQUMsbUJBQW1CLEVBQUUsQ0FBQztRQUVqSCxNQUFNLG9CQUFvQixHQUF3QztZQUNoRSxrQkFBa0I7WUFDbEIsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU07U0FDeEMsQ0FBQztRQUVGLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxvQ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F0Y2ggKGRlc2NyaWJlRmFyZ2F0ZVByb2ZpbGVFcnJvcjogYW55KSB7XG4gICAgICBpZiAoZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yIGluc3RhbmNlb2YgUmVzb3VyY2VOb3RGb3VuZEV4Y2VwdGlvbikge1xuICAgICAgICB0aGlzLmxvZygncmVjZWl2ZWQgUmVzb3VyY2VOb3RGb3VuZEV4Y2VwdGlvbiwgdGhpcyBtZWFucyB0aGUgcHJvZmlsZSBoYXMgYmVlbiBkZWxldGVkIChvciBuZXZlciBleGlzdGVkKScpO1xuICAgICAgICByZXR1cm4gJ05PVF9GT1VORCc7XG4gICAgICB9XG5cbiAgICAgIHRoaXMubG9nKHsgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yIH0pO1xuICAgICAgdGhyb3cgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yO1xuICAgIH1cbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts new file mode 100644 index 0000000000000..16b9f9abfeb49 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts @@ -0,0 +1,121 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies +import { ResourceHandler } from './common'; + +const MAX_NAME_LEN = 63; + +export class FargateProfileResourceHandler extends ResourceHandler { + protected async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + + const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + + protected async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + + const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + + return; + } + + protected async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + + protected async isCreateComplete() { + return this.isUpdateComplete(); + } + + protected async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + + protected async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + + /** + * Generates a fargate profile name. + */ + private generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + private async queryStatus(): Promise { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + + const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + try { + + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + + return status; + } catch (describeFargateProfileError: any) { + if (describeFargateProfileError instanceof ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip new file mode 100644 index 0000000000000..90a8a2a6e2615 Binary files /dev/null and b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/aws-stepfunctions-tasks-emr-containers-all-services-test.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/aws-stepfunctions-tasks-emr-containers-all-services-test.assets.json index 46dd29d848839..b4f74a74dd157 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/aws-stepfunctions-tasks-emr-containers-all-services-test.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/aws-stepfunctions-tasks-emr-containers-all-services-test.assets.json @@ -14,15 +14,15 @@ } } }, - "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649": { + "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31": { "source": { - "path": "asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649", + "path": "asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip", + "objectKey": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -53,15 +53,15 @@ } } }, - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -79,7 +79,7 @@ } } }, - "69feeb9cd44f367c110e45d2af8cdadf91aa64f06f45ac0eabd487257e5b8288": { + "706f726c67d8650ee65026b6b77982101b9c6dd3624a017db1131eccafef5878": { "source": { "path": "awsstepfunctionstasksemrcontainersallservicestestawscdkawseksClusterResourceProvider6985269B.nested.template.json", "packaging": "file" @@ -87,12 +87,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "69feeb9cd44f367c110e45d2af8cdadf91aa64f06f45ac0eabd487257e5b8288.json", + "objectKey": "706f726c67d8650ee65026b6b77982101b9c6dd3624a017db1131eccafef5878.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "595c013871e33e03a7b00168e3763347a6af19ecdaeaa39d143d1f2a2f318f5f": { + "780b5907606332dd9e996a130e6cb185cbe01db313f103ae522165dff6c07025": { "source": { "path": "awsstepfunctionstasksemrcontainersallservicestestawscdkawseksKubectlProviderD9DFA1E3.nested.template.json", "packaging": "file" @@ -100,12 +100,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "595c013871e33e03a7b00168e3763347a6af19ecdaeaa39d143d1f2a2f318f5f.json", + "objectKey": "780b5907606332dd9e996a130e6cb185cbe01db313f103ae522165dff6c07025.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "da1751454d1165801b19bc7d9771647b8b26bdd58c9dd70fc6a605fa551f4fae": { + "0f7cc8f67619a34f35709c1148bf0b930b24f48e117bcdeaf558ccbb3719c049": { "source": { "path": "aws-stepfunctions-tasks-emr-containers-all-services-test.template.json", "packaging": "file" @@ -113,7 +113,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "da1751454d1165801b19bc7d9771647b8b26bdd58c9dd70fc6a605fa551f4fae.json", + "objectKey": "0f7cc8f67619a34f35709c1148bf0b930b24f48e117bcdeaf558ccbb3719c049.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/aws-stepfunctions-tasks-emr-containers-all-services-test.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/aws-stepfunctions-tasks-emr-containers-all-services-test.template.json index 55c128eaefc26..5b21c4a6933a1 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/aws-stepfunctions-tasks-emr-containers-all-services-test.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/aws-stepfunctions-tasks-emr-containers-all-services-test.template.json @@ -993,7 +993,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/69feeb9cd44f367c110e45d2af8cdadf91aa64f06f45ac0eabd487257e5b8288.json" + "/706f726c67d8650ee65026b6b77982101b9c6dd3624a017db1131eccafef5878.json" ] ] } @@ -1040,7 +1040,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/595c013871e33e03a7b00168e3763347a6af19ecdaeaa39d143d1f2a2f318f5f.json" + "/780b5907606332dd9e996a130e6cb185cbe01db313f103ae522165dff6c07025.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/awsstepfunctionstasksemrcontainersallservicestestawscdkawseksClusterResourceProvider6985269B.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/awsstepfunctionstasksemrcontainersallservicestestawscdkawseksClusterResourceProvider6985269B.nested.template.json index e49c10ee90073..2dd068294541a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/awsstepfunctionstasksemrcontainersallservicestestawscdkawseksClusterResourceProvider6985269B.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/awsstepfunctionstasksemrcontainersallservicestestawscdkawseksClusterResourceProvider6985269B.nested.template.json @@ -50,7 +50,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "onEvent handler for EKS cluster resource provider", "Environment": { @@ -115,7 +115,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "isComplete handler for EKS cluster resource provider", "Environment": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/awsstepfunctionstasksemrcontainersallservicestestawscdkawseksKubectlProviderD9DFA1E3.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/awsstepfunctionstasksemrcontainersallservicestestawscdkawseksKubectlProviderD9DFA1E3.nested.template.json index 16f78e55ba9d2..345c0997639a7 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/awsstepfunctionstasksemrcontainersallservicestestawscdkawseksKubectlProviderD9DFA1E3.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/awsstepfunctionstasksemrcontainersallservicestestawscdkawseksKubectlProviderD9DFA1E3.nested.template.json @@ -49,7 +49,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/cdk.out index f0b901e7c06e5..560dae10d018f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"33.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/manifest.json index 1aaffa29e33c8..c423dfbc30472 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/manifest.json @@ -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}/da1751454d1165801b19bc7d9771647b8b26bdd58c9dd70fc6a605fa551f4fae.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/0f7cc8f67619a34f35709c1148bf0b930b24f48e117bcdeaf558ccbb3719c049.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/tree.json index 26f93791c0ab4..16b93996d09de 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.job-submission-workflow.js.snapshot/tree.json @@ -1478,7 +1478,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "onEvent handler for EKS cluster resource provider", "environment": { @@ -1610,7 +1610,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "isComplete handler for EKS cluster resource provider", "environment": { @@ -2516,7 +2516,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/69feeb9cd44f367c110e45d2af8cdadf91aa64f06f45ac0eabd487257e5b8288.json" + "/706f726c67d8650ee65026b6b77982101b9c6dd3624a017db1131eccafef5878.json" ] ] } @@ -2663,7 +2663,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -3072,7 +3072,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/595c013871e33e03a7b00168e3763347a6af19ecdaeaa39d143d1f2a2f318f5f.json" + "/780b5907606332dd9e996a130e6cb185cbe01db313f103ae522165dff6c07025.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip deleted file mode 100644 index e6cb898734b43..0000000000000 Binary files a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and /dev/null differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js deleted file mode 100644 index b89707a0a08e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.js +++ /dev/null @@ -1,277 +0,0 @@ -"use strict"; -/* eslint-disable no-console */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ClusterResourceHandler = void 0; -const common_1 = require("./common"); -const compareLogging_1 = require("./compareLogging"); -const MAX_CLUSTER_NAME_LEN = 100; -class ClusterResourceHandler extends common_1.ResourceHandler { - get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - return this.physicalResourceId; - } - constructor(eks, event) { - super(eks, event); - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - // ------ - // CREATE - // ------ - async onCreate() { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - const clusterName = this.newProps.name || this.generateClusterName(); - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - return { - PhysicalResourceId: resp.cluster.name, - }; - } - async isCreateComplete() { - return this.isActive(); - } - // ------ - // DELETE - // ------ - async onDelete() { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } - catch (e) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } - else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - async isDeleteComplete() { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } - catch (e) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - console.log('describeCluster error:', e); - throw e; - } - return { - IsComplete: false, - }; - } - // ------ - // UPDATE - // ------ - async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - return this.onCreate(); - } - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - return this.updateClusterVersion(this.newProps.version); - } - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - if (updates.updateLogging || updates.updateAccess) { - const config = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - } - ; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - return { EksUpdateId: updateResponse.update?.id }; - } - // no updates - return; - } - async isUpdateComplete() { - console.log('isUpdateComplete'); - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - return this.isActive(); - } - async updateClusterVersion(newVersion) { - console.log(`updating cluster version to ${newVersion}`); - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - async isActive() { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } - else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } - else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - async isEksUpdateComplete(eksUpdateId) { - this.log({ isEksUpdateComplete: eksUpdateId }); - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - this.log({ describeUpdateResponse }); - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} -exports.ClusterResourceHandler = ClusterResourceHandler; -function parseProps(props) { - const parsed = props?.Config ?? {}; - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - return parsed; -} -function analyzeUpdate(oldProps, newProps) { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} -function setsEqual(first, second) { - return first.size === second.size && [...first].every((e) => second.has(e)); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBSy9CLHFDQUFxRTtBQUNyRSxxREFBdUQ7QUFHdkQsTUFBTSxvQkFBb0IsR0FBRyxHQUFHLENBQUM7QUFFakMsTUFBYSxzQkFBdUIsU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yksXG4gIH07XG59XG5cbmZ1bmN0aW9uIHNldHNFcXVhbChmaXJzdDogU2V0PHN0cmluZz4sIHNlY29uZDogU2V0PHN0cmluZz4pIHtcbiAgcmV0dXJuIGZpcnN0LnNpemUgPT09IHNlY29uZC5zaXplICYmIFsuLi5maXJzdF0uZXZlcnkoKGU6IHN0cmluZykgPT4gc2Vjb25kLmhhcyhlKSk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts deleted file mode 100644 index c058e47b62c68..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.ts +++ /dev/null @@ -1,348 +0,0 @@ -/* eslint-disable no-console */ - -// eslint-disable-next-line import/no-extraneous-dependencies -// eslint-disable-next-line import/no-extraneous-dependencies -import * as aws from 'aws-sdk'; -import { EksClient, ResourceEvent, ResourceHandler } from './common'; -import { compareLoggingProps } from './compareLogging'; -import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; - -const MAX_CLUSTER_NAME_LEN = 100; - -export class ClusterResourceHandler extends ResourceHandler { - public get clusterName() { - if (!this.physicalResourceId) { - throw new Error('Cannot determine cluster name without physical resource ID'); - } - - return this.physicalResourceId; - } - - private readonly newProps: aws.EKS.CreateClusterRequest; - private readonly oldProps: Partial; - - constructor(eks: EksClient, event: ResourceEvent) { - super(eks, event); - - this.newProps = parseProps(this.event.ResourceProperties); - this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; - // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); - this.newProps.logging = compared.logging; - } - - // ------ - // CREATE - // ------ - - protected async onCreate(): Promise { - console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); - if (!this.newProps.roleArn) { - throw new Error('"roleArn" is required'); - } - - const clusterName = this.newProps.name || this.generateClusterName(); - - const resp = await this.eks.createCluster({ - ...this.newProps, - name: clusterName, - }); - - if (!resp.cluster) { - throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); - } - - return { - PhysicalResourceId: resp.cluster.name, - }; - } - - protected async isCreateComplete() { - return this.isActive(); - } - - // ------ - // DELETE - // ------ - - protected async onDelete(): Promise { - console.log(`onDelete: deleting cluster ${this.clusterName}`); - try { - await this.eks.deleteCluster({ name: this.clusterName }); - } catch (e: any) { - if (e.code !== 'ResourceNotFoundException') { - throw e; - } else { - console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); - } - } - return { - PhysicalResourceId: this.clusterName, - }; - } - - protected async isDeleteComplete(): Promise { - console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); - - try { - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); - } catch (e: any) { - if (e.code === 'ResourceNotFoundException') { - console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); - return { IsComplete: true }; - } - - console.log('describeCluster error:', e); - throw e; - } - - return { - IsComplete: false, - }; - } - - // ------ - // UPDATE - // ------ - - protected async onUpdate() { - const updates = analyzeUpdate(this.oldProps, this.newProps); - console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); - - // updates to encryption config is not supported - if (updates.updateEncryption) { - throw new Error('Cannot update cluster encryption configuration'); - } - - // if there is an update that requires replacement, go ahead and just create - // a new cluster with the new config. The old cluster will automatically be - // deleted by cloudformation upon success. - if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { - - // if we are replacing this cluster and the cluster has an explicit - // physical name, the creation of the new cluster will fail with "there is - // already a cluster with that name". this is a common behavior for - // CloudFormation resources that support specifying a physical name. - if (this.oldProps.name === this.newProps.name && this.oldProps.name) { - throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); - } - - return this.onCreate(); - } - - // if a version update is required, issue the version update - if (updates.updateVersion) { - if (!this.newProps.version) { - throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); - } - - return this.updateClusterVersion(this.newProps.version); - } - - if (updates.updateLogging && updates.updateAccess) { - throw new Error('Cannot update logging and access at the same time'); - } - - if (updates.updateLogging || updates.updateAccess) { - const config: aws.EKS.UpdateClusterConfigRequest = { - name: this.clusterName, - }; - if (updates.updateLogging) { - config.logging = this.newProps.logging; - }; - if (updates.updateAccess) { - // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: - // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) - // will fail, therefore we take only the access fields explicitly - config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, - }; - } - const updateResponse = await this.eks.updateClusterConfig(config); - - return { EksUpdateId: updateResponse.update?.id }; - } - - // no updates - return; - } - - protected async isUpdateComplete() { - console.log('isUpdateComplete'); - - // if this is an EKS update, we will monitor the update event itself - if (this.event.EksUpdateId) { - const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); - if (!complete) { - return { IsComplete: false }; - } - - // fall through: if the update is done, we simply delegate to isActive() - // in order to extract attributes and state from the cluster itself, which - // is supposed to be in an ACTIVE state after the update is complete. - } - - return this.isActive(); - } - - private async updateClusterVersion(newVersion: string) { - console.log(`updating cluster version to ${newVersion}`); - - // update-cluster-version will fail if we try to update to the same version, - // so skip in this case. - const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; - if (cluster?.version === newVersion) { - console.log(`cluster already at version ${cluster.version}, skipping version update`); - return; - } - - const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); - return { EksUpdateId: updateResponse.update?.id }; - } - - private async isActive(): Promise { - console.log('waiting for cluster to become ACTIVE'); - const resp = await this.eks.describeCluster({ name: this.clusterName }); - console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); - const cluster = resp.cluster; - - // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are - // not complete. note that the custom resource provider framework forbids - // returning attributes (Data) if isComplete is false. - if (cluster?.status === 'FAILED') { - // not very informative, unfortunately the response doesn't contain any error - // information :\ - throw new Error('Cluster is in a FAILED status'); - } else if (cluster?.status !== 'ACTIVE') { - return { - IsComplete: false, - }; - } else { - return { - IsComplete: true, - Data: { - Name: cluster.name, - Endpoint: cluster.endpoint, - Arn: cluster.arn, - - // IMPORTANT: CFN expects that attributes will *always* have values, - // so return an empty string in case the value is not defined. - // Otherwise, CFN will throw with `Vendor response doesn't contain - // XXXX key`. - - CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', - ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', - OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', - OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url - - // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig - EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', - }, - }; - } - } - - private async isEksUpdateComplete(eksUpdateId: string) { - this.log({ isEksUpdateComplete: eksUpdateId }); - - const describeUpdateResponse = await this.eks.describeUpdate({ - name: this.clusterName, - updateId: eksUpdateId, - }); - - this.log({ describeUpdateResponse }); - - if (!describeUpdateResponse.update) { - throw new Error(`unable to describe update with id "${eksUpdateId}"`); - } - - switch (describeUpdateResponse.update.status) { - case 'InProgress': - return false; - case 'Successful': - return true; - case 'Failed': - case 'Cancelled': - throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); - default: - throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); - } - } - - private generateClusterName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } -} - -function parseProps(props: any): aws.EKS.CreateClusterRequest { - - const parsed = props?.Config ?? {}; - - // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. - // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' - - if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; - } - - if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { - parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; - } - - if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { - parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; - } - - return parsed; - -} - -interface UpdateMap { - replaceName: boolean; // name - replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds - replaceRole: boolean; // roleArn - - updateVersion: boolean; // version - updateLogging: boolean; // logging - updateEncryption: boolean; // encryption (cannot be updated) - updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess -} - -function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { - console.log('old props: ', JSON.stringify(oldProps)); - console.log('new props: ', JSON.stringify(newProps)); - - const newVpcProps = newProps.resourcesVpcConfig || {}; - const oldVpcProps = oldProps.resourcesVpcConfig || {}; - - const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); - const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); - const newEnc = newProps.encryptionConfig || {}; - const oldEnc = oldProps.encryptionConfig || {}; - - return { - replaceName: newProps.name !== oldProps.name, - replaceVpc: - JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || - JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), - updateAccess: - newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || - newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || - !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), - replaceRole: newProps.roleArn !== oldProps.roleArn, - updateVersion: newProps.version !== oldProps.version, - updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), - updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), - }; -} - -function setsEqual(first: Set, second: Set) { - return first.size === second.size && [...first].every((e: string) => second.has(e)); -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js deleted file mode 100644 index 34ab6ff0ba0e8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FargateProfileResourceHandler = void 0; -const common_1 = require("./common"); -const MAX_NAME_LEN = 63; -class FargateProfileResourceHandler extends common_1.ResourceHandler { - async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - const createFargateProfile = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - const deleteFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - return; - } - async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - async isCreateComplete() { - return this.isUpdateComplete(); - } - async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - /** - * Generates a fargate profile name. - */ - generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - async queryStatus() { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - const describeFargateProfile = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - try { - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - return status; - } - catch (describeFargateProfileError) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} -exports.FargateProfileResourceHandler = FargateProfileResourceHandler; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EscUNBQTJDO0FBRTNDLE1BQU0sWUFBWSxHQUFHLEVBQUUsQ0FBQztBQUV4QixNQUFhLDZCQUE4QixTQUFRLHdCQUFlO0lBQ3RELEtBQUssQ0FBQyxRQUFRO1FBQ3RCLE1BQU0sa0JBQWtCLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNLENBQUMsa0JBQWtCLElBQUksSUFBSSxDQUFDLG1CQUFtQixFQUFFLENBQUM7UUFFakgsTUFBTSxvQkFBb0IsR0FBd0M7WUFDaEUsa0JBQWtCO1lBQ2xCLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNO1NBQ3hDLENBQUM7UUFFRixJQUFJLENBQ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Jyb3IuY29kZSA9PT0gJ1Jlc291cmNlTm90Rm91bmRFeGNlcHRpb24nKSB7XG4gICAgICAgIHRoaXMubG9nKCdyZWNlaXZlZCBSZXNvdXJjZU5vdEZvdW5kRXhjZXB0aW9uLCB0aGlzIG1lYW5zIHRoZSBwcm9maWxlIGhhcyBiZWVuIGRlbGV0ZWQgKG9yIG5ldmVyIGV4aXN0ZWQpJyk7XG4gICAgICAgIHJldHVybiAnTk9UX0ZPVU5EJztcbiAgICAgIH1cblxuICAgICAgdGhpcy5sb2coeyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3IgfSk7XG4gICAgICB0aHJvdyBkZXNjcmliZUZhcmdhdGVQcm9maWxlRXJyb3I7XG4gICAgfVxuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts deleted file mode 100644 index 7db97a7f69d38..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.ts +++ /dev/null @@ -1,119 +0,0 @@ -import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies -import { ResourceHandler } from './common'; - -const MAX_NAME_LEN = 63; - -export class FargateProfileResourceHandler extends ResourceHandler { - protected async onCreate() { - const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - - const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { - fargateProfileName, - ...this.event.ResourceProperties.Config, - }; - - this.log({ createFargateProfile }); - const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); - this.log({ createFargateProfileResponse }); - - if (!createFargateProfileResponse.fargateProfile) { - throw new Error('invalid CreateFargateProfile response'); - } - - return { - PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, - Data: { - fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, - }, - }; - } - - protected async onDelete() { - if (!this.physicalResourceId) { - throw new Error('Cannot delete a profile without a physical id'); - } - - const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - this.log({ deleteFargateProfile }); - const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); - this.log({ deleteFargateProfileResponse }); - - return; - } - - protected async onUpdate() { - // all updates require a replacement. as long as name is generated, we are - // good. if name is explicit, update will fail, which is common when trying - // to replace cfn resources with explicit physical names - return this.onCreate(); - } - - protected async isCreateComplete() { - return this.isUpdateComplete(); - } - - protected async isUpdateComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'ACTIVE', - }; - } - - protected async isDeleteComplete() { - const status = await this.queryStatus(); - return { - IsComplete: status === 'NOT_FOUND', - }; - } - - /** - * Generates a fargate profile name. - */ - private generateProfileName() { - const suffix = this.requestId.replace(/-/g, ''); // 32 chars - const offset = MAX_NAME_LEN - suffix.length - 1; - const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); - return `${prefix}-${suffix}`; - } - - /** - * Queries the Fargate profile's current status and returns the status or - * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). - */ - private async queryStatus(): Promise { - if (!this.physicalResourceId) { - throw new Error('Unable to determine status for fargate profile without a resource name'); - } - - const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { - clusterName: this.event.ResourceProperties.Config.clusterName, - fargateProfileName: this.physicalResourceId, - }; - - try { - - this.log({ describeFargateProfile }); - const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); - this.log({ describeFargateProfileResponse }); - const status = describeFargateProfileResponse.fargateProfile?.status; - - if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { - throw new Error(status); - } - - return status; - } catch (describeFargateProfileError: any) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { - this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); - return 'NOT_FOUND'; - } - - this.log({ describeFargateProfileError }); - throw describeFargateProfileError; - } - } -} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/cluster.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js new file mode 100644 index 0000000000000..aefb970a3fe47 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.js @@ -0,0 +1,280 @@ +"use strict"; +/* eslint-disable no-console */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClusterResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const compareLogging_1 = require("./compareLogging"); +const MAX_CLUSTER_NAME_LEN = 100; +class ClusterResourceHandler extends common_1.ResourceHandler { + get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + return this.physicalResourceId; + } + constructor(eks, event) { + super(eks, event); + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared = (0, compareLogging_1.compareLoggingProps)(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + // ------ + // CREATE + // ------ + async onCreate() { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + const clusterName = this.newProps.name || this.generateClusterName(); + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + return { + PhysicalResourceId: resp.cluster.name, + }; + } + async isCreateComplete() { + return this.isActive(); + } + // ------ + // DELETE + // ------ + async onDelete() { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } + catch (e) { + if (!(e instanceof client_eks_1.ResourceNotFoundException)) { + throw e; + } + else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + async isDeleteComplete() { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } + catch (e) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof client_eks_1.ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + console.log('describeCluster error:', e); + throw e; + } + return { + IsComplete: false, + }; + } + // ------ + // UPDATE + // ------ + async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + return this.onCreate(); + } + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + return this.updateClusterVersion(this.newProps.version); + } + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + if (updates.updateLogging || updates.updateAccess) { + const config = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + } + ; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + return { EksUpdateId: updateResponse.update?.id }; + } + // no updates + return; + } + async isUpdateComplete() { + console.log('isUpdateComplete'); + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + return this.isActive(); + } + async updateClusterVersion(newVersion) { + console.log(`updating cluster version to ${newVersion}`); + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + async isActive() { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } + else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } + else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + async isEksUpdateComplete(eksUpdateId) { + this.log({ isEksUpdateComplete: eksUpdateId }); + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + this.log({ describeUpdateResponse }); + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} +exports.ClusterResourceHandler = ClusterResourceHandler; +function parseProps(props) { + const parsed = props?.Config ?? {}; + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + return parsed; +} +function analyzeUpdate(oldProps, newProps) { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} +function setsEqual(first, second) { + return first.size === second.size && [...first].every((e) => second.has(e)); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBR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GVWZXJzaW9uOiBuZXdQcm9wcy52ZXJzaW9uICE9PSBvbGRQcm9wcy52ZXJzaW9uLFxuICAgIHVwZGF0ZUVuY3J5cHRpb246IEpTT04uc3RyaW5naWZ5KG5ld0VuYykgIT09IEpTT04uc3RyaW5naWZ5KG9sZEVuYyksXG4gICAgdXBkYXRlTG9nZ2luZzogSlNPTi5zdHJpbmdpZnkobmV3UHJvcHMubG9nZ2luZykgIT09IEpTT04uc3RyaW5naWZ5KG9sZFByb3BzLmxvZ2dpbmcpLFxuICB9O1xufVxuXG5mdW5jdGlvbiBzZXRzRXF1YWwoZmlyc3Q6IFNldDxzdHJpbmc+LCBzZWNvbmQ6IFNldDxzdHJpbmc+KSB7XG4gIHJldHVybiBmaXJzdC5zaXplID09PSBzZWNvbmQuc2l6ZSAmJiBbLi4uZmlyc3RdLmV2ZXJ5KChlOiBzdHJpbmcpID0+IHNlY29uZC5oYXMoZSkpO1xufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts new file mode 100644 index 0000000000000..3a0a7294db31d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/cluster.ts @@ -0,0 +1,350 @@ +/* eslint-disable no-console */ + +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +// eslint-disable-next-line import/no-extraneous-dependencies +import * as aws from 'aws-sdk'; +import { EksClient, ResourceEvent, ResourceHandler } from './common'; +import { compareLoggingProps } from './compareLogging'; +import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; + +const MAX_CLUSTER_NAME_LEN = 100; + +export class ClusterResourceHandler extends ResourceHandler { + public get clusterName() { + if (!this.physicalResourceId) { + throw new Error('Cannot determine cluster name without physical resource ID'); + } + + return this.physicalResourceId; + } + + private readonly newProps: aws.EKS.CreateClusterRequest; + private readonly oldProps: Partial; + + constructor(eks: EksClient, event: ResourceEvent) { + super(eks, event); + + this.newProps = parseProps(this.event.ResourceProperties); + this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; + // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any + const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); + this.newProps.logging = compared.logging; + } + + // ------ + // CREATE + // ------ + + protected async onCreate(): Promise { + console.log('onCreate: creating cluster with options:', JSON.stringify(this.newProps, undefined, 2)); + if (!this.newProps.roleArn) { + throw new Error('"roleArn" is required'); + } + + const clusterName = this.newProps.name || this.generateClusterName(); + + const resp = await this.eks.createCluster({ + ...this.newProps, + name: clusterName, + }); + + if (!resp.cluster) { + throw new Error(`Error when trying to create cluster ${clusterName}: CreateCluster returned without cluster information`); + } + + return { + PhysicalResourceId: resp.cluster.name, + }; + } + + protected async isCreateComplete() { + return this.isActive(); + } + + // ------ + // DELETE + // ------ + + protected async onDelete(): Promise { + console.log(`onDelete: deleting cluster ${this.clusterName}`); + try { + await this.eks.deleteCluster({ name: this.clusterName }); + } catch (e: any) { + if (!(e instanceof ResourceNotFoundException)) { + throw e; + } else { + console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); + } + } + return { + PhysicalResourceId: this.clusterName, + }; + } + + protected async isDeleteComplete(): Promise { + console.log(`isDeleteComplete: waiting for cluster ${this.clusterName} to be deleted`); + + try { + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); + } catch (e: any) { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof ResourceNotFoundException) { + console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); + return { IsComplete: true }; + } + + console.log('describeCluster error:', e); + throw e; + } + + return { + IsComplete: false, + }; + } + + // ------ + // UPDATE + // ------ + + protected async onUpdate() { + const updates = analyzeUpdate(this.oldProps, this.newProps); + console.log('onUpdate:', JSON.stringify({ updates }, undefined, 2)); + + // updates to encryption config is not supported + if (updates.updateEncryption) { + throw new Error('Cannot update cluster encryption configuration'); + } + + // if there is an update that requires replacement, go ahead and just create + // a new cluster with the new config. The old cluster will automatically be + // deleted by cloudformation upon success. + if (updates.replaceName || updates.replaceRole || updates.replaceVpc) { + + // if we are replacing this cluster and the cluster has an explicit + // physical name, the creation of the new cluster will fail with "there is + // already a cluster with that name". this is a common behavior for + // CloudFormation resources that support specifying a physical name. + if (this.oldProps.name === this.newProps.name && this.oldProps.name) { + throw new Error(`Cannot replace cluster "${this.oldProps.name}" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration`); + } + + return this.onCreate(); + } + + // if a version update is required, issue the version update + if (updates.updateVersion) { + if (!this.newProps.version) { + throw new Error(`Cannot remove cluster version configuration. Current version is ${this.oldProps.version}`); + } + + return this.updateClusterVersion(this.newProps.version); + } + + if (updates.updateLogging && updates.updateAccess) { + throw new Error('Cannot update logging and access at the same time'); + } + + if (updates.updateLogging || updates.updateAccess) { + const config: aws.EKS.UpdateClusterConfigRequest = { + name: this.clusterName, + }; + if (updates.updateLogging) { + config.logging = this.newProps.logging; + }; + if (updates.updateAccess) { + // Updating the cluster with securityGroupIds and subnetIds (as specified in the warning here: + // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) + // will fail, therefore we take only the access fields explicitly + config.resourcesVpcConfig = { + endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + }; + } + const updateResponse = await this.eks.updateClusterConfig(config); + + return { EksUpdateId: updateResponse.update?.id }; + } + + // no updates + return; + } + + protected async isUpdateComplete() { + console.log('isUpdateComplete'); + + // if this is an EKS update, we will monitor the update event itself + if (this.event.EksUpdateId) { + const complete = await this.isEksUpdateComplete(this.event.EksUpdateId); + if (!complete) { + return { IsComplete: false }; + } + + // fall through: if the update is done, we simply delegate to isActive() + // in order to extract attributes and state from the cluster itself, which + // is supposed to be in an ACTIVE state after the update is complete. + } + + return this.isActive(); + } + + private async updateClusterVersion(newVersion: string) { + console.log(`updating cluster version to ${newVersion}`); + + // update-cluster-version will fail if we try to update to the same version, + // so skip in this case. + const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster; + if (cluster?.version === newVersion) { + console.log(`cluster already at version ${cluster.version}, skipping version update`); + return; + } + + const updateResponse = await this.eks.updateClusterVersion({ name: this.clusterName, version: newVersion }); + return { EksUpdateId: updateResponse.update?.id }; + } + + private async isActive(): Promise { + console.log('waiting for cluster to become ACTIVE'); + const resp = await this.eks.describeCluster({ name: this.clusterName }); + console.log('describeCluster result:', JSON.stringify(resp, undefined, 2)); + const cluster = resp.cluster; + + // if cluster is undefined (shouldnt happen) or status is not ACTIVE, we are + // not complete. note that the custom resource provider framework forbids + // returning attributes (Data) if isComplete is false. + if (cluster?.status === 'FAILED') { + // not very informative, unfortunately the response doesn't contain any error + // information :\ + throw new Error('Cluster is in a FAILED status'); + } else if (cluster?.status !== 'ACTIVE') { + return { + IsComplete: false, + }; + } else { + return { + IsComplete: true, + Data: { + Name: cluster.name, + Endpoint: cluster.endpoint, + Arn: cluster.arn, + + // IMPORTANT: CFN expects that attributes will *always* have values, + // so return an empty string in case the value is not defined. + // Otherwise, CFN will throw with `Vendor response doesn't contain + // XXXX key`. + + CertificateAuthorityData: cluster.certificateAuthority?.data ?? '', + ClusterSecurityGroupId: cluster.resourcesVpcConfig?.clusterSecurityGroupId ?? '', + OpenIdConnectIssuerUrl: cluster.identity?.oidc?.issuer ?? '', + OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url + + // We can safely return the first item from encryption configuration array, because it has a limit of 1 item + // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', + }, + }; + } + } + + private async isEksUpdateComplete(eksUpdateId: string) { + this.log({ isEksUpdateComplete: eksUpdateId }); + + const describeUpdateResponse = await this.eks.describeUpdate({ + name: this.clusterName, + updateId: eksUpdateId, + }); + + this.log({ describeUpdateResponse }); + + if (!describeUpdateResponse.update) { + throw new Error(`unable to describe update with id "${eksUpdateId}"`); + } + + switch (describeUpdateResponse.update.status) { + case 'InProgress': + return false; + case 'Successful': + return true; + case 'Failed': + case 'Cancelled': + throw new Error(`cluster update id "${eksUpdateId}" failed with errors: ${JSON.stringify(describeUpdateResponse.update.errors)}`); + default: + throw new Error(`unknown status "${describeUpdateResponse.update.status}" for update id "${eksUpdateId}"`); + } + } + + private generateClusterName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_CLUSTER_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } +} + +function parseProps(props: any): aws.EKS.CreateClusterRequest { + + const parsed = props?.Config ?? {}; + + // this is weird but these boolean properties are passed by CFN as a string, and we need them to be booleanic for the SDK. + // Otherwise it fails with 'Unexpected Parameter: params.resourcesVpcConfig.endpointPrivateAccess is expected to be a boolean' + + if (typeof (parsed.resourcesVpcConfig?.endpointPrivateAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPrivateAccess = parsed.resourcesVpcConfig.endpointPrivateAccess === 'true'; + } + + if (typeof (parsed.resourcesVpcConfig?.endpointPublicAccess) === 'string') { + parsed.resourcesVpcConfig.endpointPublicAccess = parsed.resourcesVpcConfig.endpointPublicAccess === 'true'; + } + + if (typeof (parsed.logging?.clusterLogging[0].enabled) === 'string') { + parsed.logging.clusterLogging[0].enabled = parsed.logging.clusterLogging[0].enabled === 'true'; + } + + return parsed; + +} + +interface UpdateMap { + replaceName: boolean; // name + replaceVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds + replaceRole: boolean; // roleArn + + updateVersion: boolean; // version + updateLogging: boolean; // logging + updateEncryption: boolean; // encryption (cannot be updated) + updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess +} + +function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { + console.log('old props: ', JSON.stringify(oldProps)); + console.log('new props: ', JSON.stringify(newProps)); + + const newVpcProps = newProps.resourcesVpcConfig || {}; + const oldVpcProps = oldProps.resourcesVpcConfig || {}; + + const oldPublicAccessCidrs = new Set(oldVpcProps.publicAccessCidrs ?? []); + const newPublicAccessCidrs = new Set(newVpcProps.publicAccessCidrs ?? []); + const newEnc = newProps.encryptionConfig || {}; + const oldEnc = oldProps.encryptionConfig || {}; + + return { + replaceName: newProps.name !== oldProps.name, + replaceVpc: + JSON.stringify(newVpcProps.subnetIds?.sort()) !== JSON.stringify(oldVpcProps.subnetIds?.sort()) || + JSON.stringify(newVpcProps.securityGroupIds?.sort()) !== JSON.stringify(oldVpcProps.securityGroupIds?.sort()), + updateAccess: + newVpcProps.endpointPrivateAccess !== oldVpcProps.endpointPrivateAccess || + newVpcProps.endpointPublicAccess !== oldVpcProps.endpointPublicAccess || + !setsEqual(newPublicAccessCidrs, oldPublicAccessCidrs), + replaceRole: newProps.roleArn !== oldProps.roleArn, + updateVersion: newProps.version !== oldProps.version, + updateEncryption: JSON.stringify(newEnc) !== JSON.stringify(oldEnc), + updateLogging: JSON.stringify(newProps.logging) !== JSON.stringify(oldProps.logging), + }; +} + +function setsEqual(first: Set, second: Set) { + return first.size === second.size && [...first].every((e: string) => second.has(e)); +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/common.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/common.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/compareLogging.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/compareLogging.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/consts.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/consts.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/fargate.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js new file mode 100644 index 0000000000000..ed1eab8530351 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FargateProfileResourceHandler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const client_eks_1 = require("@aws-sdk/client-eks"); +const common_1 = require("./common"); +const MAX_NAME_LEN = 63; +class FargateProfileResourceHandler extends common_1.ResourceHandler { + async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + const createFargateProfile = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + const deleteFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + return; + } + async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + async isCreateComplete() { + return this.isUpdateComplete(); + } + async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + /** + * Generates a fargate profile name. + */ + generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + async queryStatus() { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + const describeFargateProfile = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + try { + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + return status; + } + catch (describeFargateProfileError) { + if (describeFargateProfileError instanceof client_eks_1.ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} +exports.FargateProfileResourceHandler = FargateProfileResourceHandler; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFyZ2F0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZhcmdhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsNkRBQTZEO0FBQzdELG9EQUFnRTtBQUVoRSxxQ0FBMkM7QUFFM0MsTUFBTSxZQUFZLEdBQUcsRUFBRSxDQUFDO0FBRXhCLE1BQWEsNkJBQThCLFNBQVEsd0JBQWU7SUFDdEQsS0FBSyxDQUFDLFFBQVE7UUFDdEIsTUFBTSxrQkFBa0IsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU0sQ0FBQyxrQkFBa0IsSUFBSSxJQUFJLENBQUMsbUJBQW1CLEVBQUUsQ0FBQztRQUVqSCxNQUFNLG9CQUFvQixHQUF3QztZQUNoRSxrQkFBa0I7WUFDbEIsR0FBRyxJQUFJLEN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SB7XG4gICAgICAgIHRocm93IG5ldyBFcnJvcihzdGF0dXMpO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gc3RhdHVzO1xuICAgIH0gY2F0Y2ggKGRlc2NyaWJlRmFyZ2F0ZVByb2ZpbGVFcnJvcjogYW55KSB7XG4gICAgICBpZiAoZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yIGluc3RhbmNlb2YgUmVzb3VyY2VOb3RGb3VuZEV4Y2VwdGlvbikge1xuICAgICAgICB0aGlzLmxvZygncmVjZWl2ZWQgUmVzb3VyY2VOb3RGb3VuZEV4Y2VwdGlvbiwgdGhpcyBtZWFucyB0aGUgcHJvZmlsZSBoYXMgYmVlbiBkZWxldGVkIChvciBuZXZlciBleGlzdGVkKScpO1xuICAgICAgICByZXR1cm4gJ05PVF9GT1VORCc7XG4gICAgICB9XG5cbiAgICAgIHRoaXMubG9nKHsgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yIH0pO1xuICAgICAgdGhyb3cgZGVzY3JpYmVGYXJnYXRlUHJvZmlsZUVycm9yO1xuICAgIH1cbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts new file mode 100644 index 0000000000000..16b9f9abfeb49 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/fargate.ts @@ -0,0 +1,121 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; +import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies +import { ResourceHandler } from './common'; + +const MAX_NAME_LEN = 63; + +export class FargateProfileResourceHandler extends ResourceHandler { + protected async onCreate() { + const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); + + const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { + fargateProfileName, + ...this.event.ResourceProperties.Config, + }; + + this.log({ createFargateProfile }); + const createFargateProfileResponse = await this.eks.createFargateProfile(createFargateProfile); + this.log({ createFargateProfileResponse }); + + if (!createFargateProfileResponse.fargateProfile) { + throw new Error('invalid CreateFargateProfile response'); + } + + return { + PhysicalResourceId: createFargateProfileResponse.fargateProfile.fargateProfileName, + Data: { + fargateProfileArn: createFargateProfileResponse.fargateProfile.fargateProfileArn, + }, + }; + } + + protected async onDelete() { + if (!this.physicalResourceId) { + throw new Error('Cannot delete a profile without a physical id'); + } + + const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + this.log({ deleteFargateProfile }); + const deleteFargateProfileResponse = await this.eks.deleteFargateProfile(deleteFargateProfile); + this.log({ deleteFargateProfileResponse }); + + return; + } + + protected async onUpdate() { + // all updates require a replacement. as long as name is generated, we are + // good. if name is explicit, update will fail, which is common when trying + // to replace cfn resources with explicit physical names + return this.onCreate(); + } + + protected async isCreateComplete() { + return this.isUpdateComplete(); + } + + protected async isUpdateComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'ACTIVE', + }; + } + + protected async isDeleteComplete() { + const status = await this.queryStatus(); + return { + IsComplete: status === 'NOT_FOUND', + }; + } + + /** + * Generates a fargate profile name. + */ + private generateProfileName() { + const suffix = this.requestId.replace(/-/g, ''); // 32 chars + const offset = MAX_NAME_LEN - suffix.length - 1; + const prefix = this.logicalResourceId.slice(0, offset > 0 ? offset : 0); + return `${prefix}-${suffix}`; + } + + /** + * Queries the Fargate profile's current status and returns the status or + * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). + */ + private async queryStatus(): Promise { + if (!this.physicalResourceId) { + throw new Error('Unable to determine status for fargate profile without a resource name'); + } + + const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { + clusterName: this.event.ResourceProperties.Config.clusterName, + fargateProfileName: this.physicalResourceId, + }; + + try { + + this.log({ describeFargateProfile }); + const describeFargateProfileResponse = await this.eks.describeFargateProfile(describeFargateProfile); + this.log({ describeFargateProfileResponse }); + const status = describeFargateProfileResponse.fargateProfile?.status; + + if (status === 'CREATE_FAILED' || status === 'DELETE_FAILED') { + throw new Error(status); + } + + return status; + } catch (describeFargateProfileError: any) { + if (describeFargateProfileError instanceof ResourceNotFoundException) { + this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); + return 'NOT_FOUND'; + } + + this.log({ describeFargateProfileError }); + throw describeFargateProfileError; + } + } +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.d.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.d.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649/index.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31/index.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip new file mode 100644 index 0000000000000..90a8a2a6e2615 Binary files /dev/null and b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/aws-stepfunctions-tasks-emr-containers-start-job-run-test.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/aws-stepfunctions-tasks-emr-containers-start-job-run-test.template.json index e47df6234b239..134d4c867ee62 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/aws-stepfunctions-tasks-emr-containers-start-job-run-test.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/aws-stepfunctions-tasks-emr-containers-start-job-run-test.template.json @@ -1052,7 +1052,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/e821390ff3d49bf2c2bae31412f405ce6c254adac09aaf4b5aade28604dd4d68.json" + "/8f60868c53c7dd0ee86dcebd8ef75ed04c182356828bd3acb9febf74a4da7b03.json" ] ] } @@ -1099,7 +1099,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/fcfd45ab193cce58bc57448fae2176db60020def0d25dcc9649e60e3ed148434.json" + "/13a2ab958d83a0d701093b97d1a0bf06fc58c3ba829284db8471f584349aa667.json" ] ] } @@ -1256,7 +1256,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/awsstepfunctionstasksemrcontainersstartjobruntestawscdkawseksClusterResourceProvider2391B7F7.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/awsstepfunctionstasksemrcontainersstartjobruntestawscdkawseksClusterResourceProvider2391B7F7.nested.template.json index 3a4fcc72fa4dd..187c454be0548 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/awsstepfunctionstasksemrcontainersstartjobruntestawscdkawseksClusterResourceProvider2391B7F7.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/awsstepfunctionstasksemrcontainersstartjobruntestawscdkawseksClusterResourceProvider2391B7F7.nested.template.json @@ -50,7 +50,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "onEvent handler for EKS cluster resource provider", "Environment": { @@ -115,7 +115,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "S3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "Description": "isComplete handler for EKS cluster resource provider", "Environment": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/awsstepfunctionstasksemrcontainersstartjobruntestawscdkawseksKubectlProviderEB85BF5A.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/awsstepfunctionstasksemrcontainersstartjobruntestawscdkawseksKubectlProviderEB85BF5A.nested.template.json index 68a5321bb4be6..a6d0ff0112050 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/awsstepfunctionstasksemrcontainersstartjobruntestawscdkawseksKubectlProviderEB85BF5A.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/awsstepfunctionstasksemrcontainersstartjobruntestawscdkawseksKubectlProviderEB85BF5A.nested.template.json @@ -49,7 +49,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/cdk.out index f0b901e7c06e5..560dae10d018f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"33.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/tree.json index 7bfe4efaf18fc..57c9f8e6e796b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emrcontainers/integ.start-job-run.js.snapshot/tree.json @@ -1534,7 +1534,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "onEvent handler for EKS cluster resource provider", "environment": { @@ -1666,7 +1666,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip" + "s3Key": "bb544555825b6abfdf2cf0c13f9410a77d62ad0fe0bf5c38cef55631cf427f31.zip" }, "description": "isComplete handler for EKS cluster resource provider", "environment": { @@ -2572,7 +2572,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/e821390ff3d49bf2c2bae31412f405ce6c254adac09aaf4b5aade28604dd4d68.json" + "/8f60868c53c7dd0ee86dcebd8ef75ed04c182356828bd3acb9febf74a4da7b03.json" ] ] } @@ -2719,7 +2719,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -3128,7 +3128,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/fcfd45ab193cce58bc57448fae2176db60020def0d25dcc9649e60e3ed148434.json" + "/13a2ab958d83a0d701093b97d1a0bf06fc58c3ba829284db8471f584349aa667.json" ] ] } @@ -3384,7 +3384,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip b/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip deleted file mode 100644 index e6cb898734b43..0000000000000 Binary files a/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip and /dev/null differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip b/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip new file mode 100644 index 0000000000000..90a8a2a6e2615 Binary files /dev/null and b/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip differ diff --git a/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/integ.json index cf9d3f33b6fe3..9aeb58d63ab4a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/integ.json @@ -5,6 +5,7 @@ "stacks": [ "lambda-layer-awscli-integ-stack" ], + "diffAssets": true, "cdkCommandOptions": { "deploy": { "args": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/lambda-layer-awscli-integ-stack.assets.json b/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/lambda-layer-awscli-integ-stack.assets.json index 0ea965e42cd25..9bb2cb6a10880 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/lambda-layer-awscli-integ-stack.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/lambda-layer-awscli-integ-stack.assets.json @@ -1,15 +1,15 @@ { "version": "32.0.0", "files": { - "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc": { + "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": { "source": { - "path": "asset.292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip", + "objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -40,7 +40,7 @@ } } }, - "62998cd4c6a1f659096629c403ab29f6d901d0703b3b0510ed1dc023c49eec7e": { + "8a65fc5beae77d8d7d35eb629b3d3c2af942c0cbe961fad51c4459bd129c48cc": { "source": { "path": "lambda-layer-awscli-integ-stack.template.json", "packaging": "file" @@ -48,7 +48,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "62998cd4c6a1f659096629c403ab29f6d901d0703b3b0510ed1dc023c49eec7e.json", + "objectKey": "8a65fc5beae77d8d7d35eb629b3d3c2af942c0cbe961fad51c4459bd129c48cc.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/lambda-layer-awscli-integ-stack.template.json b/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/lambda-layer-awscli-integ-stack.template.json index ac6e9b1218162..8f02146345021 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/lambda-layer-awscli-integ-stack.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/lambda-layer-awscli-integ-stack.template.json @@ -7,7 +7,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "S3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/manifest.json index cdb7b59ca0303..8708e342b11c6 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/manifest.json @@ -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}/62998cd4c6a1f659096629c403ab29f6d901d0703b3b0510ed1dc023c49eec7e.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/8a65fc5beae77d8d7d35eb629b3d3c2af942c0cbe961fad51c4459bd129c48cc.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -36,7 +36,10 @@ "/lambda-layer-awscli-integ-stack/AwsCliLayer/Resource": [ { "type": "aws:cdk:logicalId", - "data": "AwsCliLayerF44AAF94" + "data": "AwsCliLayerF44AAF94", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] } ], "/lambda-layer-awscli-integ-stack/Lambda$python3.7/ServiceRole/Resource": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/tree.json index 486695b0060f8..493a7845fe55c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-awscli/test/integ.awscli-layer.js.snapshot/tree.json @@ -48,7 +48,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "292870ae2617f1c4d62ff18422e009afd534a342c17877fd1b931fb8d8a62abc.zip" + "s3Key": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip" }, "description": "/opt/awscli/aws" } @@ -793,7 +793,7 @@ "path": "lambda-layer-awscli-integ-test/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } }, "DeployAssert": { @@ -839,7 +839,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } } }, diff --git a/packages/@aws-cdk/aws-amplify-alpha/package.json b/packages/@aws-cdk/aws-amplify-alpha/package.json index 379fd0930f22f..f40749210db00 100644 --- a/packages/@aws-cdk/aws-amplify-alpha/package.json +++ b/packages/@aws-cdk/aws-amplify-alpha/package.json @@ -86,10 +86,10 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@aws-sdk/client-amplify": "^3.357.0", - "@aws-sdk/client-s3": "^3.357.0", - "@aws-sdk/s3-request-presigner": "^3.357.0", - "@types/jest": "^29.5.1", + "@aws-sdk/client-amplify": "^3.369.0", + "@aws-sdk/client-s3": "^3.369.0", + "@aws-sdk/s3-request-presigner": "^3.369.0", + "@types/jest": "^29.5.3", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0" }, diff --git a/packages/@aws-cdk/aws-apigatewayv2-alpha/package.json b/packages/@aws-cdk/aws-apigatewayv2-alpha/package.json index 89b9fe89e2d55..565a6c3b2b84c 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-alpha/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2-alpha/package.json @@ -89,7 +89,7 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0" }, diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/package.json b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/package.json index edd3e256534ca..abf3c465217f6 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/package.json @@ -86,8 +86,8 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/aws-lambda": "^8.10.115", - "@types/jest": "^29.5.1", + "@types/aws-lambda": "^8.10.119", + "@types/jest": "^29.5.3", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0", "@aws-cdk/aws-apigatewayv2-integrations-alpha": "0.0.0", diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/package.json b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/package.json index 527a610ec0894..f3ffc1d758644 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/package.json @@ -85,7 +85,7 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0", "@aws-cdk/integ-tests-alpha": "0.0.0", diff --git a/packages/@aws-cdk/aws-apprunner-alpha/package.json b/packages/@aws-cdk/aws-apprunner-alpha/package.json index 4d769473b9b59..7bc6876fced9b 100644 --- a/packages/@aws-cdk/aws-apprunner-alpha/package.json +++ b/packages/@aws-cdk/aws-apprunner-alpha/package.json @@ -88,7 +88,7 @@ "aws-cdk-lib": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "constructs": "^10.0.0", "@aws-cdk/integ-tests-alpha": "0.0.0" }, diff --git a/packages/@aws-cdk/aws-batch-alpha/package.json b/packages/@aws-cdk/aws-batch-alpha/package.json index a0e3503aad95a..59e5ca4c3e7e8 100644 --- a/packages/@aws-cdk/aws-batch-alpha/package.json +++ b/packages/@aws-cdk/aws-batch-alpha/package.json @@ -84,8 +84,8 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", - "jest": "^29.5.0", + "@types/jest": "^29.5.3", + "jest": "^29.6.1", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0", "@aws-cdk/integ-tests-alpha": "0.0.0" diff --git a/packages/@aws-cdk/aws-cloud9-alpha/package.json b/packages/@aws-cdk/aws-cloud9-alpha/package.json index 23a1436e06545..3186758da35ea 100644 --- a/packages/@aws-cdk/aws-cloud9-alpha/package.json +++ b/packages/@aws-cdk/aws-cloud9-alpha/package.json @@ -84,7 +84,7 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0", "@aws-cdk/integ-tests-alpha": "0.0.0" diff --git a/packages/@aws-cdk/aws-codestar-alpha/package.json b/packages/@aws-cdk/aws-codestar-alpha/package.json index e00066915de12..81bfaac324cd7 100644 --- a/packages/@aws-cdk/aws-codestar-alpha/package.json +++ b/packages/@aws-cdk/aws-codestar-alpha/package.json @@ -86,7 +86,7 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0" }, diff --git a/packages/@aws-cdk/aws-cognito-identitypool-alpha/package.json b/packages/@aws-cdk/aws-cognito-identitypool-alpha/package.json index 5d1d026b65059..795cfc675122c 100644 --- a/packages/@aws-cdk/aws-cognito-identitypool-alpha/package.json +++ b/packages/@aws-cdk/aws-cognito-identitypool-alpha/package.json @@ -84,8 +84,8 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", - "jest": "^29.5.0", + "@types/jest": "^29.5.3", + "jest": "^29.6.1", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0" }, diff --git a/packages/@aws-cdk/aws-gamelift-alpha/package.json b/packages/@aws-cdk/aws-gamelift-alpha/package.json index 01ccd7927a9ca..0202d961e1a1a 100644 --- a/packages/@aws-cdk/aws-gamelift-alpha/package.json +++ b/packages/@aws-cdk/aws-gamelift-alpha/package.json @@ -84,8 +84,8 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", - "jest": "^29.5.0", + "@types/jest": "^29.5.3", + "jest": "^29.6.1", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0", "@aws-cdk/integ-tests-alpha": "0.0.0" diff --git a/packages/@aws-cdk/aws-glue-alpha/package.json b/packages/@aws-cdk/aws-glue-alpha/package.json index f18e376658f77..490c61b1e3806 100644 --- a/packages/@aws-cdk/aws-glue-alpha/package.json +++ b/packages/@aws-cdk/aws-glue-alpha/package.json @@ -85,10 +85,10 @@ "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@aws-cdk/integ-tests-alpha": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0", - "jest": "^29.5.0" + "jest": "^29.6.1" }, "dependencies": {}, "homepage": "https://github.com/aws/aws-cdk", diff --git a/packages/@aws-cdk/aws-iot-actions-alpha/package.json b/packages/@aws-cdk/aws-iot-actions-alpha/package.json index 2ccc973a3e584..833b3884844af 100644 --- a/packages/@aws-cdk/aws-iot-actions-alpha/package.json +++ b/packages/@aws-cdk/aws-iot-actions-alpha/package.json @@ -84,8 +84,8 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", - "jest": "^29.5.0", + "@types/jest": "^29.5.3", + "jest": "^29.6.1", "constructs": "^10.0.0", "aws-cdk-lib": "0.0.0", "@aws-cdk/aws-kinesisfirehose-destinations-alpha": "0.0.0", diff --git a/packages/@aws-cdk/aws-iot-alpha/package.json b/packages/@aws-cdk/aws-iot-alpha/package.json index 4c660212c4519..b78e7ed19850c 100644 --- a/packages/@aws-cdk/aws-iot-alpha/package.json +++ b/packages/@aws-cdk/aws-iot-alpha/package.json @@ -84,8 +84,8 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", - "jest": "^29.5.0", + "@types/jest": "^29.5.3", + "jest": "^29.6.1", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0", "@aws-cdk/integ-tests-alpha": "0.0.0" diff --git a/packages/@aws-cdk/aws-iotevents-actions-alpha/package.json b/packages/@aws-cdk/aws-iotevents-actions-alpha/package.json index 67f56885d6b25..c7e7a2c3468f2 100644 --- a/packages/@aws-cdk/aws-iotevents-actions-alpha/package.json +++ b/packages/@aws-cdk/aws-iotevents-actions-alpha/package.json @@ -77,8 +77,8 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", - "jest": "^29.5.0", + "@types/jest": "^29.5.3", + "jest": "^29.6.1", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0", "@aws-cdk/integ-tests-alpha": "0.0.0", diff --git a/packages/@aws-cdk/aws-iotevents-alpha/package.json b/packages/@aws-cdk/aws-iotevents-alpha/package.json index b114e9d02c003..bdfa461309b2b 100644 --- a/packages/@aws-cdk/aws-iotevents-alpha/package.json +++ b/packages/@aws-cdk/aws-iotevents-alpha/package.json @@ -86,8 +86,8 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", - "jest": "^29.5.0", + "@types/jest": "^29.5.3", + "jest": "^29.6.1", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0", "@aws-cdk/integ-tests-alpha": "0.0.0" diff --git a/packages/@aws-cdk/aws-ivs-alpha/package.json b/packages/@aws-cdk/aws-ivs-alpha/package.json index a7579ac5d2d8d..d1daf4f045e20 100644 --- a/packages/@aws-cdk/aws-ivs-alpha/package.json +++ b/packages/@aws-cdk/aws-ivs-alpha/package.json @@ -92,7 +92,7 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0", "@aws-cdk/integ-tests-alpha": "0.0.0" diff --git a/packages/@aws-cdk/aws-kinesisanalytics-flink-alpha/package.json b/packages/@aws-cdk/aws-kinesisanalytics-flink-alpha/package.json index 2d32b473cfe40..be95c78c48d08 100644 --- a/packages/@aws-cdk/aws-kinesisanalytics-flink-alpha/package.json +++ b/packages/@aws-cdk/aws-kinesisanalytics-flink-alpha/package.json @@ -80,8 +80,8 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", - "jest": "^29.5.0", + "@types/jest": "^29.5.3", + "jest": "^29.6.1", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0", "@aws-cdk/integ-tests-alpha": "0.0.0" diff --git a/packages/@aws-cdk/aws-kinesisfirehose-alpha/package.json b/packages/@aws-cdk/aws-kinesisfirehose-alpha/package.json index 5915fc9f75fcc..cd7ea89514326 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose-alpha/package.json +++ b/packages/@aws-cdk/aws-kinesisfirehose-alpha/package.json @@ -84,7 +84,7 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0" }, diff --git a/packages/@aws-cdk/aws-kinesisfirehose-destinations-alpha/package.json b/packages/@aws-cdk/aws-kinesisfirehose-destinations-alpha/package.json index 57ad3b11ce4ad..0c8af2e894660 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose-destinations-alpha/package.json +++ b/packages/@aws-cdk/aws-kinesisfirehose-destinations-alpha/package.json @@ -78,8 +78,8 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", - "jest": "^29.5.0", + "@types/jest": "^29.5.3", + "jest": "^29.6.1", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0", "@aws-cdk/aws-kinesisfirehose-alpha": "0.0.0" diff --git a/packages/@aws-cdk/aws-lambda-go-alpha/package.json b/packages/@aws-cdk/aws-lambda-go-alpha/package.json index 2540ba1e4d673..283eafc54c3f3 100644 --- a/packages/@aws-cdk/aws-lambda-go-alpha/package.json +++ b/packages/@aws-cdk/aws-lambda-go-alpha/package.json @@ -80,7 +80,7 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0" }, diff --git a/packages/@aws-cdk/aws-lambda-python-alpha/package.json b/packages/@aws-cdk/aws-lambda-python-alpha/package.json index 5e6d7702268d6..5de594e84d50e 100644 --- a/packages/@aws-cdk/aws-lambda-python-alpha/package.json +++ b/packages/@aws-cdk/aws-lambda-python-alpha/package.json @@ -79,7 +79,7 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0", "@aws-cdk/integ-tests-alpha": "0.0.0" diff --git a/packages/@aws-cdk/aws-location-alpha/package.json b/packages/@aws-cdk/aws-location-alpha/package.json index 4cc1f14ca4645..e41f690ebc63f 100644 --- a/packages/@aws-cdk/aws-location-alpha/package.json +++ b/packages/@aws-cdk/aws-location-alpha/package.json @@ -87,7 +87,7 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0", "@aws-cdk/integ-tests-alpha": "0.0.0" diff --git a/packages/@aws-cdk/aws-msk-alpha/package.json b/packages/@aws-cdk/aws-msk-alpha/package.json index a9e1fd186b3df..8257f92b1f896 100644 --- a/packages/@aws-cdk/aws-msk-alpha/package.json +++ b/packages/@aws-cdk/aws-msk-alpha/package.json @@ -86,8 +86,8 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", - "jest": "^29.5.0", + "@types/jest": "^29.5.3", + "jest": "^29.6.1", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0", "@aws-cdk/integ-tests-alpha": "0.0.0" diff --git a/packages/@aws-cdk/aws-neptune-alpha/package.json b/packages/@aws-cdk/aws-neptune-alpha/package.json index 21ab86360e8a0..cf20aece51da8 100644 --- a/packages/@aws-cdk/aws-neptune-alpha/package.json +++ b/packages/@aws-cdk/aws-neptune-alpha/package.json @@ -85,7 +85,7 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0", "@aws-cdk/integ-tests-alpha": "0.0.0" diff --git a/packages/@aws-cdk/aws-redshift-alpha/package.json b/packages/@aws-cdk/aws-redshift-alpha/package.json index 4a31743a2c426..363f049758840 100644 --- a/packages/@aws-cdk/aws-redshift-alpha/package.json +++ b/packages/@aws-cdk/aws-redshift-alpha/package.json @@ -84,10 +84,10 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@aws-sdk/client-redshift": "^3.357.0", - "@aws-sdk/client-redshift-data": "^3.357.0", - "@aws-sdk/client-secrets-manager": "^3.357.0", - "@types/jest": "^29.5.1", + "@aws-sdk/client-redshift": "^3.369.0", + "@aws-sdk/client-redshift-data": "^3.369.0", + "@aws-sdk/client-secrets-manager": "^3.369.0", + "@types/jest": "^29.5.3", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0", "@aws-cdk/integ-tests-alpha": "0.0.0" diff --git a/packages/@aws-cdk/aws-route53resolver-alpha/package.json b/packages/@aws-cdk/aws-route53resolver-alpha/package.json index 6e3d60b1120d9..e6e0f6fca0735 100644 --- a/packages/@aws-cdk/aws-route53resolver-alpha/package.json +++ b/packages/@aws-cdk/aws-route53resolver-alpha/package.json @@ -85,7 +85,7 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0" }, diff --git a/packages/@aws-cdk/aws-s3objectlambda-alpha/package.json b/packages/@aws-cdk/aws-s3objectlambda-alpha/package.json index 6b43ffdf34422..a9ba1cbeb668c 100644 --- a/packages/@aws-cdk/aws-s3objectlambda-alpha/package.json +++ b/packages/@aws-cdk/aws-s3objectlambda-alpha/package.json @@ -87,8 +87,8 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", - "jest": "^29.5.0", + "@types/jest": "^29.5.3", + "jest": "^29.6.1", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0" }, diff --git a/packages/@aws-cdk/aws-sagemaker-alpha/package.json b/packages/@aws-cdk/aws-sagemaker-alpha/package.json index a8c0eee464fba..927c514d4e476 100644 --- a/packages/@aws-cdk/aws-sagemaker-alpha/package.json +++ b/packages/@aws-cdk/aws-sagemaker-alpha/package.json @@ -85,8 +85,8 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", - "jest": "^29.5.0", + "@types/jest": "^29.5.3", + "jest": "^29.6.1", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0", "@aws-cdk/integ-tests-alpha": "0.0.0" diff --git a/packages/@aws-cdk/aws-scheduler-alpha/package.json b/packages/@aws-cdk/aws-scheduler-alpha/package.json index 098aed842335d..96028b336af5d 100644 --- a/packages/@aws-cdk/aws-scheduler-alpha/package.json +++ b/packages/@aws-cdk/aws-scheduler-alpha/package.json @@ -84,7 +84,7 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0" }, diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry-alpha/package.json b/packages/@aws-cdk/aws-servicecatalogappregistry-alpha/package.json index 83c1a3bc8976c..d51d2edcd0245 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry-alpha/package.json +++ b/packages/@aws-cdk/aws-servicecatalogappregistry-alpha/package.json @@ -87,7 +87,7 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0", "@aws-cdk/integ-tests-alpha": "0.0.0" diff --git a/packages/@aws-cdk/aws-synthetics-alpha/package.json b/packages/@aws-cdk/aws-synthetics-alpha/package.json index 9683ea6fb709a..ac0b64ef4b798 100644 --- a/packages/@aws-cdk/aws-synthetics-alpha/package.json +++ b/packages/@aws-cdk/aws-synthetics-alpha/package.json @@ -87,8 +87,8 @@ "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@aws-cdk/integ-tests-alpha": "0.0.0", - "@types/jest": "^29.5.1", - "jest": "^29.5.0", + "@types/jest": "^29.5.3", + "jest": "^29.6.1", "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0" }, diff --git a/packages/@aws-cdk/cdk-cli-wrapper/package.json b/packages/@aws-cdk/cdk-cli-wrapper/package.json index f04471685a13e..167e88b12cc61 100644 --- a/packages/@aws-cdk/cdk-cli-wrapper/package.json +++ b/packages/@aws-cdk/cdk-cli-wrapper/package.json @@ -27,9 +27,9 @@ }, "license": "Apache-2.0", "devDependencies": { - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "@aws-cdk/cdk-build-tools": "0.0.0", - "jest": "^29.5.0", + "jest": "^29.6.1", "@aws-cdk/pkglint": "0.0.0" }, "repository": { diff --git a/packages/@aws-cdk/cfnspec/package.json b/packages/@aws-cdk/cfnspec/package.json index 1c365fdbf1f2d..36b027b80ff66 100644 --- a/packages/@aws-cdk/cfnspec/package.json +++ b/packages/@aws-cdk/cfnspec/package.json @@ -33,10 +33,10 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@types/fs-extra": "^9.0.13", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "@types/md5": "^2.3.2", "fast-json-patch": "^3.1.1", - "jest": "^29.5.0", + "jest": "^29.6.1", "json-diff": "^0.10.0", "sort-json": "^2.0.1", "ts-node": "^10.9.1" diff --git a/packages/@aws-cdk/cli-lib-alpha/package.json b/packages/@aws-cdk/cli-lib-alpha/package.json index 5e75fb7387650..2bf0c0373eaf4 100644 --- a/packages/@aws-cdk/cli-lib-alpha/package.json +++ b/packages/@aws-cdk/cli-lib-alpha/package.json @@ -91,10 +91,10 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "aws-cdk-lib": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "aws-cdk": "0.0.0", "constructs": "^10.0.0", - "jest": "^29.5.0", + "jest": "^29.6.1", "ts-node": "^10.9.1" }, "repository": { diff --git a/packages/@aws-cdk/cloud-assembly-schema/package.json b/packages/@aws-cdk/cloud-assembly-schema/package.json index ebce85d91ee36..e519664df4c5b 100644 --- a/packages/@aws-cdk/cloud-assembly-schema/package.json +++ b/packages/@aws-cdk/cloud-assembly-schema/package.json @@ -79,11 +79,11 @@ "devDependencies": { "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "@types/mock-fs": "^4.13.1", "@types/semver": "^7.5.0", "aws-cdk-lib": "0.0.0", - "jest": "^29.5.0", + "jest": "^29.6.1", "mock-fs": "^4.14.0", "typescript-json-schema": "^0.56.0" }, @@ -110,7 +110,7 @@ }, "dependencies": { "jsonschema": "^1.4.1", - "semver": "^7.5.1" + "semver": "^7.5.4" }, "awscdkio": { "announce": false diff --git a/packages/@aws-cdk/cloudformation-diff/package.json b/packages/@aws-cdk/cloudformation-diff/package.json index aa41cf51893ae..ea4031ec1cf79 100644 --- a/packages/@aws-cdk/cloudformation-diff/package.json +++ b/packages/@aws-cdk/cloudformation-diff/package.json @@ -33,11 +33,11 @@ "devDependencies": { "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "@types/string-width": "^4.0.1", "fast-check": "^2.25.0", - "jest": "^29.5.0", - "ts-jest": "^29.1.0" + "jest": "^29.6.1", + "ts-jest": "^29.1.1" }, "repository": { "url": "https://github.com/aws/aws-cdk.git", diff --git a/packages/@aws-cdk/custom-resource-handlers/package.json b/packages/@aws-cdk/custom-resource-handlers/package.json index f67a3cc881d38..34d9cbacde414 100644 --- a/packages/@aws-cdk/custom-resource-handlers/package.json +++ b/packages/@aws-cdk/custom-resource-handlers/package.json @@ -27,13 +27,13 @@ "devDependencies": { "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", - "jest": "^29.5.0", - "esbuild": "^0.17.19" + "@types/jest": "^29.5.3", + "jest": "^29.6.1", + "esbuild": "^0.18.11" }, "dependencies": { - "@aws-sdk/client-ecr": "^3.357.0", - "@aws-sdk/client-s3": "^3.357.0" + "@aws-sdk/client-ecr": "^3.369.0", + "@aws-sdk/client-s3": "^3.369.0" }, "repository": { "url": "https://github.com/aws/aws-cdk.git", diff --git a/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md b/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md index 901042138a6ee..19a44575155c2 100644 --- a/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md +++ b/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md @@ -54,6 +54,8 @@ Flags come in three types: | [@aws-cdk/aws-ec2:restrictDefaultSecurityGroup](#aws-cdkaws-ec2restrictdefaultsecuritygroup) | Restrict access to the VPC default security group | 2.78.0 | (default) | | [@aws-cdk/aws-kms:aliasNameRef](#aws-cdkaws-kmsaliasnameref) | KMS Alias name and keyArn will have implicit reference to KMS Key | 2.83.0 | (fix) | | [@aws-cdk/core:includePrefixInUniqueNameGeneration](#aws-cdkcoreincludeprefixinuniquenamegeneration) | Include the stack prefix in the stack name generation process | 2.84.0 | (fix) | +| [@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig](#aws-cdkaws-autoscalinggeneratelaunchtemplateinsteadoflaunchconfig) | Generate a launch template when creating an AutoScalingGroup | V2NEXT | (fix) | +| [@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby](#aws-cdkaws-opensearchserviceenableopensearchmultiazwithstandby) | Enables support for Multi-AZ with Standby deployment for opensearch domains | V2NEXT | (default) | @@ -98,7 +100,9 @@ The following json shows the current recommended set of flags, as `cdk init` wou "@aws-cdk/aws-ec2:restrictDefaultSecurityGroup": true, "@aws-cdk/aws-apigateway:requestValidatorUniqueId": true, "@aws-cdk/aws-kms:aliasNameRef": true, - "@aws-cdk/core:includePrefixInUniqueNameGeneration": true + "@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig": true, + "@aws-cdk/core:includePrefixInUniqueNameGeneration": true, + "@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": true } } ``` @@ -1008,4 +1012,44 @@ is not viable in some productive setups. | 2.84.0 | `false` | `true` | +### @aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig + +*Generate a launch template when creating an AutoScalingGroup* (fix) + +Enable this flag to allow AutoScalingGroups to generate a launch template when being created. +Launch configurations have been deprecated and cannot be created in AWS Accounts created after +December 31, 2023. Existing 'AutoScalingGroup' properties used for creating a launch configuration +will now create an equivalent 'launchTemplate'. Alternatively, users can provide an explicit +'launchTemplate' or 'mixedInstancesPolicy'. When this flag is enabled a 'launchTemplate' will +attempt to set user data according to the OS of the machine image if explicit user data is not +provided. + + +| Since | Default | Recommended | +| ----- | ----- | ----- | +| (not in v1) | | | +| V2NEXT | `false` | `true` | + +**Compatibility with old behavior:** + If backwards compatibility needs to be maintained due to an existing autoscaling group + using a launch config, set this flag to false. + + + +### @aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby + +*Enables support for Multi-AZ with Standby deployment for opensearch domains* (default) + +If this is set, an opensearch domain will automatically be created with +multi-az with standby enabled. + + +| Since | Default | Recommended | +| ----- | ----- | ----- | +| (not in v1) | | | +| V2NEXT | `false` | `true` | + +**Compatibility with old behavior:** Pass `capacity.multiAzWithStandbyEnabled: false` to `Domain` construct to restore the old behavior. + + diff --git a/packages/@aws-cdk/cx-api/package.json b/packages/@aws-cdk/cx-api/package.json index 6513b3cc59d39..a3b81a77ad096 100644 --- a/packages/@aws-cdk/cx-api/package.json +++ b/packages/@aws-cdk/cx-api/package.json @@ -77,7 +77,7 @@ }, "dependencies": { "@aws-cdk/cloud-assembly-schema": "0.0.0", - "semver": "^7.5.1" + "semver": "^7.5.4" }, "peerDependencies": { "@aws-cdk/cloud-assembly-schema": "0.0.0" @@ -87,10 +87,10 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "@types/mock-fs": "^4.13.1", "@types/semver": "^7.5.0", - "jest": "^29.5.0", + "jest": "^29.6.1", "madge": "^5.0.2", "mock-fs": "^4.14.0" }, diff --git a/packages/@aws-cdk/example-construct-library/package.json b/packages/@aws-cdk/example-construct-library/package.json index ec2560f77150f..a1ce0ea849249 100644 --- a/packages/@aws-cdk/example-construct-library/package.json +++ b/packages/@aws-cdk/example-construct-library/package.json @@ -77,8 +77,8 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", - "jest": "^29.5.0" + "@types/jest": "^29.5.3", + "jest": "^29.6.1" }, "dependencies": { "aws-cdk-lib": "0.0.0", diff --git a/packages/@aws-cdk/integ-runner/THIRD_PARTY_LICENSES b/packages/@aws-cdk/integ-runner/THIRD_PARTY_LICENSES index 1524800b29732..a4b83ac36b3f6 100644 --- a/packages/@aws-cdk/integ-runner/THIRD_PARTY_LICENSES +++ b/packages/@aws-cdk/integ-runner/THIRD_PARTY_LICENSES @@ -176,7 +176,7 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE ---------------- -** aws-sdk@2.1401.0 - https://www.npmjs.com/package/aws-sdk/v/2.1401.0 | Apache-2.0 +** aws-sdk@2.1415.0 - https://www.npmjs.com/package/aws-sdk/v/2.1415.0 | Apache-2.0 AWS SDK for JavaScript Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -2244,7 +2244,7 @@ License, as follows: ---------------- -** semver@7.5.2 - https://www.npmjs.com/package/semver/v/7.5.2 | ISC +** semver@7.5.4 - https://www.npmjs.com/package/semver/v/7.5.4 | ISC The ISC License Copyright (c) Isaac Z. Schlueter and Contributors diff --git a/packages/@aws-cdk/integ-runner/lib/cli.ts b/packages/@aws-cdk/integ-runner/lib/cli.ts index 3334cd11e5435..7ce6528204a06 100644 --- a/packages/@aws-cdk/integ-runner/lib/cli.ts +++ b/packages/@aws-cdk/integ-runner/lib/cli.ts @@ -111,7 +111,7 @@ export async function main(args: string[]) { }); const testsToRun: IntegTestWorkerConfig[] = []; - const destructiveChanges: DestructiveChange[] = []; + let destructiveChanges: boolean = false; let failedSnapshots: IntegTestWorkerConfig[] = []; let testsSucceeded = false; validateWatchArgs({ @@ -130,7 +130,11 @@ export async function main(args: string[]) { verbose: options.verbose, }); for (const failure of failedSnapshots) { - destructiveChanges.push(...failure.destructiveChanges ?? []); + logger.warning(`Failed: ${failure.fileName}`); + if (failure.destructiveChanges && failure.destructiveChanges.length > 0) { + printDestructiveChanges(failure.destructiveChanges); + destructiveChanges = true; + } } if (!options.force) { testsToRun.push(...failedSnapshots); @@ -182,8 +186,7 @@ export async function main(args: string[]) { void pool.terminate(); } - if (destructiveChanges.length > 0) { - printDestructiveChanges(destructiveChanges); + if (destructiveChanges) { throw new Error('Some changes were destructive!'); } if (failedSnapshots.length > 0) { diff --git a/packages/@aws-cdk/integ-runner/package.json b/packages/@aws-cdk/integ-runner/package.json index 4112e216760f4..a5e715584662f 100644 --- a/packages/@aws-cdk/integ-runner/package.json +++ b/packages/@aws-cdk/integ-runner/package.json @@ -59,13 +59,13 @@ "aws-cdk-lib": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@types/fs-extra": "^9.0.13", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "@types/mock-fs": "^4.13.1", "@types/workerpool": "^6.4.0", "@types/yargs": "^15.0.15", "constructs": "^10.0.0", "mock-fs": "^4.14.0", - "jest": "^29.5.0", + "jest": "^29.6.1", "ts-node": "^10.9.1" }, "dependencies": { diff --git a/packages/@aws-cdk/integ-tests-alpha/package.json b/packages/@aws-cdk/integ-tests-alpha/package.json index 030d94f8ee20c..e491ed0e298b5 100644 --- a/packages/@aws-cdk/integ-tests-alpha/package.json +++ b/packages/@aws-cdk/integ-tests-alpha/package.json @@ -69,21 +69,21 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@aws-cdk/sdk-v2-to-v3-adapter": "0.0.0", - "@aws-sdk/client-ec2": "^3.357.0", - "@aws-sdk/client-s3": "^3.357.0", - "@aws-sdk/client-sfn": "^3.357.0", - "@aws-sdk/types": "^3.357.0", + "@aws-cdk/sdk-v2-to-v3-adapter": "0.0.0", + "@aws-sdk/client-ec2": "^3.369.0", + "@aws-sdk/client-s3": "^3.369.0", + "@aws-sdk/client-sfn": "^3.369.0", + "@aws-sdk/types": "^3.369.0", "@types/fs-extra": "^9.0.13", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "aws-sdk-client-mock": "^3.0.0", "aws-sdk-client-mock-jest": "^3.0.0", - "jest": "^29.5.0", + "jest": "^29.6.1", "nock": "^13.3.1", "sinon": "^9.2.4", "aws-cdk-lib": "0.0.0", - "node-fetch": "^2.6.11", - "@types/node-fetch": "^2.6.2", + "node-fetch": "^2.6.12", + "@types/node-fetch": "^2.6.4", "constructs": "^10.0.0" }, "dependencies": {}, diff --git a/packages/@aws-cdk/region-info/package.json b/packages/@aws-cdk/region-info/package.json index a9e14bb21202f..febbd32615f2e 100644 --- a/packages/@aws-cdk/region-info/package.json +++ b/packages/@aws-cdk/region-info/package.json @@ -81,7 +81,7 @@ "@aws-cdk/pkglint": "0.0.0", "aws-cdk-lib": "0.0.0", "@types/fs-extra": "^9.0.13", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "fs-extra": "^9.1.0" }, "repository": { diff --git a/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/cluster.ts b/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/cluster.ts index c058e47b62c68..3a0a7294db31d 100644 --- a/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/cluster.ts +++ b/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/cluster.ts @@ -1,6 +1,7 @@ /* eslint-disable no-console */ // eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; // eslint-disable-next-line import/no-extraneous-dependencies import * as aws from 'aws-sdk'; import { EksClient, ResourceEvent, ResourceHandler } from './common'; @@ -70,7 +71,7 @@ export class ClusterResourceHandler extends ResourceHandler { try { await this.eks.deleteCluster({ name: this.clusterName }); } catch (e: any) { - if (e.code !== 'ResourceNotFoundException') { + if (!(e instanceof ResourceNotFoundException)) { throw e; } else { console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); @@ -88,7 +89,8 @@ export class ClusterResourceHandler extends ResourceHandler { const resp = await this.eks.describeCluster({ name: this.clusterName }); console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); } catch (e: any) { - if (e.code === 'ResourceNotFoundException') { + // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ + if (e instanceof ResourceNotFoundException) { console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); return { IsComplete: true }; } diff --git a/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/fargate.ts b/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/fargate.ts index 7db97a7f69d38..16b9f9abfeb49 100644 --- a/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/fargate.ts +++ b/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/fargate.ts @@ -1,3 +1,5 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { ResourceNotFoundException } from '@aws-sdk/client-eks'; import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies import { ResourceHandler } from './common'; @@ -107,7 +109,7 @@ export class FargateProfileResourceHandler extends ResourceHandler { return status; } catch (describeFargateProfileError: any) { - if (describeFargateProfileError.code === 'ResourceNotFoundException') { + if (describeFargateProfileError instanceof ResourceNotFoundException) { this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); return 'NOT_FOUND'; } diff --git a/packages/aws-cdk-lib/aws-eks/test/cluster-resource-handler-mocks.ts b/packages/aws-cdk-lib/aws-eks/test/cluster-resource-handler-mocks.ts index a12a913d44447..8cd2f45acf69e 100644 --- a/packages/aws-cdk-lib/aws-eks/test/cluster-resource-handler-mocks.ts +++ b/packages/aws-cdk-lib/aws-eks/test/cluster-resource-handler-mocks.ts @@ -27,8 +27,8 @@ export let simulateResponse: { describeClusterResponseMockStatus?: string; describeUpdateResponseMockStatus?: string; describeUpdateResponseMockErrors?: sdk.EKS.ErrorDetails; - deleteClusterErrorCode?: string; - describeClusterExceptionCode?: string; + deleteClusterError?: Error; + describeClusterException?: Error; } = { }; export function reset() { @@ -60,10 +60,8 @@ export const client: EksClient = { deleteCluster: async req => { actualRequest.deleteClusterRequest = req; - if (simulateResponse.deleteClusterErrorCode) { - const e = new Error('mock error'); - (e as any).code = simulateResponse.deleteClusterErrorCode; - throw e; + if (simulateResponse.deleteClusterError) { + throw simulateResponse.deleteClusterError; } return { cluster: { @@ -75,10 +73,8 @@ export const client: EksClient = { describeCluster: async req => { actualRequest.describeClusterRequest = req; - if (simulateResponse.describeClusterExceptionCode) { - const e = new Error('mock exception'); - (e as any).code = simulateResponse.describeClusterExceptionCode; - throw e; + if (simulateResponse.describeClusterException) { + throw simulateResponse.describeClusterException; } return { diff --git a/packages/aws-cdk-lib/aws-eks/test/cluster-resource-provider.test.ts b/packages/aws-cdk-lib/aws-eks/test/cluster-resource-provider.test.ts index d0c233a992325..dbabdee770d4c 100644 --- a/packages/aws-cdk-lib/aws-eks/test/cluster-resource-provider.test.ts +++ b/packages/aws-cdk-lib/aws-eks/test/cluster-resource-provider.test.ts @@ -1,3 +1,4 @@ +import * as eks from '@aws-sdk/client-eks'; import * as mocks from './cluster-resource-handler-mocks'; import { ClusterResourceHandler } from '../lib/cluster-resource-handler/cluster'; @@ -149,7 +150,12 @@ describe('cluster resource provider', () => { test('onDelete ignores ResourceNotFoundException', async () => { const handler = new ClusterResourceHandler(mocks.client, mocks.newRequest('Delete')); - mocks.simulateResponse.deleteClusterErrorCode = 'ResourceNotFoundException'; + mocks.simulateResponse.deleteClusterError = new eks.ResourceNotFoundException({ + message: 'Cluster not found', + $metadata: { + httpStatusCode: 404, + }, + }); await handler.onEvent(); }); @@ -162,21 +168,26 @@ describe('cluster resource provider', () => { test('isDeleteComplete returns true when describeCluster throws a ResourceNotFound exception', async () => { const handler = new ClusterResourceHandler(mocks.client, mocks.newRequest('Delete')); - mocks.simulateResponse.describeClusterExceptionCode = 'ResourceNotFoundException'; + mocks.simulateResponse.describeClusterException = new eks.ResourceNotFoundException({ + message: 'Cluster not found', + $metadata: { + httpStatusCode: 404, + }, + }); const resp = await handler.isComplete(); expect(resp.IsComplete).toEqual(true); }); test('isDeleteComplete propagates other errors', async () => { const handler = new ClusterResourceHandler(mocks.client, mocks.newRequest('Delete')); - mocks.simulateResponse.describeClusterExceptionCode = 'OtherException'; + mocks.simulateResponse.describeClusterException = new Error('OtherException'); let error: any; try { await handler.isComplete(); } catch (e) { error = e; } - expect(error.code).toEqual('OtherException'); + expect(error.message).toEqual('OtherException'); }); }); diff --git a/packages/aws-cdk-lib/aws-eks/test/fargate-resource-provider.test.ts b/packages/aws-cdk-lib/aws-eks/test/fargate-resource-provider.test.ts index 751bdcd49ae02..b87dccaf778e2 100644 --- a/packages/aws-cdk-lib/aws-eks/test/fargate-resource-provider.test.ts +++ b/packages/aws-cdk-lib/aws-eks/test/fargate-resource-provider.test.ts @@ -1,3 +1,4 @@ +import * as eks from '@aws-sdk/client-eks'; import * as sinon from 'sinon'; import { FARGATE_PROFILE_RESOURCE_TYPE } from '../lib/cluster-resource-handler/consts'; import { FargateProfileResourceHandler } from '../lib/cluster-resource-handler/fargate'; @@ -200,8 +201,12 @@ describe('fargate resource provider', () => { // GIVEN const client = newEksClientMock(); - const resourceNotFoundError = new Error(); - (resourceNotFoundError as any).code = 'ResourceNotFoundException'; + const resourceNotFoundError = new eks.ResourceNotFoundException({ + message: 'Cluster not found', + $metadata: { + httpStatusCode: 404, + }, + }); client.describeFargateProfile = sinon.fake.throws(resourceNotFoundError); // WHEN diff --git a/packages/aws-cdk-lib/custom-resources/lib/aws-custom-resource/sdk-api-metadata.json b/packages/aws-cdk-lib/custom-resources/lib/aws-custom-resource/sdk-api-metadata.json index 66df6b4394a4d..37da13eb89936 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/aws-custom-resource/sdk-api-metadata.json +++ b/packages/aws-cdk-lib/custom-resources/lib/aws-custom-resource/sdk-api-metadata.json @@ -1314,5 +1314,8 @@ }, "verifiedpermissions": { "name": "VerifiedPermissions" + }, + "appfabric": { + "name": "AppFabric" } } \ No newline at end of file diff --git a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md index bad1157e57f3d..19a44575155c2 100644 --- a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +++ b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md @@ -102,7 +102,7 @@ The following json shows the current recommended set of flags, as `cdk init` wou "@aws-cdk/aws-kms:aliasNameRef": true, "@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig": true, "@aws-cdk/core:includePrefixInUniqueNameGeneration": true, - "@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": false + "@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": true } } ``` @@ -1047,7 +1047,7 @@ multi-az with standby enabled. | Since | Default | Recommended | | ----- | ----- | ----- | | (not in v1) | | | -| V2NEXT | `false` | `false` | +| V2NEXT | `false` | `true` | **Compatibility with old behavior:** Pass `capacity.multiAzWithStandbyEnabled: false` to `Domain` construct to restore the old behavior. diff --git a/packages/aws-cdk-lib/package.json b/packages/aws-cdk-lib/package.json index 6e39c0fd6acd3..e91d21a8bd1cb 100644 --- a/packages/aws-cdk-lib/package.json +++ b/packages/aws-cdk-lib/package.json @@ -123,9 +123,9 @@ "yaml" ], "dependencies": { - "@aws-cdk/asset-awscli-v1": "^2.2.177", - "@aws-cdk/asset-node-proxy-agent-v5": "^2.0.148", - "@aws-cdk/asset-kubectl-v20": "^2.1.1", + "@aws-cdk/asset-awscli-v1": "^2.2.200", + "@aws-cdk/asset-node-proxy-agent-v5": "^2.0.165", + "@aws-cdk/asset-kubectl-v20": "^2.1.2", "@balena/dockerignore": "^1.0.2", "case": "1.6.3", "fs-extra": "^11.1.1", @@ -133,7 +133,7 @@ "jsonschema": "^1.4.1", "minimatch": "^3.1.2", "punycode": "^2.3.0", - "semver": "^7.5.1", + "semver": "^7.5.4", "table": "^6.8.1", "yaml": "1.10.2" }, @@ -145,43 +145,43 @@ "@aws-cdk/pkglint": "0.0.0", "@aws-cdk/sdk-v2-to-v3-adapter": "0.0.0", "@aws-cdk/spec2cdk": "0.0.0", - "@aws-sdk/client-acm": "^3.357.0", - "@aws-sdk/client-account": "^3.357.0", - "@aws-sdk/client-codepipeline": "^3.357.0", - "@aws-sdk/client-dynamodb": "^3.357.0", - "@aws-sdk/client-ecr": "^3.357.0", - "@aws-sdk/client-eks": "^3.357.0", - "@aws-sdk/client-lambda": "^3.357.0", - "@aws-sdk/client-route-53": "^3.357.0", - "@aws-sdk/client-s3": "^3.357.0", - "@aws-sdk/client-sfn": "^3.357.0", - "@aws-sdk/client-ssm": "^3.357.0", - "@aws-sdk/client-sts": "^3.357.0", - "@aws-sdk/credential-providers": "^3.357.0", - "@aws-sdk/node-http-handler": "^3.357.0", - "@aws-sdk/types": "^3.357.0", - "@types/aws-lambda": "^8.10.115", - "@types/jest": "^29.5.1", - "@types/lodash": "^4.14.194", + "@aws-sdk/client-acm": "^3.369.0", + "@aws-sdk/client-account": "^3.369.0", + "@aws-sdk/client-codepipeline": "^3.369.0", + "@aws-sdk/client-dynamodb": "^3.369.0", + "@aws-sdk/client-ecr": "^3.369.0", + "@aws-sdk/client-eks": "^3.369.0", + "@aws-sdk/client-lambda": "^3.369.0", + "@aws-sdk/client-route-53": "^3.369.0", + "@aws-sdk/client-s3": "^3.369.0", + "@aws-sdk/client-sfn": "^3.369.0", + "@aws-sdk/client-ssm": "^3.369.0", + "@aws-sdk/client-sts": "^3.369.0", + "@aws-sdk/credential-providers": "^3.369.0", + "@aws-sdk/node-http-handler": "^3.369.0", + "@aws-sdk/types": "^3.369.0", + "@types/aws-lambda": "^8.10.119", + "@types/jest": "^29.5.3", + "@types/lodash": "^4.14.195", "@types/punycode": "^2.1.0", - "aws-sdk": "^2.1379.0", + "aws-sdk": "^2.1414.0", "aws-sdk-client-mock": "^3.0.0", "aws-sdk-mock": "5.8.0", - "cdk8s": "^2.7.68", + "cdk8s": "^2.7.102", "constructs": "^10.0.0", "delay": "5.0.0", - "esbuild": "^0.17.19", + "esbuild": "^0.18.11", "fast-check": "^2.25.0", "fs-extra": "^11.1.1", - "jest": "^29.5.0", - "jest-each": "^29.5.0", + "jest": "^29.6.1", + "jest-each": "^29.6.1", "lambda-tester": "^4.0.1", "lodash": "^4.17.21", "nock": "^13.3.1", "ts-mock-imports": "^1.3.8", "ts-node": "^10.9.1", "sinon": "^9.2.4", - "typescript": "~5.1.3", + "typescript": "~5.1.6", "typescript-json-schema": "^0.56.0" }, "peerDependencies": { diff --git a/packages/aws-cdk/THIRD_PARTY_LICENSES b/packages/aws-cdk/THIRD_PARTY_LICENSES index c1c6d72ae8513..30ae3c3d4fc39 100644 --- a/packages/aws-cdk/THIRD_PARTY_LICENSES +++ b/packages/aws-cdk/THIRD_PARTY_LICENSES @@ -1,6 +1,6 @@ The aws-cdk package includes the following third-party software/licensing: -** @jsii/check-node@1.81.0 - https://www.npmjs.com/package/@jsii/check-node/v/1.81.0 | Apache-2.0 +** @jsii/check-node@1.84.0 - https://www.npmjs.com/package/@jsii/check-node/v/1.84.0 | Apache-2.0 jsii Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -268,7 +268,7 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE ---------------- -** aws-sdk@2.1401.0 - https://www.npmjs.com/package/aws-sdk/v/2.1401.0 | Apache-2.0 +** aws-sdk@2.1415.0 - https://www.npmjs.com/package/aws-sdk/v/2.1415.0 | Apache-2.0 AWS SDK for JavaScript Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -2969,6 +2969,26 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +---------------- + +** semver@7.5.4 - https://www.npmjs.com/package/semver/v/7.5.4 | ISC +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ---------------- ** setprototypeof@1.2.0 - https://www.npmjs.com/package/setprototypeof/v/1.2.0 | ISC diff --git a/packages/aws-cdk/lib/init-templates/app/javascript/package.json b/packages/aws-cdk/lib/init-templates/app/javascript/package.json index c4314e7f6c633..7efecb3220b85 100644 --- a/packages/aws-cdk/lib/init-templates/app/javascript/package.json +++ b/packages/aws-cdk/lib/init-templates/app/javascript/package.json @@ -11,7 +11,7 @@ }, "devDependencies": { "aws-cdk": "%cdk-version%", - "jest": "^29.5.0" + "jest": "^29.6.1" }, "dependencies": { "aws-cdk-lib": "%cdk-version%", diff --git a/packages/aws-cdk/lib/init-templates/app/typescript/package.json b/packages/aws-cdk/lib/init-templates/app/typescript/package.json index bc38af45efcb5..eda190e5d88f5 100644 --- a/packages/aws-cdk/lib/init-templates/app/typescript/package.json +++ b/packages/aws-cdk/lib/init-templates/app/typescript/package.json @@ -11,13 +11,13 @@ "cdk": "cdk" }, "devDependencies": { - "@types/jest": "^29.5.1", - "@types/node": "20.1.7", - "jest": "^29.5.0", - "ts-jest": "^29.1.0", + "@types/jest": "^29.5.3", + "@types/node": "20.4.1", + "jest": "^29.6.1", + "ts-jest": "^29.1.1", "aws-cdk": "%cdk-version%", "ts-node": "^10.9.1", - "typescript": "~5.1.3" + "typescript": "~5.1.6" }, "dependencies": { "aws-cdk-lib": "%cdk-version%", diff --git a/packages/aws-cdk/lib/init-templates/lib/typescript/package.json b/packages/aws-cdk/lib/init-templates/lib/typescript/package.json index 161176d695c8c..a5df5ddc203e3 100644 --- a/packages/aws-cdk/lib/init-templates/lib/typescript/package.json +++ b/packages/aws-cdk/lib/init-templates/lib/typescript/package.json @@ -9,13 +9,13 @@ "test": "jest" }, "devDependencies": { - "@types/jest": "^29.5.1", - "@types/node": "20.1.7", + "@types/jest": "^29.5.3", + "@types/node": "20.4.1", "aws-cdk-lib": "%cdk-version%", "constructs": "%constructs-version%", - "jest": "^29.5.0", - "ts-jest": "^29.1.0", - "typescript": "~5.1.3" + "jest": "^29.6.1", + "ts-jest": "^29.1.1", + "typescript": "~5.1.6" }, "peerDependencies": { "aws-cdk-lib": "%cdk-version%", diff --git a/packages/aws-cdk/lib/init-templates/sample-app/javascript/package.json b/packages/aws-cdk/lib/init-templates/sample-app/javascript/package.json index c4314e7f6c633..7efecb3220b85 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/javascript/package.json +++ b/packages/aws-cdk/lib/init-templates/sample-app/javascript/package.json @@ -11,7 +11,7 @@ }, "devDependencies": { "aws-cdk": "%cdk-version%", - "jest": "^29.5.0" + "jest": "^29.6.1" }, "dependencies": { "aws-cdk-lib": "%cdk-version%", diff --git a/packages/aws-cdk/lib/init-templates/sample-app/typescript/package.json b/packages/aws-cdk/lib/init-templates/sample-app/typescript/package.json index d936407260e2c..f0387ee0e106b 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/typescript/package.json +++ b/packages/aws-cdk/lib/init-templates/sample-app/typescript/package.json @@ -11,13 +11,13 @@ "cdk": "cdk" }, "devDependencies": { - "@types/jest": "^29.5.1", - "@types/node": "20.1.7", - "jest": "^29.5.0", - "ts-jest": "^29.1.0", + "@types/jest": "^29.5.3", + "@types/node": "20.4.1", + "jest": "^29.6.1", + "ts-jest": "^29.1.1", "aws-cdk": "%cdk-version%", "ts-node": "^10.9.1", - "typescript": "~5.1.3" + "typescript": "~5.1.6" }, "dependencies": { "aws-cdk-lib": "%cdk-version%", diff --git a/packages/aws-cdk/package.json b/packages/aws-cdk/package.json index 1ad50493e7477..b53e0c664960b 100644 --- a/packages/aws-cdk/package.json +++ b/packages/aws-cdk/package.json @@ -68,7 +68,7 @@ "@types/archiver": "^5.3.2", "@types/fs-extra": "^9.0.13", "@types/glob": "^7.2.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "@types/mockery": "^1.4.30", "@types/promptly": "^3.0.2", "@types/semver": "^7.5.0", @@ -83,13 +83,13 @@ "axios": "^0.27.2", "constructs": "^10.0.0", "fast-check": "^2.25.0", - "jest": "^29.5.0", + "jest": "^29.6.1", "madge": "^5.0.2", "make-runnable": "^1.4.1", "mockery": "^2.1.0", "nock": "^13.3.1", "sinon": "^9.2.4", - "ts-jest": "^29.1.0", + "ts-jest": "^29.1.1", "ts-mock-imports": "^1.3.8", "xml-js": "^1.6.11" }, @@ -98,9 +98,9 @@ "@aws-cdk/cloudformation-diff": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "@jsii/check-node": "1.81.0", + "@jsii/check-node": "1.84.0", "archiver": "^5.3.1", - "aws-sdk": "^2.1379.0", + "aws-sdk": "^2.1414.0", "camelcase": "^6.3.0", "cdk-assets": "0.0.0", "chalk": "^4", @@ -109,10 +109,10 @@ "fs-extra": "^9.1.0", "glob": "^7.2.3", "json-diff": "^0.10.0", - "minimatch": "^9.0.0", + "minimatch": "^9.0.3", "promptly": "^3.2.0", "proxy-agent": "^5.0.0", - "semver": "^7.5.1", + "semver": "^7.5.4", "source-map-support": "^0.5.21", "strip-ansi": "^6.0.1", "table": "^6.8.1", diff --git a/packages/awslint/package.json b/packages/awslint/package.json index 9bfda0946f130..65c9d617f16ef 100644 --- a/packages/awslint/package.json +++ b/packages/awslint/package.json @@ -18,19 +18,19 @@ "awslint": "bin/awslint" }, "dependencies": { - "@jsii/spec": "1.81.0", + "@jsii/spec": "1.84.0", "camelcase": "^6.3.0", "chalk": "^4", "fs-extra": "^9.1.0", - "jsii-reflect": "1.81.0", + "jsii-reflect": "1.84.0", "yargs": "^16.2.0" }, "devDependencies": { "@types/fs-extra": "^9.0.13", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "@types/yargs": "^15.0.15", "@aws-cdk/pkglint": "0.0.0", - "typescript": "~5.1.3", + "typescript": "~5.1.6", "@typescript-eslint/eslint-plugin": "^4.33.0", "@typescript-eslint/parser": "^4.33.0", "eslint": "^7.32.0", @@ -39,7 +39,7 @@ "@aws-cdk/eslint-plugin": "0.0.0", "eslint-plugin-import": "^2.27.5", "eslint-plugin-jest": "^24.7.0", - "jest": "^29.5.0" + "jest": "^29.6.1" }, "repository": { "type": "git", diff --git a/packages/cdk-assets/package.json b/packages/cdk-assets/package.json index 9d1fdc50fbe4b..ed5e708c640d1 100644 --- a/packages/cdk-assets/package.json +++ b/packages/cdk-assets/package.json @@ -32,12 +32,12 @@ "devDependencies": { "@types/archiver": "^5.3.2", "@types/glob": "^7.2.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "@types/mime": "^2.0.3", "@types/mock-fs": "^4.13.1", "@types/yargs": "^15.0.15", "@aws-cdk/cdk-build-tools": "0.0.0", - "jest": "^29.5.0", + "jest": "^29.6.1", "jszip": "^3.10.1", "mock-fs": "^4.14.0", "@aws-cdk/pkglint": "0.0.0" @@ -46,7 +46,7 @@ "@aws-cdk/cloud-assembly-schema": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "archiver": "^5.3.1", - "aws-sdk": "^2.1379.0", + "aws-sdk": "^2.1414.0", "glob": "^7.2.3", "mime": "^2.6.0", "yargs": "^16.2.0" diff --git a/scripts/@aws-cdk/script-tests/package.json b/scripts/@aws-cdk/script-tests/package.json index a625e3a6fdad7..7c631f343e39a 100644 --- a/scripts/@aws-cdk/script-tests/package.json +++ b/scripts/@aws-cdk/script-tests/package.json @@ -12,6 +12,6 @@ "build+extract": "npm run build" }, "devDependencies": { - "jest": "^29.5.0" + "jest": "^29.6.1" } } diff --git a/tools/@aws-cdk/cdk-build-tools/package.json b/tools/@aws-cdk/cdk-build-tools/package.json index 6724a43dcc9f2..9d498523a0e2b 100644 --- a/tools/@aws-cdk/cdk-build-tools/package.json +++ b/tools/@aws-cdk/cdk-build-tools/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@aws-cdk/pkglint": "0.0.0", "@types/fs-extra": "^9.0.13", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "@types/semver": "^7.5.0", "@types/yargs": "^15.0.15" }, @@ -57,16 +57,16 @@ "eslint-plugin-jest": "^24.7.0", "fs-extra": "^9.1.0", "glob": "^7.2.3", - "jest": "^29.5.0", + "jest": "^29.6.1", "jest-junit": "^13.2.0", - "jsii": "~5.0.8", - "jsii-pacmak": "1.82.0", - "jsii-reflect": "1.82.0", - "markdownlint-cli": "^0.34.0", + "jsii": "~5.1.6", + "jsii-pacmak": "1.84.0", + "jsii-reflect": "1.84.0", + "markdownlint-cli": "^0.35.0", "nyc": "^15.1.0", - "semver": "^7.5.1", - "ts-jest": "^29.1.0", - "typescript": "~5.1.3", + "semver": "^7.5.4", + "ts-jest": "^29.1.1", + "typescript": "~5.1.6", "yargs": "^16.2.0" }, "keywords": [ diff --git a/tools/@aws-cdk/cdk-release/package.json b/tools/@aws-cdk/cdk-release/package.json index 0288df0c6c2e1..87fa1367d0f36 100644 --- a/tools/@aws-cdk/cdk-release/package.json +++ b/tools/@aws-cdk/cdk-release/package.json @@ -32,9 +32,9 @@ "@aws-cdk/pkglint": "0.0.0", "@types/changelog-parser": "^2.8.1", "@types/fs-extra": "^9.0.13", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "@types/yargs": "^15.0.15", - "jest": "^29.5.0" + "jest": "^29.6.1" }, "dependencies": { "@lerna/project": "^4.0.0", @@ -48,7 +48,7 @@ "detect-newline": "^3.1.0", "fs-extra": "^9.1.0", "git-raw-commits": "^2.0.11", - "semver": "^7.5.1", + "semver": "^7.5.4", "stringify-package": "^1.0.1" }, "keywords": [ diff --git a/tools/@aws-cdk/cfn2ts/package.json b/tools/@aws-cdk/cfn2ts/package.json index f4ccdfca77db9..906707faf87c3 100644 --- a/tools/@aws-cdk/cfn2ts/package.json +++ b/tools/@aws-cdk/cfn2ts/package.json @@ -33,7 +33,7 @@ "dependencies": { "@aws-cdk/cfnspec": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "codemaker": "1.81.0", + "codemaker": "1.84.0", "fast-json-patch": "^3.1.1", "fs-extra": "^9.1.0", "yargs": "^16.2.0" @@ -42,9 +42,9 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@types/fs-extra": "^9.0.13", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "@types/yargs": "^15.0.15", - "jest": "^29.5.0" + "jest": "^29.6.1" }, "keywords": [ "aws", diff --git a/tools/@aws-cdk/eslint-plugin/package.json b/tools/@aws-cdk/eslint-plugin/package.json index df8b1de5039be..a934325b22e00 100644 --- a/tools/@aws-cdk/eslint-plugin/package.json +++ b/tools/@aws-cdk/eslint-plugin/package.json @@ -16,10 +16,10 @@ "devDependencies": { "@types/eslint": "^7.29.0", "@types/fs-extra": "^9.0.13", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "@types/estree": "*", - "jest": "^29.5.0", - "typescript": "~5.1.3" + "jest": "^29.6.1", + "typescript": "~5.1.6" }, "dependencies": { "@typescript-eslint/parser": "^4.33.0", diff --git a/tools/@aws-cdk/node-bundle/package.json b/tools/@aws-cdk/node-bundle/package.json index 399fb7098a551..73afe2d2fe9cb 100644 --- a/tools/@aws-cdk/node-bundle/package.json +++ b/tools/@aws-cdk/node-bundle/package.json @@ -25,7 +25,7 @@ "projen": "projen" }, "devDependencies": { - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "@types/license-checker": "^25.0.3", "@types/madge": "^5.0.0", "@types/node": "^14", @@ -38,13 +38,13 @@ "jest": "^29", "jest-junit": "^13", "npm-check-updates": "^16", - "projen": "^0.71.60", + "projen": "^0.71.134", "standard-version": "^9", "ts-jest": "^29", "typescript": "^4.5.5" }, "dependencies": { - "esbuild": "^0.17.19", + "esbuild": "^0.18.11", "fs-extra": "^10.1.0", "license-checker": "^25.0.1", "madge": "^5.0.2", diff --git a/tools/@aws-cdk/pkglint/package.json b/tools/@aws-cdk/pkglint/package.json index ebf24351fc4df..eef9ef98d2773 100644 --- a/tools/@aws-cdk/pkglint/package.json +++ b/tools/@aws-cdk/pkglint/package.json @@ -40,7 +40,7 @@ "@aws-cdk/eslint-plugin": "0.0.0", "@types/fs-extra": "^9.0.13", "@types/glob": "^7.2.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "@types/semver": "^7.5.0", "@types/yargs": "^15.0.15", "@typescript-eslint/eslint-plugin": "^4.33.0", @@ -50,8 +50,8 @@ "eslint-import-resolver-typescript": "^2.7.1", "eslint-plugin-import": "^2.27.5", "eslint-plugin-jest": "^24.7.0", - "jest": "^29.5.0", - "typescript": "~5.1.3" + "jest": "^29.6.1", + "typescript": "~5.1.6" }, "nozem": { "ostools": [ @@ -66,7 +66,7 @@ "fs-extra": "^9.1.0", "glob": "^7.2.3", "npm-bundled": "^1.1.2", - "semver": "^7.5.1", + "semver": "^7.5.4", "yargs": "^16.2.0" } } diff --git a/tools/@aws-cdk/prlint/package.json b/tools/@aws-cdk/prlint/package.json index 8ee225ad8f82b..2056865f005da 100644 --- a/tools/@aws-cdk/prlint/package.json +++ b/tools/@aws-cdk/prlint/package.json @@ -22,10 +22,10 @@ "@types/conventional-commits-parser": "3.0.2", "@types/fs-extra": "^9.0.13", "@types/glob": "^7.2.0", - "@types/jest": "^29.5.1", - "jest": "^29.5.0", + "@types/jest": "^29.5.3", + "jest": "^29.6.1", "make-runnable": "^1.4.1", - "typescript": "~5.1.3" + "typescript": "~5.1.6" }, "jest": { "testMatch": [ diff --git a/tools/@aws-cdk/spec2cdk/package.json b/tools/@aws-cdk/spec2cdk/package.json index 5c37d1a7aa06c..3881a98444ffc 100644 --- a/tools/@aws-cdk/spec2cdk/package.json +++ b/tools/@aws-cdk/spec2cdk/package.json @@ -43,9 +43,9 @@ "devDependencies": { "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "@types/node": "^16", - "jest": "^29.5.0" + "jest": "^29.6.1" }, "keywords": [ "aws", diff --git a/tools/@aws-cdk/yarn-cling/package.json b/tools/@aws-cdk/yarn-cling/package.json index a4c326322140a..e088c97084a61 100644 --- a/tools/@aws-cdk/yarn-cling/package.json +++ b/tools/@aws-cdk/yarn-cling/package.json @@ -38,16 +38,16 @@ }, "devDependencies": { "@aws-cdk/pkglint": "0.0.0", - "@types/jest": "^29.5.1", + "@types/jest": "^29.5.3", "@types/node": "18.11.19", "@types/semver": "^7.5.0", - "@types/yarnpkg__lockfile": "^1.1.5", - "jest": "^29.5.0", - "typescript": "~5.1.3" + "@types/yarnpkg__lockfile": "^1.1.6", + "jest": "^29.6.1", + "typescript": "~5.1.6" }, "dependencies": { "@yarnpkg/lockfile": "^1.1.0", - "semver": "^7.5.1" + "semver": "^7.5.4" }, "keywords": [ "aws", diff --git a/yarn.lock b/yarn.lock index 3b541b78c2851..894ae39638305 100644 --- a/yarn.lock +++ b/yarn.lock @@ -35,17 +35,17 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@aws-cdk/asset-awscli-v1@^2.2.177": - version "2.2.198" - resolved "https://registry.npmjs.org/@aws-cdk/asset-awscli-v1/-/asset-awscli-v1-2.2.198.tgz#7a7cddbbc33c6f42b4e6457296dc40c5926d27c3" - integrity sha512-RfOMXFMyZ5Ca8ytB3/vs6srFH5HVV4M2JS9Wsb/uXPEpSblEmuf31iGVfN6Q+xRoNPm8icsquCRQ79JBqH4yjA== +"@aws-cdk/asset-awscli-v1@^2.2.200": + version "2.2.200" + resolved "https://registry.npmjs.org/@aws-cdk/asset-awscli-v1/-/asset-awscli-v1-2.2.200.tgz#6ead533f73f705ad7350eb46955e2538e50cd013" + integrity sha512-Kf5J8DfJK4wZFWT2Myca0lhwke7LwHcHBo+4TvWOGJrFVVKVuuiLCkzPPRBQQVDj0Vtn2NBokZAz8pfMpAqAKg== -"@aws-cdk/asset-kubectl-v20@^2.1.1": +"@aws-cdk/asset-kubectl-v20@^2.1.2": version "2.1.2" resolved "https://registry.npmjs.org/@aws-cdk/asset-kubectl-v20/-/asset-kubectl-v20-2.1.2.tgz#d8e20b5f5dc20128ea2000dc479ca3c7ddc27248" integrity sha512-3M2tELJOxQv0apCIiuKQ4pAbncz9GuLwnKFqxifWfe77wuMxyTRPmxssYHs42ePqzap1LT6GDcPygGs+hHstLg== -"@aws-cdk/asset-node-proxy-agent-v5@^2.0.148": +"@aws-cdk/asset-node-proxy-agent-v5@^2.0.165": version "2.0.165" resolved "https://registry.npmjs.org/@aws-cdk/asset-node-proxy-agent-v5/-/asset-node-proxy-agent-v5-2.0.165.tgz#c169599d83beceea7e638082ef9833997f04c85d" integrity sha512-bsyLQD/vqXQcc9RDmlM1XqiFNO/yewgVFXmkMcQkndJbmE/jgYkzewwYGrBlfL725hGLQipXq19+jwWwdsXQqg== @@ -58,10 +58,10 @@ "@aws-cdk/service-spec-types" "^0.0.2" "@cdklabs/tskb" "^0.0.1" -"@aws-cdk/lambda-layer-kubectl-v24@^2.0.195": - version "2.0.229" - resolved "https://registry.npmjs.org/@aws-cdk/lambda-layer-kubectl-v24/-/lambda-layer-kubectl-v24-2.0.229.tgz#fc766bcf0899e24ba9af5b8757264479e3f1c662" - integrity sha512-ATloS7yCcJHxMaOwItTndudTzmtbfYYyw9seaIeTvAHLeRcwIdpT0fDJKGzNVq+Aqn3nu0RjJI3kOpmJ7/sM7A== +"@aws-cdk/lambda-layer-kubectl-v24@^2.0.242": + version "2.0.242" + resolved "https://registry.npmjs.org/@aws-cdk/lambda-layer-kubectl-v24/-/lambda-layer-kubectl-v24-2.0.242.tgz#4273a5ad7714f933a7eba155eb9280823086db71" + integrity sha512-7/wIOo685tmrEe4hh6zqDELhBZh5OQGf3Hd2FU2Vnwy2ZubW8qTmEw5gqJCsCrGKeYDoa1BcVhDRZ/nzjkaqyA== "@aws-cdk/service-spec-types@^0.0.2": version "0.0.2" @@ -147,12 +147,20 @@ "@aws-sdk/util-utf8-browser" "^3.0.0" tslib "^1.11.1" -"@aws-sdk/abort-controller@3.357.0": - version "3.357.0" - resolved "https://registry.npmjs.org/@aws-sdk/abort-controller/-/abort-controller-3.357.0.tgz#5c5336d18b97781d0b940700375d825f9e20d9be" - integrity sha512-nQYDJon87quPwt2JZJwUN2GFKJnvE5kWb6tZP4xb5biSGUKBqDQo06oYed7yokatCuCMouIXV462aN0fWODtOw== +"@aws-sdk/abort-controller@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/abort-controller/-/abort-controller-3.370.0.tgz#89f90269af8d41ce5fc23b5f0c1b6dd7986c34d5" + integrity sha512-/W4arzC/+yVW/cvEXbuwvG0uly4yFSZnnIA+gkqgAm+0HVfacwcPpNf4BjyxjnvIdh03l7w2DriF6MlKUfiQ3A== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" + tslib "^2.5.0" + +"@aws-sdk/chunked-blob-reader-native@3.310.0": + version "3.310.0" + resolved "https://registry.npmjs.org/@aws-sdk/chunked-blob-reader-native/-/chunked-blob-reader-native-3.310.0.tgz#98d43a6213557835b3bbb0cd2ee0a4e2088e916a" + integrity sha512-RuhyUY9hCd6KWA2DMF/U6rilYLLRYrDY6e0lq3Of1yzSRFxi4bk9ZMCF0mxf/9ppsB5eudUjrOypYgm6Axt3zw== + dependencies: + "@aws-sdk/util-base64" "3.310.0" tslib "^2.5.0" "@aws-sdk/chunked-blob-reader@3.310.0": @@ -162,414 +170,414 @@ dependencies: tslib "^2.5.0" -"@aws-sdk/client-account@^3.357.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-account/-/client-account-3.363.0.tgz#a57e12ae88121c671ad463a8a2f13c4be0c49fd6" - integrity sha512-1RMgSXqGN6Hk8w/wgT25Lzy90UMTMvpkWnoz9LSg6+6Jg+psEOFWPXpQLqzF1D0e7atNNJeM/abqbzq6NM9Azw== +"@aws-sdk/client-account@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-account/-/client-account-3.370.0.tgz#ee7a2cc5dd272f84bb730215199110d580e304bb" + integrity sha512-4bzV1slq3jkR412ZXwjMKHDl78KgaUxGCqPsY3q2/xR4En8FqoWFTlKX5rOCNKKnf5Vje/TYPY0BvoJaNoIO8w== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sts" "3.363.0" - "@aws-sdk/credential-provider-node" "3.363.0" - "@aws-sdk/middleware-host-header" "3.363.0" - "@aws-sdk/middleware-logger" "3.363.0" - "@aws-sdk/middleware-recursion-detection" "3.363.0" - "@aws-sdk/middleware-signing" "3.363.0" - "@aws-sdk/middleware-user-agent" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" - "@aws-sdk/util-user-agent-browser" "3.363.0" - "@aws-sdk/util-user-agent-node" "3.363.0" + "@aws-sdk/client-sts" "3.370.0" + "@aws-sdk/credential-provider-node" "3.370.0" + "@aws-sdk/middleware-host-header" "3.370.0" + "@aws-sdk/middleware-logger" "3.370.0" + "@aws-sdk/middleware-recursion-detection" "3.370.0" + "@aws-sdk/middleware-signing" "3.370.0" + "@aws-sdk/middleware-user-agent" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" + "@aws-sdk/util-user-agent-browser" "3.370.0" + "@aws-sdk/util-user-agent-node" "3.370.0" "@smithy/config-resolver" "^1.0.1" "@smithy/fetch-http-handler" "^1.0.1" "@smithy/hash-node" "^1.0.1" "@smithy/invalid-dependency" "^1.0.1" "@smithy/middleware-content-length" "^1.0.1" - "@smithy/middleware-endpoint" "^1.0.1" - "@smithy/middleware-retry" "^1.0.2" + "@smithy/middleware-endpoint" "^1.0.2" + "@smithy/middleware-retry" "^1.0.3" "@smithy/middleware-serde" "^1.0.1" "@smithy/middleware-stack" "^1.0.1" "@smithy/node-config-provider" "^1.0.1" "@smithy/node-http-handler" "^1.0.2" - "@smithy/protocol-http" "^1.0.1" + "@smithy/protocol-http" "^1.1.0" "@smithy/smithy-client" "^1.0.3" - "@smithy/types" "^1.0.0" + "@smithy/types" "^1.1.0" "@smithy/url-parser" "^1.0.1" "@smithy/util-base64" "^1.0.1" "@smithy/util-body-length-browser" "^1.0.1" "@smithy/util-body-length-node" "^1.0.1" "@smithy/util-defaults-mode-browser" "^1.0.1" "@smithy/util-defaults-mode-node" "^1.0.1" - "@smithy/util-retry" "^1.0.2" + "@smithy/util-retry" "^1.0.3" "@smithy/util-utf8" "^1.0.1" tslib "^2.5.0" -"@aws-sdk/client-acm@^3.357.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-acm/-/client-acm-3.363.0.tgz#7947bd38c52ddbfde3ab73ed0843772a7e69d466" - integrity sha512-NFwpEOu+3EUnHxiPZV1ci142l2b5qNCYZBkJiuV2Wf7mLMbMESfaO2/0QNdZQEBbCwZDou1/VBdchv52D4nzJg== +"@aws-sdk/client-acm@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-acm/-/client-acm-3.370.0.tgz#6573ed2f0e877227526cde19449bb5fe2303f95f" + integrity sha512-bhrNCxD1K06deUEMYwcQMwIW+wtd3nNYRHAh04sSqWIen2+k+g7HAs76vICMoODdCdJS5O5vw/hRdGsXVAySfw== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sts" "3.363.0" - "@aws-sdk/credential-provider-node" "3.363.0" - "@aws-sdk/middleware-host-header" "3.363.0" - "@aws-sdk/middleware-logger" "3.363.0" - "@aws-sdk/middleware-recursion-detection" "3.363.0" - "@aws-sdk/middleware-signing" "3.363.0" - "@aws-sdk/middleware-user-agent" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" - "@aws-sdk/util-user-agent-browser" "3.363.0" - "@aws-sdk/util-user-agent-node" "3.363.0" + "@aws-sdk/client-sts" "3.370.0" + "@aws-sdk/credential-provider-node" "3.370.0" + "@aws-sdk/middleware-host-header" "3.370.0" + "@aws-sdk/middleware-logger" "3.370.0" + "@aws-sdk/middleware-recursion-detection" "3.370.0" + "@aws-sdk/middleware-signing" "3.370.0" + "@aws-sdk/middleware-user-agent" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" + "@aws-sdk/util-user-agent-browser" "3.370.0" + "@aws-sdk/util-user-agent-node" "3.370.0" "@smithy/config-resolver" "^1.0.1" "@smithy/fetch-http-handler" "^1.0.1" "@smithy/hash-node" "^1.0.1" "@smithy/invalid-dependency" "^1.0.1" "@smithy/middleware-content-length" "^1.0.1" - "@smithy/middleware-endpoint" "^1.0.1" - "@smithy/middleware-retry" "^1.0.2" + "@smithy/middleware-endpoint" "^1.0.2" + "@smithy/middleware-retry" "^1.0.3" "@smithy/middleware-serde" "^1.0.1" "@smithy/middleware-stack" "^1.0.1" "@smithy/node-config-provider" "^1.0.1" "@smithy/node-http-handler" "^1.0.2" - "@smithy/protocol-http" "^1.0.1" + "@smithy/protocol-http" "^1.1.0" "@smithy/smithy-client" "^1.0.3" - "@smithy/types" "^1.0.0" + "@smithy/types" "^1.1.0" "@smithy/url-parser" "^1.0.1" "@smithy/util-base64" "^1.0.1" "@smithy/util-body-length-browser" "^1.0.1" "@smithy/util-body-length-node" "^1.0.1" "@smithy/util-defaults-mode-browser" "^1.0.1" "@smithy/util-defaults-mode-node" "^1.0.1" - "@smithy/util-retry" "^1.0.2" + "@smithy/util-retry" "^1.0.3" "@smithy/util-utf8" "^1.0.1" "@smithy/util-waiter" "^1.0.1" tslib "^2.5.0" -"@aws-sdk/client-amplify@^3.357.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-amplify/-/client-amplify-3.363.0.tgz#593d360984e891004897650a61c906efe0f68745" - integrity sha512-PQzJRA6IS5D86D+bCPyIRxshIMFfYfRRdj+jwALLE/7em6ZCTjDt1Rh3sr7MlJZOfGHABAlw+jaz5UQwfAHlFw== +"@aws-sdk/client-amplify@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-amplify/-/client-amplify-3.370.0.tgz#66e324f5d2383b07ee8ac3eb881bb1941f9752b4" + integrity sha512-0CWB2Yfez8PT8cd3b7QUZ1s970cL2DHRBmQoVgg/h1aC6yOaRGxBBtLp7mFGnDcdYtTrys3VYMcGQqKJ3viQGQ== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sts" "3.363.0" - "@aws-sdk/credential-provider-node" "3.363.0" - "@aws-sdk/middleware-host-header" "3.363.0" - "@aws-sdk/middleware-logger" "3.363.0" - "@aws-sdk/middleware-recursion-detection" "3.363.0" - "@aws-sdk/middleware-signing" "3.363.0" - "@aws-sdk/middleware-user-agent" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" - "@aws-sdk/util-user-agent-browser" "3.363.0" - "@aws-sdk/util-user-agent-node" "3.363.0" + "@aws-sdk/client-sts" "3.370.0" + "@aws-sdk/credential-provider-node" "3.370.0" + "@aws-sdk/middleware-host-header" "3.370.0" + "@aws-sdk/middleware-logger" "3.370.0" + "@aws-sdk/middleware-recursion-detection" "3.370.0" + "@aws-sdk/middleware-signing" "3.370.0" + "@aws-sdk/middleware-user-agent" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" + "@aws-sdk/util-user-agent-browser" "3.370.0" + "@aws-sdk/util-user-agent-node" "3.370.0" "@smithy/config-resolver" "^1.0.1" "@smithy/fetch-http-handler" "^1.0.1" "@smithy/hash-node" "^1.0.1" "@smithy/invalid-dependency" "^1.0.1" "@smithy/middleware-content-length" "^1.0.1" - "@smithy/middleware-endpoint" "^1.0.1" - "@smithy/middleware-retry" "^1.0.2" + "@smithy/middleware-endpoint" "^1.0.2" + "@smithy/middleware-retry" "^1.0.3" "@smithy/middleware-serde" "^1.0.1" "@smithy/middleware-stack" "^1.0.1" "@smithy/node-config-provider" "^1.0.1" "@smithy/node-http-handler" "^1.0.2" - "@smithy/protocol-http" "^1.0.1" + "@smithy/protocol-http" "^1.1.0" "@smithy/smithy-client" "^1.0.3" - "@smithy/types" "^1.0.0" + "@smithy/types" "^1.1.0" "@smithy/url-parser" "^1.0.1" "@smithy/util-base64" "^1.0.1" "@smithy/util-body-length-browser" "^1.0.1" "@smithy/util-body-length-node" "^1.0.1" "@smithy/util-defaults-mode-browser" "^1.0.1" "@smithy/util-defaults-mode-node" "^1.0.1" - "@smithy/util-retry" "^1.0.2" + "@smithy/util-retry" "^1.0.3" "@smithy/util-utf8" "^1.0.1" tslib "^2.5.0" -"@aws-sdk/client-codepipeline@^3.357.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-codepipeline/-/client-codepipeline-3.363.0.tgz#bde5a418fb40a9d519159ec3364d11cdf9bee780" - integrity sha512-6Ap4uLWJuYva9H1mwHLvXJHsWY8PKlD40WBHuZSj8Fjg4UdwQ8lxERck5LUlUmeasfmBMG8ggdqQcDFP9WRZpw== +"@aws-sdk/client-codepipeline@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-codepipeline/-/client-codepipeline-3.370.0.tgz#ea0ca3e931cbc1bb4f5af007b2d2997865e39004" + integrity sha512-tTlHhspgQtul+vuldNxJUYXMagMf6e3YW/iaEpCQz7DvKUGqSyg6U1vYjWQarjJNsjsvHLoefaHahiJLWsDQ7w== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sts" "3.363.0" - "@aws-sdk/credential-provider-node" "3.363.0" - "@aws-sdk/middleware-host-header" "3.363.0" - "@aws-sdk/middleware-logger" "3.363.0" - "@aws-sdk/middleware-recursion-detection" "3.363.0" - "@aws-sdk/middleware-signing" "3.363.0" - "@aws-sdk/middleware-user-agent" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" - "@aws-sdk/util-user-agent-browser" "3.363.0" - "@aws-sdk/util-user-agent-node" "3.363.0" + "@aws-sdk/client-sts" "3.370.0" + "@aws-sdk/credential-provider-node" "3.370.0" + "@aws-sdk/middleware-host-header" "3.370.0" + "@aws-sdk/middleware-logger" "3.370.0" + "@aws-sdk/middleware-recursion-detection" "3.370.0" + "@aws-sdk/middleware-signing" "3.370.0" + "@aws-sdk/middleware-user-agent" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" + "@aws-sdk/util-user-agent-browser" "3.370.0" + "@aws-sdk/util-user-agent-node" "3.370.0" "@smithy/config-resolver" "^1.0.1" "@smithy/fetch-http-handler" "^1.0.1" "@smithy/hash-node" "^1.0.1" "@smithy/invalid-dependency" "^1.0.1" "@smithy/middleware-content-length" "^1.0.1" - "@smithy/middleware-endpoint" "^1.0.1" - "@smithy/middleware-retry" "^1.0.2" + "@smithy/middleware-endpoint" "^1.0.2" + "@smithy/middleware-retry" "^1.0.3" "@smithy/middleware-serde" "^1.0.1" "@smithy/middleware-stack" "^1.0.1" "@smithy/node-config-provider" "^1.0.1" "@smithy/node-http-handler" "^1.0.2" - "@smithy/protocol-http" "^1.0.1" + "@smithy/protocol-http" "^1.1.0" "@smithy/smithy-client" "^1.0.3" - "@smithy/types" "^1.0.0" + "@smithy/types" "^1.1.0" "@smithy/url-parser" "^1.0.1" "@smithy/util-base64" "^1.0.1" "@smithy/util-body-length-browser" "^1.0.1" "@smithy/util-body-length-node" "^1.0.1" "@smithy/util-defaults-mode-browser" "^1.0.1" "@smithy/util-defaults-mode-node" "^1.0.1" - "@smithy/util-retry" "^1.0.2" + "@smithy/util-retry" "^1.0.3" "@smithy/util-utf8" "^1.0.1" tslib "^2.5.0" uuid "^8.3.2" -"@aws-sdk/client-cognito-identity@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.363.0.tgz#75c94c3ea4dd1ef3bd5fefab3bde69dd19dbbb38" - integrity sha512-tsJzgBSCpna85IVsuS7FBIK9wkSl7fs8TJ/QzapIgu8rKss0ySHVO6TeMVAdw2BvaQl7CxU9c3PosjhLWHu6KQ== +"@aws-sdk/client-cognito-identity@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.370.0.tgz#cfa6bc1a1b4b3631d0a62cd9861e56a397faba43" + integrity sha512-/dQFXT8y0WUD/731cdLjCrxNxH7Wtg2uZx7PggevTZs9Yr2fdGPSHehIYfvpCvi59yeG9T2Cl8sFnxXL1OEx4A== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sts" "3.363.0" - "@aws-sdk/credential-provider-node" "3.363.0" - "@aws-sdk/middleware-host-header" "3.363.0" - "@aws-sdk/middleware-logger" "3.363.0" - "@aws-sdk/middleware-recursion-detection" "3.363.0" - "@aws-sdk/middleware-signing" "3.363.0" - "@aws-sdk/middleware-user-agent" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" - "@aws-sdk/util-user-agent-browser" "3.363.0" - "@aws-sdk/util-user-agent-node" "3.363.0" + "@aws-sdk/client-sts" "3.370.0" + "@aws-sdk/credential-provider-node" "3.370.0" + "@aws-sdk/middleware-host-header" "3.370.0" + "@aws-sdk/middleware-logger" "3.370.0" + "@aws-sdk/middleware-recursion-detection" "3.370.0" + "@aws-sdk/middleware-signing" "3.370.0" + "@aws-sdk/middleware-user-agent" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" + "@aws-sdk/util-user-agent-browser" "3.370.0" + "@aws-sdk/util-user-agent-node" "3.370.0" "@smithy/config-resolver" "^1.0.1" "@smithy/fetch-http-handler" "^1.0.1" "@smithy/hash-node" "^1.0.1" "@smithy/invalid-dependency" "^1.0.1" "@smithy/middleware-content-length" "^1.0.1" - "@smithy/middleware-endpoint" "^1.0.1" - "@smithy/middleware-retry" "^1.0.2" + "@smithy/middleware-endpoint" "^1.0.2" + "@smithy/middleware-retry" "^1.0.3" "@smithy/middleware-serde" "^1.0.1" "@smithy/middleware-stack" "^1.0.1" "@smithy/node-config-provider" "^1.0.1" "@smithy/node-http-handler" "^1.0.2" - "@smithy/protocol-http" "^1.0.1" + "@smithy/protocol-http" "^1.1.0" "@smithy/smithy-client" "^1.0.3" - "@smithy/types" "^1.0.0" + "@smithy/types" "^1.1.0" "@smithy/url-parser" "^1.0.1" "@smithy/util-base64" "^1.0.1" "@smithy/util-body-length-browser" "^1.0.1" "@smithy/util-body-length-node" "^1.0.1" "@smithy/util-defaults-mode-browser" "^1.0.1" "@smithy/util-defaults-mode-node" "^1.0.1" - "@smithy/util-retry" "^1.0.2" + "@smithy/util-retry" "^1.0.3" "@smithy/util-utf8" "^1.0.1" tslib "^2.5.0" -"@aws-sdk/client-dynamodb@^3.357.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-dynamodb/-/client-dynamodb-3.363.0.tgz#424d7c45cce51ec87ff860b562429f697d9c12a9" - integrity sha512-RkO3CfnFjbd40pco81ucmbuF4ZMLGgPfssjmZRClb4bqysH0MB7GAf/hC54aVEzrXqTP2SMjCaLpoRiv8Qngsg== +"@aws-sdk/client-dynamodb@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-dynamodb/-/client-dynamodb-3.370.0.tgz#6712ce2750eb2a9d0813b9bdd25ac205dac44938" + integrity sha512-qL02C4adrZljZXgPonSHYJ95qkj1IlIsZx3NxaGzMc5S3uPJua14phktk2XP8K/Ap3gD6vLWt1UVVoo/rDFOAQ== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sts" "3.363.0" - "@aws-sdk/credential-provider-node" "3.363.0" - "@aws-sdk/middleware-endpoint-discovery" "3.363.0" - "@aws-sdk/middleware-host-header" "3.363.0" - "@aws-sdk/middleware-logger" "3.363.0" - "@aws-sdk/middleware-recursion-detection" "3.363.0" - "@aws-sdk/middleware-signing" "3.363.0" - "@aws-sdk/middleware-user-agent" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" - "@aws-sdk/util-user-agent-browser" "3.363.0" - "@aws-sdk/util-user-agent-node" "3.363.0" + "@aws-sdk/client-sts" "3.370.0" + "@aws-sdk/credential-provider-node" "3.370.0" + "@aws-sdk/middleware-endpoint-discovery" "3.370.0" + "@aws-sdk/middleware-host-header" "3.370.0" + "@aws-sdk/middleware-logger" "3.370.0" + "@aws-sdk/middleware-recursion-detection" "3.370.0" + "@aws-sdk/middleware-signing" "3.370.0" + "@aws-sdk/middleware-user-agent" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" + "@aws-sdk/util-user-agent-browser" "3.370.0" + "@aws-sdk/util-user-agent-node" "3.370.0" "@smithy/config-resolver" "^1.0.1" "@smithy/fetch-http-handler" "^1.0.1" "@smithy/hash-node" "^1.0.1" "@smithy/invalid-dependency" "^1.0.1" "@smithy/middleware-content-length" "^1.0.1" - "@smithy/middleware-endpoint" "^1.0.1" - "@smithy/middleware-retry" "^1.0.2" + "@smithy/middleware-endpoint" "^1.0.2" + "@smithy/middleware-retry" "^1.0.3" "@smithy/middleware-serde" "^1.0.1" "@smithy/middleware-stack" "^1.0.1" "@smithy/node-config-provider" "^1.0.1" "@smithy/node-http-handler" "^1.0.2" - "@smithy/protocol-http" "^1.0.1" + "@smithy/protocol-http" "^1.1.0" "@smithy/smithy-client" "^1.0.3" - "@smithy/types" "^1.0.0" + "@smithy/types" "^1.1.0" "@smithy/url-parser" "^1.0.1" "@smithy/util-base64" "^1.0.1" "@smithy/util-body-length-browser" "^1.0.1" "@smithy/util-body-length-node" "^1.0.1" "@smithy/util-defaults-mode-browser" "^1.0.1" "@smithy/util-defaults-mode-node" "^1.0.1" - "@smithy/util-retry" "^1.0.2" + "@smithy/util-retry" "^1.0.3" "@smithy/util-utf8" "^1.0.1" "@smithy/util-waiter" "^1.0.1" tslib "^2.5.0" uuid "^8.3.2" -"@aws-sdk/client-ec2@^3.357.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-ec2/-/client-ec2-3.363.0.tgz#69e8c045c5427d52fb9ac067a036029d50f299d0" - integrity sha512-AnF8o9PxxqLOtMh6kpxvlLkdabXsR7aIwViiTFh8lmsE0wRm5RGnlIOtEvGD4ze2o96PmB/vKrsise1W3d8YXA== +"@aws-sdk/client-ec2@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-ec2/-/client-ec2-3.370.0.tgz#0813760eb21bec202589fd130541bba1affae529" + integrity sha512-BlsBWbA8nBPZec7t1Lx+9vGuSA4yl6w/94E6ahqaWgH4xA+r8VJ4JqhagPIkXjU5yC1YV7BwLPihFVWAgdiipg== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sts" "3.363.0" - "@aws-sdk/credential-provider-node" "3.363.0" - "@aws-sdk/middleware-host-header" "3.363.0" - "@aws-sdk/middleware-logger" "3.363.0" - "@aws-sdk/middleware-recursion-detection" "3.363.0" - "@aws-sdk/middleware-sdk-ec2" "3.363.0" - "@aws-sdk/middleware-signing" "3.363.0" - "@aws-sdk/middleware-user-agent" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" - "@aws-sdk/util-user-agent-browser" "3.363.0" - "@aws-sdk/util-user-agent-node" "3.363.0" + "@aws-sdk/client-sts" "3.370.0" + "@aws-sdk/credential-provider-node" "3.370.0" + "@aws-sdk/middleware-host-header" "3.370.0" + "@aws-sdk/middleware-logger" "3.370.0" + "@aws-sdk/middleware-recursion-detection" "3.370.0" + "@aws-sdk/middleware-sdk-ec2" "3.370.0" + "@aws-sdk/middleware-signing" "3.370.0" + "@aws-sdk/middleware-user-agent" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" + "@aws-sdk/util-user-agent-browser" "3.370.0" + "@aws-sdk/util-user-agent-node" "3.370.0" "@smithy/config-resolver" "^1.0.1" "@smithy/fetch-http-handler" "^1.0.1" "@smithy/hash-node" "^1.0.1" "@smithy/invalid-dependency" "^1.0.1" "@smithy/middleware-content-length" "^1.0.1" - "@smithy/middleware-endpoint" "^1.0.1" - "@smithy/middleware-retry" "^1.0.2" + "@smithy/middleware-endpoint" "^1.0.2" + "@smithy/middleware-retry" "^1.0.3" "@smithy/middleware-serde" "^1.0.1" "@smithy/middleware-stack" "^1.0.1" "@smithy/node-config-provider" "^1.0.1" "@smithy/node-http-handler" "^1.0.2" - "@smithy/protocol-http" "^1.0.1" + "@smithy/protocol-http" "^1.1.0" "@smithy/smithy-client" "^1.0.3" - "@smithy/types" "^1.0.0" + "@smithy/types" "^1.1.0" "@smithy/url-parser" "^1.0.1" "@smithy/util-base64" "^1.0.1" "@smithy/util-body-length-browser" "^1.0.1" "@smithy/util-body-length-node" "^1.0.1" "@smithy/util-defaults-mode-browser" "^1.0.1" "@smithy/util-defaults-mode-node" "^1.0.1" - "@smithy/util-retry" "^1.0.2" + "@smithy/util-retry" "^1.0.3" "@smithy/util-utf8" "^1.0.1" "@smithy/util-waiter" "^1.0.1" fast-xml-parser "4.2.5" tslib "^2.5.0" uuid "^8.3.2" -"@aws-sdk/client-ecr@^3.357.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-ecr/-/client-ecr-3.363.0.tgz#ca8c700d955783cced7278ca3d3c36b3c413019a" - integrity sha512-KKcvsO8puIYpvlkMTJrAMA5Alnm1DBFuuAGuYxhTiSs009N2XPN0ETftBbZOlWpyVvZ9p1ukZkSqzngc41NyJw== +"@aws-sdk/client-ecr@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-ecr/-/client-ecr-3.370.0.tgz#d4554d6a8853b92870a61bba9a0f49401084c35e" + integrity sha512-yXjdARvOs1xbaUAl0uFbWDuFXzkP/SQujrJCUfvNWLQtzqi9au9TeRngHqk/K1VuB14TyKTtgAB50av08fTT8g== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sts" "3.363.0" - "@aws-sdk/credential-provider-node" "3.363.0" - "@aws-sdk/middleware-host-header" "3.363.0" - "@aws-sdk/middleware-logger" "3.363.0" - "@aws-sdk/middleware-recursion-detection" "3.363.0" - "@aws-sdk/middleware-signing" "3.363.0" - "@aws-sdk/middleware-user-agent" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" - "@aws-sdk/util-user-agent-browser" "3.363.0" - "@aws-sdk/util-user-agent-node" "3.363.0" + "@aws-sdk/client-sts" "3.370.0" + "@aws-sdk/credential-provider-node" "3.370.0" + "@aws-sdk/middleware-host-header" "3.370.0" + "@aws-sdk/middleware-logger" "3.370.0" + "@aws-sdk/middleware-recursion-detection" "3.370.0" + "@aws-sdk/middleware-signing" "3.370.0" + "@aws-sdk/middleware-user-agent" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" + "@aws-sdk/util-user-agent-browser" "3.370.0" + "@aws-sdk/util-user-agent-node" "3.370.0" "@smithy/config-resolver" "^1.0.1" "@smithy/fetch-http-handler" "^1.0.1" "@smithy/hash-node" "^1.0.1" "@smithy/invalid-dependency" "^1.0.1" "@smithy/middleware-content-length" "^1.0.1" - "@smithy/middleware-endpoint" "^1.0.1" - "@smithy/middleware-retry" "^1.0.2" + "@smithy/middleware-endpoint" "^1.0.2" + "@smithy/middleware-retry" "^1.0.3" "@smithy/middleware-serde" "^1.0.1" "@smithy/middleware-stack" "^1.0.1" "@smithy/node-config-provider" "^1.0.1" "@smithy/node-http-handler" "^1.0.2" - "@smithy/protocol-http" "^1.0.1" + "@smithy/protocol-http" "^1.1.0" "@smithy/smithy-client" "^1.0.3" - "@smithy/types" "^1.0.0" + "@smithy/types" "^1.1.0" "@smithy/url-parser" "^1.0.1" "@smithy/util-base64" "^1.0.1" "@smithy/util-body-length-browser" "^1.0.1" "@smithy/util-body-length-node" "^1.0.1" "@smithy/util-defaults-mode-browser" "^1.0.1" "@smithy/util-defaults-mode-node" "^1.0.1" - "@smithy/util-retry" "^1.0.2" + "@smithy/util-retry" "^1.0.3" "@smithy/util-utf8" "^1.0.1" "@smithy/util-waiter" "^1.0.1" tslib "^2.5.0" -"@aws-sdk/client-eks@^3.357.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-eks/-/client-eks-3.363.0.tgz#390e2c632bdbd43c9fd214016d6e98be4bd3d337" - integrity sha512-9gtETfY78bZhoeWoW/nOIDI1835x/h6ihJICE2Ykw3WHeQjp1XpkPvVVO0SXK1FoMg01FweqUF0o2LlPg1sYVw== +"@aws-sdk/client-eks@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-eks/-/client-eks-3.370.0.tgz#b097247a32b6cd75d2bac9934c4322da6fb90a03" + integrity sha512-pjaEeNjzS/zFWgd2Dt085PMt5roIVedTV+dJlktQ5qeW70f939mTDuh3gF+tUDM+mUYtdk07C5UCbJEeZKi88g== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sts" "3.363.0" - "@aws-sdk/credential-provider-node" "3.363.0" - "@aws-sdk/middleware-host-header" "3.363.0" - "@aws-sdk/middleware-logger" "3.363.0" - "@aws-sdk/middleware-recursion-detection" "3.363.0" - "@aws-sdk/middleware-signing" "3.363.0" - "@aws-sdk/middleware-user-agent" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" - "@aws-sdk/util-user-agent-browser" "3.363.0" - "@aws-sdk/util-user-agent-node" "3.363.0" + "@aws-sdk/client-sts" "3.370.0" + "@aws-sdk/credential-provider-node" "3.370.0" + "@aws-sdk/middleware-host-header" "3.370.0" + "@aws-sdk/middleware-logger" "3.370.0" + "@aws-sdk/middleware-recursion-detection" "3.370.0" + "@aws-sdk/middleware-signing" "3.370.0" + "@aws-sdk/middleware-user-agent" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" + "@aws-sdk/util-user-agent-browser" "3.370.0" + "@aws-sdk/util-user-agent-node" "3.370.0" "@smithy/config-resolver" "^1.0.1" "@smithy/fetch-http-handler" "^1.0.1" "@smithy/hash-node" "^1.0.1" "@smithy/invalid-dependency" "^1.0.1" "@smithy/middleware-content-length" "^1.0.1" - "@smithy/middleware-endpoint" "^1.0.1" - "@smithy/middleware-retry" "^1.0.2" + "@smithy/middleware-endpoint" "^1.0.2" + "@smithy/middleware-retry" "^1.0.3" "@smithy/middleware-serde" "^1.0.1" "@smithy/middleware-stack" "^1.0.1" "@smithy/node-config-provider" "^1.0.1" "@smithy/node-http-handler" "^1.0.2" - "@smithy/protocol-http" "^1.0.1" + "@smithy/protocol-http" "^1.1.0" "@smithy/smithy-client" "^1.0.3" - "@smithy/types" "^1.0.0" + "@smithy/types" "^1.1.0" "@smithy/url-parser" "^1.0.1" "@smithy/util-base64" "^1.0.1" "@smithy/util-body-length-browser" "^1.0.1" "@smithy/util-body-length-node" "^1.0.1" "@smithy/util-defaults-mode-browser" "^1.0.1" "@smithy/util-defaults-mode-node" "^1.0.1" - "@smithy/util-retry" "^1.0.2" + "@smithy/util-retry" "^1.0.3" "@smithy/util-utf8" "^1.0.1" "@smithy/util-waiter" "^1.0.1" tslib "^2.5.0" uuid "^8.3.2" -"@aws-sdk/client-lambda@^3.357.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-lambda/-/client-lambda-3.363.0.tgz#b842f7bee96cc47250806322e711127996a3f84c" - integrity sha512-oIMcGOKzdKjZbxwfXVqw83lvsLTGdGanR121Rq8hZpIME15DYlqan90aa5oSc//vy6zUdFqB/78NJO5DYjNWXg== +"@aws-sdk/client-lambda@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-lambda/-/client-lambda-3.370.0.tgz#e5fe95d2e65fe8b8d826fe8faa175f4ed430e05d" + integrity sha512-q4mwLOgrdKPpqHAgwNTikfd86rVMsDK0XFf2t99AHg8C9dXMGtDjPf5M0tTIQmh5+555XzClzxf2Nu9tn7Obrw== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sts" "3.363.0" - "@aws-sdk/credential-provider-node" "3.363.0" - "@aws-sdk/middleware-host-header" "3.363.0" - "@aws-sdk/middleware-logger" "3.363.0" - "@aws-sdk/middleware-recursion-detection" "3.363.0" - "@aws-sdk/middleware-signing" "3.363.0" - "@aws-sdk/middleware-user-agent" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" - "@aws-sdk/util-user-agent-browser" "3.363.0" - "@aws-sdk/util-user-agent-node" "3.363.0" + "@aws-sdk/client-sts" "3.370.0" + "@aws-sdk/credential-provider-node" "3.370.0" + "@aws-sdk/middleware-host-header" "3.370.0" + "@aws-sdk/middleware-logger" "3.370.0" + "@aws-sdk/middleware-recursion-detection" "3.370.0" + "@aws-sdk/middleware-signing" "3.370.0" + "@aws-sdk/middleware-user-agent" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" + "@aws-sdk/util-user-agent-browser" "3.370.0" + "@aws-sdk/util-user-agent-node" "3.370.0" "@smithy/config-resolver" "^1.0.1" "@smithy/eventstream-serde-browser" "^1.0.1" "@smithy/eventstream-serde-config-resolver" "^1.0.1" @@ -578,189 +586,189 @@ "@smithy/hash-node" "^1.0.1" "@smithy/invalid-dependency" "^1.0.1" "@smithy/middleware-content-length" "^1.0.1" - "@smithy/middleware-endpoint" "^1.0.1" - "@smithy/middleware-retry" "^1.0.2" + "@smithy/middleware-endpoint" "^1.0.2" + "@smithy/middleware-retry" "^1.0.3" "@smithy/middleware-serde" "^1.0.1" "@smithy/middleware-stack" "^1.0.1" "@smithy/node-config-provider" "^1.0.1" "@smithy/node-http-handler" "^1.0.2" - "@smithy/protocol-http" "^1.0.1" + "@smithy/protocol-http" "^1.1.0" "@smithy/smithy-client" "^1.0.3" - "@smithy/types" "^1.0.0" + "@smithy/types" "^1.1.0" "@smithy/url-parser" "^1.0.1" "@smithy/util-base64" "^1.0.1" "@smithy/util-body-length-browser" "^1.0.1" "@smithy/util-body-length-node" "^1.0.1" "@smithy/util-defaults-mode-browser" "^1.0.1" "@smithy/util-defaults-mode-node" "^1.0.1" - "@smithy/util-retry" "^1.0.2" + "@smithy/util-retry" "^1.0.3" "@smithy/util-stream" "^1.0.1" "@smithy/util-utf8" "^1.0.1" "@smithy/util-waiter" "^1.0.1" tslib "^2.5.0" -"@aws-sdk/client-redshift-data@^3.357.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-redshift-data/-/client-redshift-data-3.363.0.tgz#c4c409e204eca40c6f1b732f6f4db87e0048a808" - integrity sha512-2q0sp9jFdM24DxL4yyy4LFaE2FdVZxXsyCBe49ZYhXzbp53f546Uv/VIDv/FJTHCkf+0/VS+XnyiVR3fa6Ahqg== +"@aws-sdk/client-redshift-data@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-redshift-data/-/client-redshift-data-3.370.0.tgz#f1efe1773e2ab7011fffd6d12a51ebcbbc86d09c" + integrity sha512-9XaFRFAYjMx8FykRvpxp6lNvvwhxv0ps40zEtIBzfCTKCv7eIjiGZnG9gpQU0D4ivtZfO5RVliQ5wCsQ6FwYKQ== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sts" "3.363.0" - "@aws-sdk/credential-provider-node" "3.363.0" - "@aws-sdk/middleware-host-header" "3.363.0" - "@aws-sdk/middleware-logger" "3.363.0" - "@aws-sdk/middleware-recursion-detection" "3.363.0" - "@aws-sdk/middleware-signing" "3.363.0" - "@aws-sdk/middleware-user-agent" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" - "@aws-sdk/util-user-agent-browser" "3.363.0" - "@aws-sdk/util-user-agent-node" "3.363.0" + "@aws-sdk/client-sts" "3.370.0" + "@aws-sdk/credential-provider-node" "3.370.0" + "@aws-sdk/middleware-host-header" "3.370.0" + "@aws-sdk/middleware-logger" "3.370.0" + "@aws-sdk/middleware-recursion-detection" "3.370.0" + "@aws-sdk/middleware-signing" "3.370.0" + "@aws-sdk/middleware-user-agent" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" + "@aws-sdk/util-user-agent-browser" "3.370.0" + "@aws-sdk/util-user-agent-node" "3.370.0" "@smithy/config-resolver" "^1.0.1" "@smithy/fetch-http-handler" "^1.0.1" "@smithy/hash-node" "^1.0.1" "@smithy/invalid-dependency" "^1.0.1" "@smithy/middleware-content-length" "^1.0.1" - "@smithy/middleware-endpoint" "^1.0.1" - "@smithy/middleware-retry" "^1.0.2" + "@smithy/middleware-endpoint" "^1.0.2" + "@smithy/middleware-retry" "^1.0.3" "@smithy/middleware-serde" "^1.0.1" "@smithy/middleware-stack" "^1.0.1" "@smithy/node-config-provider" "^1.0.1" "@smithy/node-http-handler" "^1.0.2" - "@smithy/protocol-http" "^1.0.1" + "@smithy/protocol-http" "^1.1.0" "@smithy/smithy-client" "^1.0.3" - "@smithy/types" "^1.0.0" + "@smithy/types" "^1.1.0" "@smithy/url-parser" "^1.0.1" "@smithy/util-base64" "^1.0.1" "@smithy/util-body-length-browser" "^1.0.1" "@smithy/util-body-length-node" "^1.0.1" "@smithy/util-defaults-mode-browser" "^1.0.1" "@smithy/util-defaults-mode-node" "^1.0.1" - "@smithy/util-retry" "^1.0.2" + "@smithy/util-retry" "^1.0.3" "@smithy/util-utf8" "^1.0.1" tslib "^2.5.0" uuid "^8.3.2" -"@aws-sdk/client-redshift@^3.357.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-redshift/-/client-redshift-3.363.0.tgz#b67a1fec3aad734d3e5a53a173914f2ec610372f" - integrity sha512-48rV0l0Gjnh5+1jsnLIhrSPARs9Fw3RCdpwuoVfqM+wuf9TirMy+mZCM5ZJ4cJIKqIxEyyzRn37B3i9NJgJSpg== +"@aws-sdk/client-redshift@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-redshift/-/client-redshift-3.370.0.tgz#cc2e9daef59a0d80bf2ed371b09c125d706ea60c" + integrity sha512-WMP+xoh9VUYooHqxr0EQPkj9inYao/7f2chHjjgkLX7AWh3aFuaLqikqczLj8wXBFQ4LKbXfEo/XmUjNTKMunw== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sts" "3.363.0" - "@aws-sdk/credential-provider-node" "3.363.0" - "@aws-sdk/middleware-host-header" "3.363.0" - "@aws-sdk/middleware-logger" "3.363.0" - "@aws-sdk/middleware-recursion-detection" "3.363.0" - "@aws-sdk/middleware-signing" "3.363.0" - "@aws-sdk/middleware-user-agent" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" - "@aws-sdk/util-user-agent-browser" "3.363.0" - "@aws-sdk/util-user-agent-node" "3.363.0" + "@aws-sdk/client-sts" "3.370.0" + "@aws-sdk/credential-provider-node" "3.370.0" + "@aws-sdk/middleware-host-header" "3.370.0" + "@aws-sdk/middleware-logger" "3.370.0" + "@aws-sdk/middleware-recursion-detection" "3.370.0" + "@aws-sdk/middleware-signing" "3.370.0" + "@aws-sdk/middleware-user-agent" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" + "@aws-sdk/util-user-agent-browser" "3.370.0" + "@aws-sdk/util-user-agent-node" "3.370.0" "@smithy/config-resolver" "^1.0.1" "@smithy/fetch-http-handler" "^1.0.1" "@smithy/hash-node" "^1.0.1" "@smithy/invalid-dependency" "^1.0.1" "@smithy/middleware-content-length" "^1.0.1" - "@smithy/middleware-endpoint" "^1.0.1" - "@smithy/middleware-retry" "^1.0.2" + "@smithy/middleware-endpoint" "^1.0.2" + "@smithy/middleware-retry" "^1.0.3" "@smithy/middleware-serde" "^1.0.1" "@smithy/middleware-stack" "^1.0.1" "@smithy/node-config-provider" "^1.0.1" "@smithy/node-http-handler" "^1.0.2" - "@smithy/protocol-http" "^1.0.1" + "@smithy/protocol-http" "^1.1.0" "@smithy/smithy-client" "^1.0.3" - "@smithy/types" "^1.0.0" + "@smithy/types" "^1.1.0" "@smithy/url-parser" "^1.0.1" "@smithy/util-base64" "^1.0.1" "@smithy/util-body-length-browser" "^1.0.1" "@smithy/util-body-length-node" "^1.0.1" "@smithy/util-defaults-mode-browser" "^1.0.1" "@smithy/util-defaults-mode-node" "^1.0.1" - "@smithy/util-retry" "^1.0.2" + "@smithy/util-retry" "^1.0.3" "@smithy/util-utf8" "^1.0.1" "@smithy/util-waiter" "^1.0.1" fast-xml-parser "4.2.5" tslib "^2.5.0" -"@aws-sdk/client-route-53@^3.357.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-route-53/-/client-route-53-3.363.0.tgz#8cb28b3d40528bdaad2c5e9376f95c318faaa1c2" - integrity sha512-SLBgIVjpu0jr5nKMv5syCyBcC0vPJaibAfGXhBtmWdWN3L5XegKSY8O4axgjgHqqwsKbnryZj9/6D4kn6ATWTQ== +"@aws-sdk/client-route-53@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-route-53/-/client-route-53-3.370.0.tgz#b9b111df60759790785539aedfebcafc91c66fe3" + integrity sha512-jLmeUxkkRuA+1qEoFIECvxrI80QQWbnbpe+FWmnld+hS487IdsYaZ4swv0DHGchcuJsn2NbvQ1KWNoNL4kaLJA== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sts" "3.363.0" - "@aws-sdk/credential-provider-node" "3.363.0" - "@aws-sdk/middleware-host-header" "3.363.0" - "@aws-sdk/middleware-logger" "3.363.0" - "@aws-sdk/middleware-recursion-detection" "3.363.0" - "@aws-sdk/middleware-sdk-route53" "3.363.0" - "@aws-sdk/middleware-signing" "3.363.0" - "@aws-sdk/middleware-user-agent" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" - "@aws-sdk/util-user-agent-browser" "3.363.0" - "@aws-sdk/util-user-agent-node" "3.363.0" + "@aws-sdk/client-sts" "3.370.0" + "@aws-sdk/credential-provider-node" "3.370.0" + "@aws-sdk/middleware-host-header" "3.370.0" + "@aws-sdk/middleware-logger" "3.370.0" + "@aws-sdk/middleware-recursion-detection" "3.370.0" + "@aws-sdk/middleware-sdk-route53" "3.370.0" + "@aws-sdk/middleware-signing" "3.370.0" + "@aws-sdk/middleware-user-agent" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" + "@aws-sdk/util-user-agent-browser" "3.370.0" + "@aws-sdk/util-user-agent-node" "3.370.0" "@aws-sdk/xml-builder" "3.310.0" "@smithy/config-resolver" "^1.0.1" "@smithy/fetch-http-handler" "^1.0.1" "@smithy/hash-node" "^1.0.1" "@smithy/invalid-dependency" "^1.0.1" "@smithy/middleware-content-length" "^1.0.1" - "@smithy/middleware-endpoint" "^1.0.1" - "@smithy/middleware-retry" "^1.0.2" + "@smithy/middleware-endpoint" "^1.0.2" + "@smithy/middleware-retry" "^1.0.3" "@smithy/middleware-serde" "^1.0.1" "@smithy/middleware-stack" "^1.0.1" "@smithy/node-config-provider" "^1.0.1" "@smithy/node-http-handler" "^1.0.2" - "@smithy/protocol-http" "^1.0.1" + "@smithy/protocol-http" "^1.1.0" "@smithy/smithy-client" "^1.0.3" - "@smithy/types" "^1.0.0" + "@smithy/types" "^1.1.0" "@smithy/url-parser" "^1.0.1" "@smithy/util-base64" "^1.0.1" "@smithy/util-body-length-browser" "^1.0.1" "@smithy/util-body-length-node" "^1.0.1" "@smithy/util-defaults-mode-browser" "^1.0.1" "@smithy/util-defaults-mode-node" "^1.0.1" - "@smithy/util-retry" "^1.0.2" + "@smithy/util-retry" "^1.0.3" "@smithy/util-utf8" "^1.0.1" "@smithy/util-waiter" "^1.0.1" fast-xml-parser "4.2.5" tslib "^2.5.0" -"@aws-sdk/client-s3@^3.357.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.363.0.tgz#757384d92c32a407ab0aaecf6f54d47cd9053514" - integrity sha512-LNnfg/t8wG5Fqj6l+PSV/t+IXDq9r3Kj9jEHn84513+p7bewXYSSreSpmLjG8OcKuMfHc9EJGNQ3DkMyFaLoWg== +"@aws-sdk/client-s3@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.370.0.tgz#047a005040c7687bd291bc15c4153ed0ab16ab1a" + integrity sha512-+b53hI+C+tIiE6OhIvaUXD5qC0zFrCWIu6EKT597W+4XzfFIZE0BGgolP8pC1lLDghPjCFSmAm9Efcb2a1sPvw== dependencies: "@aws-crypto/sha1-browser" "3.0.0" "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sts" "3.363.0" - "@aws-sdk/credential-provider-node" "3.363.0" - "@aws-sdk/hash-blob-browser" "3.357.0" - "@aws-sdk/hash-stream-node" "3.357.0" - "@aws-sdk/md5-js" "3.357.0" - "@aws-sdk/middleware-bucket-endpoint" "3.363.0" - "@aws-sdk/middleware-expect-continue" "3.363.0" - "@aws-sdk/middleware-flexible-checksums" "3.363.0" - "@aws-sdk/middleware-host-header" "3.363.0" - "@aws-sdk/middleware-location-constraint" "3.363.0" - "@aws-sdk/middleware-logger" "3.363.0" - "@aws-sdk/middleware-recursion-detection" "3.363.0" - "@aws-sdk/middleware-sdk-s3" "3.363.0" - "@aws-sdk/middleware-signing" "3.363.0" - "@aws-sdk/middleware-ssec" "3.363.0" - "@aws-sdk/middleware-user-agent" "3.363.0" - "@aws-sdk/signature-v4-multi-region" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" - "@aws-sdk/util-user-agent-browser" "3.363.0" - "@aws-sdk/util-user-agent-node" "3.363.0" + "@aws-sdk/client-sts" "3.370.0" + "@aws-sdk/credential-provider-node" "3.370.0" + "@aws-sdk/hash-blob-browser" "3.370.0" + "@aws-sdk/hash-stream-node" "3.370.0" + "@aws-sdk/md5-js" "3.370.0" + "@aws-sdk/middleware-bucket-endpoint" "3.370.0" + "@aws-sdk/middleware-expect-continue" "3.370.0" + "@aws-sdk/middleware-flexible-checksums" "3.370.0" + "@aws-sdk/middleware-host-header" "3.370.0" + "@aws-sdk/middleware-location-constraint" "3.370.0" + "@aws-sdk/middleware-logger" "3.370.0" + "@aws-sdk/middleware-recursion-detection" "3.370.0" + "@aws-sdk/middleware-sdk-s3" "3.370.0" + "@aws-sdk/middleware-signing" "3.370.0" + "@aws-sdk/middleware-ssec" "3.370.0" + "@aws-sdk/middleware-user-agent" "3.370.0" + "@aws-sdk/signature-v4-multi-region" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" + "@aws-sdk/util-user-agent-browser" "3.370.0" + "@aws-sdk/util-user-agent-node" "3.370.0" "@aws-sdk/xml-builder" "3.310.0" "@smithy/config-resolver" "^1.0.1" "@smithy/eventstream-serde-browser" "^1.0.1" @@ -770,266 +778,266 @@ "@smithy/hash-node" "^1.0.1" "@smithy/invalid-dependency" "^1.0.1" "@smithy/middleware-content-length" "^1.0.1" - "@smithy/middleware-endpoint" "^1.0.1" - "@smithy/middleware-retry" "^1.0.2" + "@smithy/middleware-endpoint" "^1.0.2" + "@smithy/middleware-retry" "^1.0.3" "@smithy/middleware-serde" "^1.0.1" "@smithy/middleware-stack" "^1.0.1" "@smithy/node-config-provider" "^1.0.1" "@smithy/node-http-handler" "^1.0.2" - "@smithy/protocol-http" "^1.0.1" + "@smithy/protocol-http" "^1.1.0" "@smithy/smithy-client" "^1.0.3" - "@smithy/types" "^1.0.0" + "@smithy/types" "^1.1.0" "@smithy/url-parser" "^1.0.1" "@smithy/util-base64" "^1.0.1" "@smithy/util-body-length-browser" "^1.0.1" "@smithy/util-body-length-node" "^1.0.1" "@smithy/util-defaults-mode-browser" "^1.0.1" "@smithy/util-defaults-mode-node" "^1.0.1" - "@smithy/util-retry" "^1.0.2" + "@smithy/util-retry" "^1.0.3" "@smithy/util-stream" "^1.0.1" "@smithy/util-utf8" "^1.0.1" "@smithy/util-waiter" "^1.0.1" fast-xml-parser "4.2.5" tslib "^2.5.0" -"@aws-sdk/client-secrets-manager@^3.357.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-secrets-manager/-/client-secrets-manager-3.363.0.tgz#b3b94c0726500ce37f942eb74e75e0ab2280a6f6" - integrity sha512-mHiNNPQtQ7dUPjp24pIeqR+/VwLXbkCdZue9RPrYNbVcfObNlwY18IQ9ACauHOmztapKwIAKDuVFI0Sc0MDhOw== +"@aws-sdk/client-secrets-manager@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-secrets-manager/-/client-secrets-manager-3.370.0.tgz#1aefc24e23ee2a48ef41e70800750c95921b5f32" + integrity sha512-1o1mpWbI1RyzCQ4cVpHQJnm6PziAJ+ptLt4p+wlN74Z330/nnE0JkK3t9l3CxhPqCIW8VjGbTCno5IzwAXnjPw== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sts" "3.363.0" - "@aws-sdk/credential-provider-node" "3.363.0" - "@aws-sdk/middleware-host-header" "3.363.0" - "@aws-sdk/middleware-logger" "3.363.0" - "@aws-sdk/middleware-recursion-detection" "3.363.0" - "@aws-sdk/middleware-signing" "3.363.0" - "@aws-sdk/middleware-user-agent" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" - "@aws-sdk/util-user-agent-browser" "3.363.0" - "@aws-sdk/util-user-agent-node" "3.363.0" + "@aws-sdk/client-sts" "3.370.0" + "@aws-sdk/credential-provider-node" "3.370.0" + "@aws-sdk/middleware-host-header" "3.370.0" + "@aws-sdk/middleware-logger" "3.370.0" + "@aws-sdk/middleware-recursion-detection" "3.370.0" + "@aws-sdk/middleware-signing" "3.370.0" + "@aws-sdk/middleware-user-agent" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" + "@aws-sdk/util-user-agent-browser" "3.370.0" + "@aws-sdk/util-user-agent-node" "3.370.0" "@smithy/config-resolver" "^1.0.1" "@smithy/fetch-http-handler" "^1.0.1" "@smithy/hash-node" "^1.0.1" "@smithy/invalid-dependency" "^1.0.1" "@smithy/middleware-content-length" "^1.0.1" - "@smithy/middleware-endpoint" "^1.0.1" - "@smithy/middleware-retry" "^1.0.2" + "@smithy/middleware-endpoint" "^1.0.2" + "@smithy/middleware-retry" "^1.0.3" "@smithy/middleware-serde" "^1.0.1" "@smithy/middleware-stack" "^1.0.1" "@smithy/node-config-provider" "^1.0.1" "@smithy/node-http-handler" "^1.0.2" - "@smithy/protocol-http" "^1.0.1" + "@smithy/protocol-http" "^1.1.0" "@smithy/smithy-client" "^1.0.3" - "@smithy/types" "^1.0.0" + "@smithy/types" "^1.1.0" "@smithy/url-parser" "^1.0.1" "@smithy/util-base64" "^1.0.1" "@smithy/util-body-length-browser" "^1.0.1" "@smithy/util-body-length-node" "^1.0.1" "@smithy/util-defaults-mode-browser" "^1.0.1" "@smithy/util-defaults-mode-node" "^1.0.1" - "@smithy/util-retry" "^1.0.2" + "@smithy/util-retry" "^1.0.3" "@smithy/util-utf8" "^1.0.1" tslib "^2.5.0" uuid "^8.3.2" -"@aws-sdk/client-sfn@^3.357.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-sfn/-/client-sfn-3.363.0.tgz#f0a824244b3af7232c6eee1f2f6839c4e430cd43" - integrity sha512-AVd73A1nErIlu6GS1etsZL2U6PmoASaWOnbWzieXLNHmO4+f6WLyC0PRCPdvAx7sD0fIUUFJE2/7qCfhdJfdjQ== +"@aws-sdk/client-sfn@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-sfn/-/client-sfn-3.370.0.tgz#33c93bfd122e66f731eed72b5897ca9b39da3d95" + integrity sha512-ANHwU1+nL5IM2jpw6BzxnCayAuZIi1Wy7pVTltWOc0BAF576k5ZcAU9AReolu5cjo7naXBDYN5VlCVrYl8TZuw== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sts" "3.363.0" - "@aws-sdk/credential-provider-node" "3.363.0" - "@aws-sdk/middleware-host-header" "3.363.0" - "@aws-sdk/middleware-logger" "3.363.0" - "@aws-sdk/middleware-recursion-detection" "3.363.0" - "@aws-sdk/middleware-signing" "3.363.0" - "@aws-sdk/middleware-user-agent" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" - "@aws-sdk/util-user-agent-browser" "3.363.0" - "@aws-sdk/util-user-agent-node" "3.363.0" + "@aws-sdk/client-sts" "3.370.0" + "@aws-sdk/credential-provider-node" "3.370.0" + "@aws-sdk/middleware-host-header" "3.370.0" + "@aws-sdk/middleware-logger" "3.370.0" + "@aws-sdk/middleware-recursion-detection" "3.370.0" + "@aws-sdk/middleware-signing" "3.370.0" + "@aws-sdk/middleware-user-agent" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" + "@aws-sdk/util-user-agent-browser" "3.370.0" + "@aws-sdk/util-user-agent-node" "3.370.0" "@smithy/config-resolver" "^1.0.1" "@smithy/fetch-http-handler" "^1.0.1" "@smithy/hash-node" "^1.0.1" "@smithy/invalid-dependency" "^1.0.1" "@smithy/middleware-content-length" "^1.0.1" - "@smithy/middleware-endpoint" "^1.0.1" - "@smithy/middleware-retry" "^1.0.2" + "@smithy/middleware-endpoint" "^1.0.2" + "@smithy/middleware-retry" "^1.0.3" "@smithy/middleware-serde" "^1.0.1" "@smithy/middleware-stack" "^1.0.1" "@smithy/node-config-provider" "^1.0.1" "@smithy/node-http-handler" "^1.0.2" - "@smithy/protocol-http" "^1.0.1" + "@smithy/protocol-http" "^1.1.0" "@smithy/smithy-client" "^1.0.3" - "@smithy/types" "^1.0.0" + "@smithy/types" "^1.1.0" "@smithy/url-parser" "^1.0.1" "@smithy/util-base64" "^1.0.1" "@smithy/util-body-length-browser" "^1.0.1" "@smithy/util-body-length-node" "^1.0.1" "@smithy/util-defaults-mode-browser" "^1.0.1" "@smithy/util-defaults-mode-node" "^1.0.1" - "@smithy/util-retry" "^1.0.2" + "@smithy/util-retry" "^1.0.3" "@smithy/util-utf8" "^1.0.1" tslib "^2.5.0" -"@aws-sdk/client-ssm@^3.357.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-ssm/-/client-ssm-3.363.0.tgz#2c0dadc3d6e5407591c0e2bbdaac43e0ea09a2dc" - integrity sha512-xVrTZ0hBPdbVJPsJPGtTmOuETA2/WS73MghwtrejbNn5wOpuNNzJvEowEJiiFSTUXVqZhedOZiTEG6x/3zpzjQ== +"@aws-sdk/client-ssm@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-ssm/-/client-ssm-3.370.0.tgz#1f70ab13cf7b842dcff29d0a5c41da2dfa38d4f2" + integrity sha512-4zWvxA9Ljw+js1E3yE+3LPwGVrTxOC9ctpF1K/N3blqkBZX3m2w867476v9ARvk3xPR6vId9In6NjnL5Ur1+iQ== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sts" "3.363.0" - "@aws-sdk/credential-provider-node" "3.363.0" - "@aws-sdk/middleware-host-header" "3.363.0" - "@aws-sdk/middleware-logger" "3.363.0" - "@aws-sdk/middleware-recursion-detection" "3.363.0" - "@aws-sdk/middleware-signing" "3.363.0" - "@aws-sdk/middleware-user-agent" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" - "@aws-sdk/util-user-agent-browser" "3.363.0" - "@aws-sdk/util-user-agent-node" "3.363.0" + "@aws-sdk/client-sts" "3.370.0" + "@aws-sdk/credential-provider-node" "3.370.0" + "@aws-sdk/middleware-host-header" "3.370.0" + "@aws-sdk/middleware-logger" "3.370.0" + "@aws-sdk/middleware-recursion-detection" "3.370.0" + "@aws-sdk/middleware-signing" "3.370.0" + "@aws-sdk/middleware-user-agent" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" + "@aws-sdk/util-user-agent-browser" "3.370.0" + "@aws-sdk/util-user-agent-node" "3.370.0" "@smithy/config-resolver" "^1.0.1" "@smithy/fetch-http-handler" "^1.0.1" "@smithy/hash-node" "^1.0.1" "@smithy/invalid-dependency" "^1.0.1" "@smithy/middleware-content-length" "^1.0.1" - "@smithy/middleware-endpoint" "^1.0.1" - "@smithy/middleware-retry" "^1.0.2" + "@smithy/middleware-endpoint" "^1.0.2" + "@smithy/middleware-retry" "^1.0.3" "@smithy/middleware-serde" "^1.0.1" "@smithy/middleware-stack" "^1.0.1" "@smithy/node-config-provider" "^1.0.1" "@smithy/node-http-handler" "^1.0.2" - "@smithy/protocol-http" "^1.0.1" + "@smithy/protocol-http" "^1.1.0" "@smithy/smithy-client" "^1.0.3" - "@smithy/types" "^1.0.0" + "@smithy/types" "^1.1.0" "@smithy/url-parser" "^1.0.1" "@smithy/util-base64" "^1.0.1" "@smithy/util-body-length-browser" "^1.0.1" "@smithy/util-body-length-node" "^1.0.1" "@smithy/util-defaults-mode-browser" "^1.0.1" "@smithy/util-defaults-mode-node" "^1.0.1" - "@smithy/util-retry" "^1.0.2" + "@smithy/util-retry" "^1.0.3" "@smithy/util-utf8" "^1.0.1" "@smithy/util-waiter" "^1.0.1" tslib "^2.5.0" uuid "^8.3.2" -"@aws-sdk/client-sso-oidc@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.363.0.tgz#71240d729a0847fd5a7aaac09ed5a3a07c3666cf" - integrity sha512-V3Ebiq/zNtDS/O92HUWGBa7MY59RYSsqWd+E0XrXv6VYTA00RlMTbNcseivNgp2UghOgB9a20Nkz6EqAeIN+RQ== +"@aws-sdk/client-sso-oidc@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.370.0.tgz#db03c04cb6a23888dc60016eb67505a41ede410b" + integrity sha512-jAYOO74lmVXylQylqkPrjLzxvUnMKw476JCUTvCO6Q8nv3LzCWd76Ihgv/m9Q4M2Tbqi1iP2roVK5bstsXzEjA== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/middleware-host-header" "3.363.0" - "@aws-sdk/middleware-logger" "3.363.0" - "@aws-sdk/middleware-recursion-detection" "3.363.0" - "@aws-sdk/middleware-user-agent" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" - "@aws-sdk/util-user-agent-browser" "3.363.0" - "@aws-sdk/util-user-agent-node" "3.363.0" + "@aws-sdk/middleware-host-header" "3.370.0" + "@aws-sdk/middleware-logger" "3.370.0" + "@aws-sdk/middleware-recursion-detection" "3.370.0" + "@aws-sdk/middleware-user-agent" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" + "@aws-sdk/util-user-agent-browser" "3.370.0" + "@aws-sdk/util-user-agent-node" "3.370.0" "@smithy/config-resolver" "^1.0.1" "@smithy/fetch-http-handler" "^1.0.1" "@smithy/hash-node" "^1.0.1" "@smithy/invalid-dependency" "^1.0.1" "@smithy/middleware-content-length" "^1.0.1" - "@smithy/middleware-endpoint" "^1.0.1" - "@smithy/middleware-retry" "^1.0.2" + "@smithy/middleware-endpoint" "^1.0.2" + "@smithy/middleware-retry" "^1.0.3" "@smithy/middleware-serde" "^1.0.1" "@smithy/middleware-stack" "^1.0.1" "@smithy/node-config-provider" "^1.0.1" "@smithy/node-http-handler" "^1.0.2" - "@smithy/protocol-http" "^1.0.1" + "@smithy/protocol-http" "^1.1.0" "@smithy/smithy-client" "^1.0.3" - "@smithy/types" "^1.0.0" + "@smithy/types" "^1.1.0" "@smithy/url-parser" "^1.0.1" "@smithy/util-base64" "^1.0.1" "@smithy/util-body-length-browser" "^1.0.1" "@smithy/util-body-length-node" "^1.0.1" "@smithy/util-defaults-mode-browser" "^1.0.1" "@smithy/util-defaults-mode-node" "^1.0.1" - "@smithy/util-retry" "^1.0.2" + "@smithy/util-retry" "^1.0.3" "@smithy/util-utf8" "^1.0.1" tslib "^2.5.0" -"@aws-sdk/client-sso@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.363.0.tgz#b1939ee6769cf208f1dd4fbfa924c223da9d60ec" - integrity sha512-PZ+HfKSgS4hlMnJzG+Ev8/mgHd/b/ETlJWPSWjC/f2NwVoBQkBnqHjdyEx7QjF6nksJozcVh5Q+kkYLKc/QwBQ== +"@aws-sdk/client-sso@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.370.0.tgz#68aea97ecb2e5e6c817dfd3a1dd9fa4e09ff6e1c" + integrity sha512-0Ty1iHuzNxMQtN7nahgkZr4Wcu1XvqGfrQniiGdKKif9jG/4elxsQPiydRuQpFqN6b+bg7wPP7crFP1uTxx2KQ== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/middleware-host-header" "3.363.0" - "@aws-sdk/middleware-logger" "3.363.0" - "@aws-sdk/middleware-recursion-detection" "3.363.0" - "@aws-sdk/middleware-user-agent" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" - "@aws-sdk/util-user-agent-browser" "3.363.0" - "@aws-sdk/util-user-agent-node" "3.363.0" + "@aws-sdk/middleware-host-header" "3.370.0" + "@aws-sdk/middleware-logger" "3.370.0" + "@aws-sdk/middleware-recursion-detection" "3.370.0" + "@aws-sdk/middleware-user-agent" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" + "@aws-sdk/util-user-agent-browser" "3.370.0" + "@aws-sdk/util-user-agent-node" "3.370.0" "@smithy/config-resolver" "^1.0.1" "@smithy/fetch-http-handler" "^1.0.1" "@smithy/hash-node" "^1.0.1" "@smithy/invalid-dependency" "^1.0.1" "@smithy/middleware-content-length" "^1.0.1" - "@smithy/middleware-endpoint" "^1.0.1" - "@smithy/middleware-retry" "^1.0.2" + "@smithy/middleware-endpoint" "^1.0.2" + "@smithy/middleware-retry" "^1.0.3" "@smithy/middleware-serde" "^1.0.1" "@smithy/middleware-stack" "^1.0.1" "@smithy/node-config-provider" "^1.0.1" "@smithy/node-http-handler" "^1.0.2" - "@smithy/protocol-http" "^1.0.1" + "@smithy/protocol-http" "^1.1.0" "@smithy/smithy-client" "^1.0.3" - "@smithy/types" "^1.0.0" + "@smithy/types" "^1.1.0" "@smithy/url-parser" "^1.0.1" "@smithy/util-base64" "^1.0.1" "@smithy/util-body-length-browser" "^1.0.1" "@smithy/util-body-length-node" "^1.0.1" "@smithy/util-defaults-mode-browser" "^1.0.1" "@smithy/util-defaults-mode-node" "^1.0.1" - "@smithy/util-retry" "^1.0.2" + "@smithy/util-retry" "^1.0.3" "@smithy/util-utf8" "^1.0.1" tslib "^2.5.0" -"@aws-sdk/client-sts@3.363.0", "@aws-sdk/client-sts@^3.357.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.363.0.tgz#c02b3cf3bd2ef9d54195323370db964cd1df4711" - integrity sha512-0jj14WvBPJQ8xr72cL0mhlmQ90tF0O0wqXwSbtog6PsC8+KDE6Yf+WsxsumyI8E5O8u3eYijBL+KdqG07F/y/w== +"@aws-sdk/client-sts@3.370.0", "@aws-sdk/client-sts@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.370.0.tgz#65879fa35b396035dcab446c782056ef768f48af" + integrity sha512-utFxOPWIzbN+3kc415Je2o4J72hOLNhgR2Gt5EnRSggC3yOnkC4GzauxG8n7n5gZGBX45eyubHyPOXLOIyoqQA== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/credential-provider-node" "3.363.0" - "@aws-sdk/middleware-host-header" "3.363.0" - "@aws-sdk/middleware-logger" "3.363.0" - "@aws-sdk/middleware-recursion-detection" "3.363.0" - "@aws-sdk/middleware-sdk-sts" "3.363.0" - "@aws-sdk/middleware-signing" "3.363.0" - "@aws-sdk/middleware-user-agent" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" - "@aws-sdk/util-user-agent-browser" "3.363.0" - "@aws-sdk/util-user-agent-node" "3.363.0" + "@aws-sdk/credential-provider-node" "3.370.0" + "@aws-sdk/middleware-host-header" "3.370.0" + "@aws-sdk/middleware-logger" "3.370.0" + "@aws-sdk/middleware-recursion-detection" "3.370.0" + "@aws-sdk/middleware-sdk-sts" "3.370.0" + "@aws-sdk/middleware-signing" "3.370.0" + "@aws-sdk/middleware-user-agent" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" + "@aws-sdk/util-user-agent-browser" "3.370.0" + "@aws-sdk/util-user-agent-node" "3.370.0" "@smithy/config-resolver" "^1.0.1" "@smithy/fetch-http-handler" "^1.0.1" "@smithy/hash-node" "^1.0.1" "@smithy/invalid-dependency" "^1.0.1" "@smithy/middleware-content-length" "^1.0.1" - "@smithy/middleware-endpoint" "^1.0.1" - "@smithy/middleware-retry" "^1.0.1" + "@smithy/middleware-endpoint" "^1.0.2" + "@smithy/middleware-retry" "^1.0.3" "@smithy/middleware-serde" "^1.0.1" "@smithy/middleware-stack" "^1.0.1" "@smithy/node-config-provider" "^1.0.1" - "@smithy/node-http-handler" "^1.0.1" + "@smithy/node-http-handler" "^1.0.2" "@smithy/protocol-http" "^1.1.0" - "@smithy/smithy-client" "^1.0.2" + "@smithy/smithy-client" "^1.0.3" "@smithy/types" "^1.1.0" "@smithy/url-parser" "^1.0.1" "@smithy/util-base64" "^1.0.1" @@ -1037,115 +1045,115 @@ "@smithy/util-body-length-node" "^1.0.1" "@smithy/util-defaults-mode-browser" "^1.0.1" "@smithy/util-defaults-mode-node" "^1.0.1" - "@smithy/util-retry" "^1.0.1" + "@smithy/util-retry" "^1.0.3" "@smithy/util-utf8" "^1.0.1" fast-xml-parser "4.2.5" tslib "^2.5.0" -"@aws-sdk/credential-provider-cognito-identity@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.363.0.tgz#0f4ae7cd282b61a5dfdd7d38a02495411c926dc9" - integrity sha512-5x42JvqEsBUrm6/qdf0WWe4mlmJjPItxamQhRjuOzeQD/BxsA2W5VS/7n0Ws0e27DNhlnUErcIJd+bBy6j1fqA== +"@aws-sdk/credential-provider-cognito-identity@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.370.0.tgz#ba251131db44368473b151178a7c2329058dad39" + integrity sha512-OjNAN72+QoyJAmOayi47AlFzpQc4E59LWRE2GKgH0F1pEgr3t34T0/EHusCoxUjOz5mRRXrKjNlHVC7ezOFEcg== dependencies: - "@aws-sdk/client-cognito-identity" "3.363.0" - "@aws-sdk/types" "3.357.0" + "@aws-sdk/client-cognito-identity" "3.370.0" + "@aws-sdk/types" "3.370.0" "@smithy/property-provider" "^1.0.1" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/credential-provider-env@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.363.0.tgz#5b8471a243cdb54696ecae99ad4cc1c48d687657" - integrity sha512-VAQ3zITT2Q0acht0HezouYnMFKZ2vIOa20X4zQA3WI0HfaP4D6ga6KaenbDcb/4VFiqfqiRHfdyXHP0ThcDRMA== +"@aws-sdk/credential-provider-env@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.370.0.tgz#edd507a88b36b967da048255f4a478ad92d1c5aa" + integrity sha512-raR3yP/4GGbKFRPP5hUBNkEmTnzxI9mEc2vJAJrcv4G4J4i/UP6ELiLInQ5eO2/VcV/CeKGZA3t7d1tsJ+jhCg== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@smithy/property-provider" "^1.0.1" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/credential-provider-ini@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.363.0.tgz#e77e65e1ffc7c736aa724ebdf038e99dca57a87b" - integrity sha512-ZYN+INoqyX5FVC3rqUxB6O8nOWkr0gHRRBm1suoOlmuFJ/WSlW/uUGthRBY5x1AQQnBF8cpdlxZzGHd41lFVNw== +"@aws-sdk/credential-provider-ini@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.370.0.tgz#4e569b8054b4fba2f0a0a7fa88af84b1f8d78c0b" + integrity sha512-eJyapFKa4NrC9RfTgxlXnXfS9InG/QMEUPPVL+VhG7YS6nKqetC1digOYgivnEeu+XSKE0DJ7uZuXujN2Y7VAQ== dependencies: - "@aws-sdk/credential-provider-env" "3.363.0" - "@aws-sdk/credential-provider-process" "3.363.0" - "@aws-sdk/credential-provider-sso" "3.363.0" - "@aws-sdk/credential-provider-web-identity" "3.363.0" - "@aws-sdk/types" "3.357.0" + "@aws-sdk/credential-provider-env" "3.370.0" + "@aws-sdk/credential-provider-process" "3.370.0" + "@aws-sdk/credential-provider-sso" "3.370.0" + "@aws-sdk/credential-provider-web-identity" "3.370.0" + "@aws-sdk/types" "3.370.0" "@smithy/credential-provider-imds" "^1.0.1" "@smithy/property-provider" "^1.0.1" "@smithy/shared-ini-file-loader" "^1.0.1" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/credential-provider-node@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.363.0.tgz#70815b3c8bc98d9afd148b851c8fdae9ce11fcd6" - integrity sha512-C1qXFIN2yMxD6pGgug0vR1UhScOki6VqdzuBHzXZAGu7MOjvgHNdscEcb3CpWnITHaPL2ztkiw75T1sZ7oIgQg== - dependencies: - "@aws-sdk/credential-provider-env" "3.363.0" - "@aws-sdk/credential-provider-ini" "3.363.0" - "@aws-sdk/credential-provider-process" "3.363.0" - "@aws-sdk/credential-provider-sso" "3.363.0" - "@aws-sdk/credential-provider-web-identity" "3.363.0" - "@aws-sdk/types" "3.357.0" +"@aws-sdk/credential-provider-node@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.370.0.tgz#74605644ccbd9e8237223318a7955f4ab2ff0d86" + integrity sha512-gkFiotBFKE4Fcn8CzQnMeab9TAR06FEAD02T4ZRYW1xGrBJOowmje9dKqdwQFHSPgnWAP+8HoTA8iwbhTLvjNA== + dependencies: + "@aws-sdk/credential-provider-env" "3.370.0" + "@aws-sdk/credential-provider-ini" "3.370.0" + "@aws-sdk/credential-provider-process" "3.370.0" + "@aws-sdk/credential-provider-sso" "3.370.0" + "@aws-sdk/credential-provider-web-identity" "3.370.0" + "@aws-sdk/types" "3.370.0" "@smithy/credential-provider-imds" "^1.0.1" "@smithy/property-provider" "^1.0.1" "@smithy/shared-ini-file-loader" "^1.0.1" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/credential-provider-process@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.363.0.tgz#08608f6da246084f9b20481ac0de17f04ae54b4d" - integrity sha512-fOKAINU7Rtj2T8pP13GdCt+u0Ml3gYynp8ki+1jMZIQ+Ju/MdDOqZpKMFKicMn3Z1ttUOgqr+grUdus6z8ceBQ== +"@aws-sdk/credential-provider-process@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.370.0.tgz#f7b94d2ccfda3b067cb23ea832b10c692c831855" + integrity sha512-0BKFFZmUO779Xdw3u7wWnoWhYA4zygxJbgGVSyjkOGBvdkbPSTTcdwT1KFkaQy2kOXYeZPl+usVVRXs+ph4ejg== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@smithy/property-provider" "^1.0.1" "@smithy/shared-ini-file-loader" "^1.0.1" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/credential-provider-sso@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.363.0.tgz#949190c9ea510d9772aef9c61345575f4b40b44d" - integrity sha512-5RUZ5oM0lwZSo3EehT0dXggOjgtxFogpT3cZvoLGtIwrPBvm8jOQPXQUlaqCj10ThF1sYltEyukz/ovtDwYGew== +"@aws-sdk/credential-provider-sso@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.370.0.tgz#4c57f93d73f198d7e1e53fbfcdf72c053bc9c682" + integrity sha512-PFroYm5hcPSfC/jkZnCI34QFL3I7WVKveVk6/F3fud/cnP8hp6YjA9NiTNbqdFSzsyoiN/+e5fZgNKih8vVPTA== dependencies: - "@aws-sdk/client-sso" "3.363.0" - "@aws-sdk/token-providers" "3.363.0" - "@aws-sdk/types" "3.357.0" + "@aws-sdk/client-sso" "3.370.0" + "@aws-sdk/token-providers" "3.370.0" + "@aws-sdk/types" "3.370.0" "@smithy/property-provider" "^1.0.1" "@smithy/shared-ini-file-loader" "^1.0.1" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/credential-provider-web-identity@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.363.0.tgz#a5312519126ff7c3fea56ffefa0e51ef9383663c" - integrity sha512-Z6w7fjgy79pAax580wdixbStQw10xfyZ+hOYLcPudoYFKjoNx0NQBejg5SwBzCF/HQL23Ksm9kDfbXDX9fkPhA== +"@aws-sdk/credential-provider-web-identity@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.370.0.tgz#c5831bb656bea1fe3b300e495e19a33bc90f4d84" + integrity sha512-CFaBMLRudwhjv1sDzybNV93IaT85IwS+L8Wq6VRMa0mro1q9rrWsIZO811eF+k0NEPfgU1dLH+8Vc2qhw4SARQ== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@smithy/property-provider" "^1.0.1" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/credential-providers@^3.357.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.363.0.tgz#592700058349ca6fcc3f23dfcec14c9d6c0c929a" - integrity sha512-hVa1DdYasnLud2EKjDAlDHiV/+H/Zq52chHU00c/R8XwPu1s0kZX3NMmlt0D2HhYqC1mUwtdmE58Jra2POviQQ== - dependencies: - "@aws-sdk/client-cognito-identity" "3.363.0" - "@aws-sdk/client-sso" "3.363.0" - "@aws-sdk/client-sts" "3.363.0" - "@aws-sdk/credential-provider-cognito-identity" "3.363.0" - "@aws-sdk/credential-provider-env" "3.363.0" - "@aws-sdk/credential-provider-ini" "3.363.0" - "@aws-sdk/credential-provider-node" "3.363.0" - "@aws-sdk/credential-provider-process" "3.363.0" - "@aws-sdk/credential-provider-sso" "3.363.0" - "@aws-sdk/credential-provider-web-identity" "3.363.0" - "@aws-sdk/types" "3.357.0" +"@aws-sdk/credential-providers@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.370.0.tgz#280878e08298e959e1877a733ed6ead1cb3486d8" + integrity sha512-K5yUHJPB2QJKWzKoz1YCE2xJDvYL6bvCRyoT0mRPWbITrDjFuWxbe1QXWcMymwQIyzOITAnZq5fvj456KhPATg== + dependencies: + "@aws-sdk/client-cognito-identity" "3.370.0" + "@aws-sdk/client-sso" "3.370.0" + "@aws-sdk/client-sts" "3.370.0" + "@aws-sdk/credential-provider-cognito-identity" "3.370.0" + "@aws-sdk/credential-provider-env" "3.370.0" + "@aws-sdk/credential-provider-ini" "3.370.0" + "@aws-sdk/credential-provider-node" "3.370.0" + "@aws-sdk/credential-provider-process" "3.370.0" + "@aws-sdk/credential-provider-sso" "3.370.0" + "@aws-sdk/credential-provider-web-identity" "3.370.0" + "@aws-sdk/types" "3.370.0" "@smithy/credential-provider-imds" "^1.0.1" "@smithy/property-provider" "^1.0.1" "@smithy/types" "^1.1.0" @@ -1159,21 +1167,22 @@ mnemonist "0.38.3" tslib "^2.5.0" -"@aws-sdk/hash-blob-browser@3.357.0": - version "3.357.0" - resolved "https://registry.npmjs.org/@aws-sdk/hash-blob-browser/-/hash-blob-browser-3.357.0.tgz#e507929499fe0fe128664b67cd26f63f16ed4d25" - integrity sha512-RDd6UgrGHDmleTnXM9LRSSVa69euSAG2mlNhZMEDWk3OFseXVYqBDaqroVbQ01rM2UAe8MeBFchlV9OmxuVgvw== +"@aws-sdk/hash-blob-browser@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/hash-blob-browser/-/hash-blob-browser-3.370.0.tgz#e18f92c222496de6a26f671ae4d708ad95336859" + integrity sha512-DyStaznfloyF9jN3KvG6puOAjt25alXoBNeHBF2FyLlEEbrOqUmso39JB5LVAw2/KB4UmCNsbAXFb6WktX/yHQ== dependencies: "@aws-sdk/chunked-blob-reader" "3.310.0" - "@aws-sdk/types" "3.357.0" + "@aws-sdk/chunked-blob-reader-native" "3.310.0" + "@aws-sdk/types" "3.370.0" tslib "^2.5.0" -"@aws-sdk/hash-stream-node@3.357.0": - version "3.357.0" - resolved "https://registry.npmjs.org/@aws-sdk/hash-stream-node/-/hash-stream-node-3.357.0.tgz#a78c6d1ae1c78cb52854311bad50988e8fc12142" - integrity sha512-KZjN1VAw1KHNp+xKVOWBGS+MpaYQTjZFD5f+7QQqW4TfbAkFFwIAEYIHq5Q8Gw+jVh0h61OrV/LyW3J2PVzc+w== +"@aws-sdk/hash-stream-node@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/hash-stream-node/-/hash-stream-node-3.370.0.tgz#95330f409145c88e162117afd89e3d5e00ff6e86" + integrity sha512-ExsbBiIMiL9AN1VpWlD8+xaO5s0cXUZJC2UONiQbgMb1jz7Wq9fa1GmKUDyaGXOuQTT7DDhAmalb9fIpauZKuA== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@aws-sdk/util-utf8" "3.310.0" tslib "^2.5.0" @@ -1184,150 +1193,150 @@ dependencies: tslib "^2.5.0" -"@aws-sdk/md5-js@3.357.0": - version "3.357.0" - resolved "https://registry.npmjs.org/@aws-sdk/md5-js/-/md5-js-3.357.0.tgz#61853f562e71af0ec58aeede7883de122177ed55" - integrity sha512-to42sFAL7KgV/X9X40LLfEaNMHMGQL6/7mPMVCL/W2BZf3zw5OTl3lAaNyjXA+gO5Uo4lFEiQKAQVKNbr8b8Nw== +"@aws-sdk/md5-js@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/md5-js/-/md5-js-3.370.0.tgz#b0758574fa0556afbfa633ce5d21d5510fa18bb2" + integrity sha512-wch3+hiRdFGsu5E+w3WU9qmumQErKshtgetd6wMgFYm2MPSksFU58rM/aiwiWRA6knpcaShKaPKMmGnuX3HwhQ== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@aws-sdk/util-utf8" "3.310.0" tslib "^2.5.0" -"@aws-sdk/middleware-bucket-endpoint@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/middleware-bucket-endpoint/-/middleware-bucket-endpoint-3.363.0.tgz#6c9b2dda20eaaf9171b7f2c4faff3b34b4331522" - integrity sha512-kR8+0X50zslpzRW29q4JbpPMadE1z39ZfGwPaBLKpoWvSGt4x+75FaoK71TH7urPPoFyD2Y+XKGA6YRYTUNHSQ== +"@aws-sdk/middleware-bucket-endpoint@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/middleware-bucket-endpoint/-/middleware-bucket-endpoint-3.370.0.tgz#965a0ea2323b719703d1dec76a4e7b39d5a7463f" + integrity sha512-B36+fOeJVO0D9cjR92Ob6Ki2FTzyTQ/uKk8w+xtur6W6zYVOPU4IQNpNZvN3Ykt4jitR2uUnVSlBb3sXHHhdFA== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@aws-sdk/util-arn-parser" "3.310.0" "@smithy/protocol-http" "^1.1.0" "@smithy/types" "^1.1.0" "@smithy/util-config-provider" "^1.0.1" tslib "^2.5.0" -"@aws-sdk/middleware-endpoint-discovery@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/middleware-endpoint-discovery/-/middleware-endpoint-discovery-3.363.0.tgz#7b14c088b6ee8a09304be933c0f0a8620ba2d558" - integrity sha512-iGwH2YRAqP99YQZmeqTHeamIPw/BBbcHCIIvCD8GojSGbtT1OJpaex3RSFkKFtYuK4F/RLmZZBA2BXXiVIdVtw== +"@aws-sdk/middleware-endpoint-discovery@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/middleware-endpoint-discovery/-/middleware-endpoint-discovery-3.370.0.tgz#b9165d8d8319136047071114f2f154a299bc7f14" + integrity sha512-CxTo+AUW1XIT0U1COzBjdQ39eWbWk5Sv9OmA73g1vHwwvy9M3vFl78cnaKnauGv7BI/NtM5IeRy0w5T22BtWgg== dependencies: "@aws-sdk/endpoint-cache" "3.310.0" - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@smithy/protocol-http" "^1.1.0" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/middleware-expect-continue@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/middleware-expect-continue/-/middleware-expect-continue-3.363.0.tgz#125356f3685e14eaa8816383bbf5f3de05dd856e" - integrity sha512-I88xneZp6jRwySmIl9uI7eZCcTsqRVnTDfUr1JiXt7zonqNNm80PVYMs6pwaw7t97ec1AQJcsONjuXZyCMnu5g== +"@aws-sdk/middleware-expect-continue@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/middleware-expect-continue/-/middleware-expect-continue-3.370.0.tgz#5eb7c7e65fc345ef31bcecb37522550cd12cd29a" + integrity sha512-OlFIpXa53obLryHyrqedE2Cp8lp2k+1Vjd++hlZFDFJncRlWZMxoXSyl6shQPqhIiGnNW4vt7tG5xE4jg4NAvw== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@smithy/protocol-http" "^1.1.0" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/middleware-flexible-checksums@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/middleware-flexible-checksums/-/middleware-flexible-checksums-3.363.0.tgz#99cd3e09183768ac378eae5c5f4e54189147921d" - integrity sha512-FBYmrMRX01uNximNN0WLgpf97GN4xNTLaKsDlkjYRWKJ+J97ICkvLG0FcSu7+SNCpCdJJBeQ5tRVOPVpUu6nmA== +"@aws-sdk/middleware-flexible-checksums@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/middleware-flexible-checksums/-/middleware-flexible-checksums-3.370.0.tgz#f3b59ac7c3ec205d063e136fd040ca4922464c07" + integrity sha512-62fyW4hZxppvkQKSXdkzjHQ95dXyVCuL18Sfnlciy9pr9f/t5w6LhZIxsNIW+Ge9mbgc661SVRKTwxlZj6FuLQ== dependencies: "@aws-crypto/crc32" "3.0.0" "@aws-crypto/crc32c" "3.0.0" - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@smithy/is-array-buffer" "^1.0.1" "@smithy/protocol-http" "^1.1.0" "@smithy/types" "^1.1.0" "@smithy/util-utf8" "^1.0.1" tslib "^2.5.0" -"@aws-sdk/middleware-host-header@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.363.0.tgz#3fc25569c1fdbb29ee7b95690d222743b9791210" - integrity sha512-FobpclDCf5Y1ueyJDmb9MqguAdPssNMlnqWQpujhYVABq69KHu73fSCWSauFPUrw7YOpV8kG1uagDF0POSxHzA== +"@aws-sdk/middleware-host-header@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.370.0.tgz#645472416efd16b22a66b0aa1d52f48cf5699feb" + integrity sha512-CPXOm/TnOFC7KyXcJglICC7OiA7Kj6mT3ChvEijr56TFOueNHvJdV4aNIFEQy0vGHOWtY12qOWLNto/wYR1BAQ== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@smithy/protocol-http" "^1.1.0" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/middleware-location-constraint@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/middleware-location-constraint/-/middleware-location-constraint-3.363.0.tgz#48c8a16698d7678578a5f06e0eb7f8118ec86f82" - integrity sha512-piNzpNNI/fChSGOZxcq/2msN2qFUSEAbhqs91zbcpv8CEPekVLc4W9laXCG764BEMyfG97ZU8MtzwHeMhELhBA== +"@aws-sdk/middleware-location-constraint@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/middleware-location-constraint/-/middleware-location-constraint-3.370.0.tgz#aa12d98a4cd8705dbda2642aac386a7b023ae651" + integrity sha512-NlDZEbBOF1IN7svUTcjbLodkUctt9zsfDI8+DqNlklRs5lsPb91WYvahOfjFO/EvACixa+a5d3cCumMCaIq4Cw== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/middleware-logger@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.363.0.tgz#64ebef9910802f9437cae8900e8825ca5141c9ed" - integrity sha512-SSGgthScYnFGTOw8EzbkvquqweFmvn7uJihkpFekbtBNGC/jGOGO+8ziHjTQ8t/iI/YKubEwv+LMi0f77HKSEg== +"@aws-sdk/middleware-logger@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.370.0.tgz#c9f694d7e1dd47b5e6e8eab94793fc1e272b1e26" + integrity sha512-cQMq9SaZ/ORmTJPCT6VzMML7OxFdQzNkhMAgKpTDl+tdPWynlHF29E5xGoSzROnThHlQPCjogU0NZ8AxI0SWPA== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/middleware-recursion-detection@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.363.0.tgz#bd8b8010f5be5d7e90a97bf9e55a7980289b1600" - integrity sha512-MWD/57QgI/N7fG8rtzDTUdSqNpYohQfgj9XCFAoVeI/bU4usrkOrew43L4smJG4XrDxlNT8lSJlDtd64tuiUZA== +"@aws-sdk/middleware-recursion-detection@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.370.0.tgz#e5e8fd1d2ff1ade91135295dabcaa81c311ce00b" + integrity sha512-L7ZF/w0lAAY/GK1khT8VdoU0XB7nWHk51rl/ecAg64J70dHnMOAg8n+5FZ9fBu/xH1FwUlHOkwlodJOgzLJjtg== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@smithy/protocol-http" "^1.1.0" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/middleware-sdk-ec2@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/middleware-sdk-ec2/-/middleware-sdk-ec2-3.363.0.tgz#ce9c082cd422218bc626321fe5b18992c3d6e41b" - integrity sha512-F/Vj36t4k4gBW/faEJRDNC8D55vFVWjLJCcHq0RWy/vJnsmoMXLSHp++lpmLl1G8YsjjSsCObOcfJL/VHeO6Zg== +"@aws-sdk/middleware-sdk-ec2@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/middleware-sdk-ec2/-/middleware-sdk-ec2-3.370.0.tgz#88f77e1bc6209c861e9a52a69283fb2d194415f5" + integrity sha512-adb3HVeyc9nmUjdDGyVSj+0nw91b2wMJgicpATzc1rikoDI2IySSvxC5bYj5cWrIcWVNF4iui9fJehoB6ykdUQ== dependencies: - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-format-url" "3.363.0" - "@smithy/middleware-endpoint" "^1.0.1" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-format-url" "3.370.0" + "@smithy/middleware-endpoint" "^1.0.2" "@smithy/protocol-http" "^1.1.0" "@smithy/signature-v4" "^1.0.1" "@smithy/smithy-client" "^1.0.3" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/middleware-sdk-route53@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/middleware-sdk-route53/-/middleware-sdk-route53-3.363.0.tgz#cf1befa4ae1d5cb3c0f2599e28e185a22553fc67" - integrity sha512-t8jOjlvgkm5GFkj+RGRt/W9kTdmxztRzK26M85qmHbEzH430zJEzOpw1HKyOxuSvcrUWUdHfy/aR5Qqp0Vz0Mw== +"@aws-sdk/middleware-sdk-route53@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/middleware-sdk-route53/-/middleware-sdk-route53-3.370.0.tgz#dda96778d50b65b507be28771c50d9f7703fa63b" + integrity sha512-jc0ACsyRrIbOuYF7Cv/g0CpqD+HI5Qs0ML8L5jgqtKrZ5mKdl38HtovFPaZm1KUuuq1ApSnITDHNiNUUQRC6fQ== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/middleware-sdk-s3@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.363.0.tgz#35e77ad14b6799b0be1c313d9c8b7ca0ad2f4fdb" - integrity sha512-npC8vLCero+vULizrK0QPjNanWbgH4A/2Llc1nO8N005uvUe7co6WglILF2W3guZrFk/0uGEdX67OnLxUD97pw== +"@aws-sdk/middleware-sdk-s3@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.370.0.tgz#4ff48cba4da0465077230c8bdd8a117654aff9bb" + integrity sha512-DPYXtveWBDS5MzSHWTThg2KkLaOzZkCgPejjEuw3yl4ljsHawDs/ZIVCtmWXlBIS2lLCaBMpCV+t9psuJ/6/zQ== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@aws-sdk/util-arn-parser" "3.310.0" "@smithy/protocol-http" "^1.1.0" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/middleware-sdk-sts@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sts/-/middleware-sdk-sts-3.363.0.tgz#41b10aa8b8004bda9156cadde3b2302a84309e6a" - integrity sha512-1yy2Ac50FO8BrODaw5bPWvVrRhaVLqXTFH6iHB+dJLPUkwtY5zLM3Mp+9Ilm7kME+r7oIB1wuO6ZB1Lf4ZszIw== +"@aws-sdk/middleware-sdk-sts@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sts/-/middleware-sdk-sts-3.370.0.tgz#0599a624fe5cabe75cd7d9e7420927b102356fa2" + integrity sha512-ykbsoVy0AJtVbuhAlTAMcaz/tCE3pT8nAp0L7CQQxSoanRCvOux7au0KwMIQVhxgnYid4dWVF6d00SkqU5MXRA== dependencies: - "@aws-sdk/middleware-signing" "3.363.0" - "@aws-sdk/types" "3.357.0" + "@aws-sdk/middleware-signing" "3.370.0" + "@aws-sdk/types" "3.370.0" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/middleware-signing@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/middleware-signing/-/middleware-signing-3.363.0.tgz#81067698e0566584f0ca30be56232758f69e2232" - integrity sha512-/7qia715pt9JKYIPDGu22WmdZxD8cfF/5xB+1kmILg7ZtjO0pPuTaCNJ7xiIuFd7Dn7JXp5lop08anX/GOhNRQ== +"@aws-sdk/middleware-signing@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/middleware-signing/-/middleware-signing-3.370.0.tgz#c094026251faa17a24f61630d56152f7b073e6cf" + integrity sha512-Dwr/RTCWOXdm394wCwICGT2VNOTMRe4IGPsBRJAsM24pm+EEqQzSS3Xu/U/zF4exuxqpMta4wec4QpSarPNTxA== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@smithy/property-provider" "^1.0.1" "@smithy/protocol-http" "^1.1.0" "@smithy/signature-v4" "^1.0.1" @@ -1335,96 +1344,97 @@ "@smithy/util-middleware" "^1.0.1" tslib "^2.5.0" -"@aws-sdk/middleware-ssec@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/middleware-ssec/-/middleware-ssec-3.363.0.tgz#9dde9e09660bcb6a0d39939d7f1ab043b93fefdb" - integrity sha512-pN+QN1rMShYpJnTJSCIYnNRhD0S8xSZsTn6ThgcO559Xiwz5LMHFOfOXUCEyxtbVW5kMHLUh3w101AMUKae99A== +"@aws-sdk/middleware-ssec@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/middleware-ssec/-/middleware-ssec-3.370.0.tgz#e7b6f7b6fba23c64cfc9c7ceed12613d6694f1cc" + integrity sha512-NIosfLS7mxCNdGYnuy76W9qP3f3YWVTusUA+uv+s6rnwG+Z2UheXCf1wpnJKzxORA8pioSP7ylZ8w2A0reCgYQ== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/middleware-user-agent@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.363.0.tgz#a75a7ca5c791a68d750736c87b968b54d394443d" - integrity sha512-ri8YaQvXP6odteVTMfxPqFR26Q0h9ejtqhUDv47P34FaKXedEM4nC6ix6o+5FEYj6l8syGyktftZ5O70NoEhug== +"@aws-sdk/middleware-user-agent@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.370.0.tgz#a2bf71baf6407654811a02e4d276a2eec3996fdb" + integrity sha512-2+3SB6MtMAq1+gVXhw0Y3ONXuljorh6ijnxgTpv+uQnBW5jHCUiAS8WDYiDEm7i9euJPbvJfM8WUrSMDMU6Cog== dependencies: - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-endpoints" "3.357.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-endpoints" "3.370.0" "@smithy/protocol-http" "^1.1.0" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/node-http-handler@^3.357.0": - version "3.360.0" - resolved "https://registry.npmjs.org/@aws-sdk/node-http-handler/-/node-http-handler-3.360.0.tgz#6f762b57f98887b5173886f890669e6a60bf792c" - integrity sha512-oMsXdMmNwHpUbebETO44bq0N4SocEMGfPjYNUTRs8md7ita5fuFd2qFuvf+ZRt6iVcGWluIqmF8DidD+b7d+TA== +"@aws-sdk/node-http-handler@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/node-http-handler/-/node-http-handler-3.370.0.tgz#417b37857f2e081f7947102cc679703e537175aa" + integrity sha512-v2mCtrbzbsK5YFopIeD7oIl+aEHtyFeNDq2ODkNlO0HPYBRbvFHFKFeUsyR991tfmffPonae4oeI9RI8eZQu2A== dependencies: - "@aws-sdk/abort-controller" "3.357.0" - "@aws-sdk/protocol-http" "3.357.0" - "@aws-sdk/querystring-builder" "3.357.0" - "@aws-sdk/types" "3.357.0" + "@aws-sdk/abort-controller" "3.370.0" + "@aws-sdk/protocol-http" "3.370.0" + "@aws-sdk/querystring-builder" "3.370.0" + "@aws-sdk/types" "3.370.0" tslib "^2.5.0" -"@aws-sdk/protocol-http@3.357.0": - version "3.357.0" - resolved "https://registry.npmjs.org/@aws-sdk/protocol-http/-/protocol-http-3.357.0.tgz#cd47413d6c1ed2d27bc30c7e9da3b262c8804cf4" - integrity sha512-w1JHiI50VEea7duDeAspUiKJmmdIQblvRyjVMOqWA6FIQAyDVuEiPX7/MdQr0ScxhtRQxHbP0I4MFyl7ctRQvA== +"@aws-sdk/protocol-http@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/protocol-http/-/protocol-http-3.370.0.tgz#8ce4a99ea28ad373c65a86f761e3ccb859b322f7" + integrity sha512-MfZCgSsVmir+4kJps7xT0awOPNi+swBpcVp9ZtAP7POduUVV6zVLurMNLXsppKsErggssD5E9HUgQFs5w06U4Q== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" tslib "^2.5.0" -"@aws-sdk/querystring-builder@3.357.0": - version "3.357.0" - resolved "https://registry.npmjs.org/@aws-sdk/querystring-builder/-/querystring-builder-3.357.0.tgz#0d4627620eba4d3cc523c2e1da88dfa561617599" - integrity sha512-aQcicqB6Y2cNaXPPwunz612a01SMiQQPsdz632F/3Lzn0ua82BJKobHOtaiTUlmVJ5Q4/EAeNfwZgL7tTUNtDQ== +"@aws-sdk/querystring-builder@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/querystring-builder/-/querystring-builder-3.370.0.tgz#9a7aeaa7351e39549e8a1dba19cf36df1a8e1eae" + integrity sha512-yrDWn3AtXArHWXh9NATcf+aaF6SPBxgroSIHYKKDA7B0UlSEpCOroz7anj0Lvewwo1D3hLlXcJlBSGVtWI0Xyg== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@aws-sdk/util-uri-escape" "3.310.0" tslib "^2.5.0" -"@aws-sdk/s3-request-presigner@^3.357.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/s3-request-presigner/-/s3-request-presigner-3.363.0.tgz#eeef1071e151c829d10e52e9c0d4c3a02b0788e1" - integrity sha512-KbAa5mbBmSt2FEutOWUF2g8sW35I63726tnIO65Z7ej3bWoreHM1u+TCMzTiAUGW67lbsG8nTEbFz9yRrsNoLQ== +"@aws-sdk/s3-request-presigner@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/s3-request-presigner/-/s3-request-presigner-3.370.0.tgz#d0232905455cc179253585fcfe733f9debba97b7" + integrity sha512-ilTf+Q3nEKBd6soJo8cAGDCoRV6ggLYxUHqLyVXreMsio9rog7H2ePbFtO9gtbwUGR46gqgDQyIf+7i7yAuP6A== dependencies: - "@aws-sdk/signature-v4-multi-region" "3.363.0" - "@aws-sdk/types" "3.357.0" - "@aws-sdk/util-format-url" "3.363.0" - "@smithy/middleware-endpoint" "^1.0.1" + "@aws-sdk/signature-v4-multi-region" "3.370.0" + "@aws-sdk/types" "3.370.0" + "@aws-sdk/util-format-url" "3.370.0" + "@smithy/middleware-endpoint" "^1.0.2" "@smithy/protocol-http" "^1.1.0" "@smithy/smithy-client" "^1.0.3" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/signature-v4-multi-region@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.363.0.tgz#7c64ba8a6af6f52f73ef849d4fcdd102f63ad606" - integrity sha512-iWamQSpaBKg88LKuiUq8xO/7iyxJ+ORkA3qDhAwUqyTJOg87ma47yFf4ycCKqINnflc3AIGLGzBHnkBc4cMF5g== +"@aws-sdk/signature-v4-multi-region@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.370.0.tgz#1a6eee2c9a197ca3d48fcf9bfaa326e8990c6042" + integrity sha512-Q3NQopPDnHbJXMhtYl0Mfy5U2o76K6tzhdnYRcrYImY0ze/zOkCQI7KPC4588PuyvAXCdQ02cmCPPjYD55UeNg== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@smithy/protocol-http" "^1.1.0" "@smithy/signature-v4" "^1.0.1" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/token-providers@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.363.0.tgz#c211ed6db62620c46194506db6d785f5c36aedc5" - integrity sha512-6+0aJ1zugNgsMmhTtW2LBWxOVSaXCUk2q3xyTchSXkNzallYaRiZMRkieW+pKNntnu0g5H1T0zyfCO0tbXwxEA== +"@aws-sdk/token-providers@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.370.0.tgz#e5229f2d116887c90ec103e024583be05c1f506c" + integrity sha512-EyR2ZYr+lJeRiZU2/eLR+mlYU9RXLQvNyGFSAekJKgN13Rpq/h0syzXVFLP/RSod/oZenh/fhVZ2HwlZxuGBtQ== dependencies: - "@aws-sdk/client-sso-oidc" "3.363.0" - "@aws-sdk/types" "3.357.0" + "@aws-sdk/client-sso-oidc" "3.370.0" + "@aws-sdk/types" "3.370.0" "@smithy/property-provider" "^1.0.1" "@smithy/shared-ini-file-loader" "^1.0.1" "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@aws-sdk/types@3.357.0", "@aws-sdk/types@^3.357.0": - version "3.357.0" - resolved "https://registry.npmjs.org/@aws-sdk/types/-/types-3.357.0.tgz#8491da71a4291cc2661c26a75089e86532b6a3b5" - integrity sha512-/riCRaXg3p71BeWnShrai0y0QTdXcouPSM0Cn1olZbzTf7s71aLEewrc96qFrL70XhY4XvnxMpqQh+r43XIL3g== +"@aws-sdk/types@3.370.0", "@aws-sdk/types@^3.369.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/types/-/types-3.370.0.tgz#79e0e4927529c957b5c5c2a00f7590a76784a5e4" + integrity sha512-8PGMKklSkRKjunFhzM2y5Jm0H2TBu7YRNISdYzXLUHKSP9zlMEYagseKVdmox0zKHf1LXVNuSlUV2b6SRrieCQ== dependencies: + "@smithy/types" "^1.1.0" tslib "^2.5.0" "@aws-sdk/types@^3.222.0": @@ -1441,6 +1451,14 @@ dependencies: tslib "^2.5.0" +"@aws-sdk/util-base64@3.310.0": + version "3.310.0" + resolved "https://registry.npmjs.org/@aws-sdk/util-base64/-/util-base64-3.310.0.tgz#d0fd49aff358c5a6e771d0001c63b1f97acbe34c" + integrity sha512-v3+HBKQvqgdzcbL+pFswlx5HQsd9L6ZTlyPVL2LS9nNXnCcR3XgGz9jRskikRUuUvUXtkSG1J88GAOnJ/apTPg== + dependencies: + "@aws-sdk/util-buffer-from" "3.310.0" + tslib "^2.5.0" + "@aws-sdk/util-buffer-from@3.310.0": version "3.310.0" resolved "https://registry.npmjs.org/@aws-sdk/util-buffer-from/-/util-buffer-from-3.310.0.tgz#7a72cb965984d3c6a7e256ae6cf1621f52e54a57" @@ -1449,20 +1467,20 @@ "@aws-sdk/is-array-buffer" "3.310.0" tslib "^2.5.0" -"@aws-sdk/util-endpoints@3.357.0": - version "3.357.0" - resolved "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.357.0.tgz#eaa7b4481bbd9fc8f13412b308ba4129d8fa2004" - integrity sha512-XHKyS5JClT9su9hDif715jpZiWHQF9gKZXER8tW0gOizU3R9cyWc9EsJ2BRhFNhi7nt/JF/CLUEc5qDx3ETbUw== +"@aws-sdk/util-endpoints@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.370.0.tgz#bf1f4653c3afc89d4e79aa4895dd3dffbb56c930" + integrity sha512-5ltVAnM79nRlywwzZN5i8Jp4tk245OCGkKwwXbnDU+gq7zT3CIOsct1wNZvmpfZEPGt/bv7/NyRcjP+7XNsX/g== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" tslib "^2.5.0" -"@aws-sdk/util-format-url@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/util-format-url/-/util-format-url-3.363.0.tgz#bf522834b7e072712dc93308d7c87ae6a7edae8f" - integrity sha512-lz3z4M5QPVJxALVUOU6a538CO+VPDLl9dgeAQCRF7fVjYP7nRGjm7Hc1oiEP7nYL3sAw/lQfbL7NlTPNXRwRlQ== +"@aws-sdk/util-format-url@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/util-format-url/-/util-format-url-3.370.0.tgz#d4432592b02d60d8368e65443c57f296ef74a547" + integrity sha512-6ik8UTT5hNlMnATrqWiQWnIZ0EFW8wVsRGyYUYw/geB3lQ+WAWflpJg+gZiJnc5EY4R0aOzRVm02W8EUeH8f5g== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@smithy/querystring-builder" "^1.0.1" "@smithy/types" "^1.1.0" tslib "^2.5.0" @@ -1481,22 +1499,22 @@ dependencies: tslib "^2.5.0" -"@aws-sdk/util-user-agent-browser@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.363.0.tgz#6f0655976f4f5889d6f0abed6c6cdc665cab524f" - integrity sha512-fk9ymBUIYbxiGm99Cn+kAAXmvMCWTf/cHAcB79oCXV4ELXdPa9lN5xQhZRFNxLUeXG4OAMEuCAUUuZEj8Fnc1Q== +"@aws-sdk/util-user-agent-browser@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.370.0.tgz#df144f5f1a65578842b79d49555c754a531d85f0" + integrity sha512-028LxYZMQ0DANKhW+AKFQslkScZUeYlPmSphrCIXgdIItRZh6ZJHGzE7J/jDsEntZOrZJsjI4z0zZ5W2idj04w== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@smithy/types" "^1.1.0" bowser "^2.11.0" tslib "^2.5.0" -"@aws-sdk/util-user-agent-node@3.363.0": - version "3.363.0" - resolved "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.363.0.tgz#9df26188a3d22694b4d06f5f40c489cb22fddb48" - integrity sha512-Fli/dvgGA9hdnQUrYb1//wNSFlK2jAfdJcfNXA6SeBYzSeH5pVGYF4kXF0FCdnMA3Fef+Zn1zAP/hw9v8VJHWQ== +"@aws-sdk/util-user-agent-node@3.370.0": + version "3.370.0" + resolved "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.370.0.tgz#96d8420b42cbebd498de8b94886340d11c97a34b" + integrity sha512-33vxZUp8vxTT/DGYIR3PivQm07sSRGWI+4fCv63Rt7Q++fO24E0kQtmVAlikRY810I10poD6rwILVtITtFSzkg== dependencies: - "@aws-sdk/types" "3.357.0" + "@aws-sdk/types" "3.370.0" "@smithy/node-config-provider" "^1.0.1" "@smithy/types" "^1.1.0" tslib "^2.5.0" @@ -1855,115 +1873,115 @@ enabled "2.0.x" kuler "^2.0.0" -"@esbuild/android-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz#bafb75234a5d3d1b690e7c2956a599345e84a2fd" - integrity sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA== - -"@esbuild/android-arm@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz#5898f7832c2298bc7d0ab53701c57beb74d78b4d" - integrity sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A== - -"@esbuild/android-x64@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz#658368ef92067866d95fb268719f98f363d13ae1" - integrity sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww== - -"@esbuild/darwin-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz#584c34c5991b95d4d48d333300b1a4e2ff7be276" - integrity sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg== - -"@esbuild/darwin-x64@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz#7751d236dfe6ce136cce343dce69f52d76b7f6cb" - integrity sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw== - -"@esbuild/freebsd-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz#cacd171665dd1d500f45c167d50c6b7e539d5fd2" - integrity sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ== - -"@esbuild/freebsd-x64@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz#0769456eee2a08b8d925d7c00b79e861cb3162e4" - integrity sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ== - -"@esbuild/linux-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz#38e162ecb723862c6be1c27d6389f48960b68edb" - integrity sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg== - -"@esbuild/linux-arm@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz#1a2cd399c50040184a805174a6d89097d9d1559a" - integrity sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA== - -"@esbuild/linux-ia32@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz#e28c25266b036ce1cabca3c30155222841dc035a" - integrity sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ== - -"@esbuild/linux-loong64@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz#0f887b8bb3f90658d1a0117283e55dbd4c9dcf72" - integrity sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ== - -"@esbuild/linux-mips64el@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz#f5d2a0b8047ea9a5d9f592a178ea054053a70289" - integrity sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A== - -"@esbuild/linux-ppc64@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz#876590e3acbd9fa7f57a2c7d86f83717dbbac8c7" - integrity sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg== - -"@esbuild/linux-riscv64@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz#7f49373df463cd9f41dc34f9b2262d771688bf09" - integrity sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA== - -"@esbuild/linux-s390x@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz#e2afd1afcaf63afe2c7d9ceacd28ec57c77f8829" - integrity sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q== - -"@esbuild/linux-x64@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz#8a0e9738b1635f0c53389e515ae83826dec22aa4" - integrity sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw== - -"@esbuild/netbsd-x64@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz#c29fb2453c6b7ddef9a35e2c18b37bda1ae5c462" - integrity sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q== - -"@esbuild/openbsd-x64@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz#95e75a391403cb10297280d524d66ce04c920691" - integrity sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g== - -"@esbuild/sunos-x64@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz#722eaf057b83c2575937d3ffe5aeb16540da7273" - integrity sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg== - -"@esbuild/win32-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz#9aa9dc074399288bdcdd283443e9aeb6b9552b6f" - integrity sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag== - -"@esbuild/win32-ia32@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz#95ad43c62ad62485e210f6299c7b2571e48d2b03" - integrity sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw== - -"@esbuild/win32-x64@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz#8cfaf2ff603e9aabb910e9c0558c26cf32744061" - integrity sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA== +"@esbuild/android-arm64@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.13.tgz#70ef455455654c7800c31ae55ae295d81712238c" + integrity sha512-j7NhycJUoUAG5kAzGf4fPWfd17N6SM3o1X6MlXVqfHvs2buFraCJzos9vbeWjLxOyBKHyPOnuCuipbhvbYtTAg== + +"@esbuild/android-arm@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.13.tgz#15db83099855fc4193658a40687893ee5c95d7a9" + integrity sha512-KwqFhxRFMKZINHzCqf8eKxE0XqWlAVPRxwy6rc7CbVFxzUWB2sA/s3hbMZeemPdhN3fKBkqOaFhTbS8xJXYIWQ== + +"@esbuild/android-x64@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.13.tgz#473d589219e1c06e305cf61ca77b8f69d9b6ffab" + integrity sha512-M2eZkRxR6WnWfVELHmv6MUoHbOqnzoTVSIxgtsyhm/NsgmL+uTmag/VVzdXvmahak1I6sOb1K/2movco5ikDJg== + +"@esbuild/darwin-arm64@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.13.tgz#0f525b2c1821a0591a06963582e5dc749ba51d45" + integrity sha512-f5goG30YgR1GU+fxtaBRdSW3SBG9pZW834Mmhxa6terzcboz7P2R0k4lDxlkP7NYRIIdBbWp+VgwQbmMH4yV7w== + +"@esbuild/darwin-x64@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.13.tgz#81965b690bae86bf1289b2ce0732506fd41fb545" + integrity sha512-RIrxoKH5Eo+yE5BtaAIMZaiKutPhZjw+j0OCh8WdvKEKJQteacq0myZvBDLU+hOzQOZWJeDnuQ2xgSScKf1Ovw== + +"@esbuild/freebsd-arm64@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.13.tgz#895bb37fdea886db09549119158e044f146861f0" + integrity sha512-AfRPhHWmj9jGyLgW/2FkYERKmYR+IjYxf2rtSLmhOrPGFh0KCETFzSjx/JX/HJnvIqHt/DRQD/KAaVsUKoI3Xg== + +"@esbuild/freebsd-x64@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.13.tgz#0b1dfde3ff1b18f03f71e460f91dc463e6a23903" + integrity sha512-pGzWWZJBInhIgdEwzn8VHUBang8UvFKsvjDkeJ2oyY5gZtAM6BaxK0QLCuZY+qoj/nx/lIaItH425rm/hloETA== + +"@esbuild/linux-arm64@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.13.tgz#350febed5d32d8ec1a424a4c4d7c9ba885604960" + integrity sha512-hCzZbVJEHV7QM77fHPv2qgBcWxgglGFGCxk6KfQx6PsVIdi1u09X7IvgE9QKqm38OpkzaAkPnnPqwRsltvLkIQ== + +"@esbuild/linux-arm@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.13.tgz#47639d73d894026350eaccf7c174f1d26b747d6a" + integrity sha512-4iMxLRMCxGyk7lEvkkvrxw4aJeC93YIIrfbBlUJ062kilUUnAiMb81eEkVvCVoh3ON283ans7+OQkuy1uHW+Hw== + +"@esbuild/linux-ia32@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.13.tgz#a901a16349c58bf6f873bced36bdf46a5f4dac5d" + integrity sha512-I3OKGbynl3AAIO6onXNrup/ttToE6Rv2XYfFgLK/wnr2J+1g+7k4asLrE+n7VMhaqX+BUnyWkCu27rl+62Adug== + +"@esbuild/linux-loong64@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.13.tgz#faa08db402c18e351234719e00aba98867aa34ce" + integrity sha512-8pcKDApAsKc6WW51ZEVidSGwGbebYw2qKnO1VyD8xd6JN0RN6EUXfhXmDk9Vc4/U3Y4AoFTexQewQDJGsBXBpg== + +"@esbuild/linux-mips64el@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.13.tgz#2123a54b49ddc1a1dff057bba8a9a5e9f26e5009" + integrity sha512-6GU+J1PLiVqWx8yoCK4Z0GnfKyCGIH5L2KQipxOtbNPBs+qNDcMJr9euxnyJ6FkRPyMwaSkjejzPSISD9hb+gg== + +"@esbuild/linux-ppc64@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.13.tgz#9a9befd275a6a3f5baeed89aaafb746df7ba735d" + integrity sha512-pfn/OGZ8tyR8YCV7MlLl5hAit2cmS+j/ZZg9DdH0uxdCoJpV7+5DbuXrR+es4ayRVKIcfS9TTMCs60vqQDmh+w== + +"@esbuild/linux-riscv64@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.13.tgz#6644a5b5840fa0c3ffade6f87d943413ece520a8" + integrity sha512-aIbhU3LPg0lOSCfVeGHbmGYIqOtW6+yzO+Nfv57YblEK01oj0mFMtvDJlOaeAZ6z0FZ9D13oahi5aIl9JFphGg== + +"@esbuild/linux-s390x@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.13.tgz#c1367a0a02b37f6b0382e71d9c9d97352ca23013" + integrity sha512-Pct1QwF2sp+5LVi4Iu5Y+6JsGaV2Z2vm4O9Dd7XZ5tKYxEHjFtb140fiMcl5HM1iuv6xXO8O1Vrb1iJxHlv8UA== + +"@esbuild/linux-x64@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.13.tgz#892674f0918ee3f5e523270cf49a69a557fb64c0" + integrity sha512-zTrIP0KzYP7O0+3ZnmzvUKgGtUvf4+piY8PIO3V8/GfmVd3ZyHJGz7Ht0np3P1wz+I8qJ4rjwJKqqEAbIEPngA== + +"@esbuild/netbsd-x64@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.13.tgz#67954292195ecbdae33ab09a9ae6a7f566e49d04" + integrity sha512-I6zs10TZeaHDYoGxENuksxE1sxqZpCp+agYeW039yqFwh3MgVvdmXL5NMveImOC6AtpLvE4xG5ujVic4NWFIDQ== + +"@esbuild/openbsd-x64@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.13.tgz#b3eef873dfab547fbe7bcdb3573e1c59dea676b7" + integrity sha512-W5C5nczhrt1y1xPG5bV+0M12p2vetOGlvs43LH8SopQ3z2AseIROu09VgRqydx5qFN7y9qCbpgHLx0kb0TcW7g== + +"@esbuild/sunos-x64@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.13.tgz#b368080f42dbb5ae926d0567c02bcd68a34c5efd" + integrity sha512-X/xzuw4Hzpo/yq3YsfBbIsipNgmsm8mE/QeWbdGdTTeZ77fjxI2K0KP3AlhZ6gU3zKTw1bKoZTuKLnqcJ537qw== + +"@esbuild/win32-arm64@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.13.tgz#11dedda0e8cfb5f781411ea362b2040304be0fc3" + integrity sha512-4CGYdRQT/ILd+yLLE5i4VApMPfGE0RPc/wFQhlluDQCK09+b4JDbxzzjpgQqTPrdnP7r5KUtGVGZYclYiPuHrw== + +"@esbuild/win32-ia32@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.13.tgz#6b8aa95515c05827b7c24c9db9581943566e0dcb" + integrity sha512-D+wKZaRhQI+MUGMH+DbEr4owC2D7XnF+uyGiZk38QbgzLcofFqIOwFs7ELmIeU45CQgfHNy9Q+LKW3cE8g37Kg== + +"@esbuild/win32-x64@0.18.13": + version "0.18.13" + resolved "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.13.tgz#031f69b1f4cf62a18c38d502458c0b8b02625461" + integrity sha512-iVl6lehAfJS+VmpF3exKpNQ8b0eucf5VWfzR8S7xFve64NBNz2jPUgx1X93/kfnkfgP737O+i1k54SVQS7uVZA== "@eslint-community/eslint-utils@^4.2.0": version "4.4.0" @@ -2105,6 +2123,18 @@ jest-util "^29.5.0" slash "^3.0.0" +"@jest/console@^29.6.1": + version "29.6.1" + resolved "https://registry.npmjs.org/@jest/console/-/console-29.6.1.tgz#b48ba7b9c34b51483e6d590f46e5837f1ab5f639" + integrity sha512-Aj772AYgwTSr5w8qnyoJ0eDYvN6bMsH3ORH1ivMotrInHLKdUz6BDlaEXHdM6kODaBIkNIyQGzsMvRdOv7VG7Q== + dependencies: + "@jest/types" "^29.6.1" + "@types/node" "*" + chalk "^4.0.0" + jest-message-util "^29.6.1" + jest-util "^29.6.1" + slash "^3.0.0" + "@jest/core@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/core/-/core-29.5.0.tgz#76674b96904484e8214614d17261cc491e5f1f03" @@ -2139,6 +2169,40 @@ slash "^3.0.0" strip-ansi "^6.0.0" +"@jest/core@^29.6.1": + version "29.6.1" + resolved "https://registry.npmjs.org/@jest/core/-/core-29.6.1.tgz#fac0d9ddf320490c93356ba201451825231e95f6" + integrity sha512-CcowHypRSm5oYQ1obz1wfvkjZZ2qoQlrKKvlfPwh5jUXVU12TWr2qMeH8chLMuTFzHh5a1g2yaqlqDICbr+ukQ== + dependencies: + "@jest/console" "^29.6.1" + "@jest/reporters" "^29.6.1" + "@jest/test-result" "^29.6.1" + "@jest/transform" "^29.6.1" + "@jest/types" "^29.6.1" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + ci-info "^3.2.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + jest-changed-files "^29.5.0" + jest-config "^29.6.1" + jest-haste-map "^29.6.1" + jest-message-util "^29.6.1" + jest-regex-util "^29.4.3" + jest-resolve "^29.6.1" + jest-resolve-dependencies "^29.6.1" + jest-runner "^29.6.1" + jest-runtime "^29.6.1" + jest-snapshot "^29.6.1" + jest-util "^29.6.1" + jest-validate "^29.6.1" + jest-watcher "^29.6.1" + micromatch "^4.0.4" + pretty-format "^29.6.1" + slash "^3.0.0" + strip-ansi "^6.0.0" + "@jest/environment@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/environment/-/environment-29.5.0.tgz#9152d56317c1fdb1af389c46640ba74ef0bb4c65" @@ -2149,6 +2213,16 @@ "@types/node" "*" jest-mock "^29.5.0" +"@jest/environment@^29.6.1": + version "29.6.1" + resolved "https://registry.npmjs.org/@jest/environment/-/environment-29.6.1.tgz#ee358fff2f68168394b4a50f18c68278a21fe82f" + integrity sha512-RMMXx4ws+Gbvw3DfLSuo2cfQlK7IwGbpuEWXCqyYDcqYTI+9Ju3a5hDnXaxjNsa6uKh9PQF2v+qg+RLe63tz5A== + dependencies: + "@jest/fake-timers" "^29.6.1" + "@jest/types" "^29.6.1" + "@types/node" "*" + jest-mock "^29.6.1" + "@jest/expect-utils@^28.1.3": version "28.1.3" resolved "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-28.1.3.tgz#58561ce5db7cd253a7edddbc051fb39dda50f525" @@ -2163,6 +2237,13 @@ dependencies: jest-get-type "^29.4.3" +"@jest/expect-utils@^29.6.1": + version "29.6.1" + resolved "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.6.1.tgz#ab83b27a15cdd203fe5f68230ea22767d5c3acc5" + integrity sha512-o319vIf5pEMx0LmzSxxkYYxo4wrRLKHq9dP1yJU7FoPTB0LfAKSz8SWD6D/6U3v/O52t9cF5t+MeJiRsfk7zMw== + dependencies: + jest-get-type "^29.4.3" + "@jest/expect@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/expect/-/expect-29.5.0.tgz#80952f5316b23c483fbca4363ce822af79c38fba" @@ -2171,6 +2252,14 @@ expect "^29.5.0" jest-snapshot "^29.5.0" +"@jest/expect@^29.6.1": + version "29.6.1" + resolved "https://registry.npmjs.org/@jest/expect/-/expect-29.6.1.tgz#fef18265188f6a97601f1ea0a2912d81a85b4657" + integrity sha512-N5xlPrAYaRNyFgVf2s9Uyyvr795jnB6rObuPx4QFvNJz8aAjpZUDfO4bh5G/xuplMID8PrnuF1+SfSyDxhsgYg== + dependencies: + expect "^29.6.1" + jest-snapshot "^29.6.1" + "@jest/fake-timers@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.5.0.tgz#d4d09ec3286b3d90c60bdcd66ed28d35f1b4dc2c" @@ -2183,6 +2272,18 @@ jest-mock "^29.5.0" jest-util "^29.5.0" +"@jest/fake-timers@^29.6.1": + version "29.6.1" + resolved "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.6.1.tgz#c773efddbc61e1d2efcccac008139f621de57c69" + integrity sha512-RdgHgbXyosCDMVYmj7lLpUwXA4c69vcNzhrt69dJJdf8azUrpRh3ckFCaTPNjsEeRi27Cig0oKDGxy5j7hOgHg== + dependencies: + "@jest/types" "^29.6.1" + "@sinonjs/fake-timers" "^10.0.2" + "@types/node" "*" + jest-message-util "^29.6.1" + jest-mock "^29.6.1" + jest-util "^29.6.1" + "@jest/globals@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/globals/-/globals-29.5.0.tgz#6166c0bfc374c58268677539d0c181f9c1833298" @@ -2193,6 +2294,16 @@ "@jest/types" "^29.5.0" jest-mock "^29.5.0" +"@jest/globals@^29.6.1": + version "29.6.1" + resolved "https://registry.npmjs.org/@jest/globals/-/globals-29.6.1.tgz#c8a8923e05efd757308082cc22893d82b8aa138f" + integrity sha512-2VjpaGy78JY9n9370H8zGRCFbYVWwjY6RdDMhoJHa1sYfwe6XM/azGN0SjY8kk7BOZApIejQ1BFPyH7FPG0w3A== + dependencies: + "@jest/environment" "^29.6.1" + "@jest/expect" "^29.6.1" + "@jest/types" "^29.6.1" + jest-mock "^29.6.1" + "@jest/reporters@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/reporters/-/reporters-29.5.0.tgz#985dfd91290cd78ddae4914ba7921bcbabe8ac9b" @@ -2223,6 +2334,36 @@ strip-ansi "^6.0.0" v8-to-istanbul "^9.0.1" +"@jest/reporters@^29.6.1": + version "29.6.1" + resolved "https://registry.npmjs.org/@jest/reporters/-/reporters-29.6.1.tgz#3325a89c9ead3cf97ad93df3a427549d16179863" + integrity sha512-9zuaI9QKr9JnoZtFQlw4GREQbxgmNYXU6QuWtmuODvk5nvPUeBYapVR/VYMyi2WSx3jXTLJTJji8rN6+Cm4+FA== + dependencies: + "@bcoe/v8-coverage" "^0.2.3" + "@jest/console" "^29.6.1" + "@jest/test-result" "^29.6.1" + "@jest/transform" "^29.6.1" + "@jest/types" "^29.6.1" + "@jridgewell/trace-mapping" "^0.3.18" + "@types/node" "*" + chalk "^4.0.0" + collect-v8-coverage "^1.0.0" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.2.9" + istanbul-lib-coverage "^3.0.0" + istanbul-lib-instrument "^5.1.0" + istanbul-lib-report "^3.0.0" + istanbul-lib-source-maps "^4.0.0" + istanbul-reports "^3.1.3" + jest-message-util "^29.6.1" + jest-util "^29.6.1" + jest-worker "^29.6.1" + slash "^3.0.0" + string-length "^4.0.1" + strip-ansi "^6.0.0" + v8-to-istanbul "^9.0.1" + "@jest/schemas@^28.1.3": version "28.1.3" resolved "https://registry.npmjs.org/@jest/schemas/-/schemas-28.1.3.tgz#ad8b86a66f11f33619e3d7e1dcddd7f2d40ff905" @@ -2237,6 +2378,13 @@ dependencies: "@sinclair/typebox" "^0.25.16" +"@jest/schemas@^29.6.0": + version "29.6.0" + resolved "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.0.tgz#0f4cb2c8e3dca80c135507ba5635a4fd755b0040" + integrity sha512-rxLjXyJBTL4LQeJW3aKo0M/+GkCOXsO+8i9Iu7eDb6KwtP65ayoDsitrdPBtujxQ88k4wI2FNYfa6TOGwSn6cQ== + dependencies: + "@sinclair/typebox" "^0.27.8" + "@jest/source-map@^29.4.3": version "29.4.3" resolved "https://registry.npmjs.org/@jest/source-map/-/source-map-29.4.3.tgz#ff8d05cbfff875d4a791ab679b4333df47951d20" @@ -2246,6 +2394,15 @@ callsites "^3.0.0" graceful-fs "^4.2.9" +"@jest/source-map@^29.6.0": + version "29.6.0" + resolved "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.0.tgz#bd34a05b5737cb1a99d43e1957020ac8e5b9ddb1" + integrity sha512-oA+I2SHHQGxDCZpbrsCQSoMLb3Bz547JnM+jUr9qEbuw0vQlWZfpPS7CO9J7XiwKicEz9OFn/IYoLkkiUD7bzA== + dependencies: + "@jridgewell/trace-mapping" "^0.3.18" + callsites "^3.0.0" + graceful-fs "^4.2.9" + "@jest/test-result@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/test-result/-/test-result-29.5.0.tgz#7c856a6ca84f45cc36926a4e9c6b57f1973f1408" @@ -2256,6 +2413,16 @@ "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" +"@jest/test-result@^29.6.1": + version "29.6.1" + resolved "https://registry.npmjs.org/@jest/test-result/-/test-result-29.6.1.tgz#850e565a3f58ee8ca6ec424db00cb0f2d83c36ba" + integrity sha512-Ynr13ZRcpX6INak0TPUukU8GWRfm/vAytE3JbJNGAvINySWYdfE7dGZMbk36oVuK4CigpbhMn8eg1dixZ7ZJOw== + dependencies: + "@jest/console" "^29.6.1" + "@jest/types" "^29.6.1" + "@types/istanbul-lib-coverage" "^2.0.0" + collect-v8-coverage "^1.0.0" + "@jest/test-sequencer@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.5.0.tgz#34d7d82d3081abd523dbddc038a3ddcb9f6d3cc4" @@ -2266,6 +2433,16 @@ jest-haste-map "^29.5.0" slash "^3.0.0" +"@jest/test-sequencer@^29.6.1": + version "29.6.1" + resolved "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.6.1.tgz#e3e582ee074dd24ea9687d7d1aaf05ee3a9b068e" + integrity sha512-oBkC36PCDf/wb6dWeQIhaviU0l5u6VCsXa119yqdUosYAt7/FbQU2M2UoziO3igj/HBDEgp57ONQ3fm0v9uyyg== + dependencies: + "@jest/test-result" "^29.6.1" + graceful-fs "^4.2.9" + jest-haste-map "^29.6.1" + slash "^3.0.0" + "@jest/transform@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/transform/-/transform-29.5.0.tgz#cf9c872d0965f0cbd32f1458aa44a2b1988b00f9" @@ -2287,6 +2464,27 @@ slash "^3.0.0" write-file-atomic "^4.0.2" +"@jest/transform@^29.6.1": + version "29.6.1" + resolved "https://registry.npmjs.org/@jest/transform/-/transform-29.6.1.tgz#acb5606019a197cb99beda3c05404b851f441c92" + integrity sha512-URnTneIU3ZjRSaf906cvf6Hpox3hIeJXRnz3VDSw5/X93gR8ycdfSIEy19FlVx8NFmpN7fe3Gb1xF+NjXaQLWg== + dependencies: + "@babel/core" "^7.11.6" + "@jest/types" "^29.6.1" + "@jridgewell/trace-mapping" "^0.3.18" + babel-plugin-istanbul "^6.1.1" + chalk "^4.0.0" + convert-source-map "^2.0.0" + fast-json-stable-stringify "^2.1.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.6.1" + jest-regex-util "^29.4.3" + jest-util "^29.6.1" + micromatch "^4.0.4" + pirates "^4.0.4" + slash "^3.0.0" + write-file-atomic "^4.0.2" + "@jest/types@^28.1.3": version "28.1.3" resolved "https://registry.npmjs.org/@jest/types/-/types-28.1.3.tgz#b05de80996ff12512bc5ceb1d208285a7d11748b" @@ -2311,6 +2509,18 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" +"@jest/types@^29.6.1": + version "29.6.1" + resolved "https://registry.npmjs.org/@jest/types/-/types-29.6.1.tgz#ae79080278acff0a6af5eb49d063385aaa897bf2" + integrity sha512-tPKQNMPuXgvdOn2/Lg9HNfUvjYVGolt04Hp03f5hAk878uwOLikN+JzeLY0HcVgKgFl9Hs3EIqpu3WX27XNhnw== + dependencies: + "@jest/schemas" "^29.6.0" + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^17.0.8" + chalk "^4.0.0" + "@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": version "0.3.3" resolved "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" @@ -2353,7 +2563,7 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.15", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.15", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.9": version "0.3.18" resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz#25783b2086daf6ff1dcb53c9249ae480e4dd4cd6" integrity sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA== @@ -2361,22 +2571,6 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" -"@jsii/check-node@1.81.0": - version "1.81.0" - resolved "https://registry.npmjs.org/@jsii/check-node/-/check-node-1.81.0.tgz#7975de12f754f5c92ed795b1c88b1bf57edf57ea" - integrity sha512-nQ4cDehzHOkx8AXSPwmeB8JrA3FB4sqdwDtBjrMZI5LypRspHsxK91t8FzpxhE8a2nJpzRMIeAE07cLrBqeV1A== - dependencies: - chalk "^4.1.2" - semver "^7.5.0" - -"@jsii/check-node@1.82.0": - version "1.82.0" - resolved "https://registry.npmjs.org/@jsii/check-node/-/check-node-1.82.0.tgz#a3a7fc6bb6fea1843cb60ddd072a79f42c2b5379" - integrity sha512-7Djhxv+MZ80e/FAB7lT2vpQidzLDh6xcKTgA5JSuHMOJl4dylDR8g3Q06IZUrx5Hib6AmpmdTzHmosQFX0h80g== - dependencies: - chalk "^4.1.2" - semver "^7.5.1" - "@jsii/check-node@1.84.0": version "1.84.0" resolved "https://registry.npmjs.org/@jsii/check-node/-/check-node-1.84.0.tgz#cbed3a116b141e8dbef198dc161088bca603de0a" @@ -2385,14 +2579,7 @@ chalk "^4.1.2" semver "^7.5.1" -"@jsii/spec@1.81.0": - version "1.81.0" - resolved "https://registry.npmjs.org/@jsii/spec/-/spec-1.81.0.tgz#35c461a10dbf8e903df4956eb9d1097c1fcc8129" - integrity sha512-Ea1xP3ajppj6obhWrIrZASIbwsr9bGJEYHxs8UJaAoEfnDJVTRSSE1LsJtFaUuuDgeXDYGDvyhs37e8jhRvFdA== - dependencies: - ajv "^8.12.0" - -"@jsii/spec@1.84.0", "@jsii/spec@^1.81.0", "@jsii/spec@^1.82.0", "@jsii/spec@^1.84.0": +"@jsii/spec@1.84.0", "@jsii/spec@^1.84.0": version "1.84.0" resolved "https://registry.npmjs.org/@jsii/spec/-/spec-1.84.0.tgz#75f86e819999a5ee7b1430b274bf88459085bfc2" integrity sha512-P2PCE4jlmuTh5Oj7Be2jdn5qyzIWHX4rcyYspddc0DLZAuLB/LRQYytrxgfdy4+NroGhrPeKPBoF9MwJ5CzfXA== @@ -2713,6 +2900,13 @@ dependencies: "@nx/devkit" "16.3.2" +"@nrwl/devkit@16.5.2": + version "16.5.2" + resolved "https://registry.npmjs.org/@nrwl/devkit/-/devkit-16.5.2.tgz#eedcf4e546e2ebd3d01babcf5c97bc2b6bf08408" + integrity sha512-4L8cHD6cDTVWqylzM9vNbh8MuujsBpEP0yiTKQOBfAkTWpp/PcyFsnCMtYEiaWIQ5xSrruVbL5pb9KEL4ayLAg== + dependencies: + "@nx/devkit" "16.5.2" + "@nrwl/tao@16.3.2": version "16.3.2" resolved "https://registry.npmjs.org/@nrwl/tao/-/tao-16.3.2.tgz#eefc1974342afbbe48e4e5351d6707ad2f9fb179" @@ -2720,12 +2914,19 @@ dependencies: nx "16.3.2" -"@nrwl/workspace@16.3.2": - version "16.3.2" - resolved "https://registry.npmjs.org/@nrwl/workspace/-/workspace-16.3.2.tgz#3d3921dc9288fb6a9dfd8f1b05ca16b46930cdac" - integrity sha512-ORVzEEJIMOFYEOtOQHLU7N4vT4mYZ/JzKiwHZrHkCaVhgkiGBLoX3tOwVZjafKaa/24cGISv0J7WRtnfRKl2cA== +"@nrwl/tao@16.5.2": + version "16.5.2" + resolved "https://registry.npmjs.org/@nrwl/tao/-/tao-16.5.2.tgz#6b46b880e36ff0af4cceaf2409fd2055bf2cf2b1" + integrity sha512-4vQt0Jj9xHc8SpNgM2TxkPZrkjf4ayNW7elgt5rlOT1yD3Q1Fn3/VHb3cWtm/RC2vSckB4qUEuFGpdEU8wEnCg== dependencies: - "@nx/workspace" "16.3.2" + nx "16.5.2" + +"@nrwl/workspace@16.5.2": + version "16.5.2" + resolved "https://registry.npmjs.org/@nrwl/workspace/-/workspace-16.5.2.tgz#22c9e8f5ebd2d1cdc7ca5762d733422e4b5f61b8" + integrity sha512-ht3//ryb2lXKtiLyKTCITyoMsyPg0NycueU42rpmR8Gs3jFTHePQVLfSS9pdck8apors9i+Pg/tJPXdSpjY07A== + dependencies: + "@nx/workspace" "16.5.2" "@nx/devkit@16.3.2", "@nx/devkit@>=16.1.3 < 17": version "16.3.2" @@ -2739,63 +2940,125 @@ tmp "~0.2.1" tslib "^2.3.0" +"@nx/devkit@16.5.2": + version "16.5.2" + resolved "https://registry.npmjs.org/@nx/devkit/-/devkit-16.5.2.tgz#0a30fc4e3beeea7d7bf16a0496d1ff3c5fa05299" + integrity sha512-QDOQeFzVhQCA65g+2RfoGKZBUnCb151+F7/PvwRESEM+jybXHoXwR9PSE3ClnnmO/d0LUKB2ohU3Z9WQrQDALQ== + dependencies: + "@nrwl/devkit" "16.5.2" + ejs "^3.1.7" + ignore "^5.0.4" + semver "7.5.3" + tmp "~0.2.1" + tslib "^2.3.0" + "@nx/nx-darwin-arm64@16.3.2": version "16.3.2" resolved "https://registry.npmjs.org/@nx/nx-darwin-arm64/-/nx-darwin-arm64-16.3.2.tgz#83b6e78b27d2d7da8f7626560f52070c8735d28a" integrity sha512-YfYVNfsJBzBcBnJUU4AcA6A4QMkgnVlETfp4KGL36Otq542mRY1ISGHdox63ocI5AKh5gay5AaGcR4wR9PU9Vg== +"@nx/nx-darwin-arm64@16.5.2": + version "16.5.2" + resolved "https://registry.npmjs.org/@nx/nx-darwin-arm64/-/nx-darwin-arm64-16.5.2.tgz#0efcc62881eddd20e5bb8f881e6c8cc082c864f8" + integrity sha512-myiNbDJLhhVHRLo6z3TeiaUeYTWdvBR3RdHQq4szTgb82Bnn8ruzteRGGJwKZd551YlttRcieBysxzUzHkmVBg== + "@nx/nx-darwin-x64@16.3.2": version "16.3.2" resolved "https://registry.npmjs.org/@nx/nx-darwin-x64/-/nx-darwin-x64-16.3.2.tgz#0ae2a64356542c5fb73ca8038ce10ec4512e7fcb" integrity sha512-bJtpozz0zSRVRrcQ76GrlT3TWEGTymLYWrVG51bH5KZ46t6/a4EQBI3uL3vubMmOZ0jR4ywybOcPBBhxmBJ68w== +"@nx/nx-darwin-x64@16.5.2": + version "16.5.2" + resolved "https://registry.npmjs.org/@nx/nx-darwin-x64/-/nx-darwin-x64-16.5.2.tgz#6b03c1f4569411db7f8f90df90c820b083bde65f" + integrity sha512-m354qmKrv7a5eD9Qv8bGEmrLCBEyCS6/y0PyOR32Dmi7qwlgHsQ4FfVkOnlWefC5ednhFLJQT6yxwhg8cFGDxw== + "@nx/nx-freebsd-x64@16.3.2": version "16.3.2" resolved "https://registry.npmjs.org/@nx/nx-freebsd-x64/-/nx-freebsd-x64-16.3.2.tgz#202adf4d6070f47ed46450f006ecd50851147c74" integrity sha512-ZvufI0bWqT67nLbBo6ejrIGxypdoedRQTP/tudWbs/4isvxLe1uVku1BfKCTQUsJG367SqNOU1H5kzI/MRr3ow== +"@nx/nx-freebsd-x64@16.5.2": + version "16.5.2" + resolved "https://registry.npmjs.org/@nx/nx-freebsd-x64/-/nx-freebsd-x64-16.5.2.tgz#931e8be5c70d87b87f17d8faf0b9089383df0505" + integrity sha512-qrR9yxcC2BLnw9JulecILmyp6Jco9unHHzQcfhLZTpw5c1PNHmZzHwJ3i3iNEf1o2kXEIa+SlOCis9ndvNQQVA== + "@nx/nx-linux-arm-gnueabihf@16.3.2": version "16.3.2" resolved "https://registry.npmjs.org/@nx/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-16.3.2.tgz#62314a82566e3647866b9dd4167a2d0e1397f001" integrity sha512-IQL4kxdiZLvifar7+SIum3glRuVsxtE0dL8RvteSDXrxDQnaTUrjILC+VGhalRmk7ngBbGKNrhWOeeL7390CzQ== +"@nx/nx-linux-arm-gnueabihf@16.5.2": + version "16.5.2" + resolved "https://registry.npmjs.org/@nx/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-16.5.2.tgz#d9d865f99ba1128f6aa5b6bf0887bb743590eeb6" + integrity sha512-+I1Oj54caDymMsQuRu/l4ULS4RVvwDUM1nXey5JhWulDOUF//09Ckz03Q9p0NCnvBvQd3SyE65++PMfZrrurbA== + "@nx/nx-linux-arm64-gnu@16.3.2": version "16.3.2" resolved "https://registry.npmjs.org/@nx/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-16.3.2.tgz#02826400aa55b8f44bac83332dd29647d0e95001" integrity sha512-f6AWgPVu3mfUEoOBa0rY2/7QY0Or9eR0KtLFpcPh7RUpxPw2EXzIbjD/0RGipdpspSrgiMKbZpsUjo6mXBFsQA== +"@nx/nx-linux-arm64-gnu@16.5.2": + version "16.5.2" + resolved "https://registry.npmjs.org/@nx/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-16.5.2.tgz#c442df598108776cce297561555520ffbce251ea" + integrity sha512-4Q4jpgtNBTb4lMegFKS9hkzS/WttH3MxkgM//8qs1zhgUz/AsuXTitBo71E3xCnQl/i38p0eIpiKXXwBJeHgDw== + "@nx/nx-linux-arm64-musl@16.3.2": version "16.3.2" resolved "https://registry.npmjs.org/@nx/nx-linux-arm64-musl/-/nx-linux-arm64-musl-16.3.2.tgz#a0a81520e0904aa026a7ab0a8a3bf3facec9f14c" integrity sha512-AvrWcYz7021E3b5P9/0i26p60XMZfw86Epks51L6AhlflarlOH4AcEChc7APMtb1ELAIbDWx2S6oIDRbQ7rtVA== +"@nx/nx-linux-arm64-musl@16.5.2": + version "16.5.2" + resolved "https://registry.npmjs.org/@nx/nx-linux-arm64-musl/-/nx-linux-arm64-musl-16.5.2.tgz#e07c0031f60372e726d2272fac5f3743c4d9591c" + integrity sha512-VLukS/pfenr/Qw/EUn3GPAREDVXuSmfKeYBQKkALXEK6cRVQhXFXMLGHgMemCYbpoUJyFtFEO94PKV7VU7wZPg== + "@nx/nx-linux-x64-gnu@16.3.2": version "16.3.2" resolved "https://registry.npmjs.org/@nx/nx-linux-x64-gnu/-/nx-linux-x64-gnu-16.3.2.tgz#e79b5c142ec8d9bfb458ea5803bc4b62abbcf296" integrity sha512-K2pWGAcbCNm6b7UZI9cc8z4Rb540QcuepBXD7akjPjWerzXriT6VCn4i9mVKsCg2mwSfknTJJVJ1PZwJSmTl/Q== +"@nx/nx-linux-x64-gnu@16.5.2": + version "16.5.2" + resolved "https://registry.npmjs.org/@nx/nx-linux-x64-gnu/-/nx-linux-x64-gnu-16.5.2.tgz#0748beae6944b42276f4705bc41b9e06cefb1d55" + integrity sha512-TAGmY+MXbNl/aGg2KMvtg53rbmX0XHwnJRQtjhjqjAyvaOfFWI/WOqTU7xf/QCkXBUIK0D9xHWpALfA/fZFCBA== + "@nx/nx-linux-x64-musl@16.3.2": version "16.3.2" resolved "https://registry.npmjs.org/@nx/nx-linux-x64-musl/-/nx-linux-x64-musl-16.3.2.tgz#900aee8f171638b9fb44378e2ac0548cb4aa99a7" integrity sha512-sY1QDuQlqyYiRPJZanrtV07tU0DOXiCrWb0pDsGiO0qHuUSmW5Vw17GWEY4z3rt0/5U8fJ+/9WQrneviOmsOKg== +"@nx/nx-linux-x64-musl@16.5.2": + version "16.5.2" + resolved "https://registry.npmjs.org/@nx/nx-linux-x64-musl/-/nx-linux-x64-musl-16.5.2.tgz#7b150081e21ba7aa0da511f80aae1c5d230d1664" + integrity sha512-YyWmqcNbZgU76+LThAt+0arx9C2ewfI5UUI6kooZRniAd408EA2xl5fx2AWLLrISGH4nTb5p20HGmeWfGqjHPA== + "@nx/nx-win32-arm64-msvc@16.3.2": version "16.3.2" resolved "https://registry.npmjs.org/@nx/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-16.3.2.tgz#88db772b3535648e147b1a0206b1a1fe875fa9a5" integrity sha512-wBfohT2hjrLKn9WFHvG0MFVk7uYhgYNiptnTLdTouziHgFyZ08vyl7XYBq55BwHPMQ5iswVoEfjn/5ZBfCPscg== +"@nx/nx-win32-arm64-msvc@16.5.2": + version "16.5.2" + resolved "https://registry.npmjs.org/@nx/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-16.5.2.tgz#f06f74b876c92d6b12cd351baff016b18bfd9a73" + integrity sha512-pl7LluCc/57kl9VZ1ES27ym16ps4zgfCIeJiF8Ne8C6ALgt7C3PEG6417sFqbQw5J7NhsZ1aTb3eJ9fa9hurhA== + "@nx/nx-win32-x64-msvc@16.3.2": version "16.3.2" resolved "https://registry.npmjs.org/@nx/nx-win32-x64-msvc/-/nx-win32-x64-msvc-16.3.2.tgz#2195faaf1fc465c7a89bfdd62323fdd2a5d91f15" integrity sha512-QC0sWrfQm0/WdvvM//7UAgm+otbak6bznZ0zawTeqmLBh1hLjNeweyzSVKQEtZtlzDMKpzCVuuwkJq+VKBLvmw== -"@nx/workspace@16.3.2", "@nx/workspace@^16.3.2": - version "16.3.2" - resolved "https://registry.npmjs.org/@nx/workspace/-/workspace-16.3.2.tgz#145d4ee7b909d5b430d7ac9a8043d688a00d017c" - integrity sha512-gFrJEv3+Jn2leu3RKFTakPHY8okI8hjOg8RO4OWA2ZemFXRyh9oIm/xsCsOyqYlGt06eqV2mD3GUun/05z1nhg== +"@nx/nx-win32-x64-msvc@16.5.2": + version "16.5.2" + resolved "https://registry.npmjs.org/@nx/nx-win32-x64-msvc/-/nx-win32-x64-msvc-16.5.2.tgz#6ae96b6a90924daba81350863da4f9d12884fe8e" + integrity sha512-bKSMElhzP37MkzWQ/Y12pQlesZ6TxwOOqwoaK/vHe6ZtxPxvG2+U8tQ21Nw5L3KyrDCnU5MJHGFtQVHHHt5MwA== + +"@nx/workspace@16.5.2", "@nx/workspace@^16.5.1": + version "16.5.2" + resolved "https://registry.npmjs.org/@nx/workspace/-/workspace-16.5.2.tgz#7d8b84550c51bc3bebc2e6e701fd41a5995fcbca" + integrity sha512-j+EUQW0q2AtYmd1lWxnVJzzGHWbHbdjkV4b6VYG839CaK0+mWZ/t4EYzpGn7m4WU8rmyxh9YwU8uAl2nvc1JaQ== dependencies: - "@nrwl/workspace" "16.3.2" - "@nx/devkit" "16.3.2" + "@nrwl/workspace" "16.5.2" + "@nx/devkit" "16.5.2" "@parcel/watcher" "2.0.4" chalk "^4.1.0" chokidar "^3.5.1" @@ -2807,7 +3070,7 @@ ignore "^5.0.4" minimatch "3.0.5" npm-run-path "^4.0.1" - nx "16.3.2" + nx "16.5.2" open "^8.4.0" rxjs "^7.8.0" tmp "~0.2.1" @@ -3119,6 +3382,11 @@ resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.25.24.tgz#8c7688559979f7079aacaf31aa881c3aa410b718" integrity sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ== +"@sinclair/typebox@^0.27.8": + version "0.27.8" + resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" + integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== + "@sindresorhus/is@^5.2.0": version "5.4.1" resolved "https://registry.npmjs.org/@sindresorhus/is/-/is-5.4.1.tgz#c4383ce702fb90531c3d310506bab89e70427c53" @@ -3324,27 +3592,27 @@ "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@smithy/middleware-endpoint@^1.0.1": - version "1.0.1" - resolved "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-1.0.1.tgz#c1d047bd9de815cd08c5c9de7ed026754f68ac2c" - integrity sha512-XEHPq73PPm0sXul//5MRC8JKDwHTaNjV3myd9FJ5YoUT+QMJ27gqiwwAMVASJ6vC4ELHzgQdmoTZxVX83Jx17w== +"@smithy/middleware-endpoint@^1.0.2": + version "1.0.3" + resolved "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-1.0.3.tgz#ff4b1c0a83eb8d8b8d3937f434a95efbbf43e1cd" + integrity sha512-GsWvTXMFjSgl617PCE2km//kIjjtvMRrR2GAuRDIS9sHiLwmkS46VWaVYy+XE7ubEsEtzZ5yK2e8TKDR6Qr5Lw== dependencies: - "@smithy/middleware-serde" "^1.0.1" - "@smithy/types" "^1.1.0" - "@smithy/url-parser" "^1.0.1" - "@smithy/util-middleware" "^1.0.1" + "@smithy/middleware-serde" "^1.0.2" + "@smithy/types" "^1.1.1" + "@smithy/url-parser" "^1.0.2" + "@smithy/util-middleware" "^1.0.2" tslib "^2.5.0" -"@smithy/middleware-retry@^1.0.1", "@smithy/middleware-retry@^1.0.2": - version "1.0.2" - resolved "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-1.0.2.tgz#2033f82fdbd210efe70f5a35b761b13fe570d7b2" - integrity sha512-Osj+XsqJ67RuX1MLc3+7LDtlRz8eNVqr/Pim9yPAjRa03Xberu6ST3a3oV3NqRpcUgMTifxuaKVIciuPE3rTWA== - dependencies: - "@smithy/protocol-http" "^1.1.0" - "@smithy/service-error-classification" "^1.0.1" - "@smithy/types" "^1.1.0" - "@smithy/util-middleware" "^1.0.1" - "@smithy/util-retry" "^1.0.2" +"@smithy/middleware-retry@^1.0.3": + version "1.0.4" + resolved "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-1.0.4.tgz#8e9de0713dac7f7af405477d46bd4525ca7b9ea8" + integrity sha512-G7uRXGFL8c3F7APnoIMTtNAHH8vT4F2qVnAWGAZaervjupaUQuRRHYBLYubK0dWzOZz86BtAXKieJ5p+Ni2Xpg== + dependencies: + "@smithy/protocol-http" "^1.1.1" + "@smithy/service-error-classification" "^1.0.3" + "@smithy/types" "^1.1.1" + "@smithy/util-middleware" "^1.0.2" + "@smithy/util-retry" "^1.0.4" tslib "^2.5.0" uuid "^8.3.2" @@ -3356,6 +3624,14 @@ "@smithy/types" "^1.1.0" tslib "^2.5.0" +"@smithy/middleware-serde@^1.0.2": + version "1.0.2" + resolved "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-1.0.2.tgz#87b3a0211602ae991d9b756893eb6bf2e3e5f711" + integrity sha512-T4PcdMZF4xme6koUNfjmSZ1MLi7eoFeYCtodQNQpBNsS77TuJt1A6kt5kP/qxrTvfZHyFlj0AubACoaUqgzPeg== + dependencies: + "@smithy/types" "^1.1.1" + tslib "^2.5.0" + "@smithy/middleware-stack@^1.0.1": version "1.0.1" resolved "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-1.0.1.tgz#cfa8de79ca8bc09fc3c266a0e0241c639b571870" @@ -3373,7 +3649,7 @@ "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@smithy/node-http-handler@^1.0.1", "@smithy/node-http-handler@^1.0.2": +"@smithy/node-http-handler@^1.0.2": version "1.0.2" resolved "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-1.0.2.tgz#fe27a3a5d83874a23d24c29cd2bf0258a5e4730b" integrity sha512-PzPrGRSt3kNuruLCeR4ffJp57ZLVnIukMXVL3Ppr65ZoxiE+HBsOVAa/Z/T+4HzjCM6RaXnnmB8YKfsDjlb0iA== @@ -3392,7 +3668,7 @@ "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@smithy/protocol-http@^1.0.1", "@smithy/protocol-http@^1.1.0": +"@smithy/protocol-http@^1.1.0": version "1.1.0" resolved "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-1.1.0.tgz#caf22e01cb825d7490a4915e03d6fa64954ff535" integrity sha512-H5y/kZOqfJSqRkwtcAoVbqONmhdXwSgYNJ1Glk5Ry8qlhVVy5qUzD9EklaCH8/XLnoCsLO/F/Giee8MIvaBRkg== @@ -3400,6 +3676,14 @@ "@smithy/types" "^1.1.0" tslib "^2.5.0" +"@smithy/protocol-http@^1.1.1": + version "1.1.1" + resolved "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-1.1.1.tgz#10977cf71631eed4f5ad1845408920238d52cdba" + integrity sha512-mFLFa2sSvlUxm55U7B4YCIsJJIMkA6lHxwwqOaBkral1qxFz97rGffP/mmd4JDuin1EnygiO5eNJGgudiUgmDQ== + dependencies: + "@smithy/types" "^1.1.1" + tslib "^2.5.0" + "@smithy/querystring-builder@^1.0.1": version "1.0.1" resolved "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-1.0.1.tgz#c8e9ca45c072763ad34b34a4aaf6a85eb37eafd3" @@ -3417,10 +3701,18 @@ "@smithy/types" "^1.1.0" tslib "^2.5.0" -"@smithy/service-error-classification@^1.0.1": - version "1.0.1" - resolved "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-1.0.1.tgz#a8528087b5ac02ef7e0cd2190bed8399b78efa47" - integrity sha512-EcFVOHFv4YZHUrJ6161tpPKXNlQsTAQKoKorODxuOQW1my14mgoyiiMXrlnSMaYRF//oaONYfFOQ2EMAUTC5DQ== +"@smithy/querystring-parser@^1.0.2": + version "1.0.2" + resolved "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-1.0.2.tgz#559d09c46b21e6fbda71e95deda4bcd8a46bdecc" + integrity sha512-IWxwxjn+KHWRRRB+K2Ngl+plTwo2WSgc2w+DvLy0DQZJh9UGOpw40d6q97/63GBlXIt4TEt5NbcFrO30CKlrsA== + dependencies: + "@smithy/types" "^1.1.1" + tslib "^2.5.0" + +"@smithy/service-error-classification@^1.0.3": + version "1.0.3" + resolved "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-1.0.3.tgz#c620c1562610d3351985eb6dd04262ca2657ae67" + integrity sha512-2eglIYqrtcUnuI71yweu7rSfCgt6kVvRVf0C72VUqrd0LrV1M0BM0eYN+nitp2CHPSdmMI96pi+dU9U/UqAMSA== "@smithy/shared-ini-file-loader@^1.0.1": version "1.0.1" @@ -3444,7 +3736,7 @@ "@smithy/util-utf8" "^1.0.1" tslib "^2.5.0" -"@smithy/smithy-client@^1.0.2", "@smithy/smithy-client@^1.0.3": +"@smithy/smithy-client@^1.0.3": version "1.0.3" resolved "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-1.0.3.tgz#f31bf64fc4a21fc42171120635e6af2b58dabc22" integrity sha512-Wh1mNP/1yUZK0uYkgCQ6NMxpBT3Fmc45TMdUfOlH1xD2zGYL7U4yDHFOhEZdi/suyjaelFobXB2p9pPIw6LjRQ== @@ -3454,13 +3746,20 @@ "@smithy/util-stream" "^1.0.1" tslib "^2.5.0" -"@smithy/types@^1.0.0", "@smithy/types@^1.1.0": +"@smithy/types@^1.1.0": version "1.1.0" resolved "https://registry.npmjs.org/@smithy/types/-/types-1.1.0.tgz#f30a23202c97634cca5c1ac955a9bf149c955226" integrity sha512-KzmvisMmuwD2jZXuC9e65JrgsZM97y5NpDU7g347oB+Q+xQLU6hQZ5zFNNbEfwwOJHoOvEVTna+dk1h/lW7alw== dependencies: tslib "^2.5.0" +"@smithy/types@^1.1.1": + version "1.1.1" + resolved "https://registry.npmjs.org/@smithy/types/-/types-1.1.1.tgz#949394a22e13e7077471bae0d18c146e5f62c456" + integrity sha512-tMpkreknl2gRrniHeBtdgQwaOlo39df8RxSrwsHVNIGXULy5XP6KqgScUw2m12D15wnJCKWxVhCX+wbrBW/y7g== + dependencies: + tslib "^2.5.0" + "@smithy/url-parser@^1.0.1": version "1.0.1" resolved "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-1.0.1.tgz#a7e52ebb4c8c1d19aa47397b7d78ebcdf767013a" @@ -3470,6 +3769,15 @@ "@smithy/types" "^1.1.0" tslib "^2.5.0" +"@smithy/url-parser@^1.0.2": + version "1.0.2" + resolved "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-1.0.2.tgz#fb59be6f2283399443d9e7afe08ebf63b3c266bb" + integrity sha512-0JRsDMQe53F6EHRWksdcavKDRjyqp8vrjakg8EcCUOa7PaFRRB1SO/xGZdzSlW1RSTWQDEksFMTCEcVEKmAoqA== + dependencies: + "@smithy/querystring-parser" "^1.0.2" + "@smithy/types" "^1.1.1" + tslib "^2.5.0" + "@smithy/util-base64@^1.0.1": version "1.0.1" resolved "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-1.0.1.tgz#69f682a542ca57ffb732da6f2e9309d238d52d84" @@ -3543,12 +3851,19 @@ dependencies: tslib "^2.5.0" -"@smithy/util-retry@^1.0.1", "@smithy/util-retry@^1.0.2": +"@smithy/util-middleware@^1.0.2": version "1.0.2" - resolved "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-1.0.2.tgz#404ab400d3a1027acd3649b031f4108c148f10ba" - integrity sha512-LqzAy1QzeAHpSZpsd2LtKZRbco7F5gF+Zpoa4TuuFq9f+CGmH6OuTCIN3I13LPEBa4zs2AgvGnXljvMbUw5WGw== + resolved "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-1.0.2.tgz#c3d4c7a6cd31bde33901e54abd7700c8ca73dab3" + integrity sha512-vtXK7GOR2BoseCX8NCGe9SaiZrm9M2lm/RVexFGyPuafTtry9Vyv7hq/vw8ifd/G/pSJ+msByfJVb1642oQHKw== dependencies: - "@smithy/service-error-classification" "^1.0.1" + tslib "^2.5.0" + +"@smithy/util-retry@^1.0.3", "@smithy/util-retry@^1.0.4": + version "1.0.4" + resolved "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-1.0.4.tgz#9d95df3884981414163d5f780d38e3529384d9ad" + integrity sha512-RnZPVFvRoqdj2EbroDo3OsnnQU8eQ4AlnZTOGusbYKybH3269CFdrZfZJloe60AQjX7di3J6t/79PjwCLO5Khw== + dependencies: + "@smithy/service-error-classification" "^1.0.3" tslib "^2.5.0" "@smithy/util-stream@^1.0.1": @@ -3646,7 +3961,7 @@ dependencies: "@types/readdir-glob" "*" -"@types/aws-lambda@^8.10.115": +"@types/aws-lambda@^8.10.119": version "8.10.119" resolved "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.119.tgz#aaf010a9c892b3e29a290e5c49bfe8bcec82c455" integrity sha512-Vqm22aZrCvCd6I5g1SvpW151jfqwTzEZ7XJ3yZ6xaZG31nUEOEyzzVImjRcsN8Wi/QyPxId/x8GTtgIbsy8kEw== @@ -3763,10 +4078,10 @@ expect "^28.0.0" pretty-format "^28.0.0" -"@types/jest@^29.5.1": - version "29.5.2" - resolved "https://registry.npmjs.org/@types/jest/-/jest-29.5.2.tgz#86b4afc86e3a8f3005b297ed8a72494f89e6395b" - integrity sha512-mSoZVJF5YzGVCk+FsDxzDuH7s+SCkzrgKZzf0Z0T2WudhBUPoF6ktoTPC4R0ZoCPCV5xUvuU6ias5NvxcBcMMg== +"@types/jest@^29.5.1", "@types/jest@^29.5.3": + version "29.5.3" + resolved "https://registry.npmjs.org/@types/jest/-/jest-29.5.3.tgz#7a35dc0044ffb8b56325c6802a4781a626b05777" + integrity sha512-1Nq7YrO/vJE/FYnqYyw0FS8LdrjExSgIiHyKg7xPpn+yi8Q4huZryKnkJatN1ZRH89Kw2v33/8ZMB7DuZeSLlA== dependencies: expect "^29.0.0" pretty-format "^29.0.0" @@ -3786,7 +4101,7 @@ resolved "https://registry.npmjs.org/@types/license-checker/-/license-checker-25.0.3.tgz#fbe80df33f1ac9d4bc2d4c167da3c2fd2999eb73" integrity sha512-sFkIgeXh6HJR79DbTrZrsHWhfyr3q8v2Gswj3y0tRPEo57OEPVgDF/z/ePybHUGuSCwiDiAt/3YMta9ujUxQpQ== -"@types/lodash@^4.14.194": +"@types/lodash@^4.14.195": version "4.14.195" resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.195.tgz#bafc975b252eb6cea78882ce8a7b6bf22a6de632" integrity sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg== @@ -3835,7 +4150,7 @@ resolved "https://registry.npmjs.org/@types/mockery/-/mockery-1.4.30.tgz#25f07fa7340371c7ee0fb9239511a34e0a19d5b7" integrity sha512-uv53RrNdhbkV/3VmVCtfImfYCWC3GTTRn3R11Whni3EJ+gb178tkZBVNj2edLY5CMrB749dQi+SJkg87jsN8UQ== -"@types/node-fetch@^2.6.2": +"@types/node-fetch@^2.6.4": version "2.6.4" resolved "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.4.tgz#1bc3a26de814f6bf466b25aeb1473fa1afe6a660" integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg== @@ -4005,7 +4320,7 @@ dependencies: "@types/yargs-parser" "*" -"@types/yarnpkg__lockfile@^1.1.5": +"@types/yarnpkg__lockfile@^1.1.6": version "1.1.6" resolved "https://registry.npmjs.org/@types/yarnpkg__lockfile/-/yarnpkg__lockfile-1.1.6.tgz#60a35ede6197d8cbedd5bb8393f3921e8d56d44b" integrity sha512-kbdQa3J+hVCkqmGQm31fthEwGxszZtepw84p9QGCiJB7TmiPqPAf3/g9eZUnkCeanmiFOaG4pVhiPDyqJxaoaw== @@ -4174,6 +4489,14 @@ resolved "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== +"@yarnpkg/parsers@3.0.0-rc.46": + version "3.0.0-rc.46" + resolved "https://registry.npmjs.org/@yarnpkg/parsers/-/parsers-3.0.0-rc.46.tgz#03f8363111efc0ea670e53b0282cd3ef62de4e01" + integrity sha512-aiATs7pSutzda/rq8fnuPwTglyVwjM22bNnK2ZgjrpAjQHSSl3lztd2f9evst1W/qnC58DRz7T7QndUDumAR4Q== + dependencies: + js-yaml "^3.10.0" + tslib "^2.4.0" + "@yarnpkg/parsers@^3.0.0-rc.18": version "3.0.0-rc.45" resolved "https://registry.npmjs.org/@yarnpkg/parsers/-/parsers-3.0.0-rc.45.tgz#fcc7d0ab7828afdb20d1e13160b1d117c07536f4" @@ -4587,7 +4910,7 @@ aws-sdk-mock@5.8.0: sinon "^14.0.1" traverse "^0.6.6" -aws-sdk@^2.1231.0, aws-sdk@^2.1379.0, aws-sdk@^2.928.0: +aws-sdk@^2.1231.0, aws-sdk@^2.928.0: version "2.1401.0" resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1401.0.tgz#c283de69b9beb76a39243d1331c63c21f0ff5a0e" integrity sha512-qzuMxIvCmH1Df194sYn+L5yDrChIKzZG/fBLElPVSN1fB18qhPSYUfr9uVCMeTpDCmdTW1Ojk7cAkByzzAnKjA== @@ -4603,6 +4926,22 @@ aws-sdk@^2.1231.0, aws-sdk@^2.1379.0, aws-sdk@^2.928.0: uuid "8.0.0" xml2js "0.5.0" +aws-sdk@^2.1414.0: + version "2.1415.0" + resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1415.0.tgz#e21e96252f3f8bf5ccf28731bb9d0343d8bcf5b1" + integrity sha512-tJneWCa1IZnw+pn3AwjE+3u8oGSlMMk6mCkA/7BOqe+n9shLLymwPfmxeCxtArBmBzg8m74vkoEYh5tm8Eo/gw== + dependencies: + buffer "4.9.2" + events "1.1.1" + ieee754 "1.1.13" + jmespath "0.16.0" + querystring "0.2.0" + sax "1.2.1" + url "0.10.3" + util "^0.12.4" + uuid "8.0.0" + xml2js "0.5.0" + axios@^0.27.2: version "0.27.2" resolved "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" @@ -4633,6 +4972,19 @@ babel-jest@^29.5.0: graceful-fs "^4.2.9" slash "^3.0.0" +babel-jest@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/babel-jest/-/babel-jest-29.6.1.tgz#a7141ad1ed5ec50238f3cd36127636823111233a" + integrity sha512-qu+3bdPEQC6KZSPz+4Fyjbga5OODNcp49j6GKzG1EKbkfyJBxEYGVUmVGpwCSeGouG52R4EgYMLb6p9YeEEQ4A== + dependencies: + "@jest/transform" "^29.6.1" + "@types/babel__core" "^7.1.14" + babel-plugin-istanbul "^6.1.1" + babel-preset-jest "^29.5.0" + chalk "^4.0.0" + graceful-fs "^4.2.9" + slash "^3.0.0" + babel-plugin-istanbul@^6.1.1: version "6.1.1" resolved "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" @@ -4994,21 +5346,21 @@ cdk-generate-synthetic-examples@^0.1.291: jsii-rosetta "^1.84.0" yargs "^17.7.2" -cdk8s-plus-24@2.7.31: - version "2.7.31" - resolved "https://registry.npmjs.org/cdk8s-plus-24/-/cdk8s-plus-24-2.7.31.tgz#c5547b916af4a840d9373c03e86cda9fca81fbf3" - integrity sha512-3bs2WUHZCz5nPSoLtfdfdRUzAlMlQadLS4CjJd/V3h4PkFKIq+rSXT1HvCUoRWpORF177/PlbKEz52PbsVB+Fw== +cdk8s-plus-24@2.8.85: + version "2.8.85" + resolved "https://registry.npmjs.org/cdk8s-plus-24/-/cdk8s-plus-24-2.8.85.tgz#80540d7368527a98a94f9ebb3faf6da7d8c3ff85" + integrity sha512-b7/RiDeLA0oQGeUZRUgRrS5yppkcDBThWKO+23Z859QBjbhsKlFoqbHt3fdzLzPLTbOcBfyinsZYEOqBJx1GuQ== dependencies: minimatch "^3.1.2" -cdk8s@^2.7.68: - version "2.7.80" - resolved "https://registry.npmjs.org/cdk8s/-/cdk8s-2.7.80.tgz#5559d45a4a680c07764c810f0c3ace4e1e368fa1" - integrity sha512-4RLvU7uU5TSSTIhnKSTjjxFKs38N6omALHOQaeBnFQ2cc/Q/ti76rEoJ/QyLKmUYaJtzaJktfok7EI3oJPN/IQ== +cdk8s@^2.7.102: + version "2.7.108" + resolved "https://registry.npmjs.org/cdk8s/-/cdk8s-2.7.108.tgz#da5f7348b0cd731da1f5603a3d022543c2ae181b" + integrity sha512-39aX28Erex2BtmqOavw+0Cm+Ks2oxKhMyp6LQTEU5klsI2wbX3LvxrRL3Qt0uHdqFcKeXXxyiab64zvTOVjfTw== dependencies: fast-json-patch "^3.1.1" follow-redirects "^1.15.2" - yaml "2.2.2" + yaml "2.3.1" optionalDependencies: backport "8.5.0" @@ -5230,16 +5582,7 @@ co@^4.6.0: resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== -codemaker@1.81.0: - version "1.81.0" - resolved "https://registry.npmjs.org/codemaker/-/codemaker-1.81.0.tgz#389d9d90c62f1a3a498504fdedd0452141603688" - integrity sha512-gkvKT2ljySlEy9w+TVfsgJCfLlMh8wOkvWsbMfTx/yDqahorSi8rnnncXnhUrsb8iEM7HV1V0qGCZ4RgTQe2IQ== - dependencies: - camelcase "^6.3.0" - decamelize "^5.0.1" - fs-extra "^10.1.0" - -codemaker@^1.82.0: +codemaker@1.84.0, codemaker@^1.84.0: version "1.84.0" resolved "https://registry.npmjs.org/codemaker/-/codemaker-1.84.0.tgz#da95dc297fc4be657baa49fdc3127ce1f057c6f3" integrity sha512-sOUH3y2q2DEO+gDiBCCoGgkDs8aMY0LTMH0FmHbKpqReZwWDAmWJ0Voc4Thp4Mn380bPku9/ncqyY1a3MZnfEQ== @@ -5326,7 +5669,7 @@ combined-stream@^1.0.8: dependencies: delayed-stream "~1.0.0" -commander@^10.0.0, commander@~10.0.1: +commander@^10.0.0: version "10.0.1" resolved "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== @@ -5341,6 +5684,11 @@ commander@^7.2.0: resolved "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== +commander@~11.0.0: + version "11.0.0" + resolved "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz#43e19c25dbedc8256203538e8d7e9346877a6f67" + integrity sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ== + comment-json@4.2.2: version "4.2.2" resolved "https://registry.npmjs.org/comment-json/-/comment-json-4.2.2.tgz#5fae70a94e0c8f84a077bd31df5aa5269252f293" @@ -6389,33 +6737,33 @@ es6-weak-map@^2.0.3: es6-iterator "^2.0.3" es6-symbol "^3.1.1" -esbuild@^0.17.19: - version "0.17.19" - resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz#087a727e98299f0462a3d0bcdd9cd7ff100bd955" - integrity sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw== +esbuild@^0.18.11: + version "0.18.13" + resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.18.13.tgz#59160add6c3420947fe008238140ed3480baf817" + integrity sha512-vhg/WR/Oiu4oUIkVhmfcc23G6/zWuEQKFS+yiosSHe4aN6+DQRXIfeloYGibIfVhkr4wyfuVsGNLr+sQU1rWWw== optionalDependencies: - "@esbuild/android-arm" "0.17.19" - "@esbuild/android-arm64" "0.17.19" - "@esbuild/android-x64" "0.17.19" - "@esbuild/darwin-arm64" "0.17.19" - "@esbuild/darwin-x64" "0.17.19" - "@esbuild/freebsd-arm64" "0.17.19" - "@esbuild/freebsd-x64" "0.17.19" - "@esbuild/linux-arm" "0.17.19" - "@esbuild/linux-arm64" "0.17.19" - "@esbuild/linux-ia32" "0.17.19" - "@esbuild/linux-loong64" "0.17.19" - "@esbuild/linux-mips64el" "0.17.19" - "@esbuild/linux-ppc64" "0.17.19" - "@esbuild/linux-riscv64" "0.17.19" - "@esbuild/linux-s390x" "0.17.19" - "@esbuild/linux-x64" "0.17.19" - "@esbuild/netbsd-x64" "0.17.19" - "@esbuild/openbsd-x64" "0.17.19" - "@esbuild/sunos-x64" "0.17.19" - "@esbuild/win32-arm64" "0.17.19" - "@esbuild/win32-ia32" "0.17.19" - "@esbuild/win32-x64" "0.17.19" + "@esbuild/android-arm" "0.18.13" + "@esbuild/android-arm64" "0.18.13" + "@esbuild/android-x64" "0.18.13" + "@esbuild/darwin-arm64" "0.18.13" + "@esbuild/darwin-x64" "0.18.13" + "@esbuild/freebsd-arm64" "0.18.13" + "@esbuild/freebsd-x64" "0.18.13" + "@esbuild/linux-arm" "0.18.13" + "@esbuild/linux-arm64" "0.18.13" + "@esbuild/linux-ia32" "0.18.13" + "@esbuild/linux-loong64" "0.18.13" + "@esbuild/linux-mips64el" "0.18.13" + "@esbuild/linux-ppc64" "0.18.13" + "@esbuild/linux-riscv64" "0.18.13" + "@esbuild/linux-s390x" "0.18.13" + "@esbuild/linux-x64" "0.18.13" + "@esbuild/netbsd-x64" "0.18.13" + "@esbuild/openbsd-x64" "0.18.13" + "@esbuild/sunos-x64" "0.18.13" + "@esbuild/win32-arm64" "0.18.13" + "@esbuild/win32-ia32" "0.18.13" + "@esbuild/win32-x64" "0.18.13" escalade@^3.1.1: version "3.1.1" @@ -6784,6 +7132,18 @@ expect@^29.0.0, expect@^29.5.0: jest-message-util "^29.5.0" jest-util "^29.5.0" +expect@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/expect/-/expect-29.6.1.tgz#64dd1c8f75e2c0b209418f2b8d36a07921adfdf1" + integrity sha512-XEdDLonERCU1n9uR56/Stx9OqojaLAQtZf9PrCHH9Hl8YXiEIka3H4NXJ3NOIBmQJTg7+j7buh34PMHfJujc8g== + dependencies: + "@jest/expect-utils" "^29.6.1" + "@types/node" "*" + jest-get-type "^29.4.3" + jest-matcher-utils "^29.6.1" + jest-message-util "^29.6.1" + jest-util "^29.6.1" + exponential-backoff@^3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.1.tgz#64ac7526fe341ab18a39016cd22c787d01e00bf6" @@ -6839,6 +7199,17 @@ fast-glob@^3.2.12, fast-glob@^3.2.9: merge2 "^1.3.0" micromatch "^4.0.4" +fast-glob@^3.3.0: + version "3.3.0" + resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz#7c40cb491e1e2ed5664749e87bfb516dbe8727c0" + integrity sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + fast-json-patch@^3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-3.1.1.tgz#85064ea1b1ebf97a3f7ad01e23f9337e72c66947" @@ -7394,7 +7765,7 @@ glob@7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^10.2.2, glob@^10.2.5, glob@~10.2.2: +glob@^10.2.2, glob@^10.2.5, glob@~10.2.7: version "10.2.7" resolved "https://registry.npmjs.org/glob/-/glob-10.2.7.tgz#9dd2828cd5bc7bd861e7738d91e7113dda41d7d8" integrity sha512-jTKehsravOJo8IJxUGfZILnkvVJM/MOfHRs8QcXolVef2zNI9Tqyy5+SeuOAZd3upViEZQLyFpQhYiHLrMUNmA== @@ -8417,6 +8788,32 @@ jest-circus@^29.5.0: slash "^3.0.0" stack-utils "^2.0.3" +jest-circus@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest-circus/-/jest-circus-29.6.1.tgz#861dab37e71a89907d1c0fabc54a0019738ed824" + integrity sha512-tPbYLEiBU4MYAL2XoZme/bgfUeotpDBd81lgHLCbDZZFaGmECk0b+/xejPFtmiBP87GgP/y4jplcRpbH+fgCzQ== + dependencies: + "@jest/environment" "^29.6.1" + "@jest/expect" "^29.6.1" + "@jest/test-result" "^29.6.1" + "@jest/types" "^29.6.1" + "@types/node" "*" + chalk "^4.0.0" + co "^4.6.0" + dedent "^0.7.0" + is-generator-fn "^2.0.0" + jest-each "^29.6.1" + jest-matcher-utils "^29.6.1" + jest-message-util "^29.6.1" + jest-runtime "^29.6.1" + jest-snapshot "^29.6.1" + jest-util "^29.6.1" + p-limit "^3.1.0" + pretty-format "^29.6.1" + pure-rand "^6.0.0" + slash "^3.0.0" + stack-utils "^2.0.3" + jest-cli@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-cli/-/jest-cli-29.5.0.tgz#b34c20a6d35968f3ee47a7437ff8e53e086b4a67" @@ -8435,6 +8832,24 @@ jest-cli@^29.5.0: prompts "^2.0.1" yargs "^17.3.1" +jest-cli@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest-cli/-/jest-cli-29.6.1.tgz#99d9afa7449538221c71f358f0fdd3e9c6e89f72" + integrity sha512-607dSgTA4ODIN6go9w6xY3EYkyPFGicx51a69H7yfvt7lN53xNswEVLovq+E77VsTRi5fWprLH0yl4DJgE8Ing== + dependencies: + "@jest/core" "^29.6.1" + "@jest/test-result" "^29.6.1" + "@jest/types" "^29.6.1" + chalk "^4.0.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + import-local "^3.0.2" + jest-config "^29.6.1" + jest-util "^29.6.1" + jest-validate "^29.6.1" + prompts "^2.0.1" + yargs "^17.3.1" + jest-config@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-config/-/jest-config-29.5.0.tgz#3cc972faec8c8aaea9ae158c694541b79f3748da" @@ -8463,6 +8878,34 @@ jest-config@^29.5.0: slash "^3.0.0" strip-json-comments "^3.1.1" +jest-config@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest-config/-/jest-config-29.6.1.tgz#d785344509065d53a238224c6cdc0ed8e2f2f0dd" + integrity sha512-XdjYV2fy2xYixUiV2Wc54t3Z4oxYPAELUzWnV6+mcbq0rh742X2p52pii5A3oeRzYjLnQxCsZmp0qpI6klE2cQ== + dependencies: + "@babel/core" "^7.11.6" + "@jest/test-sequencer" "^29.6.1" + "@jest/types" "^29.6.1" + babel-jest "^29.6.1" + chalk "^4.0.0" + ci-info "^3.2.0" + deepmerge "^4.2.2" + glob "^7.1.3" + graceful-fs "^4.2.9" + jest-circus "^29.6.1" + jest-environment-node "^29.6.1" + jest-get-type "^29.4.3" + jest-regex-util "^29.4.3" + jest-resolve "^29.6.1" + jest-runner "^29.6.1" + jest-util "^29.6.1" + jest-validate "^29.6.1" + micromatch "^4.0.4" + parse-json "^5.2.0" + pretty-format "^29.6.1" + slash "^3.0.0" + strip-json-comments "^3.1.1" + "jest-diff@>=29.4.3 < 30", jest-diff@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-29.5.0.tgz#e0d83a58eb5451dcc1fa61b1c3ee4e8f5a290d63" @@ -8483,6 +8926,16 @@ jest-diff@^28.1.3: jest-get-type "^28.0.2" pretty-format "^28.1.3" +jest-diff@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-29.6.1.tgz#13df6db0a89ee6ad93c747c75c85c70ba941e545" + integrity sha512-FsNCvinvl8oVxpNLttNQX7FAq7vR+gMDGj90tiP7siWw1UdakWUGqrylpsYrpvj908IYckm5Y0Q7azNAozU1Kg== + dependencies: + chalk "^4.0.0" + diff-sequences "^29.4.3" + jest-get-type "^29.4.3" + pretty-format "^29.6.1" + jest-docblock@^29.4.3: version "29.4.3" resolved "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.4.3.tgz#90505aa89514a1c7dceeac1123df79e414636ea8" @@ -8501,6 +8954,17 @@ jest-each@^29.5.0: jest-util "^29.5.0" pretty-format "^29.5.0" +jest-each@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest-each/-/jest-each-29.6.1.tgz#975058e5b8f55c6780beab8b6ab214921815c89c" + integrity sha512-n5eoj5eiTHpKQCAVcNTT7DRqeUmJ01hsAL0Q1SMiBHcBcvTKDELixQOGMCpqhbIuTcfC4kMfSnpmDqRgRJcLNQ== + dependencies: + "@jest/types" "^29.6.1" + chalk "^4.0.0" + jest-get-type "^29.4.3" + jest-util "^29.6.1" + pretty-format "^29.6.1" + jest-environment-node@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.5.0.tgz#f17219d0f0cc0e68e0727c58b792c040e332c967" @@ -8513,6 +8977,18 @@ jest-environment-node@^29.5.0: jest-mock "^29.5.0" jest-util "^29.5.0" +jest-environment-node@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.6.1.tgz#08a122dece39e58bc388da815a2166c58b4abec6" + integrity sha512-ZNIfAiE+foBog24W+2caIldl4Irh8Lx1PUhg/GZ0odM1d/h2qORAsejiFc7zb+SEmYPn1yDZzEDSU5PmDkmVLQ== + dependencies: + "@jest/environment" "^29.6.1" + "@jest/fake-timers" "^29.6.1" + "@jest/types" "^29.6.1" + "@types/node" "*" + jest-mock "^29.6.1" + jest-util "^29.6.1" + jest-get-type@^28.0.2: version "28.0.2" resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-28.0.2.tgz#34622e628e4fdcd793d46db8a242227901fcf203" @@ -8542,6 +9018,25 @@ jest-haste-map@^29.5.0: optionalDependencies: fsevents "^2.3.2" +jest-haste-map@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.6.1.tgz#62655c7a1c1b349a3206441330fb2dbdb4b63803" + integrity sha512-0m7f9PZXxOCk1gRACiVgX85knUKPKLPg4oRCjLoqIm9brTHXaorMA0JpmtmVkQiT8nmXyIVoZd/nnH1cfC33ig== + dependencies: + "@jest/types" "^29.6.1" + "@types/graceful-fs" "^4.1.3" + "@types/node" "*" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.9" + jest-regex-util "^29.4.3" + jest-util "^29.6.1" + jest-worker "^29.6.1" + micromatch "^4.0.4" + walker "^1.0.8" + optionalDependencies: + fsevents "^2.3.2" + jest-junit@^13, jest-junit@^13.2.0: version "13.2.0" resolved "https://registry.npmjs.org/jest-junit/-/jest-junit-13.2.0.tgz#66eeb86429aafac8c1745a70f44ace185aacb943" @@ -8570,6 +9065,14 @@ jest-leak-detector@^29.5.0: jest-get-type "^29.4.3" pretty-format "^29.5.0" +jest-leak-detector@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.6.1.tgz#66a902c81318e66e694df7d096a95466cb962f8e" + integrity sha512-OrxMNyZirpOEwkF3UHnIkAiZbtkBWiye+hhBweCHkVbCgyEy71Mwbb5zgeTNYWJBi1qgDVfPC1IwO9dVEeTLwQ== + dependencies: + jest-get-type "^29.4.3" + pretty-format "^29.6.1" + jest-matcher-utils@^28.1.3: version "28.1.3" resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-28.1.3.tgz#5a77f1c129dd5ba3b4d7fc20728806c78893146e" @@ -8590,6 +9093,16 @@ jest-matcher-utils@^29.5.0: jest-get-type "^29.4.3" pretty-format "^29.5.0" +jest-matcher-utils@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.6.1.tgz#6c60075d84655d6300c5d5128f46531848160b53" + integrity sha512-SLaztw9d2mfQQKHmJXKM0HCbl2PPVld/t9Xa6P9sgiExijviSp7TnZZpw2Fpt+OI3nwUO/slJbOfzfUMKKC5QA== + dependencies: + chalk "^4.0.0" + jest-diff "^29.6.1" + jest-get-type "^29.4.3" + pretty-format "^29.6.1" + jest-message-util@^28.1.3: version "28.1.3" resolved "https://registry.npmjs.org/jest-message-util/-/jest-message-util-28.1.3.tgz#232def7f2e333f1eecc90649b5b94b0055e7c43d" @@ -8620,6 +9133,21 @@ jest-message-util@^29.5.0: slash "^3.0.0" stack-utils "^2.0.3" +jest-message-util@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.6.1.tgz#d0b21d87f117e1b9e165e24f245befd2ff34ff8d" + integrity sha512-KoAW2zAmNSd3Gk88uJ56qXUWbFk787QKmjjJVOjtGFmmGSZgDBrlIL4AfQw1xyMYPNVD7dNInfIbur9B2rd/wQ== + dependencies: + "@babel/code-frame" "^7.12.13" + "@jest/types" "^29.6.1" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.9" + micromatch "^4.0.4" + pretty-format "^29.6.1" + slash "^3.0.0" + stack-utils "^2.0.3" + jest-mock@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-mock/-/jest-mock-29.5.0.tgz#26e2172bcc71d8b0195081ff1f146ac7e1518aed" @@ -8629,6 +9157,15 @@ jest-mock@^29.5.0: "@types/node" "*" jest-util "^29.5.0" +jest-mock@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest-mock/-/jest-mock-29.6.1.tgz#049ee26aea8cbf54c764af649070910607316517" + integrity sha512-brovyV9HBkjXAEdRooaTQK42n8usKoSRR3gihzUpYeV/vwqgSoNfrksO7UfSACnPmxasO/8TmHM3w9Hp3G1dgw== + dependencies: + "@jest/types" "^29.6.1" + "@types/node" "*" + jest-util "^29.6.1" + jest-pnp-resolver@^1.2.2: version "1.2.3" resolved "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" @@ -8647,6 +9184,14 @@ jest-resolve-dependencies@^29.5.0: jest-regex-util "^29.4.3" jest-snapshot "^29.5.0" +jest-resolve-dependencies@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.1.tgz#b85b06670f987a62515bbf625d54a499e3d708f5" + integrity sha512-BbFvxLXtcldaFOhNMXmHRWx1nXQO5LoXiKSGQcA1LxxirYceZT6ch8KTE1bK3X31TNG/JbkI7OkS/ABexVahiw== + dependencies: + jest-regex-util "^29.4.3" + jest-snapshot "^29.6.1" + jest-resolve@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.5.0.tgz#b053cc95ad1d5f6327f0ac8aae9f98795475ecdc" @@ -8662,6 +9207,21 @@ jest-resolve@^29.5.0: resolve.exports "^2.0.0" slash "^3.0.0" +jest-resolve@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.6.1.tgz#4c3324b993a85e300add2f8609f51b80ddea39ee" + integrity sha512-AeRkyS8g37UyJiP9w3mmI/VXU/q8l/IH52vj/cDAyScDcemRbSBhfX/NMYIGilQgSVwsjxrCHf3XJu4f+lxCMg== + dependencies: + chalk "^4.0.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.6.1" + jest-pnp-resolver "^1.2.2" + jest-util "^29.6.1" + jest-validate "^29.6.1" + resolve "^1.20.0" + resolve.exports "^2.0.0" + slash "^3.0.0" + jest-runner@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-runner/-/jest-runner-29.5.0.tgz#6a57c282eb0ef749778d444c1d758c6a7693b6f8" @@ -8689,6 +9249,33 @@ jest-runner@^29.5.0: p-limit "^3.1.0" source-map-support "0.5.13" +jest-runner@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest-runner/-/jest-runner-29.6.1.tgz#54557087e7972d345540d622ab5bfc3d8f34688c" + integrity sha512-tw0wb2Q9yhjAQ2w8rHRDxteryyIck7gIzQE4Reu3JuOBpGp96xWgF0nY8MDdejzrLCZKDcp8JlZrBN/EtkQvPQ== + dependencies: + "@jest/console" "^29.6.1" + "@jest/environment" "^29.6.1" + "@jest/test-result" "^29.6.1" + "@jest/transform" "^29.6.1" + "@jest/types" "^29.6.1" + "@types/node" "*" + chalk "^4.0.0" + emittery "^0.13.1" + graceful-fs "^4.2.9" + jest-docblock "^29.4.3" + jest-environment-node "^29.6.1" + jest-haste-map "^29.6.1" + jest-leak-detector "^29.6.1" + jest-message-util "^29.6.1" + jest-resolve "^29.6.1" + jest-runtime "^29.6.1" + jest-util "^29.6.1" + jest-watcher "^29.6.1" + jest-worker "^29.6.1" + p-limit "^3.1.0" + source-map-support "0.5.13" + jest-runtime@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.5.0.tgz#c83f943ee0c1da7eb91fa181b0811ebd59b03420" @@ -8717,6 +9304,34 @@ jest-runtime@^29.5.0: slash "^3.0.0" strip-bom "^4.0.0" +jest-runtime@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.6.1.tgz#8a0fc9274ef277f3d70ba19d238e64334958a0dc" + integrity sha512-D6/AYOA+Lhs5e5il8+5pSLemjtJezUr+8zx+Sn8xlmOux3XOqx4d8l/2udBea8CRPqqrzhsKUsN/gBDE/IcaPQ== + dependencies: + "@jest/environment" "^29.6.1" + "@jest/fake-timers" "^29.6.1" + "@jest/globals" "^29.6.1" + "@jest/source-map" "^29.6.0" + "@jest/test-result" "^29.6.1" + "@jest/transform" "^29.6.1" + "@jest/types" "^29.6.1" + "@types/node" "*" + chalk "^4.0.0" + cjs-module-lexer "^1.0.0" + collect-v8-coverage "^1.0.0" + glob "^7.1.3" + graceful-fs "^4.2.9" + jest-haste-map "^29.6.1" + jest-message-util "^29.6.1" + jest-mock "^29.6.1" + jest-regex-util "^29.4.3" + jest-resolve "^29.6.1" + jest-snapshot "^29.6.1" + jest-util "^29.6.1" + slash "^3.0.0" + strip-bom "^4.0.0" + jest-snapshot@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.5.0.tgz#c9c1ce0331e5b63cd444e2f95a55a73b84b1e8ce" @@ -8746,6 +9361,33 @@ jest-snapshot@^29.5.0: pretty-format "^29.5.0" semver "^7.3.5" +jest-snapshot@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.6.1.tgz#0d083cb7de716d5d5cdbe80d598ed2fbafac0239" + integrity sha512-G4UQE1QQ6OaCgfY+A0uR1W2AY0tGXUPQpoUClhWHq1Xdnx1H6JOrC2nH5lqnOEqaDgbHFgIwZ7bNq24HpB180A== + dependencies: + "@babel/core" "^7.11.6" + "@babel/generator" "^7.7.2" + "@babel/plugin-syntax-jsx" "^7.7.2" + "@babel/plugin-syntax-typescript" "^7.7.2" + "@babel/types" "^7.3.3" + "@jest/expect-utils" "^29.6.1" + "@jest/transform" "^29.6.1" + "@jest/types" "^29.6.1" + "@types/prettier" "^2.1.5" + babel-preset-current-node-syntax "^1.0.0" + chalk "^4.0.0" + expect "^29.6.1" + graceful-fs "^4.2.9" + jest-diff "^29.6.1" + jest-get-type "^29.4.3" + jest-matcher-utils "^29.6.1" + jest-message-util "^29.6.1" + jest-util "^29.6.1" + natural-compare "^1.4.0" + pretty-format "^29.6.1" + semver "^7.5.3" + jest-util@^28.1.3: version "28.1.3" resolved "https://registry.npmjs.org/jest-util/-/jest-util-28.1.3.tgz#f4f932aa0074f0679943220ff9cbba7e497028b0" @@ -8770,6 +9412,18 @@ jest-util@^29.0.0, jest-util@^29.5.0: graceful-fs "^4.2.9" picomatch "^2.2.3" +jest-util@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest-util/-/jest-util-29.6.1.tgz#c9e29a87a6edbf1e39e6dee2b4689b8a146679cb" + integrity sha512-NRFCcjc+/uO3ijUVyNOQJluf8PtGCe/W6cix36+M3cTFgiYqFOOW5MgN4JOOcvbUhcKTYVd1CvHz/LWi8d16Mg== + dependencies: + "@jest/types" "^29.6.1" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" + jest-validate@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-validate/-/jest-validate-29.5.0.tgz#8e5a8f36178d40e47138dc00866a5f3bd9916ffc" @@ -8782,6 +9436,18 @@ jest-validate@^29.5.0: leven "^3.1.0" pretty-format "^29.5.0" +jest-validate@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest-validate/-/jest-validate-29.6.1.tgz#765e684af6e2c86dce950aebefbbcd4546d69f7b" + integrity sha512-r3Ds69/0KCN4vx4sYAbGL1EVpZ7MSS0vLmd3gV78O+NAx3PDQQukRU5hNHPXlyqCgFY8XUk7EuTMLugh0KzahA== + dependencies: + "@jest/types" "^29.6.1" + camelcase "^6.2.0" + chalk "^4.0.0" + jest-get-type "^29.4.3" + leven "^3.1.0" + pretty-format "^29.6.1" + jest-watcher@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.5.0.tgz#cf7f0f949828ba65ddbbb45c743a382a4d911363" @@ -8796,6 +9462,20 @@ jest-watcher@^29.5.0: jest-util "^29.5.0" string-length "^4.0.1" +jest-watcher@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.6.1.tgz#7c0c43ddd52418af134c551c92c9ea31e5ec942e" + integrity sha512-d4wpjWTS7HEZPaaj8m36QiaP856JthRZkrgcIY/7ISoUWPIillrXM23WPboZVLbiwZBt4/qn2Jke84Sla6JhFA== + dependencies: + "@jest/test-result" "^29.6.1" + "@jest/types" "^29.6.1" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + emittery "^0.13.1" + jest-util "^29.6.1" + string-length "^4.0.1" + jest-worker@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-29.5.0.tgz#bdaefb06811bd3384d93f009755014d8acb4615d" @@ -8806,7 +9486,17 @@ jest-worker@^29.5.0: merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^29, jest@^29.5.0: +jest-worker@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-29.6.1.tgz#64b015f0e985ef3a8ad049b61fe92b3db74a5319" + integrity sha512-U+Wrbca7S8ZAxAe9L6nb6g8kPdia5hj32Puu5iOqBCMTMWFHXuK6dOV2IFrpedbTV8fjMFLdWNttQTBL6u2MRA== + dependencies: + "@types/node" "*" + jest-util "^29.6.1" + merge-stream "^2.0.0" + supports-color "^8.0.0" + +jest@^29: version "29.5.0" resolved "https://registry.npmjs.org/jest/-/jest-29.5.0.tgz#f75157622f5ce7ad53028f2f8888ab53e1f1f24e" integrity sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ== @@ -8816,6 +9506,16 @@ jest@^29, jest@^29.5.0: import-local "^3.0.2" jest-cli "^29.5.0" +jest@^29.5.0, jest@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/jest/-/jest-29.6.1.tgz#74be1cb719c3abe439f2d94aeb18e6540a5b02ad" + integrity sha512-Nirw5B4nn69rVUZtemCQhwxOBhm0nsp3hmtF4rzCeWD7BkjAXRIji7xWQfnTNbz9g0aVsBX6aZK3n+23LM6uDw== + dependencies: + "@jest/core" "^29.6.1" + "@jest/types" "^29.6.1" + import-local "^3.0.2" + jest-cli "^29.6.1" + jju@^1.1.0: version "1.4.0" resolved "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz#a3abe2718af241a2b2904f84a625970f389ae32a" @@ -8851,62 +9551,38 @@ jsesc@^2.5.1: resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -jsii-diff@1.82.0: - version "1.82.0" - resolved "https://registry.npmjs.org/jsii-diff/-/jsii-diff-1.82.0.tgz#0498a91003536960cc401761290d5efee0236586" - integrity sha512-A2JHCMt5b/MZzFxyUwzOHyAXgeOqfAdWZSpe054lSfUc7hmtZap+mHrU7Tfy0CcKfyegy6q+Hy7kBoRYdbIKMg== +jsii-diff@1.84.0: + version "1.84.0" + resolved "https://registry.npmjs.org/jsii-diff/-/jsii-diff-1.84.0.tgz#c3f148ae2bf9d904ad20b9aa76b337b50aa6d7f4" + integrity sha512-MDw8GNkBtBxlTqMcgUANV/q4h5offJ/KN9gyU5BYK/eXsKs7xa5vBmihOgQWvqx8cnszrTMNhvpnvMSNxcPRzw== dependencies: - "@jsii/check-node" "1.82.0" - "@jsii/spec" "^1.82.0" + "@jsii/check-node" "1.84.0" + "@jsii/spec" "^1.84.0" fs-extra "^10.1.0" - jsii-reflect "^1.82.0" + jsii-reflect "^1.84.0" log4js "^6.9.1" yargs "^16.2.0" -jsii-pacmak@1.82.0: - version "1.82.0" - resolved "https://registry.npmjs.org/jsii-pacmak/-/jsii-pacmak-1.82.0.tgz#6a7fdded1af46268ff0034ce8184ce5a79744e80" - integrity sha512-2Nck/HUElL/JLD1TjGrCyLxRKm9xrysT1qUi9eQKN+kZTsdcJNtiN0EsX+77ibq9YQzcKj8H98Gnskg3BL3KTg== +jsii-pacmak@1.84.0: + version "1.84.0" + resolved "https://registry.npmjs.org/jsii-pacmak/-/jsii-pacmak-1.84.0.tgz#6501f9968dcd3fe023892cf07da82032e99f8901" + integrity sha512-+EGfpQDPSyDNPWclcOes6dUhwDsn5dG0bBgVb3hpRWZ0uDe7wLCVwGxh7fphx2XtNvTwdNfspTSBLBMqscOYmg== dependencies: - "@jsii/check-node" "1.82.0" - "@jsii/spec" "^1.82.0" + "@jsii/check-node" "1.84.0" + "@jsii/spec" "^1.84.0" clone "^2.1.2" - codemaker "^1.82.0" + codemaker "^1.84.0" commonmark "^0.30.0" escape-string-regexp "^4.0.0" fs-extra "^10.1.0" - jsii-reflect "^1.82.0" - jsii-rosetta "^1.82.0" + jsii-reflect "^1.84.0" + jsii-rosetta "^1.84.0" semver "^7.5.1" spdx-license-list "^6.6.0" xmlbuilder "^15.1.1" yargs "^16.2.0" -jsii-reflect@1.81.0: - version "1.81.0" - resolved "https://registry.npmjs.org/jsii-reflect/-/jsii-reflect-1.81.0.tgz#51ad71021de979a55192d094afdea2e3acde1976" - integrity sha512-HENelplypflpgMbkwyOBhH/McVJP+LzYZHnMjxZOSMXOMl9ZmZf8bhr9ZBu56ZyMicK0JGPQMqcu5xE+cPyklQ== - dependencies: - "@jsii/check-node" "1.81.0" - "@jsii/spec" "^1.81.0" - chalk "^4" - fs-extra "^10.1.0" - oo-ascii-tree "^1.81.0" - yargs "^16.2.0" - -jsii-reflect@1.82.0: - version "1.82.0" - resolved "https://registry.npmjs.org/jsii-reflect/-/jsii-reflect-1.82.0.tgz#0d98ecabd4273c1c8bcf03350f845bad24b87be8" - integrity sha512-23lYPizIqmBC0CqX9iKdWrYUVVxRxUf/OJMXNnjGQ6UCa62QHPUbqEmKES/0jSmV3oIouwx/ePi5PE1529TucQ== - dependencies: - "@jsii/check-node" "1.82.0" - "@jsii/spec" "^1.82.0" - chalk "^4" - fs-extra "^10.1.0" - oo-ascii-tree "^1.82.0" - yargs "^16.2.0" - -jsii-reflect@^1.82.0, jsii-reflect@^1.84.0: +jsii-reflect@1.84.0, jsii-reflect@^1.84.0: version "1.84.0" resolved "https://registry.npmjs.org/jsii-reflect/-/jsii-reflect-1.84.0.tgz#95b71dabcf3c5fc275e623a29a1d7091fc893e38" integrity sha512-Iuh0GAxsQscK1re9sWEQHG0wKswnr7ha4EZ8j47Sigo8yBIZNp01P+V0kbZ55bDjiT66Sqqu3jaDJdYzR/5o4w== @@ -8918,7 +9594,7 @@ jsii-reflect@^1.82.0, jsii-reflect@^1.84.0: oo-ascii-tree "^1.84.0" yargs "^16.2.0" -jsii-rosetta@^1.82.0, jsii-rosetta@^1.84.0: +jsii-rosetta@^1.84.0: version "1.84.0" resolved "https://registry.npmjs.org/jsii-rosetta/-/jsii-rosetta-1.84.0.tgz#1dca8518f4ae6780beb8d73b54b013a3a1420b8e" integrity sha512-VrXmc6utiNs3eNTKxVky0LTxoQrsh5GuEGyfj9ihwCkojYBJ3w80PdkMQEeRpWGdaCLEocjpy1X67xgZ4ZbPlg== @@ -8936,22 +9612,22 @@ jsii-rosetta@^1.82.0, jsii-rosetta@^1.84.0: workerpool "^6.4.0" yargs "^16.2.0" -jsii-rosetta@~5.0.8: - version "5.0.11" - resolved "https://registry.npmjs.org/jsii-rosetta/-/jsii-rosetta-5.0.11.tgz#47736c7e14101dbee34c2573c8a53fb53a0c9bb3" - integrity sha512-rdL+eBpvHTSbCjSellJHtskICY3MTMICkFgPG1B2c/aE0xdsZCQHLxi9/A8VoobhMk2r7wZtpml7vrzNIpyKYg== +jsii-rosetta@~5.1.6: + version "5.1.6" + resolved "https://registry.npmjs.org/jsii-rosetta/-/jsii-rosetta-5.1.6.tgz#be5aff54dd046cf461d47235b10086de45859db8" + integrity sha512-rBe0vu3UCDOBDx0U+Q8lmkRjnnh/6nV8lhVu/piiCfjI5U8pCYQBx4HwfdzQc4Cbmbo4YPFRl5HO9uprpx27sQ== dependencies: "@jsii/check-node" "1.84.0" "@jsii/spec" "^1.84.0" "@xmldom/xmldom" "^0.8.8" chalk "^4" commonmark "^0.30.0" - fast-glob "^3.2.12" - jsii "5.0.x" - semver "^7.5.2" + fast-glob "^3.3.0" + jsii "~5.1.5" + semver "^7.5.4" semver-intersect "^1.4.0" stream-json "^1.8.0" - typescript "~5.0.4" + typescript "~5.1.6" workerpool "^6.4.0" yargs "^17.7.2" @@ -8974,10 +9650,10 @@ jsii@1.84.0, jsii@^1.84.0: typescript "~3.9.10" yargs "^16.2.0" -jsii@5.0.x, jsii@~5.0.8: - version "5.0.11" - resolved "https://registry.npmjs.org/jsii/-/jsii-5.0.11.tgz#e87ade091b3c4a7a799e8619bf3289ec9d41ce20" - integrity sha512-mFW7gTA6w+LEB3WzJqP7isFNUYYeJHmHKIKoO3kdG266giTQuoqqnuezqgr2Hl3p66Gzs7rdDzLwefQ0vIAs8A== +jsii@~5.1.5, jsii@~5.1.6: + version "5.1.7" + resolved "https://registry.npmjs.org/jsii/-/jsii-5.1.7.tgz#4a33ae13c679db46185886563132c8d9735a8c7d" + integrity sha512-o08/xN+vffYajZCUnPETL8drWSfP+Fa3GEyHsCPP/8xxjtMVK7cmT9uBu0MNdeZzOumYFrYgprOTD/qBrN4HeQ== dependencies: "@jsii/check-node" "1.84.0" "@jsii/spec" "^1.84.0" @@ -8986,11 +9662,11 @@ jsii@5.0.x, jsii@~5.0.8: downlevel-dts "^0.11.0" fast-deep-equal "^3.1.3" log4js "^6.9.1" - semver "^7.5.2" + semver "^7.5.4" semver-intersect "^1.4.0" sort-json "^2.0.1" spdx-license-list "^6.6.0" - typescript "~5.0.4" + typescript "~5.1.6" yargs "^17.7.2" json-buffer@3.0.1: @@ -9789,33 +10465,33 @@ markdown-it@13.0.1, markdown-it@^12.3.2: mdurl "^1.0.1" uc.micro "^1.0.5" -markdownlint-cli@^0.34.0: - version "0.34.0" - resolved "https://registry.npmjs.org/markdownlint-cli/-/markdownlint-cli-0.34.0.tgz#d7a4ae8e59911de6dfb01782a7cd554e8a245947" - integrity sha512-4G9I++VBTZkaye6Yfc/7dU6HQHcyldZEVB+bYyQJLcpJOHKk/q5ZpGqK80oKMIdlxzsA3aWOJLZ4DkoaoUWXbQ== +markdownlint-cli@^0.35.0: + version "0.35.0" + resolved "https://registry.npmjs.org/markdownlint-cli/-/markdownlint-cli-0.35.0.tgz#1a6386777c6f20681e1425c0b7a056cf130bc46f" + integrity sha512-lVIIIV1MrUtjoocgDqXLxUCxlRbn7Ve8rsWppfwciUNwLlNS28AhNiyQ3PU7jjj4Qvj+rWTTvwkqg7AcdG988g== dependencies: - commander "~10.0.1" + commander "~11.0.0" get-stdin "~9.0.0" - glob "~10.2.2" + glob "~10.2.7" ignore "~5.2.4" js-yaml "^4.1.0" jsonc-parser "~3.2.0" - markdownlint "~0.28.2" - minimatch "~9.0.0" + markdownlint "~0.29.0" + minimatch "~9.0.1" run-con "~1.2.11" -markdownlint-micromark@0.1.2: - version "0.1.2" - resolved "https://registry.npmjs.org/markdownlint-micromark/-/markdownlint-micromark-0.1.2.tgz#5520e04febffa46741875a2f297509ffdb561f5c" - integrity sha512-jRxlQg8KpOfM2IbCL9RXM8ZiYWz2rv6DlZAnGv8ASJQpUh6byTBnEsbuMZ6T2/uIgntyf7SKg/mEaEBo1164fQ== +markdownlint-micromark@0.1.5: + version "0.1.5" + resolved "https://registry.npmjs.org/markdownlint-micromark/-/markdownlint-micromark-0.1.5.tgz#a23400b101be32cd4336f2b6b4c47da31825524c" + integrity sha512-HvofNU4QCvfUCWnocQP1IAWaqop5wpWrB0mKB6SSh0fcpV0PdmQNS6tdUuFew1utpYlUvYYzz84oDkrD76GB9A== -markdownlint@~0.28.2: - version "0.28.2" - resolved "https://registry.npmjs.org/markdownlint/-/markdownlint-0.28.2.tgz#ea31586a02fe3a06403ecafbbe22d77e363c8ed5" - integrity sha512-yYaQXoKKPV1zgrFsyAuZPEQoe+JrY9GDag9ObKpk09twx4OCU5lut+0/kZPrQ3W7w82SmgKhd7D8m34aG1unVw== +markdownlint@~0.29.0: + version "0.29.0" + resolved "https://registry.npmjs.org/markdownlint/-/markdownlint-0.29.0.tgz#9647478b7d5485965c557502fe54ee5a550033f2" + integrity sha512-ASAzqpODstu/Qsk0xW5BPgWnK/qjpBQ4e7IpsSvvFXcfYIjanLTdwFRJK1SIEEh0fGSMKXcJf/qhaZYHyME0wA== dependencies: markdown-it "13.0.1" - markdownlint-micromark "0.1.2" + markdownlint-micromark "0.1.5" md5@^2.3.0: version "2.3.0" @@ -9945,13 +10621,20 @@ minimatch@^8.0.2: dependencies: brace-expansion "^2.0.1" -minimatch@^9.0.0, minimatch@^9.0.1, minimatch@~9.0.0: +minimatch@^9.0.0, minimatch@^9.0.1: version "9.0.1" resolved "https://registry.npmjs.org/minimatch/-/minimatch-9.0.1.tgz#8a555f541cf976c622daf078bb28f29fb927c253" integrity sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w== dependencies: brace-expansion "^2.0.1" +minimatch@^9.0.3, minimatch@~9.0.1: + version "9.0.3" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" + integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== + dependencies: + brace-expansion "^2.0.1" + minimist-options@4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" @@ -10231,7 +10914,14 @@ node-fetch@2.6.7: dependencies: whatwg-url "^5.0.0" -node-fetch@^2.6.11, node-fetch@^2.6.7: +node-fetch@^2.6.12: + version "2.6.12" + resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" + integrity sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g== + dependencies: + whatwg-url "^5.0.0" + +node-fetch@^2.6.7: version "2.6.11" resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz#cde7fc71deef3131ef80a738919f999e6edfff25" integrity sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w== @@ -10672,7 +11362,7 @@ npmlog@^6.0.0, npmlog@^6.0.2: gauge "^4.0.3" set-blocking "^2.0.0" -nx@16.3.2, "nx@>=16.1.3 < 17", nx@^16.3.2: +nx@16.3.2, "nx@>=16.1.3 < 17": version "16.3.2" resolved "https://registry.npmjs.org/nx/-/nx-16.3.2.tgz#92a2d7ef06d15b3b111b7cf9d35de08de0a22d90" integrity sha512-fOzCVL7qoCJAcYTJwvJ9j+PSaL791ro4AICWuLxaphZsp2jcLoav4Ev7ONPks2Wlkt8FS9bee3nqQ3w1ya36Og== @@ -10723,6 +11413,57 @@ nx@16.3.2, "nx@>=16.1.3 < 17", nx@^16.3.2: "@nx/nx-win32-arm64-msvc" "16.3.2" "@nx/nx-win32-x64-msvc" "16.3.2" +nx@16.5.2, nx@^16.5.1: + version "16.5.2" + resolved "https://registry.npmjs.org/nx/-/nx-16.5.2.tgz#a271513abe73324fdf2924277d5f273d807a6f0e" + integrity sha512-3XAkVBhXuoFgD7r0lASOh2589XSmBUjioevZb13lDjKDN/FHFWedwMZWtmmbzxBGO3EAWjl+3owBS1RIPm1UHw== + dependencies: + "@nrwl/tao" "16.5.2" + "@parcel/watcher" "2.0.4" + "@yarnpkg/lockfile" "^1.1.0" + "@yarnpkg/parsers" "3.0.0-rc.46" + "@zkochan/js-yaml" "0.0.6" + axios "^1.0.0" + chalk "^4.1.0" + cli-cursor "3.1.0" + cli-spinners "2.6.1" + cliui "^7.0.2" + dotenv "~10.0.0" + enquirer "~2.3.6" + fast-glob "3.2.7" + figures "3.2.0" + flat "^5.0.2" + fs-extra "^11.1.0" + glob "7.1.4" + ignore "^5.0.4" + js-yaml "4.1.0" + jsonc-parser "3.2.0" + lines-and-columns "~2.0.3" + minimatch "3.0.5" + npm-run-path "^4.0.1" + open "^8.4.0" + semver "7.5.3" + string-width "^4.2.3" + strong-log-transformer "^2.1.0" + tar-stream "~2.2.0" + tmp "~0.2.1" + tsconfig-paths "^4.1.2" + tslib "^2.3.0" + v8-compile-cache "2.3.0" + yargs "^17.6.2" + yargs-parser "21.1.1" + optionalDependencies: + "@nx/nx-darwin-arm64" "16.5.2" + "@nx/nx-darwin-x64" "16.5.2" + "@nx/nx-freebsd-x64" "16.5.2" + "@nx/nx-linux-arm-gnueabihf" "16.5.2" + "@nx/nx-linux-arm64-gnu" "16.5.2" + "@nx/nx-linux-arm64-musl" "16.5.2" + "@nx/nx-linux-x64-gnu" "16.5.2" + "@nx/nx-linux-x64-musl" "16.5.2" + "@nx/nx-win32-arm64-msvc" "16.5.2" + "@nx/nx-win32-x64-msvc" "16.5.2" + nyc@^15.1.0: version "15.1.0" resolved "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz#1335dae12ddc87b6e249d5a1994ca4bdaea75f02" @@ -10816,7 +11557,7 @@ onetime@^5.1.0, onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" -oo-ascii-tree@^1.81.0, oo-ascii-tree@^1.82.0, oo-ascii-tree@^1.84.0: +oo-ascii-tree@^1.84.0: version "1.84.0" resolved "https://registry.npmjs.org/oo-ascii-tree/-/oo-ascii-tree-1.84.0.tgz#82828d8c962b637bffa0d1b8a555c337907837e9" integrity sha512-8bvsAKFAQ7HwU3lAEDwsKYDkTqsDTsRTkr3J0gvH1U805d2no9rUNYptWzg3oYku5h5mr9Bko+BIh1pjSD8qrg== @@ -11414,6 +12155,15 @@ pretty-format@^29.0.0, pretty-format@^29.5.0: ansi-styles "^5.0.0" react-is "^18.0.0" +pretty-format@^29.6.1: + version "29.6.1" + resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz#ec838c288850b7c4f9090b867c2d4f4edbfb0f3e" + integrity sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog== + dependencies: + "@jest/schemas" "^29.6.0" + ansi-styles "^5.0.0" + react-is "^18.0.0" + pretty-ms@^7.0.1: version "7.0.1" resolved "https://registry.npmjs.org/pretty-ms/-/pretty-ms-7.0.1.tgz#7d903eaab281f7d8e03c66f867e239dc32fb73e8" @@ -11448,10 +12198,10 @@ progress@^2.0.0, progress@^2.0.3: resolved "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== -projen@^0.71.60: - version "0.71.104" - resolved "https://registry.npmjs.org/projen/-/projen-0.71.104.tgz#b9e3c97d446509ac5d0e94d6b1dd0bc57b403c23" - integrity sha512-U55co7tARxoEcKC5bTeyCWyVUohNMEVGFN/aE8HJsKWFeD2QKOl1CJvOUI4UWp7eagITISz6QRu0UR9Z8eMJOA== +projen@^0.71.134: + version "0.71.137" + resolved "https://registry.npmjs.org/projen/-/projen-0.71.137.tgz#cc9189d8caea5fa7e3c252ed556722ff8872bc2b" + integrity sha512-oWWc9/ewW7ci7Bn/EpCzXG2WWB18+ofCq1PRpgVsinLe56/BX18RcIfzMhrY7KxggE1Z2oKiY+egTjBtn6QNlA== dependencies: "@iarna/toml" "^2.2.5" case "^1.6.3" @@ -11461,7 +12211,7 @@ projen@^0.71.60: fast-json-patch "^3.1.1" glob "^8" ini "^2.0.0" - semver "^7.5.2" + semver "^7.5.4" shx "^0.3.4" xmlbuilder2 "^3.1.1" yaml "^2.2.2" @@ -12137,7 +12887,14 @@ semver@7.3.4: dependencies: lru-cache "^6.0.0" -semver@7.x, semver@^7.0.0, semver@^7.1.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.4.0, semver@^7.5.0, semver@^7.5.1, semver@^7.5.2: +semver@7.5.3: + version "7.5.3" + resolved "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e" + integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== + dependencies: + lru-cache "^6.0.0" + +semver@7.x, semver@^7.0.0, semver@^7.1.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.4.0, semver@^7.5.1: version "7.5.2" resolved "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz#5b851e66d1be07c1cdaf37dfc856f543325a2beb" integrity sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ== @@ -12149,6 +12906,13 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.3.0: resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^7.5.3, semver@^7.5.4: + version "7.5.4" + resolved "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== + dependencies: + lru-cache "^6.0.0" + set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -12963,7 +13727,7 @@ triple-beam@^1.3.0: resolved "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz#a595214c7298db8339eeeee083e4d10bd8cb8dd9" integrity sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw== -ts-jest@^29, ts-jest@^29.1.0: +ts-jest@^29: version "29.1.0" resolved "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.0.tgz#4a9db4104a49b76d2b368ea775b6c9535c603891" integrity sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA== @@ -12977,6 +13741,20 @@ ts-jest@^29, ts-jest@^29.1.0: semver "7.x" yargs-parser "^21.0.1" +ts-jest@^29.1.1: + version "29.1.1" + resolved "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.1.tgz#f58fe62c63caf7bfcc5cc6472082f79180f0815b" + integrity sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA== + dependencies: + bs-logger "0.x" + fast-json-stable-stringify "2.x" + jest-util "^29.0.0" + json5 "^2.2.3" + lodash.memoize "4.x" + make-error "1.x" + semver "^7.5.3" + yargs-parser "^21.0.1" + ts-mock-imports@^1.3.8: version "1.3.8" resolved "https://registry.npmjs.org/ts-mock-imports/-/ts-mock-imports-1.3.8.tgz#6b26887c651effe947ea91f928338d1899146fb9" @@ -13155,7 +13933,7 @@ typescript-json-schema@^0.56.0: typescript "~4.9.5" yargs "^17.1.1" -"typescript@>=3 < 6", typescript@~5.1.3: +"typescript@>=3 < 6": version "5.1.3" resolved "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz#8d84219244a6b40b6fb2b33cc1c062f715b9e826" integrity sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw== @@ -13175,10 +13953,10 @@ typescript@next: resolved "https://registry.npmjs.org/typescript/-/typescript-5.2.0-dev.20230621.tgz#fc61be8c6448dce096aa5df1abda7966d730999d" integrity sha512-8iIehsqwx8TrzBcPWAuXZ0Z4wF/+0CmwdbibftaivqXJlD3V4qWr26hn67r/UT/VNm67iO86XN45F8Viivvobw== -typescript@~5.0.4: - version "5.0.4" - resolved "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" - integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== +typescript@~5.1.6: + version "5.1.6" + resolved "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274" + integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA== uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.6" @@ -13746,12 +14524,7 @@ yaml@1.10.2, yaml@^1.10.0, yaml@^1.10.2: resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== -yaml@2.2.2: - version "2.2.2" - resolved "https://registry.npmjs.org/yaml/-/yaml-2.2.2.tgz#ec551ef37326e6d42872dad1970300f8eb83a073" - integrity sha512-CBKFWExMn46Foo4cldiChEzn7S7SRV+wqiluAb6xmueD/fGyRHIhX8m14vVGgeFWjN540nKCNVj6P21eQjgTuA== - -yaml@^2.2.2: +yaml@2.3.1, yaml@^2.2.2: version "2.3.1" resolved "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz#02fe0975d23cd441242aa7204e09fc28ac2ac33b" integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==