🎯 Create the S3 bucket
and DynamoDB tables
for Terraform state files & locks.
init-state.sh
–> Creates a unique S3-bucket-name based on your AWS Account / Region / Hostname.# source environment/dev/.env
export AWS_REGION=
export TF_STATE_S3_BUCKET=$(echo "${PROJECT_ID}-state-${AWS_ACCOUNT}" | awk '{print tolower($0)}')
export TF_STATE_DYNAMODB_TABLE=$(echo "${PROJECT_ID}-state" | awk '{print tolower($0)}')
$ ./init-state.sh