Remediation
Update the ECS Service Network Configurationβ
Using the AWS CLIβ
Changing the network configuration triggers a new service deployment.
-
Prepare a
network-config.jsonfile. Ensure you include the correct subnets and security groups, but setassignPublicIpto DISABLED.{
"awsvpcConfiguration": {
"subnets": ["subnet-xxxx", "subnet-yyyy"],
"securityGroups": ["sg-xxxx"],
"assignPublicIp": "DISABLED"
}
} -
Run the update command:
aws ecs update-service \
--cluster {{cluster-name}} \
--service {{service-name}} \
--network-configuration file://network-config.json