我正在尝试在此代码中再添加一个AWS配置文件!
export TF_DATA_DIR="${TERRAFORM_PATH}/.terraform"
export AWS_DEFAULT_REGION=eu-west-1
if [ "${TARGET_ENV}" = "dev" ] || [ "${TARGET_ENV}" = "test" ] || [ "${TARGET_ENV}" = "uat" ]
then
export TF_VAR_aws_access_key=${AWS_ACCESS_KEY_ID_DEV}
export TF_VAR_aws_secret_key=${AWS_SECRET_ACCESS_KEY_DEV}
export AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID_DEV}
export AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY_DEV}
export STATES_BUCKET=***-dev-terraform-states
export TARGET_ENV=${TARGET_ENV}
export S3_ARTIFACTS_BUCKET="***-dev-artifacts"
aws s3 cp "s3://${S3_ARTIFACTS_BUCKET}/${PROJECT_NAME}/${BUILD_ARTIFACT}" . && tar xvfz "${BUILD_ARTIFACT}"