aws / aws/aws-cdk

S3 Bucket Deployments with content encoding based on file extension.

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

Description

Currently, there is **contentEncoding?:string** option in **BucketDeployment** construct (System-defined content-encoding metadata to be set on all objects in the deployment). It would be nice to have possibility to specify contentEncoding according to mapping for file extension. Example: for files with extension **.br** specify "Content-Encoding: br", for **.gzip** files - "Content-Encoding: gzip" and so on.

### Use Case

We use s3+ cloudfront pair to serve static website. To provide better performance **br** files are server based on **Accept-Encoding** header, so our files have to copies (ex: **index.html** and **index.html.br***). Currently, we have to use aws cli to deploy differently encoded files with right headers. If **BucketDeployment** construct will support **contentEncoding** encoding by file extension option, it would be more easy-to-go static hosting option.

* [ ] :wave: I may be able to implement this feature request
* [ ] :warning: This feature might incur a breaking change

---

This is a :rocket: Feature Request

Contributor guide

Open the contributing guide

Research direction

Start by locating the BucketDeployment construct and its existing contentEncoding option, then trace how deployment objects receive metadata. Define how file-extension mappings should be configured and applied for extensions such as .br and .gzip, and verify that differently encoded files receive the expected S3 Content-Encoding values.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, devops
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.