configure-aws-credentials
configure-aws-credentials copied to clipboard
aws-region does not work with secrets
Why can not aws-region
use a secret?
I tried this but it does not work:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
This works:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
@salatielosorno I ran into the same issue until I discovered that I had used ${ secrets.AWS_REGION }
instead of ${{ secrets.AWS_REGION }
for interpolation.
@awendt This is not the case. I mean I used ${{ secrets.AWS_REGION }}
with double brackets and it does not work yet.
Then I don't know. It works for me, so it must be specific to your use case. Can you elaborate on your workflow? When is it triggered? Who triggers it?
@awendt It is a simple workflow that is triggered when a branch is pushed. I have all secrets at the organizational level. I think this is a GitHub problem because I changed my workflow to be a reusable one and it works!! I am not sure yet what is happening.
Ran into same issue. @salatielosorno how did you fix it?
@RaviVaderaIntel @salatielosorno Not sure if this the the same problem, but I was getting the same error, I changed the secret from US-EAST-1 to us-east-1. Error went away and the step was able to complete.
My problem was related to secrets not being loaded properly. I was able to fix it by just making sure that the secrets were being loaded properly.
If anyone is running into this issue, please specify what exactly you mean by "not working". What error message are you seeing, when are you seeing the error message?
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.
I ran into the same error. This is what I see in the logs
Run aws-actions/configure-aws-credentials@v1
Error: Input required and not supplied: aws-region
Detailed debug logs:
##[debug]Evaluating condition for step: 'Configure AWS credentials'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Configure AWS credentials
##[debug]Register post job cleanup for action: aws-actions/configure-aws-credentials@v1
##[debug]Loading inputs
##[debug]Evaluating: secrets.AWS_ACCESS_KEY_ID
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'AWS_ACCESS_KEY_ID'
##[debug]=> null
##[debug]Result: null
##[debug]Evaluating: secrets.AWS_SECRET_ACCESS_KEY
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'AWS_SECRET_ACCESS_KEY'
##[debug]=> null
##[debug]Result: null
##[debug]Evaluating: secrets.AWS_REGION
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'AWS_REGION'
##[debug]=> null
##[debug]Result: null
##[debug]Loading env
Run aws-actions/configure-aws-credentials@v1
Error: Input required and not supplied: aws-region
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Configure AWS credentials
It doesn't look like your secret is loading properly @Shiti, please ensure you've set your secret appropriately and that you've defined it properly in your action.yml
file
I defined it just as mentioned here https://github.com/aws-actions/configure-aws-credentials/issues/402#issue-1164357718 and also configured them in the repo secrets.
I was able to get it working by changing the secret name i.e. instead of ${{ secrets.AWS_REGION }}
, I used ${{ secrets.MY_APP_AWS_REGION }}
. This got me wondering if the specific name AWS_REGION
is conflicting somewhere.
I'm able to name it AWS_REGION
, so it's interesting that fixed it for you. If you didn't have anything misconfigured (which could be a large number of things), I wonder what might've been the cause. Regardless, I'm glad you got it working! I wonder if this would help anyone else who runs into this down the line, if so I'd be interested to hear if renaming the secret worked for you.
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.
Ran into the same problem today with AWS_REGION
, renamed the secret and the reference in the workflow - worked for some reason.
one small thing, always check your repo visibility, if it's public then it will not be able to access private secrets
I faced same issue. But found the problem. It is my environment which I didn't pass.. haha