Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix(eks): missing support for "InstanceTypes" attribute assignment for AL2023 AMIs #29505

Merged
merged 2 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/@aws-cdk-testing/framework-integ/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"dependencies": {
"@aws-cdk/integ-tests-alpha": "0.0.0",
"@aws-cdk/lambda-layer-kubectl-v24": "^2.0.242",
"@aws-cdk/lambda-layer-kubectl-v29": "^2.0.0",
"aws-cdk-lib": "0.0.0",
"aws-sdk": "^2.1583.0",
"aws-sdk-mock": "5.6.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
import * as lambda from 'aws-cdk-lib/aws-lambda';
import { KubectlV24Layer } from '@aws-cdk/lambda-layer-kubectl-v24';
import { KubectlV29Layer } from '@aws-cdk/lambda-layer-kubectl-v29';
import { Construct } from 'constructs';
import * as eks from 'aws-cdk-lib/aws-eks';

export function getClusterVersionConfig(scope: Construct) {
const versionMap: { [key: string]: any } = {
1.24: KubectlV24Layer,
1.29: KubectlV29Layer,
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make sure it could compatible with existing integ tests.


export function getClusterVersionConfig(scope: Construct, version?: eks.KubernetesVersion) {
const _version = version ?? eks.KubernetesVersion.V1_24;
return {
version: eks.KubernetesVersion.V1_24,
version: _version,
// Crazy type-casting is required because KubectlLayer peer depends on
// types from aws-cdk-lib, but we run integration tests in the @aws-cdk/
// v1-style directory, not in the aws-cdk-lib v2-style directory.
kubectlLayer: new KubectlV24Layer(scope, 'KubectlLayer') as unknown as lambda.ILayerVersion,
// kubectlLayer: new KubectlV24Layer(scope, 'KubectlLayer') as unknown as lambda.ILayerVersion,
kubectlLayer: new versionMap[_version.version](scope, 'KubectlLayer') as unknown as lambda.ILayerVersion,
};
};

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

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

Loading