i am unable to have my pipeline assume project variables i made in the ci cd sections of my project. When i run terraform init i get the error "error configuring S3 Backend: no valid credential sources for S3 backend found. (see screenshot attached)
You can see in my other attached screenshot that i have set these variables (they are correct) and belong to the root aws account. I have also attached my gitlab ci yml which sets the environment for all the required variables that i have set to authenticate to aws (aws access/secret key/default region).
It appears that my personal variables (non project) were allowing me to connect initially but once i removed them i no longer can. I would like the project specifics ones to work.
any help would be much appreciated!
EDIT: dont think i can attach screenshots so here is everything.
GITLAB YML
image:
name: registry.gitlab.com/gitlab-org/terraform-images/stable:latest
entrypoint:
- ‘/usr/bin/env’
- ‘PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin’
variables:
NSLDS_DIR: “./test/nslds/”
PPO_DIR: “./test/ppo/”
team1: “ifo”
team2: “developers”
team3: “security”
stages:
- nslds-deploy-ifo
- nslds-deploy-developers
- nslds-deploy-security
- ppo-deploy-ifo
- ppo-deploy-developers
- ppo-deploy-security
deploy to nslds-test-ifo:
stage: nslds-deploy-ifo
script:
- cd $NSLDS_DIR/$team1
- terraform init
- terraform apply -auto-approve
deploy to nslds-test-developers:
stage: nslds-deploy-developers
script:
- cd $NSLDS_DIR/$team2
- terraform init
- terraform apply -auto-approve
deploy to nslds-test-security:
stage: nslds-deploy-security
script:
- cd $NSLDS_DIR/$team3
- terraform init
- terraform apply -auto-approve
environment:
name: nslds-test
only:
- main
deploy to ppo-test-ifo:
stage: ppo-deploy-ifo
script:
- cd $PPO_DIR/$team1
- terraform init
- terraform apply -auto-approve
deploy to ppo-test-developers:
stage: ppo-deploy-developers
script:
- cd $PPO_DIR/$team2
- terraform init
- terraform apply -auto-approve
deploy to ppo-test-security:
stage: ppo-deploy-security
script:
- cd $PPO_DIR/$team3
- terraform init
- terraform apply -auto-approve
environment:
name: ppo-test
only:
- main