In order to avoid dependency issues it is recommended to execute deployment of resources in the following order:
- VPC
- Relational Database
- DynamoDB
- S3
- Load Balancers
- Code Deploy
- ECS Cluster
- ECR
- API Gateway
- Backend Microservice 1
- Frontend Microservice
- Backend Microservice 2
Note: Relational Database, DynamoDB and S3 are dependent on the microservices used in this specific implementation. Only use them in your infrastructure if your applications need them, else replace with your own infrastructure and skip to Load Balancers .
cd account/environment/infrastructure/vpc
- Used by the backend users application to persist data.
cd account/environment/services/rds
- Used by the backend products application to persist data
cd account/environment/services/dynamodb
- Used by the backend products application to post and persist images.
cd account/environment/services/s3
- Configured to allow traffic on port 80 from a personal IP address. If secure access for the public is required, uncomment and follow the instructions in modules/support/services/load-balancers/listeners.tf .
cd account/environment/services/load-balancers
• Used to implement a blue green deployment style.
cd account/emvironment/services/code-deploy
- The cluster in which all the services reside.
cd account/emvironment/services/cluster
- After applying this step you will need to push your images to the repositories before continuing.
cd account/environment/services/ecr
cd account/environment/services/api-gateway
- The first service to go up in order to resolve dependency issues.
cd account/environment/services/ecs-backend-users
cd account/environment/services/ecs-frontend
cd account/environment/services/ecs-backend-products