This repository holds all information and scripts for provisioning Terraform workshop ECS infrastructure on Amazon Web Services.
This guide is intended to be used by both system administrators and developers.
To run locally you need to have AWS CLI and Terraform installed, please check the perrequisites section for more information.
For runs that happen on Terraform Cloud, environment variables are currently set up.
In case you need to run plan/apply locally, you need to set the following environment variables:
Name | Description |
---|---|
aws_access_key | AWS Access Key ID |
aws_access_secret | AWS Access Key Secret |
aws_region | AWS Region used for creating resources |
You can also create a .env
file from the template and populate it with information:
cp terraform.tfvars.template environments/shared/terraform.tfvars
cp terraform.tfvars.template environments/development/terraform.tfvars
cp terraform.tfvars.template environments/production/terraform.tfvars
Currently used Terraform version for the project is Terraform v1.3.5
Terraform Outputs are a way to export values that are generated by Terraform.
List of outputs:
Name | Description |
---|
Exporting all outputs to a json
file can be done with the following command:
terraform output -json > terraform.json
You can get a single output with the following command:
terraform output aws_cognito_user_pool_id
This mechanism always retrieves the current value of the output. In case of value rotation it will track the latest value after state synchronization.
Terraform configuration should be initialized with the following command per environment folder:
terraform init