class AllowedMethods
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CloudFront.AllowedMethods |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscloudfront#AllowedMethods |
![]() | software.amazon.awscdk.services.cloudfront.AllowedMethods |
![]() | aws_cdk.aws_cloudfront.AllowedMethods |
![]() | aws-cdk-lib » aws_cloudfront » AllowedMethods |
The HTTP methods that the Behavior will accept requests on.
Example
// Create a Distribution with configured HTTP methods and viewer protocol policy of the cache.
declare const myBucket: s3.Bucket;
const myWebDistribution = new cloudfront.Distribution(this, 'myDist', {
defaultBehavior: {
origin: new origins.S3Origin(myBucket),
allowedMethods: cloudfront.AllowedMethods.ALLOW_ALL,
viewerProtocolPolicy: cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
},
});
Properties
Name | Type | Description |
---|---|---|
methods | string[] | HTTP methods supported. |
static ALLOW_ALL | Allowed | All supported HTTP methods. |
static ALLOW_GET_HEAD | Allowed | HEAD and GET. |
static ALLOW_GET_HEAD_OPTIONS | Allowed | HEAD, GET, and OPTIONS. |
methods
Type:
string[]
HTTP methods supported.
static ALLOW_ALL
Type:
Allowed
All supported HTTP methods.
static ALLOW_GET_HEAD
Type:
Allowed
HEAD and GET.
static ALLOW_GET_HEAD_OPTIONS
Type:
Allowed
HEAD, GET, and OPTIONS.