Im trying to create deployments for 4 different AWS account, so I created 9 enviroment variables, 2 for each AWS account, which are access key id and secret access key id, because they're all different, and the 9th is the variable that contains the region, which is the same for every AWS account. In the script I'm making each machine to use a different enviroment variable, however they all take the default key by the name AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY_ID and I don't know what's failing.
config.yml file: version: 2.1
orbs: aws-cli: circleci/[email protected] aws-code-deploy: circleci/[email protected]
jobs:
codeDeploy:
executor: aws-cli/default
steps:
- checkout
- aws-cli/setup:
profile-name: b4rz
aws-access-key-id: AWS_ACCESS_KEY_ID
aws-secret-access-key: AWS_SECRET_ACCESS_KEY
- run: |
COMMIT_ID=$(curl -s https://api.github.com/repos/WMS-PF/WMS_LogixPro/commits/circleci-and-codedeploy-setup | jq -r '.sha')
aws deploy create-deployment
--application-name github_dep
--deployment-group-name github_dep_group
--file-exists-behavior OVERWRITE
--deployment-config-name CodeDeployDefault.OneAtATime
--github-location repository=WMS-PF/WMS_LogixPro,commitId=$COMMIT_ID
codeDeploy2:
executor: aws-cli/default
steps:
- checkout
- aws-cli/setup:
profile-name: andresF
aws-access-key-id: AWS_ACCESS_KEY_ID_1
aws-secret-access-key: AWS_SECRET_ACCESS_KEY_1
- run: |
COMMIT_ID=$(curl -s https://api.github.com/repos/WMS-PF/WMS_LogixPro/commits/circleci-and-codedeploy-setup | jq -r '.sha')
aws deploy create-deployment
--application-name Git_application
--deployment-group-name development_gropup
--file-exists-behavior OVERWRITE
--deployment-config-name CodeDeployDefault.OneAtATime
--github-location repository=WMS-PF/WMS_LogixPro,commitId=$COMMIT_ID
codeDeploy3:
executor: aws-cli/default
steps:
- checkout
- aws-cli/setup:
profile-name: Juan Camargo
aws-access-key-id: AWSJ_ACCESS_KEY_ID
aws-secret-access-key: AWSJ_SECRET_ACCESS_KEY
- run: |
COMMIT_ID=$(curl -s https://api.github.com/repos/WMS-PF/WMS_LogixPro/commits/circleci-and-codedeploy-setup | jq -r '.sha')
aws deploy create-deployment
--application-name github
--deployment-group-name github_auto
--file-exists-behavior OVERWRITE
--deployment-config-name CodeDeployDefault.OneAtATime
--github-location repository=WMS-PF/WMS_LogixPro,commitId=$COMMIT_ID
codeDeploy4:
executor: aws-cli/default
steps:
- checkout
- aws-cli/setup:
profile-name: nayelio
aws-access-key-id: AWSN_ACCESS_KEY_ID
aws-secret-access-key: AWSN_SECRET_ACCESS_KEY
- run: |
COMMIT_ID=$(curl -s https://api.github.com/repos/WMS-PF/WMS_LogixPro/commits/circleci-and-codedeploy-setup | jq -r '.sha')
aws deploy create-deployment
--application-name Nayeli_EC
--deployment-group-name EC2Nayeli_DG
--file-exists-behavior OVERWRITE
--deployment-config-name CodeDeployDefault.OneAtATime
--github-location repository=WMS-PF/WMS_LogixPro,commitId=$COMMIT_ID
workflows: EC2-Deploy: jobs: - codeDeploy - codeDeploy2 - codeDeploy3 - codeDeploy4
I've tried making it manually, which means, not using the aws-cli orb and setting it up command by command and it doesn't work either. I've also tried, changing the enviroment variables names, doesn't work either.
What I expect this to do is to use the access key id and secret access key that I'm telling the terminal to use which you can see in "aws-cli/setup" parameters for each job and not take the default parameter, so that it can create the deployment for each AWS account.