Skip to content
v2.275.0

AllowedMethods Class ​

The HTTP methods that the Behavior will accept requests on.

Example ​

ts
// 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 ​

ALLOW_ALLAllowedMethodsallow_allAllowedMethodsALLOW_ALLAllowedMethodsALLOW_ALLAllowedMethodsALLOW_ALLAllowedMethodsstatic#
All supported HTTP methods.
ALLOW_GET_HEADAllowedMethodsallow_get_headAllowedMethodsALLOW_GET_HEADAllowedMethodsALLOW_GET_HEADAllowedMethodsALLOW_GET_HEADAllowedMethodsstatic#
HEAD and GET.
ALLOW_GET_HEAD_OPTIONSAllowedMethodsallow_get_head_optionsAllowedMethodsALLOW_GET_HEAD_OPTIONSAllowedMethodsALLOW_GET_HEAD_OPTIONSAllowedMethodsALLOW_GET_HEAD_OPTIONSAllowedMethodsstatic#
HEAD, GET, and OPTIONS.
methodsstring[]methodstyping.List[str]methodsList<String>Methodsstring[]Methods*[]*string#
HTTP methods supported.