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.

DistributionSummary

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

type DistributionSummary struct { ARN *string `type:"string" required:"true"` Aliases *Aliases `type:"structure" required:"true"` CacheBehaviors *CacheBehaviors `type:"structure" required:"true"` Comment *string `type:"string" required:"true"` CustomErrorResponses *CustomErrorResponses `type:"structure" required:"true"` DefaultCacheBehavior *DefaultCacheBehavior `type:"structure" required:"true"` DomainName *string `type:"string" required:"true"` Enabled *bool `type:"boolean" required:"true"` HttpVersion *string `type:"string" required:"true" enum:"HttpVersion"` Id *string `type:"string" required:"true"` IsIPV6Enabled *bool `type:"boolean" required:"true"` LastModifiedTime *time.Time `type:"timestamp" required:"true"` OriginGroups *OriginGroups `type:"structure"` Origins *Origins `type:"structure" required:"true"` PriceClass *string `type:"string" required:"true" enum:"PriceClass"` Restrictions *Restrictions `type:"structure" required:"true"` Status *string `type:"string" required:"true"` ViewerCertificate *ViewerCertificate `type:"structure" required:"true"` WebACLId *string `type:"string" required:"true"` }

A summary of the information about a CloudFront distribution.

ARN

Type: *string

The ARN (Amazon Resource Name) for the distribution. For example: arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5, where 123456789012 is your AWS account ID.

ARN is a required field

Aliases

A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution.

CacheBehaviors

A complex type that contains zero or more CacheBehavior elements.

Comment

Type: *string

The comment originally specified when this distribution was created.

Comment is a required field

CustomErrorResponses

A complex type that controls:

  • Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the viewer.

  • How long CloudFront caches HTTP status codes in the 4xx and 5xx range.

For more information about custom error pages, see Customizing Error Responses (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) in the Amazon CloudFront Developer Guide.

DefaultCacheBehavior

A complex type that describes the default cache behavior if you don't specify a CacheBehavior element or if files don't match any of the values of PathPattern in CacheBehavior elements. You must create exactly one default cache behavior.

DomainName

Type: *string

The domain name that corresponds to the distribution, for example, d111111abcdef8.cloudfront.net.

DomainName is a required field

Enabled

Type: *bool

Whether the distribution is enabled to accept user requests for content.

Enabled is a required field

HttpVersion

Type: *string

Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront. The default value for new web distributions is http2. Viewers that don't support HTTP/2 will automatically use an earlier version.

HttpVersion is a required field

Id

Type: *string

The identifier for the distribution. For example: EDFDVBD632BHDS5.

Id is a required field

IsIPV6Enabled

Type: *bool

Whether CloudFront responds to IPv6 DNS requests with an IPv6 address for your distribution.

IsIPV6Enabled is a required field

LastModifiedTime

Type: *time.Time

The date and time the distribution was last modified.

LastModifiedTime is a required field

OriginGroups

A complex data type for the origin groups specified for a distribution.

Origins

A complex type that contains information about origins and origin groups for this distribution.

PriceClass

Type: *string

A complex type that contains information about price class for this streaming distribution.

PriceClass is a required field

Restrictions

A complex type that identifies ways in which you want to restrict distribution of your content.

Status

Type: *string

The current status of the distribution. When the status is Deployed, the distribution's information is propagated to all CloudFront edge locations.

Status is a required field

ViewerCertificate

A complex type that specifies the following:

  • Whether you want viewers to use HTTP or HTTPS to request your objects.

  • If you want viewers to use HTTPS, whether you're using an alternate domain name such as example.com or the CloudFront domain name for your distribution, such as d111111abcdef8.cloudfront.net.

  • If you're using an alternate domain name, whether AWS Certificate Manager

(ACM) provided the certificate, or you purchased a certificate from a third-party certificate authority and imported it into ACM or uploaded it to the IAM certificate store.

You must specify only one of the following values:

  • ViewerCertificate$ACMCertificateArn

  • ViewerCertificate$IAMCertificateId

  • ViewerCertificate$CloudFrontDefaultCertificate

Don't specify false for CloudFrontDefaultCertificate.

If you want viewers to use HTTP instead of HTTPS to request your objects: Specify the following value:

<CloudFrontDefaultCertificate>true<CloudFrontDefaultCertificate>

In addition, specify allow-all for ViewerProtocolPolicy for all of your cache behaviors.

If you want viewers to use HTTPS to request your objects: Choose the type of certificate that you want to use based on whether you're using an alternate domain name for your objects or the CloudFront domain name:

  • If you're using an alternate domain name, such as example.com: Specify one of the following values, depending on whether ACM provided your certificate or you purchased your certificate from third-party certificate authority:

<ACMCertificateArn>ARN for ACM SSL/TLS certificate<ACMCertificateArn> where

ARN for ACM SSL/TLS certificate is the ARN for the ACM SSL/TLS certificate that you want to use for this distribution.

<IAMCertificateId>IAM certificate ID<IAMCertificateId> where IAM certificate

ID is the ID that IAM returned when you added the certificate to the IAM certificate store.

If you specify ACMCertificateArn or IAMCertificateId, you must also specify

a value for SSLSupportMethod.

If you choose to use an ACM certificate or a certificate in the IAM certificate

store, we recommend that you use only an alternate domain name in your object URLs (https://example.com/logo.jpg). If you use the domain name that is associated with your CloudFront distribution (such as https://d111111abcdef8.cloudfront.net/logo.jpg) and the viewer supports SNI, then CloudFront behaves normally. However, if the browser does not support SNI, the user's experience depends on the value that you choose for SSLSupportMethod:

vip: The viewer displays a warning because there is a mismatch between the

CloudFront domain name and the domain name in your SSL/TLS certificate.

sni-only: CloudFront drops the connection with the browser without returning

the object.
  • If you're using the CloudFront domain name for your distribution, such as d111111abcdef8.cloudfront.net: Specify the following value:

<CloudFrontDefaultCertificate>true<CloudFrontDefaultCertificate>

If you want viewers to use HTTPS, you must also specify one of the following values in your cache behaviors:

  • <ViewerProtocolPolicy>https-only<ViewerProtocolPolicy>

  • <ViewerProtocolPolicy>redirect-to-https<ViewerProtocolPolicy>

You can also optionally require that CloudFront use HTTPS to communicate with your origin by specifying one of the following values for the applicable origins:

  • <OriginProtocolPolicy>https-only<OriginProtocolPolicy>

  • <OriginProtocolPolicy>match-viewer<OriginProtocolPolicy>

For more information, see Using Alternate Domain Names and HTTPS (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/SecureConnections.html#CNAMEsAndHTTPS) in the Amazon CloudFront Developer Guide.

WebACLId

Type: *string

The Web ACL Id (if any) associated with the distribution.

WebACLId is a required field

Method

GoString

func (s DistributionSummary) GoString() string

GoString returns the string representation

SetARN

func (s *DistributionSummary) SetARN(v string) *DistributionSummary

SetARN sets the ARN field's value.

SetAliases

func (s *DistributionSummary) SetAliases(v *Aliases) *DistributionSummary

SetAliases sets the Aliases field's value.

SetCacheBehaviors

func (s *DistributionSummary) SetCacheBehaviors(v *CacheBehaviors) *DistributionSummary

SetCacheBehaviors sets the CacheBehaviors field's value.

SetComment

func (s *DistributionSummary) SetComment(v string) *DistributionSummary

SetComment sets the Comment field's value.

SetCustomErrorResponses

func (s *DistributionSummary) SetCustomErrorResponses(v *CustomErrorResponses) *DistributionSummary

SetCustomErrorResponses sets the CustomErrorResponses field's value.

SetDefaultCacheBehavior

func (s *DistributionSummary) SetDefaultCacheBehavior(v *DefaultCacheBehavior) *DistributionSummary

SetDefaultCacheBehavior sets the DefaultCacheBehavior field's value.

SetDomainName

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

SetDomainName sets the DomainName field's value.

SetEnabled

func (s *DistributionSummary) SetEnabled(v bool) *DistributionSummary

SetEnabled sets the Enabled field's value.

SetHttpVersion

func (s *DistributionSummary) SetHttpVersion(v string) *DistributionSummary

SetHttpVersion sets the HttpVersion field's value.

SetId

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

SetId sets the Id field's value.

SetIsIPV6Enabled

func (s *DistributionSummary) SetIsIPV6Enabled(v bool) *DistributionSummary

SetIsIPV6Enabled sets the IsIPV6Enabled field's value.

SetLastModifiedTime

func (s *DistributionSummary) SetLastModifiedTime(v time.Time) *DistributionSummary

SetLastModifiedTime sets the LastModifiedTime field's value.

SetOriginGroups

func (s *DistributionSummary) SetOriginGroups(v *OriginGroups) *DistributionSummary

SetOriginGroups sets the OriginGroups field's value.

SetOrigins

func (s *DistributionSummary) SetOrigins(v *Origins) *DistributionSummary

SetOrigins sets the Origins field's value.

SetPriceClass

func (s *DistributionSummary) SetPriceClass(v string) *DistributionSummary

SetPriceClass sets the PriceClass field's value.

SetRestrictions

func (s *DistributionSummary) SetRestrictions(v *Restrictions) *DistributionSummary

SetRestrictions sets the Restrictions field's value.

SetStatus

func (s *DistributionSummary) SetStatus(v string) *DistributionSummary

SetStatus sets the Status field's value.

SetViewerCertificate

func (s *DistributionSummary) SetViewerCertificate(v *ViewerCertificate) *DistributionSummary

SetViewerCertificate sets the ViewerCertificate field's value.

SetWebACLId

func (s *DistributionSummary) SetWebACLId(v string) *DistributionSummary

SetWebACLId sets the WebACLId field's value.

String

func (s DistributionSummary) String() string

String returns the string representation

On this page: