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.

Origin

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

type Origin struct { CustomHeaders *CustomHeaders `type:"structure"` CustomOriginConfig *CustomOriginConfig `type:"structure"` DomainName *string `type:"string" required:"true"` Id *string `type:"string" required:"true"` OriginPath *string `type:"string"` S3OriginConfig *S3OriginConfig `type:"structure"` }

A complex type that describes the Amazon S3 bucket, HTTP server (for example, a web server), Amazon MediaStore, or other server from which CloudFront gets your files. This can also be an origin group, if you've created an origin group. You must specify at least one origin or origin group.

For the current limit on the number of origins or origin groups that you can specify for a distribution, see Amazon CloudFront Limits (https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_cloudfront) in the AWS General Reference.

CustomHeaders

A complex type that contains the list of Custom Headers for each origin.

CustomOriginConfig

A customer origin or an Amazon S3 bucket configured as a website endpoint.

DomainName

Type: *string

Amazon S3 origins: The DNS name of the Amazon S3 bucket from which you want CloudFront to get objects for this origin, for example, myawsbucket.s3.amazonaws.com. If you set up your bucket to be configured as a website endpoint, enter the Amazon S3 static website hosting endpoint for the bucket.

For more information about specifying this value for different types of origins, see Origin Domain Name (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesDomainName) in the Amazon CloudFront Developer Guide.

Constraints for Amazon S3 origins:

  • If you configured Amazon S3 Transfer Acceleration for your bucket, don't specify the s3-accelerate endpoint for DomainName.

  • The bucket name must be between 3 and 63 characters long (inclusive).

  • The bucket name must contain only lowercase characters, numbers, periods, underscores, and dashes.

  • The bucket name must not contain adjacent periods.

Custom Origins: The DNS domain name for the HTTP server from which you want CloudFront to get objects for this origin, for example, www.example.com.

Constraints for custom origins:

  • DomainName must be a valid DNS name that contains only a-z, A-Z, 0-9, dot (.), hyphen (-), or underscore (_) characters.

  • The name cannot exceed 128 characters.

DomainName is a required field

Id

Type: *string

A unique identifier for the origin or origin group. The value of Id must be unique within the distribution.

When you specify the value of TargetOriginId for the default cache behavior or for another cache behavior, you indicate the origin to which you want the cache behavior to route requests by specifying the value of the Id element for that origin. When a request matches the path pattern for that cache behavior, CloudFront routes the request to the specified origin. For more information, see Cache Behavior Settings (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesCacheBehavior) in the Amazon CloudFront Developer Guide.

Id is a required field

OriginPath

Type: *string

An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin. When you include the OriginPath element, specify the directory name, beginning with a /. CloudFront appends the directory name to the value of DomainName, for example, example.com/production. Do not include a / at the end of the directory name.

For example, suppose you've specified the following values for your distribution:

  • DomainName: An Amazon S3 bucket named myawsbucket.

  • OriginPath: /production

  • CNAME: example.com

When a user enters example.com/index.html in a browser, CloudFront sends a request to Amazon S3 for myawsbucket/production/index.html.

When a user enters example.com/acme/index.html in a browser, CloudFront sends a request to Amazon S3 for myawsbucket/production/acme/index.html.

S3OriginConfig

A complex type that contains information about the Amazon S3 origin. If the origin is a custom origin, use the CustomOriginConfig element instead.

Method

GoString

func (s Origin) GoString() string

GoString returns the string representation

SetCustomHeaders

func (s *Origin) SetCustomHeaders(v *CustomHeaders) *Origin

SetCustomHeaders sets the CustomHeaders field's value.

SetCustomOriginConfig

func (s *Origin) SetCustomOriginConfig(v *CustomOriginConfig) *Origin

SetCustomOriginConfig sets the CustomOriginConfig field's value.

SetDomainName

func (s *Origin) SetDomainName(v string) *Origin

SetDomainName sets the DomainName field's value.

SetId

func (s *Origin) SetId(v string) *Origin

SetId sets the Id field's value.

SetOriginPath

func (s *Origin) SetOriginPath(v string) *Origin

SetOriginPath sets the OriginPath field's value.

SetS3OriginConfig

func (s *Origin) SetS3OriginConfig(v *S3OriginConfig) *Origin

SetS3OriginConfig sets the S3OriginConfig field's value.

String

func (s Origin) String() string

String returns the string representation

Validate

func (s *Origin) Validate() error

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

On this page: