8000 ERROR: failed to invalidateCloudFront: NoSuchDistribution · Issue #72 · drone-plugins/drone-s3-sync · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ERROR: failed to invalidateCloudFront: NoSuchDistribution #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gcarq opened this issue Dec 23, 2024 · 0 comments
Open

ERROR: failed to invalidateCloudFront: NoSuchDistribution #72

gcarq opened this issue Dec 23, 2024 · 0 comments

Comments

@gcarq
Copy link
gcarq commented Dec 23, 2024

When using cloudfront invalidation an NoSuchDistribution error occurs, however the distribution exists.
This plugin is configured in the following way using drone:

  - name: Deploy to test.some.domain
    image: plugins/s3-sync
    settings:
      bucket: test.some.domain
      region: eu-central-1
      source: dist-staging/public
      target: /
      acl: public-read
      cloudfront_distribution: E21HGQ9LMGO1BV
      delete: true
      cache_control:
        '*.html': 'no-cache, no-store, must-revalidate, max-age=0,'
        '*.json': 'no-cache, no-store, must-revalidate, max-age=0,'
        '*.*': 'public, max-age=31536000'
      content_encoding:
        '*.js': gzip
        '*.css': gzip
    when:
      event:
        - push
      branch:
        - 'release/*'

This worked as expected without distribution invalidation, however when trying to invalidate the distribution the following error occurs:

Synchronizing with bucket "test.some.domain"

.........................................ERROR: failed to invalidateCloudFront  to /*: NoSuchDistribution: The specified distribution does not exist.

	status code: 404, request id: <omitted>

The distribution id is valid and exists and an invalidation can be created using the aws cli:

$ aws cloudfront create-invalidation --region eu-central-1 --distribution-id E3PZM6SBCW3APH --paths '/*'
{
    "Location": "https://cloudfront.amazonaws.com/2020-05-31/distribution/E3PZM6SBCW3APH/invalidation/I31MUPG9M8KL2YII7SSPDWHADK",
    "Invalidation": {
        "Id": "I31MUPG9M8KL2YII7SSPDWHADK",
        "Status": "InProgress",
        "CreateTime": "2024-12-23T14:55:28.463Z",
        "InvalidationBatch": {
            "Paths": {
                "Quantity": 1,
                "Items": [
                    "/*"
                ]
            },
            "CallerReference": "cli-1734965727-801260"
        }
    }
}

The following permissions have been configured for this specific user:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "",
            "Effect": "Allow",
            "Action": "sts:AssumeRole",
            "Resource": "*"
        },
        {
            "Sid": "",
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:PutObjectAcl",
                "s3:GetObject",
                "s3:GetObjectAcl",
                "s3:DeleteObject",
                "s3:ListBucket",
                "cloudfront:CreateInvalidation",
                "cloudfront:GetInvalidation",
                "cloudfront:ListInvalidations"
            ],
            "Resource": "*"
        }
    ]
}

I'm not sure if this is a configuration issue or a bug, any pointers are appreciated. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0