DNS -> ALB -> http:80 -redirect-to- https:443 -> ACM(SSL Termination) -> ECS:container_port -> Autoscaling EC2 (ASG) -> RDS
export AWS_ACCESS_KEY_ID="AK................................KMZ" && \
export AWS_SECRET_ACCESS_KEY="K7J..............................................Tnfj" && \
export AWS_REGION="us-west-2" && \
export TF_VAR_aws_region="us-west-2"
terraform apply -target="module.ecr"
export REPO=$(terraform output --raw ecr_repo_url)
aws ecr get-login-password | docker login --username AWS --password-stdin $REPO
git clone [email protected]:mrprmode/mountains.git && cd mountains
docker build -t mountains . && docker tag mountains $REPO && docker push $REPO
cd .. && rm -rf mountains && docker image rm $REPO && docker image rm mountains
Edit terraform.tfvars
: DB stuff that your application needs, RDS MySQL
parameters to be set up with and the the container_port (default:80)
# container_port = 3000
db_username = "YuYingNan"
db_password = "ShiSheng8848"
db_database = "TheZuMountainSaga"
or terraform apply -var db_username="some_name" -var db_password="some_pwd" ...........
DB_USER
DB_PWD
DB_DATABASE
DB_HOST
terraform apply