I am using bitbucket pipeline to deploy using S3 deploy and for invalidation of by using aws-cloudfront-invalidate.
I have declared some variables at repository level and some at deployment environment level.
Here:
DISTRIBUTION_ID is a part deployment variable and during the run pipeline it is throwing error (DISTRIBUTION_ID can be a null) while invalidation pipe.
When I move DISTRIBUTION_ID to repository level variable, it is working.
I am using latest version of both pipes.
@Jaisa Ram can you provide the code of your pipeline? To use deployment variables you need to put the keyword to pipeline, sth like as
name: Deploy
deployment: production
BUT be aware that deployment variables overwrites repository ones.
For more details see docs:
https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/
Regards, Galyna
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.
Hi, @Halyna Berezovska
I'm using the same deployment variables that I'm using with the previous pipe (aws-s3-deploy) but It shows me the following errors:✖ Validation errors:
AWS_ACCESS_KEY_ID:
- null value not allowed
AWS_SECRET_ACCESS_KEY:- null value not allowed
DISTRIBUTION_ID:
- null value not allowed
I had the same problem and I tried to fixed it using by moving all the variables to the repository settings.
Shouldn't aws-cloudfront-invalidate accept the deployment variables such as was-s3-deploy does?
The issue now is that it shows me the following error:ERROR: Error creating a cloudfront invalidation
✖ Failed to create a cloudfront invalidation: An error occurred (AccessDenied) when calling the CreateInvalidation operation: User: arn:aws:iam::<iam>:user/Bitbucket is not authorized to perform: cloudfront:CreateInvalidation on resource: arn:aws:cloudfront::<iam>:distribution/<distribution_id>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jaisa Ram regarding the last question, why if failed - the user you use in s3 and cloudfront, do not have permissions to execute Cloudfront actions. To fix this, you have to change policy (any permissions attached, inline policy etc.) attached to this user or create another user specific for cloudfront.
Could you also tell more details about using Cloudfront as second pipe with default variables feature without passing aws keys as variables (I susoect you're using this)? We need to understand the root cause why it is not working for you.
Also feel free to use our new Bitbucket pipelines oidc feature , where you can authenticate without using any aws keys. Example of how to use it can be found here in the first Advanced example .
Regards, Galyna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.