Skip to content

Commit

Permalink
feat(eks): expose FargateCluster's defaultProfile
Browse files Browse the repository at this point in the history
  • Loading branch information
kaylanm committed Oct 23, 2021
1 parent 924045d commit 82995b3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/@aws-cdk/aws-eks/lib/fargate-cluster.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Construct } from 'constructs';
import { Cluster, ClusterOptions, CoreDnsComputeType } from './cluster';
import { FargateProfileOptions } from './fargate-profile';
import { FargateProfile, FargateProfileOptions } from './fargate-profile';

/**
* Configuration props for EKS Fargate.
Expand All @@ -23,6 +23,11 @@ export interface FargateClusterProps extends ClusterOptions {
* `addFargateProfile`.
*/
export class FargateCluster extends Cluster {
/**
* Fargate Profile that was created with the cluster.
*/
public readonly defaultProfile: FargateProfile;

constructor(scope: Construct, id: string, props: FargateClusterProps) {
super(scope, id, {
...props,
Expand All @@ -31,7 +36,7 @@ export class FargateCluster extends Cluster {
version: props.version,
});

this.addFargateProfile(
this.defaultProfile = this.addFargateProfile(
props.defaultProfile?.fargateProfileName ?? (props.defaultProfile ? 'custom' : 'default'),
props.defaultProfile ?? {
selectors: [
Expand Down

0 comments on commit 82995b3

Please sign in to comment.