Skip to content

Commit 5bdf5cb

Browse files
authored
chore(eks): update eks compare-log unit test to use sdk v3 (#29845)
### Reason for this change The AWS SDK V2 is being deprecated. We need to remove all uses of it from the CDK. ### Description of changes The `compare-log` unit test for the `aws-eks` `compareLogging.ts` was using `CreateClusterRequest` and `LogTypes` from AWS SDK V2. I've updated the code to use the `CreateClusterRequest` and `LogType` from AWS SDK V3. Additionally, with this change, `aws-sdk` is no longer needed as a dependency for `@aws-cdk/custom-resource-handlers`. ### Description of how you validated changes This change does not impact `compareLogging.ts`. Consequently, we just need to verify that the unit tests in `compare-log.test.ts` are still successful. I have validated that these are still passing. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 7103fed commit 5bdf5cb

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

packages/@aws-cdk/custom-resource-handlers/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@
6363
"@aws-sdk/client-synthetics": "3.421.0",
6464
"@aws-sdk/client-ecr": "3.421.0",
6565
"@aws-sdk/client-s3": "3.421.0",
66-
"@aws-sdk/client-cloudwatch": "3.421.0",
67-
"aws-sdk": "^2.1596.0"
66+
"@aws-sdk/client-cloudwatch": "3.421.0"
6867
},
6968
"repository": {
7069
"url": "https://github.com/aws/aws-cdk.git",

packages/@aws-cdk/custom-resource-handlers/test/aws-eks/compare-log.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable import/no-extraneous-dependencies */
2-
import * as aws from 'aws-sdk';
2+
import { CreateClusterRequest, LogType } from '@aws-sdk/client-eks';
33
import { compareLoggingProps } from '../../lib/aws-eks/cluster-resource-handler/compareLogging';
44

55
/**
@@ -30,8 +30,8 @@ enum ClusterLoggingTypes {
3030

3131
describe('compareLoggingProps', () => {
3232

33-
type Props = Partial<aws.EKS.CreateClusterRequest>;
34-
const oldEnabledTypes: aws.EKS.LogTypes = [ClusterLoggingTypes.API, ClusterLoggingTypes.AUDIT];
33+
type Props = Partial<CreateClusterRequest>;
34+
const oldEnabledTypes: LogType[] = [ClusterLoggingTypes.API, ClusterLoggingTypes.AUDIT];
3535

3636
test('when newProps.logging.clusterLogging is undefined, should disable all types with enabled:true in oldProps', () => {
3737
const oldProps: Props = {

0 commit comments

Comments
 (0)