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.

GeoRestriction

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

type GeoRestriction struct { Items []*string `locationNameList:"Location" type:"list"` Quantity *int64 `type:"integer" required:"true"` RestrictionType *string `type:"string" required:"true" enum:"GeoRestrictionType"` }

A complex type that controls the countries in which your content is distributed. CloudFront determines the location of your users using MaxMind GeoIP databases.

Items

Type: []*string

A complex type that contains a Location element for each country in which you want CloudFront either to distribute your content (whitelist) or not distribute your content (blacklist).

The Location element is a two-letter, uppercase country code for a country that you want to include in your blacklist or whitelist. Include one Location element for each country.

CloudFront and MaxMind both use ISO 3166 country codes. For the current list of countries and the corresponding codes, see ISO 3166-1-alpha-2 code on the International Organization for Standardization website. You can also refer to the country list on the CloudFront console, which includes both country names and codes.

Quantity

Type: *int64

When geo restriction is enabled, this is the number of countries in your whitelist or blacklist. Otherwise, when it is not enabled, Quantity is 0, and you can omit Items.

Quantity is a required field

RestrictionType

Type: *string

The method that you want to use to restrict distribution of your content by country:

  • none: No geo restriction is enabled, meaning access to content is not restricted by client geo location.

  • blacklist: The Location elements specify the countries in which you don't want CloudFront to distribute your content.

  • whitelist: The Location elements specify the countries in which you want CloudFront to distribute your content.

RestrictionType is a required field

Method

GoString

func (s GeoRestriction) GoString() string

GoString returns the string representation

SetItems

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

SetItems sets the Items field's value.

SetQuantity

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

SetQuantity sets the Quantity field's value.

SetRestrictionType

func (s *GeoRestriction) SetRestrictionType(v string) *GeoRestriction

SetRestrictionType sets the RestrictionType field's value.

String

func (s GeoRestriction) String() string

String returns the string representation

Validate

func (s *GeoRestriction) Validate() error

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

On this page: