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

BucketDeployment: unable to set cacheControl #4665

Closed
sbstjn opened this issue Oct 24, 2019 · 2 comments · Fixed by #6086
Closed

BucketDeployment: unable to set cacheControl #4665

sbstjn opened this issue Oct 24, 2019 · 2 comments · Fixed by #6086
Assignees
Labels
@aws-cdk/aws-s3 Related to Amazon S3 bug This issue is a bug. good first issue Related to contributions. See CONTRIBUTING.md needs-reproduction This issue needs reproduction. p1

Comments

@sbstjn
Copy link

sbstjn commented Oct 24, 2019

Using cacheControl for BucketDeployment in @aws-cdk/aws-s3-deployment does not work.

Reproduction Steps

new BucketDeployment(this, 'deployment', {
  sources: [Source.asset(path.resolve(__dirname, '../build'))],
  destinationBucket: assets,
  distribution: cdn.distribution,
  cacheControl: [CacheControl.fromString(`max-age=600`)]
})
new BucketDeployment(this, 'deployment', {
  sources: [Source.asset(path.resolve(__dirname, '../build'))],
  destinationBucket: assets,
  distribution: cdn.distribution,
  cacheControl: [CacheControl.maxAge(Duration.minutes(10))]
})

Error Log

Lambda error log for /aws/lambda/…CustomCDKBucketDeployment…:

aws s3 sync --delete /tmp/…/contents s3://foobar/ --cache-control 'max-age=600' --metadata-directive REPLACE

Unknown options: --cache-control 'max-age=600'

Environment

  • CLI Version : 1.14.0
  • Framework Version: @aws-cdk/[email protected]
  • Language : typescript

This is 🐛 Bug Report

@sbstjn sbstjn added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 24, 2019
@SomayaB SomayaB added the @aws-cdk/aws-s3 Related to Amazon S3 label Oct 24, 2019
@SomayaB SomayaB added needs-reproduction This issue needs reproduction. and removed needs-triage This issue or PR still needs to be triaged. labels Oct 24, 2019
@eladb eladb changed the title BucketDeployment: Unable to set cacheControl BucketDeployment: metadata options should not be used in "delete" Oct 25, 2019
@eladb eladb added the p1 label Oct 25, 2019
@eladb eladb changed the title BucketDeployment: metadata options should not be used in "delete" BucketDeployment: unable to set cacheControl Oct 25, 2019
@eladb
Copy link
Contributor

eladb commented Oct 25, 2019

@AlexCheema can you take a look please?

@iliapolo
Copy link
Contributor

iliapolo commented Feb 6, 2020

This problem is actually not strictly related to cache-control. It will happen for every property that eventually translates to SystemMetadata. The fix proposed in the mentioned PR address that problem as a whole.

@mergify mergify bot closed this as completed in #6086 Feb 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-s3 Related to Amazon S3 bug This issue is a bug. good first issue Related to contributions. See CONTRIBUTING.md needs-reproduction This issue needs reproduction. p1
Projects
None yet
4 participants