Search code examples
amazon-web-servicesamazon-ecs

Apply security group to ECS container instances dynamically


If I want all the ECS container instances to be accessible by SSH from our corporate network I need to apply a security group for each instance. Since ECS spins up instances when needed this can not be done manually beforehand.

How do I make sure that all ECS container instances dynamically get a specific security group assigned?


Solution

  • Answering my own question; it is pretty obvious in the end.

    After creating a service, a security group is created following the step as shown in Çağatay's answer. This security group can simply be updated as any other security group, which solves the issue.

    Leaving this here for anyone who couldn't find it either.