- Subnet CIDR Calculation can be better.
- Using Single Subnet may cause RDS creation to Fail (Min 2 Required)
- VPC NACL Can be restricted for Ephemeral ports and Health Checks
- ..
- RDS Username & Password via AWS Secret Manager
- Connection to WebServer Private instances should be made via SessionManager, and BH totally removed.
- CI/CD should laverage on "terraform plan -out xxx"
- Addition of Terragrunt
- Tests automation with Terratest.
- ..
-
Backend Initialization:
docker run --rm -i -t -v $PWD:$PWD -w $PWD --env-file aws.env
hashicorp/terraform:1.0.9
-chdir=applications/wordpress/components/remote-state
init
-backend-config="../../environments/dev.backend.tfvars"
&&
docker run --rm -i -t -v $PWD:$PWD -w $PWD --env-file aws.env
hashicorp/terraform:1.0.9
-chdir=applications/wordpress/components/automations
init
-backend-config="../../environments/dev.backend.tfvars"
&& docker run --rm -i -t -v $PWD:$PWD -w $PWD --env-file aws.env
hashicorp/terraform:1.0.9
-chdir=applications/wordpress/components/infrastructure
init
-backend-config="../../environments/dev.backend.tfvars" -
Apply first the remote-state component (Required for storing tf state for the other components)
docker run --rm -i -t -v $PWD:$PWD -w $PWD --env-file aws.env
hashicorp/terraform:1.0.9
-chdir=applications/wordpress/components/remote-state
apply
-var-file="../../environments/dev.tfvars"
-var-file="../../regions/eu-central-1.tfvars" -
Apply Infrastructure component
docker run --rm -i -t -v $PWD:$PWD -w $PWD --env-file aws.env
hashicorp/terraform:1.0.9
-chdir=applications/wordpress/components/infrastructure
apply
-var-file="../../environments/dev.tfvars"
-var-file="../../regions/eu-central-1.tfvars" -
Apply automations components
docker run --rm -i -t -v $PWD:$PWD -w $PWD --env-file aws.env
hashicorp/terraform:1.0.9
-chdir=applications/wordpress/components/automations
apply
-var-file="../../environments/dev.tfvars"
-var-file="../../regions/eu-central-1.tfvars"