aws / aws/aws-cdk

s3deploy.BucketDeployment: invalidate multiple CF distributions

Open
#22,309 0 comments 2 reactions 0 assignees View on GitHub
@aws-cdk/aws-s3-deployment feature-request p1
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

`BucketDeployment` allows for the specification of a CloudFront distribution to be invalidated after the deployment finishes.

It would be nice if more than one CF distributions could be invalidated in cases where the same bucket is used as origin for multiple distributions.

### Use Case

I'm using a number CF distributions with multiple origins each; one origin bucket is shared across distributions.

### Proposed Solution

Allow `BucketDeployment.distribution` to accept an array of distributions. Allow `distributionPaths` to be a 2-d array (array of filepath[])

### Other Information

I wonder about the best way to implement this with the current constructs and can think of two ways.

* using `triggers` (but not sure whether I can get them to execute every time I need them to execute)
* Creating multiple dummy `BucketDeployment` instances (one for each CF dist) with some nullish content. Their only purpose would be to invalidate their respective dist. Not sure, though, about the execution order (the associated lambda functions should only be running after the main content has been updated, not their respective nullish/dummy content).

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.44.0

### Environment details (OS name and version, etc.)

MacOs, node 16

Contributor guide

Open the contributing guide

Research direction

Start by locating the TypeScript BucketDeployment construct and the existing distribution and distributionPaths API. Trace how invalidation is triggered after deployment, then define and test support for multiple CloudFront distributions and their paths while preserving the documented deployment ordering.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.