Deploys an infrastructure in a containerized cloud application.
This repository stores the code used to build the infrastructure needed to deploy the Aluraflix API using Terraform to provision resources and Github Actions to automate deployment.
English - Portuguese
- Terraform as IaC.
- Github Actions as CI/CD.
- VPC as a virtual network dedicated to the application.
- Subnets across different availability zones.
- Internet Gateway for Internet access.
- Route Tables mapping network route traffic.
- Security groups in service level access control.
- EC2 instances generated via Launch Template.
- Autoscaling group to manage server scalability.
- Load Balancer as an interface that will redirect requests to a target group.
- Cluster grouping infrastructure (autoscaling), services and other sharing configurations.
- Service willl be manage the tasks.
- Tasks is where the container of the application that will be run.
-
Clone the repository.
-
Configure the secrets and environment variables on Github:
- TF_CLOUD_ORGANIZATION: organization in which the project is created in Terraform Cloud.
- TF_API_TOKEN: token generated in Terraform Cloud.
- TF_WORKSPACE: name of the workspace in Terraform Cloud where the implementation of resources will be executed.
- Configure environment variables in Terraform Cloud:
- AWS_ACCESS_KEY_ID: IAM AWS access key ID.
- AWS_SECRET_ACCESS_KEY: IAM AWS secret access key ID (sensitive).
-
As the entire process is carried out via CI, to implement the infrastructure it is necessary to make a Pull Request of any change and perform the Merge.
-
Another way is to directly access Github Actions and run the workflow in the dashboard.