Skip to content
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

aws-s3-deployment: DeployTimeSubstitutedFile doesn't keep original file name #28450

Closed
garysassano opened this issue Dec 21, 2023 · 5 comments · Fixed by #29029
Closed

aws-s3-deployment: DeployTimeSubstitutedFile doesn't keep original file name #28450

garysassano opened this issue Dec 21, 2023 · 5 comments · Fixed by #29029
Labels
@aws-cdk/aws-s3-deployment effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. needs-review p2

Comments

@garysassano
Copy link

Describe the bug

When using DeployTimeSubstitutedFile, it might seem logical to assume that the uploaded file name, where substitutions are made, remains unchanged. However, this is not the case. Surprisingly, the system utilizes the file's fingerprint as the object key, rather than retaining the original file name. This approach can be quite unintuitive and unhelpful.

image

Expected Behavior

see above

Current Behavior

see above

Reproduction Steps

see above

Possible Solution

Use the original file name as the object key.

Additional Information/Context

No response

CDK CLI Version

2.115.0

Framework Version

No response

Node.js Version

18.18.2

OS

Windows 11 23H2

Language

TypeScript

Language Version

No response

Other information

No response

@garysassano garysassano added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 21, 2023
@gshpychka
Copy link
Contributor

Seems like a deliberate design choice as opposed to a bug. This would probably make more sense as a feature request.

@khushail
Copy link
Contributor

@garysassano , thanks for reporting this. Agree with @gshpychka , this might be a feature request.

@khushail khushail added p2 feature-request A feature should be added or improved. effort/medium Medium work item – several days of effort needs-review and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 21, 2023
@jmgtan
Copy link
Contributor

jmgtan commented Feb 8, 2024

Any update on this issue? This is complicating our deployment because we have to do another step to rename the file via S3 API.

@gshpychka
Copy link
Contributor

Any update on this issue? This is complicating our deployment because we have to do another step to rename the file via S3 API.

There will not be any updates unless someone from the community implements this (since this is a feature request and it's marked as P2).

If there are updates, you will see them here

@mergify mergify bot closed this as completed in #29029 Feb 11, 2024
mergify bot pushed a commit that referenced this issue Feb 11, 2024
…itution (#29029)

### Issue # (if applicable)

Closes #28450 

### Reason for this change

Currently, the filename is automatically generated based on its fingerprint. There's no way to override the resulting filename.

### Description of changes

Added an optional `destinationKey` parameter. If this is provided, the construct would use the `destinationKey` when uploading the resulting processed file to S3. If the `destinationKey` is not provided, the current approach would be the default.

### Description of how you validated changes

Added a unit test to confirm that the correct filename is being used.

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

GavinZZ pushed a commit that referenced this issue Feb 22, 2024
…itution (#29029)

### Issue # (if applicable)

Closes #28450 

### Reason for this change

Currently, the filename is automatically generated based on its fingerprint. There's no way to override the resulting filename.

### Description of changes

Added an optional `destinationKey` parameter. If this is provided, the construct would use the `destinationKey` when uploading the resulting processed file to S3. If the `destinationKey` is not provided, the current approach would be the default.

### Description of how you validated changes

Added a unit test to confirm that the correct filename is being used.

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-s3-deployment effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. needs-review p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants