我正在尝试在jenkins构建脚本中的〜/ .aws / configure中将AWS Cross Account凭据添加为AWS配置文件

时间:2018-12-19 07:59:48

标签: amazon-web-services jenkins-pipeline devops

我正在尝试在此代码中再添加一个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}"

0 个答案:

没有答案