Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

The cloudfront invalidation dont work

Felipe Micheletto December 22, 2022

I set up all variables required but i receive this error

ERROR: Error creating a cloudfront invalidation
✖ Failed to create a cloudfront invalidation: Unable to locate credentials

I set up, AWS_SECRET_KEY, AWS_ACCESS_KEY_ID, DISTRIBUTION_ID and REGION, and received credential error

1 answer

1 accepted

1 vote
Answer accepted
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 23, 2022

@Felipe Micheletto hi. Thanks for your question.

We need more information. Please, provide us your config details, and a screenshot of your repository variables (values should be hidden).

Alternative way to is to configure some test script in pipeline to check your aws configuration:

script:
- curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.2.9.zip" -o "awscliv2.zip" && unzip awscliv2.zip
- echo 'c778f4cc55877833679fdd4ae9c94c07d0ac3794d0193da3f18cb14713af615f awscliv2.zip' | sha256sum -c - && ./aws/install
- aws configure list

 according to this guide.

 

Regards, Igor

Felipe Micheletto December 23, 2022

image.pngimage.png

Felipe Micheletto December 23, 2022

The S3 deploy steps works fine, and use the same variables as the cloudfront

Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 24, 2022

@Felipe Micheletto  just for tests. Set up in cloudfront pipe config aws region like in your s3 pipe config.

AWS_DEFAULT_REGION: "us-east-1"
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 24, 2022

Also try to run cloudfront via aws cli from your local machine (without using pipe, with using the same creds) to understand where the problem exactly is.

Felipe Micheletto December 24, 2022

i alredy tried setting the egion like the s3, but dont work, i will try via cli

Felipe Micheletto December 26, 2022

@Igor Stoyanov via cli works, i used the same credentials from the pipeline

Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 26, 2022

@Felipe Micheletto Try to delete/add_again DISTRIBUTION_ID in the repository variables. Check in the logs this line:


If this will not help, try to call cli command inside pipeline without using pipe. 
How to install aws cli in pipeline:

script:
- curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.2.9.zip" -o "awscliv2.zip" && unzip awscliv2.zip
- echo 'c778f4cc55877833679fdd4ae9c94c07d0ac3794d0193da3f18cb14713af615f awscliv2.zip' | sha256sum -c - && ./aws/install
- aws <run your command>

Also please provide full log output (hide secret data) with DEBUG variable when using pipe to help us understand where is the problem

Felipe Micheletto December 29, 2022


I Found my problem, i was using deployment variables were is not set to use, i added my variables as repository variables and everything works now! Thanks @Igor Stoyanov 

Like Igor Stoyanov likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events