s3deploy.BucketDeployment: invalidate multiple CF distributions
- 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
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