Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
chore(s3-deployment): Exclude pattern in README example for prune was…
Browse files Browse the repository at this point in the history
… wrong (aws#9352)

The documentation at https://docs.aws.amazon.com/cdk/api/latest/docs/aws-s3-deployment-readme.html#prune currently mentions that you can create two deployments with different cache policies by using the `exclude` option in the `asset` function. The last deployment aims to only set the cache policy on `index.html` but ends up setting the policy on everything.

According to aws#9146 (comment), an exclude pattern should be preceded by a `'*'` glob pattern, for it to take the desired effect that is mentioned in the documentation (to only include the `index.html` file).

This PR adds the missing `'*'` glob pattern to the documentations example.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
Tehnix authored Aug 3, 2020
1 parent 70b9f63 commit 22fa426
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-s3-deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ new BucketDeployment(this, 'BucketDeployment', {
});

new BucketDeployment(this, 'HTMLBucketDeployment', {
sources: [Source.asset('./website', { exclude: ['!index.html'] })],
sources: [Source.asset('./website', { exclude: ['*', '!index.html'] })],
destinationBucket: bucket,
cacheControl: [CacheControl.fromString('max-age=0,no-cache,no-store,must-revalidate')],
prune: false,
Expand Down

0 comments on commit 22fa426

Please sign in to comment.