This project involves the creation of key AWS resources using Terraform. The aim is to establish a central repository for managing the state of application AWS resources and facilitating resource locking for collaborative editing. The variable PROJECT_ENV can be employed to distinguish between different stages (DEV, TEST, PROD). These resources are intended to be created only once within the account.
Create environment vars
export AWS_ACCESS_KEY_ID=<access_key>
export AWS_SECRET_ACCESS_KEY=<secret_access_key>
The access key can be generated in the IAM console in the security information tab.
More Information on Terraform AWS Provider
#cd into project dir (in which main.cf is located)
terraform init
Verify connection and creation of AWS resources
terraform plan
The AWS region could be specified with "aws_region=<REGION>". Default is "eu-central-1"
terraform plan -var="AWS_REGION=<region>"
The Environment (DEV, TEST, PROD) can be specified with "PROJECT_ENV=<environment>". Default is "DEV"
terraform plan -var="PROJECT_ENV=<environment>"
If terraform plan is successfull, you can apply the changes
terraform apply