-
Notifications
You must be signed in to change notification settings - Fork 9
Infrastructure
Artem Chubchenko edited this page Feb 11, 2021
·
1 revision
- AWS as a cloud provider
- Terraform Cloud provides remote operations for Terraform
- Terraform HCL infrastructure as code (IaC)
- ECR - storage for all Docker images
- ECS - service for running containers on EC2 instances
- EC2 - instance for running application
- RDS - instance for running a cloud database (PostgreSQL)
- ElastiCache - instance for running a key-value database (Redis)
- ALB - tool for balancing all the requests pushed
- S3 - object service storage
- CloudWatch - storage for logs
- Setup
[Terraform CLI 12.X](https://learn.hashicorp.com/tutorials/terraform/install-cli)
- Add next credentials (
REGION
,ACCESS_KEY
,ACCESS_SECRET_KEY
) to~/.aws/credentials
~/.aws/config
- Override all
boilerplate
name in.terraform
- Sign up to Terraform Cloud
-) Create two workspaces
staging
andproduction
. In each workspace add terraform variables:DB_PASSWORD
DB_USERNAME
AWS_DEFAULT_REGION
AWS_SERCET_ACCESS_KEY
AWS_ACCESS_KEY_ID
Attention!
Add your ssh public key to the
.terraform/staging/ssh_keys/boilerplate-api-staging.pub
-
.terraform/staging/ssh_keys/boilerplate-api-production.pub
. - Move to
.terraform/staging
performterraform login
terraform init
-
terraform applay
- to raiseSTAGING
server
- Move to
.terraform/production
performterraform login
terraform init
-
terraform applay
to raisePRODUCTION
server
- Check AWS resources and terraform state on terraform cloud!
RubyGarage is a leading software development and consulting company in Eastern Europe. Our main expertise includes Ruby and Ruby on Rails, but we successfully employ other technologies to deliver the best results to our clients. Check out our portfolio for even more exciting works!