Skip to content

Commit

Permalink
fix(eks): add clusterLogging props to Fargate Cluster (#20707)
Browse files Browse the repository at this point in the history
Fixes #19302
----

### All Submissions:

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

### Adding new Unconventional Dependencies:

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

### New Features

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

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
ranjith-jagadeesh authored Jun 13, 2022
1 parent 6176400 commit 1882d7c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/@aws-cdk/aws-eks/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,12 @@ export interface ClusterOptions extends CommonClusterOptions {
* @default - The controller is not installed.
*/
readonly albController?: AlbControllerOptions;
/**
* The cluster log types which you want to enable.
*
* @default - none
*/
readonly clusterLogging?: ClusterLoggingTypes[];
}

/**
Expand Down Expand Up @@ -753,13 +759,6 @@ export interface ClusterProps extends ClusterOptions {
* @default - none
*/
readonly tags?: { [key: string]: string };

/**
* The cluster log types which you want to enable.
*
* @default - none
*/
readonly clusterLogging?: ClusterLoggingTypes[];
}

/**
Expand Down
27 changes: 27 additions & 0 deletions packages/@aws-cdk/aws-eks/test/fargate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,4 +458,31 @@ describe('fargate', () => {
});

});

test('supports cluster logging with FargateCluster', () => {
// GIVEN
const stack = new Stack();

// WHEN

new eks.FargateCluster(stack, 'FargateCluster', {
version: CLUSTER_VERSION,
clusterLogging: [
eks.ClusterLoggingTypes.API,
eks.ClusterLoggingTypes.AUTHENTICATOR,
eks.ClusterLoggingTypes.SCHEDULER,
],
});

//THEN
Template.fromStack(stack).hasResourceProperties('Custom::AWSCDK-EKS-Cluster', {
Config: {
logging: {
clusterLogging: [
{ enabled: true, types: ['api', 'authenticator', 'scheduler'] },
],
},
},
});
});
});

0 comments on commit 1882d7c

Please sign in to comment.