Search code examples
amazon-web-servicesdockerdocker-composeamazon-ecsamazon-vpc

How to add Amazon ECS to non default VPC I have already created?


I have created VPC and added Amazon RDS to it. Now I want to add ECS in this VPC and push my Docker container. My container is React web app and Flask server which I want to communicate with Amazon RDS. I have passed through a great deal of ECS documentation but still can’t do this. Any help or guidance will be great. Thanks!


Solution

  • It depends on how you create your ECS service. One way was already provided by @ThiagoDaAnunciação.

    Other ways are (for FARGATE):

    For EC2 launch type, you specify the VPC and subnets when you create your container instances.