Skip to content

How to use in continues integration, and successfully call multiple times #26

@dkarchmer

Description

@dkarchmer

Sorry, I know this is more of an AWS question, but maybe you have seen this. As I am having trouble figuring it out.

I am basically setting up a continues deployment pipeline, and I am using your tool to deploy to s3/cloudfront. I deployed once successfully but now I am getting this error

botocore.errorfactory.InvalidArgument: An error occurred (InvalidArgument) when calling the CreateInvalidation operation: Your request contains a caller reference that was used for a previous invalidation batch for the same distribution.

My guess is that this is due to

response = cloudfront.create_invalidation(
                DistributionId=dist_id,
                InvalidationBatch=dict(
                    Paths=dict(
                        Quantity=len(paths),
                        Items=paths
                    ),
                    CallerReference='s3-deploy-website'
                )
            )

and the fact that uses the same string as CallerReference.

Should this use instead some string that changes from call to call (maybe adding a datetime.now())?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions