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
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The S3 deploy steps works fine, and use the same variables as the cloudfront
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i alredy tried setting the egion like the s3, but dont work, i will try via cli
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.