aws-cdk-lib.aws_cloudfront.AllowedMethods

class AllowedMethods

LanguageType name
.NETAmazon.CDK.AWS.CloudFront.AllowedMethods
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscloudfront#AllowedMethods
Javasoftware.amazon.awscdk.services.cloudfront.AllowedMethods
Pythonaws_cdk.aws_cloudfront.AllowedMethods
TypeScript (source)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

NameTypeDescription
methodsstring[]HTTP methods supported.
static ALLOW_ALLAllowedMethodsAll supported HTTP methods.
static ALLOW_GET_HEADAllowedMethodsHEAD and GET.
static ALLOW_GET_HEAD_OPTIONSAllowedMethodsHEAD, GET, and OPTIONS.

methods

Type: string[]

HTTP methods supported.


static ALLOW_ALL

Type: AllowedMethods

All supported HTTP methods.


static ALLOW_GET_HEAD

Type: AllowedMethods

HEAD and GET.


static ALLOW_GET_HEAD_OPTIONS

Type: AllowedMethods

HEAD, GET, and OPTIONS.