diff --git a/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-task-definition.ts b/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-task-definition.ts index 2c700e03ffd71..475e90faa2d01 100644 --- a/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-task-definition.ts @@ -46,7 +46,10 @@ export class FargateTaskDefinition extends TaskDefinition { /** * The configured network mode */ - public readonly networkMode = NetworkMode.AwsVpc; + public readonly networkMode: NetworkMode = NetworkMode.AwsVpc; + // NOTE: Until the fix to https://github.com/Microsoft/TypeScript/issues/26969 gets released, + // we need to explicitly write the type here, as type deduction for enums won't lead to + // the import being generated in the .d.ts file. constructor(parent: cdk.Construct, name: string, props: FargateTaskDefinitionProps = {}) { super(parent, name, {