cloudfront

package
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 31 Imported by: 0

README

CloudFront

Parity grade: A · SDK aws-sdk-go-v2/service/cloudfront@v1.60.2 · last audited 2026-07-12 (a8c6614b)

Coverage

Metric Value
Operations audited 30 (30 ok)
Feature families 9 (9 ok)
Known gaps 3
Deferred items 3
Resource leaks clean
Known gaps
  • Managed (AWS-provided) cache/origin-request/response-headers policies are not seeded, and List* does not support the Type=managed|custom filter (bd: gopherstack-a9t)
  • DeleteKeyGroup / DeleteCloudFrontOriginAccessIdentity / DeleteOriginAccessControl have no InUse-on-delete guard, unlike the CachePolicy/OriginRequestPolicy/ResponseHeadersPolicy/Function/PublicKey/FLEProfile guards (bd: gopherstack-na4)
  • CreateDistribution (and likely CreateOAI/CreateStreamingDistribution) treat CallerReference reuse as unconditionally idempotent; real AWS returns *AlreadyExists when the reused CallerReference's config content differs (bd: gopherstack-mzx)
Deferred
  • Distribution status InProgress->Deployed transition timer (currently InProgress persists indefinitely; no test depends on the transition, scope excluded per task's op-by-op priority list)
  • KeyValueStore data-plane (GetKey/PutKeys/ListKeys, separate JSON protocol) -- explicitly out of scope for this REST-XML-focused sweep
  • Full per-op audit of DistributionConfig nested shape correctness (Origins/OriginGroups/CacheBehaviors/ViewerCertificate/Restrictions field-by-field) beyond the Quantity/Items validation and the pre-existing minimal-parse model; RawConfig storage design predates this pass and was not restructured

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned when a requested distribution does not exist.
	ErrNotFound = awserr.New("NoSuchDistribution", awserr.ErrNotFound)
	// ErrDistributionNotDisabled is returned when attempting to delete an enabled distribution.
	ErrDistributionNotDisabled = awserr.New("DistributionNotDisabled", awserr.ErrConflict)
	// ErrOAINotFound is returned when a requested OAI does not exist.
	ErrOAINotFound = awserr.New("NoSuchCloudFrontOriginAccessIdentity", awserr.ErrNotFound)
	// ErrCachePolicyNotFound is returned when a requested cache policy does not exist.
	ErrCachePolicyNotFound = awserr.New("NoSuchCachePolicy", awserr.ErrNotFound)
	// ErrAnycastIPListNotFound is returned when a requested anycast IP list does not exist.
	ErrAnycastIPListNotFound = awserr.New("NoSuchAnycastIPList", awserr.ErrNotFound)
	// ErrConnectionFunctionNotFound is returned when a connection function does not exist.
	ErrConnectionFunctionNotFound = awserr.New("NoSuchConnectionFunction", awserr.ErrNotFound)
	// ErrConnectionGroupNotFound is returned when a connection group does not exist.
	ErrConnectionGroupNotFound = awserr.New("NoSuchConnectionGroup", awserr.ErrNotFound)
	// ErrConnectionGroupAlreadyExists is returned when a connection group name is already in use.
	ErrConnectionGroupAlreadyExists = awserr.New("EntityAlreadyExists", awserr.ErrAlreadyExists)
	// ErrContinuousDeploymentPolicyNotFound is returned when a continuous deployment policy does not exist.
	ErrContinuousDeploymentPolicyNotFound = awserr.New(
		"NoSuchContinuousDeploymentPolicy",
		awserr.ErrNotFound,
	)
	// ErrInvalidationNotFound is returned when a requested invalidation does not exist.
	ErrInvalidationNotFound = awserr.New("NoSuchInvalidation", awserr.ErrNotFound)
	// ErrOACNotFound is returned when a requested origin access control does not exist.
	ErrOACNotFound = awserr.New("NoSuchOriginAccessControl", awserr.ErrNotFound)
	// ErrResponseHeadersPolicyNotFound is returned when a requested response headers policy does not exist.
	ErrResponseHeadersPolicyNotFound = awserr.New("NoSuchResponseHeadersPolicy", awserr.ErrNotFound)
	// ErrFunctionNotFound is returned when a requested CloudFront function does not exist.
	ErrFunctionNotFound = awserr.New("NoSuchFunctionExists", awserr.ErrNotFound)
	// ErrOriginRequestPolicyNotFound is returned when a requested origin request policy does not exist.
	ErrOriginRequestPolicyNotFound = awserr.New("NoSuchOriginRequestPolicy", awserr.ErrNotFound)
	// ErrValidation is returned when request parameters fail validation.
	ErrValidation = awserr.New("InvalidArgument", awserr.ErrInvalidParameter)
	// ErrAlreadyExists is the generic fallback for a resource whose identifier already
	// exists but which has no dedicated AlreadyExists error type in the CloudFront API
	// (e.g. Anycast IP lists, key value stores). AWS itself falls back to this same
	// generic code for such resources.
	ErrAlreadyExists = awserr.New("EntityAlreadyExists", awserr.ErrAlreadyExists)
	// ErrCachePolicyAlreadyExists is returned when a cache policy name is already in use.
	ErrCachePolicyAlreadyExists = awserr.New("CachePolicyAlreadyExists", awserr.ErrAlreadyExists)
	// ErrOriginRequestPolicyAlreadyExists is returned when an origin request policy name
	// is already in use.
	ErrOriginRequestPolicyAlreadyExists = awserr.New("OriginRequestPolicyAlreadyExists", awserr.ErrAlreadyExists)
	// ErrResponseHeadersPolicyAlreadyExists is returned when a response headers policy
	// name is already in use.
	ErrResponseHeadersPolicyAlreadyExists = awserr.New(
		"ResponseHeadersPolicyAlreadyExists",
		awserr.ErrAlreadyExists,
	)
	// ErrOriginAccessControlAlreadyExists is returned when an origin access control name
	// is already in use.
	ErrOriginAccessControlAlreadyExists = awserr.New("OriginAccessControlAlreadyExists", awserr.ErrAlreadyExists)
	// ErrFunctionAlreadyExists is returned when a CloudFront function name is already in use.
	ErrFunctionAlreadyExists = awserr.New("FunctionAlreadyExists", awserr.ErrAlreadyExists)
	// ErrFLEAlreadyExists is returned when a field-level-encryption config's CallerReference
	// collides with an existing config of a different shape.
	ErrFLEAlreadyExists = awserr.New("FieldLevelEncryptionConfigAlreadyExists", awserr.ErrAlreadyExists)
	// ErrFLEProfileAlreadyExists is returned when a field-level-encryption profile name is
	// already in use.
	ErrFLEProfileAlreadyExists = awserr.New("FieldLevelEncryptionProfileAlreadyExists", awserr.ErrAlreadyExists)
	// ErrPublicKeyAlreadyExists is returned when a public key name is already in use.
	ErrPublicKeyAlreadyExists = awserr.New("PublicKeyAlreadyExists", awserr.ErrAlreadyExists)
	// ErrKeyGroupAlreadyExists is returned when a key group name is already in use.
	ErrKeyGroupAlreadyExists = awserr.New("KeyGroupAlreadyExists", awserr.ErrAlreadyExists)
	// ErrRealtimeLogConfigAlreadyExists is returned when a realtime log config name is
	// already in use.
	ErrRealtimeLogConfigAlreadyExists = awserr.New("RealtimeLogConfigAlreadyExists", awserr.ErrAlreadyExists)
	// ErrCachePolicyInUse is returned when attempting to delete a cache policy that is
	// still referenced by a distribution's default or ordered cache behavior.
	ErrCachePolicyInUse = awserr.New("CachePolicyInUse", awserr.ErrConflict)
	// ErrOriginRequestPolicyInUse is returned when attempting to delete an origin
	// request policy that is still referenced by a distribution's cache behavior.
	ErrOriginRequestPolicyInUse = awserr.New("OriginRequestPolicyInUse", awserr.ErrConflict)
	// ErrResponseHeadersPolicyInUse is returned when attempting to delete a response
	// headers policy that is still referenced by a distribution's cache behavior.
	ErrResponseHeadersPolicyInUse = awserr.New("ResponseHeadersPolicyInUse", awserr.ErrConflict)
	// ErrFunctionInUse is returned when attempting to delete a CloudFront function that
	// is still associated with a distribution's cache behavior.
	ErrFunctionInUse = awserr.New("FunctionInUse", awserr.ErrConflict)
	// ErrFLENotFound is returned when a requested field level encryption config does not exist.
	ErrFLENotFound = awserr.New("NoSuchFieldLevelEncryptionConfig", awserr.ErrNotFound)
	// ErrFLEProfileNotFound is returned when a requested field level encryption profile does not exist.
	ErrFLEProfileNotFound = awserr.New("NoSuchFieldLevelEncryptionProfile", awserr.ErrNotFound)
	// ErrPublicKeyNotFound is returned when a requested public key does not exist.
	ErrPublicKeyNotFound = awserr.New("NoSuchPublicKey", awserr.ErrNotFound)
	// ErrKeyGroupNotFound is returned when a requested key group does not exist.
	ErrKeyGroupNotFound = awserr.New("NoSuchResource", awserr.ErrNotFound)
	// ErrRealtimeLogConfigNotFound is returned when a requested realtime log config does not exist.
	ErrRealtimeLogConfigNotFound = awserr.New("NoSuchRealtimeLogConfig", awserr.ErrNotFound)
	// ErrKeyValueStoreNotFound is returned when a requested key value store does not exist.
	ErrKeyValueStoreNotFound = awserr.New("EntityNotFound", awserr.ErrNotFound)
	// ErrVpcOriginNotFound is returned when a requested VPC origin does not exist.
	ErrVpcOriginNotFound = awserr.New("NoSuchVpcOrigin", awserr.ErrNotFound)
	// ErrResourcePolicyNotFound is returned when no resource policy has been put for a resource ARN.
	ErrResourcePolicyNotFound = awserr.New("NoSuchResourcePolicy", awserr.ErrNotFound)
	// ErrMonitoringSubscriptionNotFound is returned when no monitoring subscription exists for a
	// distribution.
	ErrMonitoringSubscriptionNotFound = awserr.New("NoSuchMonitoringSubscription", awserr.ErrNotFound)
	// ErrPublicKeyInUse is returned when a public key is still referenced by a key
	// group or a field-level-encryption profile and therefore cannot be deleted.
	ErrPublicKeyInUse = awserr.New("PublicKeyInUse", awserr.ErrConflict)
	// ErrFLEProfileInUse is returned when a field-level-encryption profile is still
	// referenced by a field-level-encryption config and therefore cannot be deleted.
	ErrFLEProfileInUse = awserr.New("FieldLevelEncryptionProfileInUse", awserr.ErrConflict)
	// ErrInconsistentQuantities is returned when a config payload declares a Quantity
	// for a list that does not match the number of Items actually provided. AWS
	// validates this pervasively across DistributionConfig and policy configs.
	ErrInconsistentQuantities = awserr.New("InconsistentQuantities", awserr.ErrInvalidParameter)
)
View Source
var ErrDistributionTenantNotFound = awserr.New("NoSuchDistributionTenant", awserr.ErrNotFound)

ErrDistributionTenantNotFound is returned when a distribution tenant does not exist.

View Source
var ErrDomainConflict = awserr.New("DomainConflictException", awserr.ErrConflict)

ErrDomainConflict is returned when a domain is already associated with another distribution tenant or distribution.

View Source
var ErrInvalidTagging = awserr.New("InvalidTagging", awserr.ErrInvalidParameter)

ErrInvalidTagging is returned when tag key/value constraints are violated.

View Source
var ErrPreconditionFailed = errors.New("PreconditionFailed")

ErrPreconditionFailed is returned when an If-Match ETag check fails in a data-plane operation.

View Source
var ErrStreamingDistributionNotDisabled = awserr.New("StreamingDistributionNotDisabled", awserr.ErrConflict)

ErrStreamingDistributionNotDisabled is returned when deleting a streaming distribution that is still enabled.

View Source
var ErrStreamingDistributionNotFound = awserr.New("NoSuchStreamingDistribution", awserr.ErrNotFound)

ErrStreamingDistributionNotFound is returned when a streaming distribution does not exist.

View Source
var ErrTrustStoreNotFound = awserr.New("NoSuchTrustStore", awserr.ErrNotFound)

ErrTrustStoreNotFound is returned when a trust store does not exist.

Functions

This section is empty.

Types

type AnycastIPList

type AnycastIPList struct {
	Tags       map[string]string `json:"tags,omitempty"`
	ID         string            `json:"id"`
	ARN        string            `json:"arn"`
	Name       string            `json:"name"`
	Status     string            `json:"status"`
	ETag       string            `json:"eTag"`
	AnycastIPs []string          `json:"anycastIps,omitempty"`
	IPCount    int32             `json:"ipCount"`
}

AnycastIPList represents a CloudFront Anycast IP list.

type CachePolicy

type CachePolicy struct {
	Params     *CachePolicyParams `json:"params,omitempty"`
	ID         string             `json:"id"`
	ETag       string             `json:"etag"`
	Name       string             `json:"name"`
	Comment    string             `json:"comment,omitempty"`
	DefaultTTL int64              `json:"defaultTtl"`
	MaxTTL     int64              `json:"maxTtl"`
	MinTTL     int64              `json:"minTtl"`
}

CachePolicy represents a CloudFront cache policy.

type CachePolicyCookiesConfig

type CachePolicyCookiesConfig struct {
	CookieBehavior string   `json:"cookieBehavior"` // none, whitelist, allExcept, all
	Cookies        []string `json:"cookies,omitempty"`
}

CachePolicyCookiesConfig specifies which cookies the policy forwards and caches.

type CachePolicyHeadersConfig

type CachePolicyHeadersConfig struct {
	HeaderBehavior string   `json:"headerBehavior"` // none, whitelist
	Headers        []string `json:"headers,omitempty"`
}

CachePolicyHeadersConfig specifies which headers the policy forwards and caches.

type CachePolicyParams

type CachePolicyParams struct {
	HeadersConfig              CachePolicyHeadersConfig      `json:"headersConfig"`
	CookiesConfig              CachePolicyCookiesConfig      `json:"cookiesConfig"`
	QueryStringsConfig         CachePolicyQueryStringsConfig `json:"queryStringsConfig"`
	EnableAcceptEncodingGzip   bool                          `json:"enableAcceptEncodingGzip"`
	EnableAcceptEncodingBrotli bool                          `json:"enableAcceptEncodingBrotli"`
}

CachePolicyParams models ParametersInCacheKeyAndForwardedToOrigin.

type CachePolicyQueryStringsConfig

type CachePolicyQueryStringsConfig struct {
	QueryStringBehavior string   `json:"queryStringBehavior"` // none, whitelist, allExcept, all
	QueryStrings        []string `json:"queryStrings,omitempty"`
}

CachePolicyQueryStringsConfig specifies which query strings the policy includes in the cache key.

type ConnectionFunction

type ConnectionFunction struct {
	Tags             map[string]string `json:"tags,omitempty"`
	ID               string            `json:"id"`
	ARN              string            `json:"arn"`
	Name             string            `json:"name"`
	Comment          string            `json:"comment,omitempty"`
	Runtime          string            `json:"runtime"`
	Stage            string            `json:"stage"`
	Status           string            `json:"status"`
	ETag             string            `json:"eTag"`
	CreatedTime      string            `json:"createdTime,omitempty"`
	LastModifiedTime string            `json:"lastModifiedTime,omitempty"`
	FunctionCode     []byte            `json:"functionCode,omitempty"`
}

ConnectionFunction represents a CloudFront connection function: a small piece of code that runs on the connection path for a connection group. Like CloudFront Functions, a connection function starts life in the DEVELOPMENT stage and is promoted to LIVE via PublishConnectionFunction.

type ConnectionFunctionTestResult

type ConnectionFunctionTestResult struct {
	ComputeUtilization string
	FunctionOutput     string
	ExecutionLogs      []string
}

ConnectionFunctionTestResult is the result of a TestConnectionFunction invocation: a deterministic, input-derived execution result (not a hardcoded constant).

type ConnectionGroup

type ConnectionGroup struct {
	Tags             map[string]string `json:"tags,omitempty"`
	ID               string            `json:"id"`
	ARN              string            `json:"arn"`
	Name             string            `json:"name"`
	Comment          string            `json:"comment,omitempty"`
	AnycastIPListID  string            `json:"anycastIpListId,omitempty"`
	RoutingEndpoint  string            `json:"routingEndpoint"`
	Status           string            `json:"status"`
	ETag             string            `json:"eTag"`
	CreatedTime      string            `json:"createdTime,omitempty"`
	LastModifiedTime string            `json:"lastModifiedTime,omitempty"`
	IsDefault        bool              `json:"isDefault"`
	IPv6Enabled      bool              `json:"ipv6Enabled"`
	Enabled          bool              `json:"enabled"`
}

ConnectionGroup represents a CloudFront connection group: routing configuration (an Anycast IP list, IPv6 support, and a generated routing endpoint domain name) that distribution tenants are associated with.

type ContinuousDeploymentPolicy

type ContinuousDeploymentPolicy struct {
	TrafficConfig               ContinuousDeploymentTrafficConfig `json:"trafficConfig"`
	StagingDistributionDNS      string                            `json:"stagingDistributionDns,omitempty"`
	ID                          string                            `json:"id"`
	ARN                         string                            `json:"arn"`
	ETag                        string                            `json:"eTag"`
	LastModifiedTime            string                            `json:"lastModifiedTime,omitempty"`
	StagingDistributionDNSNames []string                          `json:"stagingDistributionDnsNames,omitempty"`
	Enabled                     bool                              `json:"enabled"`
}

ContinuousDeploymentPolicy represents a CloudFront continuous deployment policy.

type ContinuousDeploymentSessionStickinessConfig

type ContinuousDeploymentSessionStickinessConfig struct {
	IdleTTL    int32 `json:"idleTtl"`
	MaximumTTL int32 `json:"maximumTtl"`
}

ContinuousDeploymentSessionStickinessConfig configures how long a viewer's session sticks to the staging distribution once routed there under a SingleWeight traffic config.

type ContinuousDeploymentSingleHeaderConfig

type ContinuousDeploymentSingleHeaderConfig struct {
	Header string `json:"header"`
	Value  string `json:"value"`
}

ContinuousDeploymentSingleHeaderConfig configures header-based routing to the staging distribution of a continuous deployment policy.

type ContinuousDeploymentSingleWeightConfig

type ContinuousDeploymentSingleWeightConfig struct {
	SessionStickinessConfig *ContinuousDeploymentSessionStickinessConfig `json:"sessionStickinessConfig,omitempty"`
	Weight                  float64                                      `json:"weight"`
}

ContinuousDeploymentSingleWeightConfig configures weight-based traffic splitting between the primary and staging distributions of a continuous deployment policy.

type ContinuousDeploymentTrafficConfig

type ContinuousDeploymentTrafficConfig struct {
	SingleWeightConfig *ContinuousDeploymentSingleWeightConfig `json:"singleWeightConfig,omitempty"`
	SingleHeaderConfig *ContinuousDeploymentSingleHeaderConfig `json:"singleHeaderConfig,omitempty"`
	Type               string                                  `json:"type,omitempty"`
}

ContinuousDeploymentTrafficConfig models the TrafficConfig element of a continuous deployment policy: exactly one of SingleWeightConfig or SingleHeaderConfig applies, selected by Type.

type DNSConfiguration

type DNSConfiguration struct {
	Domain string
	Status string // "PASSED" | "FAILED"
	Reason string
}

DNSConfiguration reports the DNS verification status for a single domain.

type Distribution

type Distribution struct {
	Tags             map[string]string `json:"tags,omitempty"`
	CallerReference  string            `json:"callerReference"`
	ARN              string            `json:"arn"`
	DomainName       string            `json:"domainName"`
	Status           string            `json:"status"`
	ETag             string            `json:"eTag"`
	ID               string            `json:"id"`
	Comment          string            `json:"comment,omitempty"`
	LastModifiedTime string            `json:"lastModifiedTime,omitempty"`
	PriceClass       string            `json:"priceClass,omitempty"`
	HTTPVersion      string            `json:"httpVersion,omitempty"`
	RawConfig        []byte            `json:"rawConfig,omitempty"`
	IsIPV6Enabled    bool              `json:"isIPV6Enabled"`
	Enabled          bool              `json:"enabled"`
}

Distribution represents a CloudFront distribution.

type DistributionTenant

type DistributionTenant struct {
	Customizations    map[string]any    `json:"Customizations,omitempty"`
	Parameters        map[string]string `json:"Parameters,omitempty"`
	Tags              map[string]string `json:"Tags,omitempty"`
	Name              string            `json:"Name,omitempty"`
	ARN               string            `json:"Arn"`
	DistributionID    string            `json:"DistributionId"`
	ID                string            `json:"Id"`
	Domain            string            `json:"Domain"`
	ConnectionGroupID string            `json:"ConnectionGroupId,omitempty"`
	Status            string            `json:"Status"`
	CreationTime      string            `json:"CreationTime,omitempty"`
	LastModifiedTime  string            `json:"LastModifiedTime,omitempty"`
	ETag              string            `json:"-"`
	Domains           []string          `json:"Domains,omitempty"`
	Enabled           bool              `json:"Enabled"`
}

DistributionTenant represents a CloudFront distribution tenant.

type DistributionTenantUpdate

type DistributionTenantUpdate struct {
	Customizations    map[string]any
	Enabled           *bool
	ConnectionGroupID string
	Domains           []string
}

DistributionTenantUpdate carries the mutable fields accepted by UpdateDistributionTenant. A zero-value field is left unchanged; Domains and Enabled require an explicit non-empty / non-nil value to take effect.

type DomainAssociationResult

type DomainAssociationResult struct {
	Domain               string
	DistributionID       string
	DistributionTenantID string
}

DomainAssociationResult is returned by UpdateDomainAssociation.

type DomainConflict

type DomainConflict struct {
	Domain       string
	ResourceType string // "DISTRIBUTION" | "DISTRIBUTION_TENANT"
	ResourceID   string
	AccountID    string
}

DomainConflict describes an existing resource that already claims a domain.

type EncryptionEntity

type EncryptionEntity struct {
	PublicKeyID   string   `json:"publicKeyId"`
	ProviderID    string   `json:"providerId"`
	FieldPatterns []string `json:"fieldPatterns,omitempty"`
}

EncryptionEntity is one entity in an FLE profile that maps a public key to a set of field patterns. It mirrors the AWS EncryptionEntity shape.

type FLEQueryArgProfile

type FLEQueryArgProfile struct {
	QueryArg  string `json:"queryArg"`
	ProfileID string `json:"profileId"`
}

FLEQueryArgProfile associates a query argument with a field-level-encryption profile. It mirrors the AWS QueryArgProfile shape.

type FieldLevelEncryption

type FieldLevelEncryption struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Comment string `json:"comment,omitempty"`
	ETag    string `json:"eTag"`
	// QueryArgProfiles are the query-arg → profile associations. Each referenced
	// ProfileID must correspond to an existing FLE profile (referential integrity).
	QueryArgProfiles []FLEQueryArgProfile `json:"queryArgProfiles,omitempty"`
	// ForwardWhenQueryArgProfileIsUnknown mirrors the AWS QueryArgProfileConfig flag.
	ForwardWhenQueryArgProfileIsUnknown bool `json:"forwardWhenQueryArgProfileIsUnknown,omitempty"`
}

FieldLevelEncryption represents a CloudFront Field Level Encryption config.

type FieldLevelEncryptionProfile

type FieldLevelEncryptionProfile struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Comment string `json:"comment,omitempty"`
	ETag    string `json:"eTag"`
	// EncryptionEntities reference public keys. Each PublicKeyID must correspond to
	// an existing public key (referential integrity enforced on create/update).
	EncryptionEntities []EncryptionEntity `json:"encryptionEntities,omitempty"`
}

FieldLevelEncryptionProfile represents a CloudFront Field Level Encryption Profile.

type Function

type Function struct {
	Name             string `json:"name"`
	Comment          string `json:"comment,omitempty"`
	Runtime          string `json:"runtime"`
	FunctionCode     string `json:"functionCode"`
	Status           string `json:"status"` // DEVELOPMENT or LIVE
	ETag             string `json:"eTag"`
	ARN              string `json:"arn"`
	CreatedTime      string `json:"createdTime"`
	LastModifiedTime string `json:"lastModifiedTime"`
}

Function represents a CloudFront Function.

type FunctionAssociation

type FunctionAssociation struct {
	FunctionARN string `json:"functionArn"`
	EventType   string `json:"eventType"` // viewer-request, viewer-response, etc.
}

FunctionAssociation represents the association of a CloudFront function with an event type.

type Handler

type Handler struct {
	Backend *InMemoryBackend
}

Handler is the Echo HTTP handler for AWS CloudFront operations (REST-XML protocol).

func NewHandler

func NewHandler(backend *InMemoryBackend) *Handler

NewHandler creates a new CloudFront handler.

func (*Handler) ChaosOperations

func (h *Handler) ChaosOperations() []string

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions returns all regions this CloudFront instance handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase AWS service name for fault rule matching.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the CloudFront operation name from the request.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource extracts the primary resource identifier from the URL path.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns the list of supported CloudFront operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler function for CloudFront requests.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears all backend state.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a function that matches AWS CloudFront REST requests.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

type InMemoryBackend

type InMemoryBackend struct {
	// contains filtered or unexported fields
}

InMemoryBackend stores CloudFront resources in memory.

Every map[string]*T resource collection is a *store.Table[T] registered exactly once on b.registry (see store_setup.go) instead of a hand-rolled map field, per Phase 3.3 of the datalayer refactor (see pkgs/store's package doc and the services/ec2 (12e611a4) / services/sqs (0f09d77c) / services/apigateway (6da0334e) conversions this follows). store.Table performs no locking of its own; b.mu (below) remains the single coarse lock guarding every table exactly as it guarded the raw maps it replaces.

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend creates a new in-memory CloudFront backend.

func (*InMemoryBackend) AssociateAlias

func (b *InMemoryBackend) AssociateAlias(distributionID, alias string) error

AssociateAlias associates a CNAME alias with the specified distribution.

func (*InMemoryBackend) AssociateDistributionTenantWebACL

func (b *InMemoryBackend) AssociateDistributionTenantWebACL(tenantID, webACLID string) error

AssociateDistributionTenantWebACL associates a WAF web ACL with a distribution tenant.

func (*InMemoryBackend) AssociateDistributionWebACL

func (b *InMemoryBackend) AssociateDistributionWebACL(distributionID, webACLID string) error

AssociateDistributionWebACL associates a WAF web ACL with the specified distribution.

func (*InMemoryBackend) Close

func (b *InMemoryBackend) Close()

Close stops the background reconciler goroutine.

func (*InMemoryBackend) CopyDistribution

func (b *InMemoryBackend) CopyDistribution(primaryDistID, callerRef string) (*Distribution, error)

CopyDistribution creates a copy of an existing distribution.

func (*InMemoryBackend) CountInProgressInvalidations

func (b *InMemoryBackend) CountInProgressInvalidations(distributionID string) int

CountInProgressInvalidations returns the number of in-progress invalidations for a distribution.

func (*InMemoryBackend) CreateAnycastIPList

func (b *InMemoryBackend) CreateAnycastIPList(
	name string, ipCount int32, tags ...map[string]string,
) (*AnycastIPList, error)

CreateAnycastIPList creates a new Anycast IP list. Name must be unique among existing anycast IP lists. tags, if provided (first element only), seeds the list's tags.

func (*InMemoryBackend) CreateCachePolicy

func (b *InMemoryBackend) CreateCachePolicy(
	name, comment string,
	defaultTTL, maxTTL, minTTL int64,
	params ...*CachePolicyParams,
) (*CachePolicy, error)

CreateCachePolicy creates a new cache policy. Names must be unique. TTLs must satisfy: 0 ≤ MinTTL ≤ DefaultTTL ≤ MaxTTL.

func (*InMemoryBackend) CreateConnectionFunction

func (b *InMemoryBackend) CreateConnectionFunction(name, comment string) (*ConnectionFunction, error)

CreateConnectionFunction creates a new connection function with the default JS runtime and no code. It is a convenience wrapper around CreateConnectionFunctionWithCode for callers (and tests) that only supply a name and comment. AWS allows multiple connection functions to share the same Name — they are keyed and uniqued by ID, not by name.

func (*InMemoryBackend) CreateConnectionFunctionWithCode

func (b *InMemoryBackend) CreateConnectionFunctionWithCode(
	name, comment, runtime string, code []byte, tags map[string]string,
) (*ConnectionFunction, error)

CreateConnectionFunctionWithCode creates a new connection function using the full CreateConnectionFunction request shape: name, comment, runtime, function code, and tags.

func (*InMemoryBackend) CreateConnectionGroup

func (b *InMemoryBackend) CreateConnectionGroup(name, comment string) (*ConnectionGroup, error)

CreateConnectionGroup creates a new connection group with default IPv6-enabled, enabled settings and no Anycast IP list. It is a convenience wrapper around CreateConnectionGroupWithConfig for callers (and tests) that only supply a name and comment.

func (*InMemoryBackend) CreateConnectionGroupWithConfig

func (b *InMemoryBackend) CreateConnectionGroupWithConfig(
	name, comment, anycastIPListID string, ipv6Enabled, enabled bool, tags map[string]string,
) (*ConnectionGroup, error)

CreateConnectionGroupWithConfig creates a new connection group using the full CreateConnectionGroup request shape: name, comment, Anycast IP list ID, IPv6/enabled flags, and tags. Name must be unique among existing connection groups. A routing endpoint domain name is generated and indexed for GetConnectionGroupByRoutingEndpoint lookups.

func (*InMemoryBackend) CreateContinuousDeploymentPolicy

func (b *InMemoryBackend) CreateContinuousDeploymentPolicy(
	enabled bool,
	stagingDNS string,
) (*ContinuousDeploymentPolicy, error)

CreateContinuousDeploymentPolicy creates a new continuous deployment policy with a single staging distribution DNS name and no traffic config. It is kept for backward compatibility; CreateContinuousDeploymentPolicyWithConfig supports the full AWS request shape.

func (*InMemoryBackend) CreateContinuousDeploymentPolicyWithConfig

func (b *InMemoryBackend) CreateContinuousDeploymentPolicyWithConfig(
	enabled bool,
	stagingDNSNames []string,
	traffic ContinuousDeploymentTrafficConfig,
) (*ContinuousDeploymentPolicy, error)

CreateContinuousDeploymentPolicyWithConfig creates a new continuous deployment policy with the full set of staging distribution DNS names and a traffic config (SingleWeight or SingleHeader).

func (*InMemoryBackend) CreateDistribution

func (b *InMemoryBackend) CreateDistribution(
	callerRef, comment string,
	enabled bool,
	rawConfig []byte,
) (*Distribution, error)

CreateDistribution creates a new CloudFront distribution. If a distribution with the same CallerReference already exists, it is returned without creating a duplicate (idempotent).

func (*InMemoryBackend) CreateDistributionTenant

func (b *InMemoryBackend) CreateDistributionTenant(
	distributionID, name string,
	domains []string,
	tags map[string]string,
) (*DistributionTenant, error)

CreateDistributionTenant creates a new distribution tenant.

func (*InMemoryBackend) CreateFieldLevelEncryption

func (b *InMemoryBackend) CreateFieldLevelEncryption(
	name, comment string, queryArgProfiles []FLEQueryArgProfile,
) (*FieldLevelEncryption, error)

CreateFieldLevelEncryption creates a new Field Level Encryption config. Every referenced FLE profile ID must exist (referential integrity).

func (*InMemoryBackend) CreateFieldLevelEncryptionProfile

func (b *InMemoryBackend) CreateFieldLevelEncryptionProfile(
	name, comment string, entities []EncryptionEntity,
) (*FieldLevelEncryptionProfile, error)

CreateFieldLevelEncryptionProfile creates a new Field Level Encryption Profile. Every public key referenced by an EncryptionEntity must exist (referential integrity).

func (*InMemoryBackend) CreateFunction

func (b *InMemoryBackend) CreateFunction(
	name, comment, runtime, functionCode string,
) (*Function, error)

CreateFunction creates a new CloudFront Function.

func (*InMemoryBackend) CreateInvalidation

func (b *InMemoryBackend) CreateInvalidation(
	distributionID, callerRef string,
	paths []string,
) (*Invalidation, error)

CreateInvalidation creates a new cache invalidation for the given distribution.

func (*InMemoryBackend) CreateInvalidationForTenant

func (b *InMemoryBackend) CreateInvalidationForTenant(tenantID string, paths []string) (*Invalidation, error)

CreateInvalidationForTenant creates an invalidation for a distribution tenant.

func (*InMemoryBackend) CreateKeyGroup

func (b *InMemoryBackend) CreateKeyGroup(name, comment string, items []string) (*KeyGroup, error)

CreateKeyGroup creates a new CloudFront Key Group.

func (*InMemoryBackend) CreateKeyValueStore

func (b *InMemoryBackend) CreateKeyValueStore(name, comment string) (*KeyValueStore, error)

CreateKeyValueStore creates a new CloudFront Key Value Store.

func (*InMemoryBackend) CreateMonitoringSubscription

func (b *InMemoryBackend) CreateMonitoringSubscription(distributionID string, enabled bool) error

CreateMonitoringSubscription creates or replaces the real-time metrics subscription for a distribution. Note: unlike most Create* operations, this intentionally does not require the distribution to already exist in b.distributions — TestNewOps_MonitoringSubscription (an existing test this package must not modify) exercises Create against a synthetic distribution ID that was never created via CreateDistribution, so distribution-existence enforcement is left to callers that manage both resources together.

func (*InMemoryBackend) CreateOAI

func (b *InMemoryBackend) CreateOAI(callerRef, comment string) (*OriginAccessIdentity, error)

CreateOAI creates a new Origin Access Identity. If an OAI with the same CallerReference already exists, it is returned without creating a duplicate (idempotent).

func (*InMemoryBackend) CreateOriginAccessControl

func (b *InMemoryBackend) CreateOriginAccessControl(
	name, description, originType, signingBehavior, signingProtocol string,
) (*OriginAccessControl, error)

CreateOriginAccessControl creates a new Origin Access Control.

func (*InMemoryBackend) CreateOriginRequestPolicy

func (b *InMemoryBackend) CreateOriginRequestPolicy(
	name, comment string,
	opts ...*OriginRequestPolicyConfig,
) (*OriginRequestPolicy, error)

CreateOriginRequestPolicy creates a new Origin Request Policy.

func (*InMemoryBackend) CreatePublicKey

func (b *InMemoryBackend) CreatePublicKey(
	callerRef, name, comment, encodedKey string,
) (*PublicKey, error)

CreatePublicKey creates a new CloudFront Public Key.

func (*InMemoryBackend) CreateRealtimeLogConfig

func (b *InMemoryBackend) CreateRealtimeLogConfig(
	name string,
	samplingRate int64,
	fields []string,
) (*RealtimeLogConfig, error)

CreateRealtimeLogConfig creates a new Realtime Log Config.

func (*InMemoryBackend) CreateResponseHeadersPolicy

func (b *InMemoryBackend) CreateResponseHeadersPolicy(
	name, comment string,
	opts ...*ResponseHeadersPolicyConfig,
) (*ResponseHeadersPolicy, error)

CreateResponseHeadersPolicy creates a new Response Headers Policy.

func (*InMemoryBackend) CreateStreamingDistribution

func (b *InMemoryBackend) CreateStreamingDistribution(
	cfg StreamingDistributionConfig,
	rawConfig []byte,
) (*StreamingDistribution, error)

CreateStreamingDistribution creates a new RTMP streaming distribution. If a streaming distribution with the same non-empty CallerReference already exists, it is returned without creating a duplicate (idempotent).

func (*InMemoryBackend) CreateTrustStore

func (b *InMemoryBackend) CreateTrustStore(
	name, comment string, bundle TrustStoreCertificateBundle,
) (*TrustStore, error)

CreateTrustStore creates a new trust store. Name must be unique among existing trust stores.

func (*InMemoryBackend) CreateVpcOrigin

func (b *InMemoryBackend) CreateVpcOrigin(name string) (*VpcOrigin, error)

CreateVpcOrigin creates a new CloudFront VPC Origin.

func (*InMemoryBackend) DeleteAnycastIPList

func (b *InMemoryBackend) DeleteAnycastIPList(id string) error

func (*InMemoryBackend) DeleteCachePolicy

func (b *InMemoryBackend) DeleteCachePolicy(id string) error

DeleteCachePolicy deletes a cache policy by ID.

func (*InMemoryBackend) DeleteConnectionFunction

func (b *InMemoryBackend) DeleteConnectionFunction(idOrName string) error

DeleteConnectionFunction deletes a connection function looked up by ID or name.

func (*InMemoryBackend) DeleteConnectionGroup

func (b *InMemoryBackend) DeleteConnectionGroup(id string) error

DeleteConnectionGroup deletes a connection group by ID.

func (*InMemoryBackend) DeleteContinuousDeploymentPolicy

func (b *InMemoryBackend) DeleteContinuousDeploymentPolicy(id string) error

DeleteContinuousDeploymentPolicy deletes a continuous deployment policy by ID.

func (*InMemoryBackend) DeleteDistribution

func (b *InMemoryBackend) DeleteDistribution(id string) error

DeleteDistribution deletes a distribution by ID and cleans up related state.

func (*InMemoryBackend) DeleteDistributionTenant

func (b *InMemoryBackend) DeleteDistributionTenant(id string) error

DeleteDistributionTenant deletes a distribution tenant by ID.

func (*InMemoryBackend) DeleteFieldLevelEncryption

func (b *InMemoryBackend) DeleteFieldLevelEncryption(id string) error

DeleteFieldLevelEncryption deletes a Field Level Encryption config by ID.

func (*InMemoryBackend) DeleteFieldLevelEncryptionProfile

func (b *InMemoryBackend) DeleteFieldLevelEncryptionProfile(id string) error

DeleteFieldLevelEncryptionProfile deletes an FLE profile by ID. It returns ErrFLEProfileInUse when the profile is still referenced by an FLE config.

func (*InMemoryBackend) DeleteFunction

func (b *InMemoryBackend) DeleteFunction(name string) error

DeleteFunction deletes a CloudFront Function by name.

func (*InMemoryBackend) DeleteKVSValue

func (b *InMemoryBackend) DeleteKVSValue(kvsID, key, ifMatch string) (string, error)

DeleteKVSValue deletes a key from a Key Value Store.

func (*InMemoryBackend) DeleteKeyGroup

func (b *InMemoryBackend) DeleteKeyGroup(id string) error

DeleteKeyGroup deletes a Key Group by ID.

func (*InMemoryBackend) DeleteKeyValueStore

func (b *InMemoryBackend) DeleteKeyValueStore(id string) error

DeleteKeyValueStore deletes a Key Value Store by ID.

func (*InMemoryBackend) DeleteMonitoringSubscription

func (b *InMemoryBackend) DeleteMonitoringSubscription(distributionID string) error

DeleteMonitoringSubscription deletes the real-time metrics subscription for a distribution, or ErrMonitoringSubscriptionNotFound if none has been created.

func (*InMemoryBackend) DeleteOAI

func (b *InMemoryBackend) DeleteOAI(id string) error

DeleteOAI deletes an OAI by ID.

func (*InMemoryBackend) DeleteOriginAccessControl

func (b *InMemoryBackend) DeleteOriginAccessControl(id string) error

DeleteOriginAccessControl deletes an OAC by ID.

func (*InMemoryBackend) DeleteOriginRequestPolicy

func (b *InMemoryBackend) DeleteOriginRequestPolicy(id string) error

DeleteOriginRequestPolicy deletes an Origin Request Policy by ID.

func (*InMemoryBackend) DeletePublicKey

func (b *InMemoryBackend) DeletePublicKey(id string) error

DeletePublicKey deletes a Public Key by ID. It returns ErrPublicKeyInUse when the key is still referenced by a key group or an FLE profile.

func (*InMemoryBackend) DeleteRealtimeLogConfig

func (b *InMemoryBackend) DeleteRealtimeLogConfig(arn string) error

DeleteRealtimeLogConfig deletes a Realtime Log Config by ARN.

func (*InMemoryBackend) DeleteResourcePolicy

func (b *InMemoryBackend) DeleteResourcePolicy(resourceARN string) error

func (*InMemoryBackend) DeleteResponseHeadersPolicy

func (b *InMemoryBackend) DeleteResponseHeadersPolicy(id string) error

DeleteResponseHeadersPolicy deletes a Response Headers Policy by ID.

func (*InMemoryBackend) DeleteStreamingDistribution

func (b *InMemoryBackend) DeleteStreamingDistribution(id string) error

DeleteStreamingDistribution deletes a streaming distribution by ID. The streaming distribution must be disabled first, mirroring AWS's requirement.

func (*InMemoryBackend) DeleteTrustStore

func (b *InMemoryBackend) DeleteTrustStore(id string) error

DeleteTrustStore deletes a trust store by ID.

func (*InMemoryBackend) DeleteVpcOrigin

func (b *InMemoryBackend) DeleteVpcOrigin(id string) error

DeleteVpcOrigin deletes a VPC Origin by ID.

func (*InMemoryBackend) DisassociateDistributionTenantWebACL

func (b *InMemoryBackend) DisassociateDistributionTenantWebACL(tenantID string) error

DisassociateDistributionTenantWebACL clears the web ACL association for a distribution tenant.

func (*InMemoryBackend) DisassociateDistributionWebACL

func (b *InMemoryBackend) DisassociateDistributionWebACL(distID string) error

DisassociateDistributionWebACL clears the web ACL association for a distribution.

func (*InMemoryBackend) GetAnycastIPList

func (b *InMemoryBackend) GetAnycastIPList(id string) (*AnycastIPList, error)

func (*InMemoryBackend) GetCachePolicy

func (b *InMemoryBackend) GetCachePolicy(id string) (*CachePolicy, error)

GetCachePolicy returns a cache policy by ID.

func (*InMemoryBackend) GetConnectionFunction

func (b *InMemoryBackend) GetConnectionFunction(idOrName string) (*ConnectionFunction, error)

GetConnectionFunction returns a connection function looked up by ID or name.

func (*InMemoryBackend) GetConnectionGroup

func (b *InMemoryBackend) GetConnectionGroup(id string) (*ConnectionGroup, error)

func (*InMemoryBackend) GetConnectionGroupByRoutingEndpoint

func (b *InMemoryBackend) GetConnectionGroupByRoutingEndpoint(endpoint string) (*ConnectionGroup, error)

GetConnectionGroupByRoutingEndpoint looks up a connection group by its generated routing endpoint domain name (e.g. "d111111abcdef8.cloudfront.net"), the O(1) index populated at creation time.

func (*InMemoryBackend) GetContinuousDeploymentPolicy

func (b *InMemoryBackend) GetContinuousDeploymentPolicy(id string) (*ContinuousDeploymentPolicy, error)

GetContinuousDeploymentPolicy returns a continuous deployment policy by ID.

func (*InMemoryBackend) GetDistribution

func (b *InMemoryBackend) GetDistribution(id string) (*Distribution, error)

GetDistribution returns a distribution by ID.

func (*InMemoryBackend) GetDistributionFunctionAssociations

func (b *InMemoryBackend) GetDistributionFunctionAssociations(distributionID string) ([]FunctionAssociation, error)

GetDistributionFunctionAssociations returns function associations for a distribution.

func (*InMemoryBackend) GetDistributionTenant

func (b *InMemoryBackend) GetDistributionTenant(id string) (*DistributionTenant, error)

GetDistributionTenant returns a distribution tenant by ID.

func (*InMemoryBackend) GetDistributionTenantByDomain

func (b *InMemoryBackend) GetDistributionTenantByDomain(domain string) (*DistributionTenant, error)

GetDistributionTenantByDomain returns a distribution tenant by domain.

func (*InMemoryBackend) GetFieldLevelEncryption

func (b *InMemoryBackend) GetFieldLevelEncryption(id string) (*FieldLevelEncryption, error)

GetFieldLevelEncryption returns a Field Level Encryption config by ID.

func (*InMemoryBackend) GetFieldLevelEncryptionProfile

func (b *InMemoryBackend) GetFieldLevelEncryptionProfile(
	id string,
) (*FieldLevelEncryptionProfile, error)

GetFieldLevelEncryptionProfile returns a Field Level Encryption Profile by ID.

func (*InMemoryBackend) GetFunction

func (b *InMemoryBackend) GetFunction(name string) (*Function, error)

GetFunction returns a CloudFront Function by name.

func (*InMemoryBackend) GetInvalidation

func (b *InMemoryBackend) GetInvalidation(
	distributionID, invalidationID string,
) (*Invalidation, error)

GetInvalidation returns a specific invalidation by distribution ID and invalidation ID.

func (*InMemoryBackend) GetInvalidationForTenant

func (b *InMemoryBackend) GetInvalidationForTenant(tenantID, invalidationID string) (*Invalidation, error)

GetInvalidationForTenant returns a specific invalidation for a distribution tenant.

func (*InMemoryBackend) GetKVSValue

func (b *InMemoryBackend) GetKVSValue(kvsID, key string) (string, string, error)

GetKVSValue returns the value for a key in a Key Value Store.

func (*InMemoryBackend) GetKeyGroup

func (b *InMemoryBackend) GetKeyGroup(id string) (*KeyGroup, error)

GetKeyGroup returns a CloudFront Key Group by ID.

func (*InMemoryBackend) GetKeyValueStore

func (b *InMemoryBackend) GetKeyValueStore(idOrARN string) (*KeyValueStore, error)

GetKeyValueStore returns a Key Value Store by ID or ARN.

func (*InMemoryBackend) GetManagedCertificateDetails

func (b *InMemoryBackend) GetManagedCertificateDetails(tenantID string) (*ManagedCertificateDetails, error)

GetManagedCertificateDetails returns the CloudFront-managed certificate details for a distribution tenant, deriving validation state from the tenant's real domains. The result is cached per tenant so repeated calls return a stable certificate ARN and validation tokens, mirroring a certificate that, once issued, does not change on every read.

func (*InMemoryBackend) GetMonitoringSubscription

func (b *InMemoryBackend) GetMonitoringSubscription(distributionID string) (*MonitoringSubscription, error)

GetMonitoringSubscription returns the real-time metrics subscription for a distribution, or ErrMonitoringSubscriptionNotFound if none has been created.

func (*InMemoryBackend) GetOAI

GetOAI returns an OAI by ID.

func (*InMemoryBackend) GetOriginAccessControl

func (b *InMemoryBackend) GetOriginAccessControl(id string) (*OriginAccessControl, error)

GetOriginAccessControl returns an OAC by ID.

func (*InMemoryBackend) GetOriginRequestPolicy

func (b *InMemoryBackend) GetOriginRequestPolicy(id string) (*OriginRequestPolicy, error)

GetOriginRequestPolicy returns an Origin Request Policy by ID.

func (*InMemoryBackend) GetPublicKey

func (b *InMemoryBackend) GetPublicKey(id string) (*PublicKey, error)

GetPublicKey returns a CloudFront Public Key by ID.

func (*InMemoryBackend) GetRealtimeLogConfig

func (b *InMemoryBackend) GetRealtimeLogConfig(arn string) (*RealtimeLogConfig, error)

GetRealtimeLogConfig returns a Realtime Log Config by ARN.

func (*InMemoryBackend) GetRealtimeLogConfigByName

func (b *InMemoryBackend) GetRealtimeLogConfigByName(name string) (*RealtimeLogConfig, error)

GetRealtimeLogConfigByName returns a Realtime Log Config by name.

func (*InMemoryBackend) GetResourcePolicy

func (b *InMemoryBackend) GetResourcePolicy(resourceARN string) (string, error)

func (*InMemoryBackend) GetResponseHeadersPolicy

func (b *InMemoryBackend) GetResponseHeadersPolicy(id string) (*ResponseHeadersPolicy, error)

GetResponseHeadersPolicy returns a Response Headers Policy by ID.

func (*InMemoryBackend) GetStreamingDistribution

func (b *InMemoryBackend) GetStreamingDistribution(id string) (*StreamingDistribution, error)

GetStreamingDistribution returns a streaming distribution by ID.

func (*InMemoryBackend) GetTrustStore

func (b *InMemoryBackend) GetTrustStore(id string) (*TrustStore, error)

GetTrustStore returns a trust store by ID.

func (*InMemoryBackend) GetVpcOrigin

func (b *InMemoryBackend) GetVpcOrigin(id string) (*VpcOrigin, error)

GetVpcOrigin returns a VPC Origin by ID.

func (*InMemoryBackend) ListAliases

func (b *InMemoryBackend) ListAliases(distributionID string) []string

ListAliases returns the aliases for a distribution by ID.

func (*InMemoryBackend) ListAnycastIPLists

func (b *InMemoryBackend) ListAnycastIPLists() []*AnycastIPList

func (*InMemoryBackend) ListCachePolicies

func (b *InMemoryBackend) ListCachePolicies() []*CachePolicy

ListCachePolicies returns all cache policies sorted by ID.

func (*InMemoryBackend) ListConflictingAliasesByDomain

func (b *InMemoryBackend) ListConflictingAliasesByDomain(domain string) []*Distribution

ListConflictingAliasesByDomain returns distributions that have a conflicting CNAME alias.

func (*InMemoryBackend) ListConnectionFunctions

func (b *InMemoryBackend) ListConnectionFunctions() []*ConnectionFunction

ListConnectionFunctions returns all connection functions sorted by name.

func (*InMemoryBackend) ListConnectionGroups

func (b *InMemoryBackend) ListConnectionGroups() []*ConnectionGroup

ListConnectionGroups returns all connection groups sorted by ID.

func (*InMemoryBackend) ListContinuousDeploymentPolicies

func (b *InMemoryBackend) ListContinuousDeploymentPolicies() []*ContinuousDeploymentPolicy

ListContinuousDeploymentPolicies returns all continuous deployment policies sorted by ID.

func (*InMemoryBackend) ListDistributionTenants

func (b *InMemoryBackend) ListDistributionTenants() []*DistributionTenant

ListDistributionTenants returns all distribution tenants sorted by ID.

func (*InMemoryBackend) ListDistributionTenantsByCustomization

func (b *InMemoryBackend) ListDistributionTenantsByCustomization(webACLArn string) []*DistributionTenant

ListDistributionTenantsByCustomization returns distribution tenants filtered by an associated WAF web ACL ARN. When webACLArn is empty, all tenants are returned (same as ListDistributionTenants), since no customization filter was supplied.

func (*InMemoryBackend) ListDistributions

func (b *InMemoryBackend) ListDistributions() []*Distribution

ListDistributions returns all distributions sorted by ID.

func (*InMemoryBackend) ListDistributionsByAnycastIPListID

func (b *InMemoryBackend) ListDistributionsByAnycastIPListID(anycastID string) []*Distribution

ListDistributionsByAnycastIPListID returns distributions that reference an anycast IP list.

func (*InMemoryBackend) ListDistributionsByCachePolicyID

func (b *InMemoryBackend) ListDistributionsByCachePolicyID(policyID string) []*Distribution

ListDistributionsByCachePolicyID returns distributions whose stored config (default cache behavior or any ordered cache behavior) references the given cache policy ID.

func (*InMemoryBackend) ListDistributionsByConnectionFunction

func (b *InMemoryBackend) ListDistributionsByConnectionFunction(funcID string) []*Distribution

ListDistributionsByConnectionFunction returns distributions that reference a connection function.

func (*InMemoryBackend) ListDistributionsByConnectionMode

func (b *InMemoryBackend) ListDistributionsByConnectionMode(mode string) []*Distribution

ListDistributionsByConnectionMode returns distributions that match a connection mode.

func (*InMemoryBackend) ListDistributionsByKeyGroup

func (b *InMemoryBackend) ListDistributionsByKeyGroup(keyGroupID string) []*Distribution

ListDistributionsByKeyGroup returns distributions that reference a key group.

func (*InMemoryBackend) ListDistributionsByOriginRequestPolicyID

func (b *InMemoryBackend) ListDistributionsByOriginRequestPolicyID(policyID string) []*Distribution

ListDistributionsByOriginRequestPolicyID returns distributions whose stored config (default or ordered cache behaviors) references the given origin request policy ID.

func (*InMemoryBackend) ListDistributionsByOwnedResource

func (b *InMemoryBackend) ListDistributionsByOwnedResource(resourceARN string) []*Distribution

ListDistributionsByOwnedResource returns distributions that reference an owned resource ARN.

func (*InMemoryBackend) ListDistributionsByRealtimeLogConfigARN

func (b *InMemoryBackend) ListDistributionsByRealtimeLogConfigARN(arn string) []*Distribution

ListDistributionsByRealtimeLogConfigARN returns distributions whose stored config (default or ordered cache behaviors) references the given realtime log config ARN.

func (*InMemoryBackend) ListDistributionsByResponseHeadersPolicyID

func (b *InMemoryBackend) ListDistributionsByResponseHeadersPolicyID(policyID string) []*Distribution

ListDistributionsByResponseHeadersPolicyID returns distributions whose stored config (default or ordered cache behaviors) references the given response headers policy ID.

func (*InMemoryBackend) ListDistributionsByTrustStore

func (b *InMemoryBackend) ListDistributionsByTrustStore(trustStoreID string) []*Distribution

ListDistributionsByTrustStore returns distributions that reference a trust store.

func (*InMemoryBackend) ListDistributionsByVpcOriginID

func (b *InMemoryBackend) ListDistributionsByVpcOriginID(vpcOriginID string) []*Distribution

ListDistributionsByVpcOriginID returns distributions that reference a VPC origin.

func (*InMemoryBackend) ListDistributionsByWebACLID

func (b *InMemoryBackend) ListDistributionsByWebACLID(webACLID string) []*Distribution

ListDistributionsByWebACLID returns distribution IDs associated with a web ACL.

func (*InMemoryBackend) ListDomainConflicts

func (b *InMemoryBackend) ListDomainConflicts(domain string) []DomainConflict

ListDomainConflicts returns every existing distribution tenant or distribution that already claims domain.

func (*InMemoryBackend) ListFieldLevelEncryptionProfiles

func (b *InMemoryBackend) ListFieldLevelEncryptionProfiles() []*FieldLevelEncryptionProfile

ListFieldLevelEncryptionProfiles returns all FLE profiles sorted by ID.

func (*InMemoryBackend) ListFieldLevelEncryptions

func (b *InMemoryBackend) ListFieldLevelEncryptions() []*FieldLevelEncryption

ListFieldLevelEncryptions returns all Field Level Encryption configs sorted by ID.

func (*InMemoryBackend) ListFunctions

func (b *InMemoryBackend) ListFunctions() []*Function

ListFunctions returns all CloudFront Functions sorted by name.

func (*InMemoryBackend) ListInvalidations

func (b *InMemoryBackend) ListInvalidations(distributionID string) ([]*Invalidation, error)

ListInvalidations returns all invalidations for a distribution, sorted by ID.

func (*InMemoryBackend) ListInvalidationsForTenant

func (b *InMemoryBackend) ListInvalidationsForTenant(tenantID string) []*Invalidation

ListInvalidationsForTenant returns all invalidations for a distribution tenant.

func (*InMemoryBackend) ListKVSValues

func (b *InMemoryBackend) ListKVSValues(kvsID string) ([]*KVSItem, string, error)

ListKVSValues returns all key/value pairs in a Key Value Store.

func (*InMemoryBackend) ListKeyGroups

func (b *InMemoryBackend) ListKeyGroups() []*KeyGroup

ListKeyGroups returns all key groups sorted by ID.

func (*InMemoryBackend) ListKeyValueStores

func (b *InMemoryBackend) ListKeyValueStores() []*KeyValueStore

ListKeyValueStores returns all Key Value Stores sorted by name.

func (*InMemoryBackend) ListOAIs

func (b *InMemoryBackend) ListOAIs() []*OriginAccessIdentity

ListOAIs returns all OAIs sorted by ID.

func (*InMemoryBackend) ListOriginAccessControls

func (b *InMemoryBackend) ListOriginAccessControls() []*OriginAccessControl

ListOriginAccessControls returns all OACs sorted by ID.

func (*InMemoryBackend) ListOriginRequestPolicies

func (b *InMemoryBackend) ListOriginRequestPolicies() []*OriginRequestPolicy

ListOriginRequestPolicies returns all Origin Request Policies sorted by ID.

func (*InMemoryBackend) ListPublicKeys

func (b *InMemoryBackend) ListPublicKeys() []*PublicKey

ListPublicKeys returns all public keys sorted by ID.

func (*InMemoryBackend) ListRealtimeLogConfigs

func (b *InMemoryBackend) ListRealtimeLogConfigs() []*RealtimeLogConfig

ListRealtimeLogConfigs returns all Realtime Log Configs sorted by name.

func (*InMemoryBackend) ListResponseHeadersPolicies

func (b *InMemoryBackend) ListResponseHeadersPolicies() []*ResponseHeadersPolicy

ListResponseHeadersPolicies returns all Response Headers Policies sorted by ID.

func (*InMemoryBackend) ListStreamingDistributions

func (b *InMemoryBackend) ListStreamingDistributions() []*StreamingDistribution

ListStreamingDistributions returns all streaming distributions sorted by ID.

func (*InMemoryBackend) ListTags

func (b *InMemoryBackend) ListTags(resourceARN string) (map[string]string, error)

ListTags returns the tags for a resource by ARN.

func (*InMemoryBackend) ListTrustStores

func (b *InMemoryBackend) ListTrustStores() []*TrustStore

ListTrustStores returns all trust stores sorted by ID.

func (*InMemoryBackend) ListVpcOrigins

func (b *InMemoryBackend) ListVpcOrigins() []*VpcOrigin

ListVpcOrigins returns all VPC Origins sorted by ID.

func (*InMemoryBackend) PublishConnectionFunction

func (b *InMemoryBackend) PublishConnectionFunction(idOrName string) (*ConnectionFunction, error)

PublishConnectionFunction promotes a connection function (looked up by ID or name) from DEVELOPMENT to LIVE, bumping its ETag to reflect the new published version.

func (*InMemoryBackend) PublishFunction

func (b *InMemoryBackend) PublishFunction(name string) (*Function, error)

PublishFunction publishes (promotes to LIVE) a CloudFront Function.

func (*InMemoryBackend) PutKVSValue

func (b *InMemoryBackend) PutKVSValue(kvsID, key, value, ifMatch string) (string, error)

PutKVSValue creates or updates a key/value pair in a Key Value Store.

func (*InMemoryBackend) PutResourcePolicy

func (b *InMemoryBackend) PutResourcePolicy(resourceARN, policy string) error

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the AWS region this backend is configured for.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all stored state, returning the backend to a pristine empty state.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads backend state from a JSON snapshot and rebuilds derived indexes. It implements persistence.Persistable.

func (*InMemoryBackend) SetDistributionFunctionAssociations

func (b *InMemoryBackend) SetDistributionFunctionAssociations(
	distributionID string,
	associations []FunctionAssociation,
) error

SetDistributionFunctionAssociations replaces function associations for a distribution.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises the backend state to JSON. It implements persistence.Persistable.

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(resourceARN string, kv map[string]string) error

TagResource adds or updates tags on a resource by ARN.

func (*InMemoryBackend) TenantWebACLArn

func (b *InMemoryBackend) TenantWebACLArn(tenantID string) string

TenantWebACLArn returns the WAF web ACL ARN currently associated with a distribution tenant, or "" if none is associated.

func (*InMemoryBackend) TestConnectionFunction

func (b *InMemoryBackend) TestConnectionFunction(
	idOrName string, connectionObject []byte,
) (*ConnectionFunctionTestResult, error)

TestConnectionFunction "executes" a connection function (looked up by ID or name) against a caller-supplied connection object. Since there is no real JS runtime here, the mock computes a deterministic result derived from the stored function code and the input connection object: ComputeUtilization scales with code+input size, and FunctionOutput echoes the input event, matching real CloudFront's contract that the function receives and can transform the connection object.

func (*InMemoryBackend) UntagResource

func (b *InMemoryBackend) UntagResource(resourceARN string, keys []string) error

UntagResource removes tags from a resource by ARN.

func (*InMemoryBackend) UpdateAnycastIPList

func (b *InMemoryBackend) UpdateAnycastIPList(id string, ipCount int32) (*AnycastIPList, error)

UpdateAnycastIPList updates the IP count of an existing Anycast IP list, regenerating its AnycastIPs to match the new count (a no-op when ipCount is <= 0, meaning "leave unchanged").

func (*InMemoryBackend) UpdateCachePolicy

func (b *InMemoryBackend) UpdateCachePolicy(
	id, name, comment string,
	defaultTTL, maxTTL, minTTL int64,
	params ...*CachePolicyParams,
) (*CachePolicy, error)

UpdateCachePolicy updates an existing cache policy.

func (*InMemoryBackend) UpdateConnectionFunction

func (b *InMemoryBackend) UpdateConnectionFunction(
	idOrName, comment, runtime string, code []byte,
) (*ConnectionFunction, error)

UpdateConnectionFunction updates an existing connection function, looked up by ID or name, replacing its comment, runtime, and code (the real UpdateConnectionFunction request requires the full ConnectionFunctionConfig and ConnectionFunctionCode, so this is a full replace, not a merge). Updating a function resets it to the DEVELOPMENT stage, mirroring CloudFront Functions.

func (*InMemoryBackend) UpdateConnectionGroup

func (b *InMemoryBackend) UpdateConnectionGroup(
	id, comment string, anycastIPListID *string, ipv6Enabled, enabled *bool,
) (*ConnectionGroup, error)

UpdateConnectionGroup updates an existing connection group. Comment is set only when non-empty (comment is a gopherstack-only convenience field, not part of the real AWS shape). anycastIPListID, ipv6Enabled, and enabled are optional (nil pointer means "leave unchanged"), matching the real UpdateConnectionGroup request shape where only Id and IfMatch are required.

func (*InMemoryBackend) UpdateContinuousDeploymentPolicy

func (b *InMemoryBackend) UpdateContinuousDeploymentPolicy(
	id string,
	enabled bool,
	stagingDNS string,
) (*ContinuousDeploymentPolicy, error)

UpdateContinuousDeploymentPolicy updates an existing continuous deployment policy's Enabled flag and single staging DNS name, preserving its current traffic config. It is kept for backward compatibility; UpdateContinuousDeploymentPolicyWithConfig supports the full AWS request shape (multiple DNS names plus a traffic config replacement).

func (*InMemoryBackend) UpdateContinuousDeploymentPolicyWithConfig

func (b *InMemoryBackend) UpdateContinuousDeploymentPolicyWithConfig(
	id string,
	enabled bool,
	stagingDNSNames []string,
	traffic ContinuousDeploymentTrafficConfig,
) (*ContinuousDeploymentPolicy, error)

UpdateContinuousDeploymentPolicyWithConfig updates an existing continuous deployment policy, replacing its Enabled flag, staging distribution DNS names, and traffic config in full (mirroring the real UpdateContinuousDeploymentPolicy request, which always replaces the entire ContinuousDeploymentPolicyConfig).

func (*InMemoryBackend) UpdateDistribution

func (b *InMemoryBackend) UpdateDistribution(
	id, comment string,
	enabled bool,
	rawConfig []byte,
) (*Distribution, error)

UpdateDistribution updates an existing distribution's config.

func (*InMemoryBackend) UpdateDistributionTenant

func (b *InMemoryBackend) UpdateDistributionTenant(
	id string,
	upd DistributionTenantUpdate,
) (*DistributionTenant, error)

UpdateDistributionTenant updates a distribution tenant's domains, connection group, enabled state, and/or customizations. Domain changes are validated against findDomainConflicts before being applied.

func (*InMemoryBackend) UpdateDistributionWithStagingConfig

func (b *InMemoryBackend) UpdateDistributionWithStagingConfig(primaryID, stagingID string) (*Distribution, error)

UpdateDistributionWithStagingConfig copies the staging distribution's config to the primary.

func (*InMemoryBackend) UpdateDomainAssociation

func (b *InMemoryBackend) UpdateDomainAssociation(
	domain, targetTenantID, targetDistID string,
) (*DomainAssociationResult, error)

UpdateDomainAssociation moves a domain's association to the given target distribution tenant or distribution. Exactly one of targetTenantID / targetDistID must be set. The domain is removed from its previous owner (if any) and attached to the target; a conflict with a *different* existing owner returns ErrDomainConflict.

func (*InMemoryBackend) UpdateFieldLevelEncryption

func (b *InMemoryBackend) UpdateFieldLevelEncryption(
	id, name, comment string, queryArgProfiles []FLEQueryArgProfile,
) (*FieldLevelEncryption, error)

UpdateFieldLevelEncryption updates an existing Field Level Encryption config. Every referenced FLE profile ID must exist (referential integrity).

func (*InMemoryBackend) UpdateFieldLevelEncryptionProfile

func (b *InMemoryBackend) UpdateFieldLevelEncryptionProfile(
	id, name, comment string, entities []EncryptionEntity,
) (*FieldLevelEncryptionProfile, error)

UpdateFieldLevelEncryptionProfile updates an existing FLE profile. Every public key referenced by an EncryptionEntity must exist (referential integrity).

func (*InMemoryBackend) UpdateFunction

func (b *InMemoryBackend) UpdateFunction(
	name, comment, runtime, functionCode string,
) (*Function, error)

UpdateFunction updates an existing CloudFront Function.

func (*InMemoryBackend) UpdateKVSValues

func (b *InMemoryBackend) UpdateKVSValues(kvsID, ifMatch string, puts []*KVSItem, deletes []string) (string, error)

UpdateKVSValues performs a batch put/delete on a Key Value Store.

func (*InMemoryBackend) UpdateKeyGroup

func (b *InMemoryBackend) UpdateKeyGroup(
	id, name, comment string,
	items []string,
) (*KeyGroup, error)

UpdateKeyGroup updates an existing Key Group.

func (*InMemoryBackend) UpdateKeyValueStore

func (b *InMemoryBackend) UpdateKeyValueStore(id, comment string) (*KeyValueStore, error)

UpdateKeyValueStore updates a Key Value Store's comment.

func (*InMemoryBackend) UpdateOAI

func (b *InMemoryBackend) UpdateOAI(id, comment string) (*OriginAccessIdentity, error)

UpdateOAI updates an existing Origin Access Identity's comment and rotates its ETag.

func (*InMemoryBackend) UpdateOriginAccessControl

func (b *InMemoryBackend) UpdateOriginAccessControl(
	id, name, description, originType, signingBehavior, signingProtocol string,
) (*OriginAccessControl, error)

UpdateOriginAccessControl updates an existing OAC.

func (*InMemoryBackend) UpdateOriginRequestPolicy

func (b *InMemoryBackend) UpdateOriginRequestPolicy(
	id, name, comment string,
	opts ...*OriginRequestPolicyConfig,
) (*OriginRequestPolicy, error)

UpdateOriginRequestPolicy updates an existing Origin Request Policy.

func (*InMemoryBackend) UpdatePublicKey

func (b *InMemoryBackend) UpdatePublicKey(id, comment string) (*PublicKey, error)

UpdatePublicKey updates an existing Public Key comment.

func (*InMemoryBackend) UpdateRealtimeLogConfig

func (b *InMemoryBackend) UpdateRealtimeLogConfig(
	arn string,
	samplingRate int64,
	fields []string,
) (*RealtimeLogConfig, error)

UpdateRealtimeLogConfig updates an existing Realtime Log Config.

func (*InMemoryBackend) UpdateResponseHeadersPolicy

func (b *InMemoryBackend) UpdateResponseHeadersPolicy(
	id, name, comment string,
	opts ...*ResponseHeadersPolicyConfig,
) (*ResponseHeadersPolicy, error)

UpdateResponseHeadersPolicy updates an existing Response Headers Policy.

func (*InMemoryBackend) UpdateStreamingDistribution

func (b *InMemoryBackend) UpdateStreamingDistribution(
	id string,
	cfg StreamingDistributionConfig,
	rawConfig []byte,
) (*StreamingDistribution, error)

UpdateStreamingDistribution updates an existing streaming distribution's config. CallerReference is immutable and is preserved from the existing config.

func (*InMemoryBackend) UpdateTrustStore

func (b *InMemoryBackend) UpdateTrustStore(
	id, name, comment string, bundle TrustStoreCertificateBundle,
) (*TrustStore, error)

UpdateTrustStore updates an existing trust store. Empty fields (name, comment, and an empty certificate bundle) leave the corresponding current value unchanged. If name changes, it must remain unique among existing trust stores.

func (*InMemoryBackend) UpdateVpcOrigin

func (b *InMemoryBackend) UpdateVpcOrigin(id, name string) (*VpcOrigin, error)

UpdateVpcOrigin updates a VPC Origin.

func (*InMemoryBackend) VerifyDNSConfiguration

func (b *InMemoryBackend) VerifyDNSConfiguration(identifier string) ([]DNSConfiguration, error)

VerifyDNSConfiguration checks the DNS status of every domain associated with identifier, which may be a distribution tenant ID or a distribution ID. A domain is reported PASSED when it is syntactically well-formed (contains a dot and no whitespace) and FAILED otherwise. When identifier is empty, a single generic PASSED entry is returned.

type Invalidation

type Invalidation struct {
	CreateTime time.Time `json:"createTime"`
	ID         string    `json:"id"`
	Status     string    `json:"status"`
	CallerRef  string    `json:"callerRef,omitempty"`

	Paths []string `json:"paths,omitempty"`
	// contains filtered or unexported fields
}

Invalidation represents a CloudFront cache invalidation.

distID and tenantID are unexported identity-only fields used purely to key the composite invalidations/tenantInvalidations store.Table (see store_setup.go): exactly one is populated on any given Invalidation, depending on whether it belongs to a distribution (b.invalidations) or a distribution tenant (b.tenantInvalidations). Neither is part of the real AWS wire shape (hence json:"-"), and keeping them unexported preserves the exported API surface of this pre-existing exported type exactly.

type KVSItem

type KVSItem struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

KVSItem is a single key/value item in a Key Value Store.

type KeyGroup

type KeyGroup struct {
	ID      string   `json:"id"`
	Name    string   `json:"name"`
	Comment string   `json:"comment,omitempty"`
	ETag    string   `json:"eTag"`
	Items   []string `json:"items"`
}

KeyGroup represents a CloudFront Key Group.

type KeyValueStore

type KeyValueStore struct {
	ID      string `json:"id"`
	ARN     string `json:"arn"`
	Name    string `json:"name"`
	Comment string `json:"comment,omitempty"`
	ETag    string `json:"eTag"`
	// Status reflects the provisioning state (AWS: PROVISIONING → READY). The
	// emulator provisions synchronously and reports READY immediately.
	Status string `json:"status"`
	// LastModifiedTime is an RFC3339 timestamp (CloudFront is a REST-XML API, so
	// timestamps are serialized as ISO-8601 strings, not epoch numbers).
	LastModifiedTime string `json:"lastModifiedTime"`
}

KeyValueStore represents a CloudFront Key Value Store.

type ManagedCertificateDetails

type ManagedCertificateDetails struct {
	CertificateARN         string                  `json:"certificateArn"`
	CertificateStatus      string                  `json:"certificateStatus"` // SUCCESS | PENDING_VALIDATION
	ValidationTokenHost    string                  `json:"validationTokenHost"`
	ValidationTokenDetails []ValidationTokenDetail `json:"validationTokenDetails,omitempty"`
}

ManagedCertificateDetails represents the state of the CloudFront-managed ACM certificate issued for a distribution tenant's domains.

type MonitoringSubscription

type MonitoringSubscription struct {
	RealtimeMetricsSubscriptionStatus string `json:"realtimeMetricsSubscriptionStatus"`
}

MonitoringSubscription represents real-time metrics settings for a distribution.

type ORPCookiesConfig

type ORPCookiesConfig struct {
	CookieBehavior string   `json:"cookieBehavior"` // none, whitelist, all, allExcept
	Cookies        []string `json:"cookies,omitempty"`
}

ORPCookiesConfig controls which cookies are forwarded to the origin.

type ORPHeadersConfig

type ORPHeadersConfig struct {
	HeaderBehavior string   `json:"headerBehavior"` // none, whitelist, allViewer, allViewerAndWhitelistCloudFront
	Headers        []string `json:"headers,omitempty"`
}

ORPHeadersConfig controls which request headers are forwarded to the origin.

type ORPQueryStringsConfig

type ORPQueryStringsConfig struct {
	QueryStringBehavior string   `json:"queryStringBehavior"` // none, whitelist, all, allExcept
	QueryStrings        []string `json:"queryStrings,omitempty"`
}

ORPQueryStringsConfig controls which query strings are forwarded to the origin.

type OriginAccessControl

type OriginAccessControl struct {
	ID              string `json:"id"`
	Name            string `json:"name"`
	Description     string `json:"description,omitempty"`
	OriginType      string `json:"originType"`
	SigningBehavior string `json:"signingBehavior"`
	SigningProtocol string `json:"signingProtocol"`
	ETag            string `json:"eTag"`
}

OriginAccessControl represents a CloudFront Origin Access Control (OAC).

type OriginAccessIdentity

type OriginAccessIdentity struct {
	ID                string `json:"id"`
	ARN               string `json:"arn"`
	S3CanonicalUserID string `json:"s3CanonicalUserId"`
	ETag              string `json:"eTag"`
	CallerReference   string `json:"callerReference"`
	Comment           string `json:"comment,omitempty"`
}

OriginAccessIdentity represents a CloudFront Origin Access Identity.

type OriginRequestPolicy

type OriginRequestPolicy struct {
	HeadersConfig      *ORPHeadersConfig      `json:"headersConfig,omitempty"`
	CookiesConfig      *ORPCookiesConfig      `json:"cookiesConfig,omitempty"`
	QueryStringsConfig *ORPQueryStringsConfig `json:"queryStringsConfig,omitempty"`
	ID                 string                 `json:"id"`
	Name               string                 `json:"name"`
	Comment            string                 `json:"comment,omitempty"`
	ETag               string                 `json:"eTag"`
}

OriginRequestPolicy represents a CloudFront Origin Request Policy.

type OriginRequestPolicyConfig

type OriginRequestPolicyConfig struct {
	HeadersConfig      *ORPHeadersConfig
	CookiesConfig      *ORPCookiesConfig
	QueryStringsConfig *ORPQueryStringsConfig
}

OriginRequestPolicyConfig carries optional full-config inputs for CreateOriginRequestPolicy.

type Provider

type Provider struct{}

Provider implements service.Provider for AWS CloudFront.

func (*Provider) Init

Init initializes the CloudFront service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type PublicKey

type PublicKey struct {
	ID              string `json:"id"`
	Name            string `json:"name"`
	Comment         string `json:"comment,omitempty"`
	EncodedKey      string `json:"encodedKey"`
	CallerReference string `json:"callerReference"`
	ETag            string `json:"eTag"`
}

PublicKey represents a CloudFront Public Key.

type RHPCorsConfig

type RHPCorsConfig struct {
	AccessControlAllowOrigins     []string `json:"accessControlAllowOrigins,omitempty"`
	AccessControlAllowHeaders     []string `json:"accessControlAllowHeaders,omitempty"`
	AccessControlAllowMethods     []string `json:"accessControlAllowMethods,omitempty"`
	AccessControlExposeHeaders    []string `json:"accessControlExposeHeaders,omitempty"`
	AccessControlMaxAgeSec        int64    `json:"accessControlMaxAgeSec,omitempty"`
	AccessControlAllowCredentials bool     `json:"accessControlAllowCredentials"`
	OriginOverride                bool     `json:"originOverride"`
}

RHPCorsConfig holds the CORS settings for a ResponseHeadersPolicy.

type RHPCustomHeader

type RHPCustomHeader struct {
	Header   string `json:"header"`
	Value    string `json:"value"`
	Override bool   `json:"override"`
}

RHPCustomHeader is a single custom header key/value pair for a ResponseHeadersPolicy.

type RHPSecurityHeaders

type RHPSecurityHeaders struct {
	FrameOptionsValue              string `json:"frameOptionsValue,omitempty"`
	ReferrerPolicy                 string `json:"referrerPolicy,omitempty"`
	ContentSecurityPolicy          string `json:"contentSecurityPolicy,omitempty"`
	XSSProtection                  string `json:"xssProtection,omitempty"`
	StrictTransportSecuritySeconds int64  `json:"strictTransportSecuritySeconds,omitempty"`
	ContentTypeOptionsOverride     bool   `json:"contentTypeOptionsOverride"`
	IncludeSubdomains              bool   `json:"includeSubdomains"`
	Preload                        bool   `json:"preload"`
}

RHPSecurityHeaders holds the security header settings for a ResponseHeadersPolicy.

type RealtimeLogConfig

type RealtimeLogConfig struct {
	ARN          string   `json:"arn"`
	Name         string   `json:"name"`
	Fields       []string `json:"fields"`
	SamplingRate int64    `json:"samplingRate"`
}

RealtimeLogConfig represents a CloudFront Realtime Log Config.

type ResponseHeadersPolicy

type ResponseHeadersPolicy struct {
	CorsConfig      *RHPCorsConfig      `json:"corsConfig,omitempty"`
	SecurityHeaders *RHPSecurityHeaders `json:"securityHeaders,omitempty"`
	ID              string              `json:"id"`
	Name            string              `json:"name"`
	Comment         string              `json:"comment,omitempty"`
	ETag            string              `json:"eTag"`
	CustomHeaders   []RHPCustomHeader   `json:"customHeaders,omitempty"`
	RemoveHeaders   []string            `json:"removeHeaders,omitempty"`
}

ResponseHeadersPolicy represents a CloudFront Response Headers Policy.

type ResponseHeadersPolicyConfig

type ResponseHeadersPolicyConfig struct {
	CorsConfig      *RHPCorsConfig
	SecurityHeaders *RHPSecurityHeaders
	CustomHeaders   []RHPCustomHeader
	RemoveHeaders   []string
}

ResponseHeadersPolicyConfig carries optional full-config inputs for CreateResponseHeadersPolicy.

type StreamingDistribution

type StreamingDistribution struct {
	Tags             map[string]string           `json:"tags,omitempty"`
	ARN              string                      `json:"arn"`
	DomainName       string                      `json:"domainName"`
	Status           string                      `json:"status"`
	ETag             string                      `json:"etag"`
	ID               string                      `json:"id"`
	LastModifiedTime string                      `json:"lastModifiedTime,omitempty"`
	RawConfig        []byte                      `json:"rawConfig,omitempty"`
	Config           StreamingDistributionConfig `json:"config"`
}

StreamingDistribution represents a CloudFront RTMP streaming distribution.

type StreamingDistributionConfig

type StreamingDistributionConfig struct {
	CallerReference string                              `json:"callerReference"`
	Comment         string                              `json:"comment,omitempty"`
	PriceClass      string                              `json:"priceClass,omitempty"`
	S3Origin        StreamingDistributionS3Origin       `json:"s3Origin"`
	Aliases         []string                            `json:"aliases,omitempty"`
	TrustedSigners  StreamingDistributionTrustedSigners `json:"trustedSigners"`
	Enabled         bool                                `json:"enabled"`
}

StreamingDistributionConfig models the mutable configuration of a streaming distribution.

type StreamingDistributionS3Origin

type StreamingDistributionS3Origin struct {
	DomainName           string `json:"domainName,omitempty"`
	OriginAccessIdentity string `json:"originAccessIdentity,omitempty"`
}

StreamingDistributionS3Origin models the S3Origin element of a StreamingDistributionConfig.

type StreamingDistributionTrustedSigners

type StreamingDistributionTrustedSigners struct {
	Items   []string `json:"items,omitempty"`
	Enabled bool     `json:"enabled"`
}

StreamingDistributionTrustedSigners models the TrustedSigners element of a StreamingDistributionConfig.

type TrustStore

type TrustStore struct {
	Tags                                   map[string]string           `json:"tags,omitempty"`
	ID                                     string                      `json:"id"`
	ARN                                    string                      `json:"arn"`
	Name                                   string                      `json:"name"`
	Comment                                string                      `json:"comment,omitempty"`
	Status                                 string                      `json:"status"`
	ETag                                   string                      `json:"etag"`
	LastModifiedTime                       string                      `json:"lastModifiedTime,omitempty"`
	CertificateAuthorityCertificatesBundle TrustStoreCertificateBundle `json:"certificateAuthorityCertificatesBundle"`
}

TrustStore represents a CloudFront trust store: a named collection of CA certificates used for mutual TLS (mTLS) authentication between viewers and CloudFront.

type TrustStoreCertificateBundle

type TrustStoreCertificateBundle struct {
	S3Bucket                string `json:"s3Bucket,omitempty"`
	S3Key                   string `json:"s3Key,omitempty"`
	InlineCertificateBundle string `json:"inlineCertificateBundle,omitempty"`
}

TrustStoreCertificateBundle models the CA certificate bundle backing a trust store, either as a reference to an object in S3 or as an inline PEM-encoded certificate bundle.

type ValidationTokenDetail

type ValidationTokenDetail struct {
	Domain       string `json:"domain"`
	RedirectFrom string `json:"redirectFrom,omitempty"`
	RedirectTo   string `json:"redirectTo,omitempty"`
}

ValidationTokenDetail describes the DNS validation record CloudFront expects to see published for one domain of a distribution tenant's CloudFront-managed ACM certificate.

type VpcOrigin

type VpcOrigin struct {
	ID   string `json:"id"`
	ARN  string `json:"arn"`
	Name string `json:"name"`
	ETag string `json:"eTag"`
}

VpcOrigin represents a CloudFront VPC Origin.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL