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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,121
Community Members
 
Community Events
176
Community Groups

The cloudfront invalidation dont work

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

0 votes

@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

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

@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"

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.

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

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

@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


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

Atlassian Community Events