- Git
- Docker
- Docker-compose
- Make
- AWS CLI version 2
Create .env
file to AWS credentials with access key and secret key.
# AWS environment
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
Create a terraform.tf
file with the following contents. If you prefer, change the environment variable name.
provider "aws" {
region = "us-east-2"
version = "= 3.0"
}
terraform {
backend "s3" {
bucket = "your-bucket-here"
key = "key-terraform-.tfstate"
region = "us-east-2"
}
}
module "dev_cluster" {
source = "[email protected]:EzzioMoreira/module-factory-floor.git?ref=v1.1"
environment = "development"
vpc_cidr_block = "10.10.0.0/16"
}
output "ecs_cluster_name" {
value = module.dev_cluster.ecs_cluster_name
}
output "vpc_id" {
value = module.dev_cluster.vpc_id
}
output "subnet_private" {
value = module.dev_cluster.subnet_private
}
output "subnet_public" {
value = module.dev_cluster.subnet_public
}
make help: ## Run make help.
terraform-init: ## Run terraform init to download all necessary plugins
terraform-plan: ## Exec a terraform plan and puts it on a file called plano
terraform-apply: ## Uses plano to apply the changes on AWS.
terraform-destroy: ## Destroy all resources created by the terraform file in this repo.
Create .env
file to AWS credentials with access key and secret key.
# AWS environment
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_ACCOUNT
=you_account-idAPP_IMAGE
=application_nameAWS_REGIO
=you_aws_region
make help: ## Run make help.
ecr-build: ## ECR-step:1 Build your Docker image.
ecr-login: ## ECR-step:2 Retrieve an authentication token and authenticate your Docker client to your registry.
ecr-tag: ## ECR-step:3 Tag your image so you can push the image to this repository.
ecr-push: ## ECR-step:4 Push this image to your newly created AWS repository.
- Git
- Docker
- Docker-compose
- Make
- AWS CLI version 2
Create .env
file to AWS credentials with access key and secret key.
# AWS environment
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_ACCOUNT
=you_account-idAPP_IMAGE
=application_nameAWS_REGIO
=you_aws_region
make help: ## Run make help.
terraform-init: ## Run terraform init to download all necessary plugins
terraform-plan: ## Exec a terraform plan and puts it on a file called plano
terraform-apply: ## Uses plano to apply the changes on AWS.
terraform-destroy: ## Destroy all resources created by the terraform file in this repo.
make help: ## Run make help.
docker-run-local: ## Run the container on the local machine.
docker-stop-local: ## Destroy the container on the local machine.