CDK Fargate deploy adds unwanted SG rules

0

I'm setting up a Fargate cluster with AWS CDK v2. On deploy, CDK is adding a "0.0.0.0/0 Allow from anyone on port 80" rule to a pre-made security group. Any idea how to stop this behavior? Here is my service stanza:

const service = new ecs.FargateService(this, "SBfargate", {
  cluster,
  desiredCount: 1,
  taskDefinition: fargateTaskDefinition,
  assignPublicIp: true,
  securityGroups: [sbsg],
  serviceName: 'SB-Fargate_service',
});
1 Answer
1

Found https://github.com/aws/aws-cdk/issues/3177 after more digging. Mutable: false on the SG stanza worked as I wanted.

sbecker
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions