DEV Community

Discussion on: The GITHUB_TOKEN in GitHub Actions: How it Works, Change Permissions, Customizations

Collapse
 
dreyo1 profile image
drey • Edited

I am using Githubactions with codebuild but each time the CodeBuild stage starts to run,I am getting Error message: The Security token included in the request is invalid.please can you help with how to fix it?

Run aws-actions/aws-codebuild-run-build@v1
with:
project-name: CodeBuild
buildspec-override: dev-env/buildspec.yml
env-vars-for-codebuild: TF_INPUT,
AWS_ACCESS_KEY_ID,
AWS_SECRET_ACCESS_KEY,
AWS_REGION,
ROLE_TO_ASSUME,
ROLE_DURATION_SECONDS,

env:
tf_version: latest
tg_version: latest
AWS_DEFAULT_REGION: us-east-2
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: ***
AWS_SECRET_ACCESS_KEY: ***
AWS_SESSION_TOKEN: ***
TF_INPUT: false
ROLE_TO_ASSUME: ***
ROLE_DURATION_SECONDS: 3600
**STARTING CODEBUILD**
Error: The security token included in the request is invalid
**CODEBUILD COMPLETE**

Collapse
 
n3wt0n profile image
Davide 'CoderDave' Benvegnù

It means there is something wrong with your credentials. Either the accessKeyId or secretAccessKey (or both) are wrong. You can try validating your credentials using the AWS cli using the STS get caller identity call before using them in your code.