├── environments
│ ├── dev
│ │ ├── 1-initializations
│ │ │ └── aws
│ │ ├── 2-foundations
│ │ │ └── aws
│ │ ├── 3-functionalities
│ │ │ └── aws
│ │ ├── main.tf
│ │ ├── provider.tf
│ │ ├── terraform.tfvars
│ │ ├── terraform.tfvars.example
│ │ ├── variables.tf
│ │ └── versions.tf
│ ├── stg
│ │ ├── 1-initializations
│ │ │ └── aws
│ │ ├── 2-foundations
│ │ │ └── aws
│ │ ├── 3-functionalities
│ │ │ └── aws
│ │ ├── main.tf
│ │ ├── provider.tf
│ │ ├── terraform.tfvars
│ │ ├── terraform.tfvars.example
│ │ ├── variables.tf
│ │ └── versions.tf
│ └── prod
└── modules
└── aws
├── acm-certificate
├── backend-bucket
├── cognito
├── ecr
├── ecs
├── iot-core
├── load-balancers
├── nat-instances
├── rds
├── security-group
├── sqs
└── vpc-subnet-internet-gateway
Ensure you have AWS credentials configured either through environment variables or AWS CLI configuration.
# move to specific environment & cloud platform
cd environments/<environment>/initializations/<cloud_platform>
# e.g: cd environments/dev/initializations/aws
Copy the terraform.tfvars.example
in the environment directory to new file terraform.tfvars
then review to ensure all necessary variables are defined.
# Can update and modify the script to suit specific cloud provider (in this case AWS)
./terraform-init.sh <AWS_ACCOUNT_ID>
# terraform init
terraform plan --var-file="terraform.tfvars"
terraform apply --var-file="terraform.tfvars"
Navigate to the environment directory (e.g., environments/dev
) and run terraform init
to initialize the environment.
cd environments/dev
terraform init
terraform workspace select <environment>
Copy the terraform.tfvars.example
in the environment directory to new file terraform.tfvars
then review to ensure all necessary variables are defined.
terraform plan --var-file="terraform.tfvars"
terraform apply --var-file="terraform.tfvars"