AWS SDK for Go (PILOT)
API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see https://docs.aws.amazon.com/sdk-for-go/api/.

We welcome your feedback on this new version of the documentation. Send your comments to aws-sdkdocs-feedback@amazon.com.

AllowedMethods

import "github.com/aws/aws-sdk-go/service/cloudfront"

type AllowedMethods struct { CachedMethods *CachedMethods `type:"structure"` Items []*string `locationNameList:"Method" type:"list" required:"true"` Quantity *int64 `type:"integer" required:"true"` }

A complex type that controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin. There are three choices:

  • CloudFront forwards only GET and HEAD requests.

  • CloudFront forwards only GET, HEAD, and OPTIONS requests.

  • CloudFront forwards GET, HEAD, OPTIONS, PUT, PATCH, POST, and DELETE requests.

If you pick the third choice, you may need to restrict access to your Amazon S3 bucket or to your custom origin so users can't perform operations that you don't want them to. For example, you might not want users to have permissions to delete objects from your origin.

CachedMethods

A complex type that controls whether CloudFront caches the response to requests using the specified HTTP methods. There are two choices:

  • CloudFront caches responses to GET and HEAD requests.

  • CloudFront caches responses to GET, HEAD, and OPTIONS requests.

If you pick the second choice for your Amazon S3 Origin, you may need to forward Access-Control-Request-Method, Access-Control-Request-Headers, and Origin headers for the responses to be cached correctly.

Items

Type: []*string

A complex type that contains the HTTP methods that you want CloudFront to process and forward to your origin.

Items is a required field

Quantity

Type: *int64

The number of HTTP methods that you want CloudFront to forward to your origin. Valid values are 2 (for GET and HEAD requests), 3 (for GET, HEAD, and OPTIONS requests) and 7 (for GET, HEAD, OPTIONS, PUT, PATCH, POST, and DELETE requests).

Quantity is a required field

Method

GoString

func (s AllowedMethods) GoString() string

GoString returns the string representation

SetCachedMethods

func (s *AllowedMethods) SetCachedMethods(v *CachedMethods) *AllowedMethods

SetCachedMethods sets the CachedMethods field's value.

SetItems

func (s *AllowedMethods) SetItems(v []*string) *AllowedMethods

SetItems sets the Items field's value.

SetQuantity

func (s *AllowedMethods) SetQuantity(v int64) *AllowedMethods

SetQuantity sets the Quantity field's value.

String

func (s AllowedMethods) String() string

String returns the string representation

Validate

func (s *AllowedMethods) Validate() error

Validate inspects the fields of the type to determine if they are valid.

On this page: