Open
Description
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!
Metadata
Metadata
Assignees
Labels
No labels