Skip to content

Commit

Permalink
feat(cdk-site-distribution): support allowed http methods prop
Browse files Browse the repository at this point in the history
  • Loading branch information
thijsdaniels committed Jul 15, 2024
1 parent a0f29b3 commit 7d709c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/moody-waves-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@codedazur/cdk-site-distribution": minor
---

You can now choose which HTTP methods to allow.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
ICertificate,
} from "aws-cdk-lib/aws-certificatemanager";
import {
AllowedMethods,
Function as CloudFrontFunction,
Distribution,
FunctionCode,
Expand Down Expand Up @@ -42,6 +43,7 @@ export interface SiteDistributionProps {
subdomain?: string;
zone?: IHostedZone;
};
allowedMethods?: AllowedMethods;
cachePolicy?: ICachePolicy;
originRequestPolicy?: IOriginRequestPolicy;
invalidateCache?: boolean | string[];
Expand Down Expand Up @@ -296,6 +298,7 @@ export class SiteDistribution extends Construct {
domainNames: this.domain ? [this.domain] : undefined,
defaultBehavior: {
origin: this.props.origin,
allowedMethods: this.props.allowedMethods,
originRequestPolicy: this.props.originRequestPolicy,
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
functionAssociations: [
Expand Down

0 comments on commit 7d709c8

Please sign in to comment.