Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
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

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

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.
Dec 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

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.
Dec 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.
Dec 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.

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

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

@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
AUG Leaders

Atlassian Community Events