Documentation
¶
Index ¶
- type Behavior
- type Distribution
- type DistributionBuilder
- func (b DistributionBuilder) Build() Distribution
- func (b DistributionBuilder) WithAlternateDomains(domains []string) DistributionBuilder
- func (b DistributionBuilder) WithIPv6() DistributionBuilder
- func (b DistributionBuilder) WithLogging(bucketAddress, prefix string) DistributionBuilder
- func (b DistributionBuilder) WithTLS(certARN, securityPolicyID string) DistributionBuilder
- func (b DistributionBuilder) WithTags(tags map[string]string) DistributionBuilder
- func (b DistributionBuilder) WithWebACL(id string) DistributionBuilder
- type Origin
- type OriginBuilder
- type OriginRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Behavior ¶
type Behavior struct {
// PathPattern is the path pattern used when configuring the Behavior
PathPattern string
// ViewerFnARN is the ARN of the function to be associated with the Behavior's viewer requests
ViewerFnARN string
}
Behavior represents a CloudFront Cache Behavior
type Distribution ¶ added in v0.0.7
type Distribution struct {
AlternateDomains []string
DefaultOriginDomain string
Description string
IPv6Enabled bool
Logging loggingConfig
PriceClass string
Tags map[string]string
TLS tlsConfig
WebACLID string
}
Distribution represents a CloudFront distribution
type DistributionBuilder ¶ added in v0.0.7
type DistributionBuilder struct {
// contains filtered or unexported fields
}
DistributionBuilder allows the construction of a Distribution
func NewDistributionBuilder ¶ added in v0.0.7
func NewDistributionBuilder(defaultOriginDomain, description, priceClass, group string) DistributionBuilder
NewDistributionBuilder takes required arguments for a distribution and returns a DistributionBuilder
func (DistributionBuilder) Build ¶ added in v0.0.7
func (b DistributionBuilder) Build() Distribution
Build constructs a Distribution taking into account all configuration set by previous "With*" method calls
func (DistributionBuilder) WithAlternateDomains ¶ added in v0.0.7
func (b DistributionBuilder) WithAlternateDomains(domains []string) DistributionBuilder
WithAlternateDomains takes a slice of domains to be configured as the Distribution's alternate domains
func (DistributionBuilder) WithIPv6 ¶ added in v0.0.7
func (b DistributionBuilder) WithIPv6() DistributionBuilder
WithIPv6 enables IPv6
func (DistributionBuilder) WithLogging ¶ added in v0.0.7
func (b DistributionBuilder) WithLogging(bucketAddress, prefix string) DistributionBuilder
WithLogging takes in bucket address and file prefix to enable sending CF logs to S3
func (DistributionBuilder) WithTLS ¶ added in v0.0.7
func (b DistributionBuilder) WithTLS(certARN, securityPolicyID string) DistributionBuilder
WithTLS takes in an ACM certificate ARN and a Security Policy ID to enable TLS termination
func (DistributionBuilder) WithTags ¶ added in v0.0.7
func (b DistributionBuilder) WithTags(tags map[string]string) DistributionBuilder
WithTags takes in custom tags which should be present at the Distribution
func (DistributionBuilder) WithWebACL ¶ added in v0.0.7
func (b DistributionBuilder) WithWebACL(id string) DistributionBuilder
WithWebACL takes the ID of the Web ACL that should be associated with the Distribution
type Origin ¶
type Origin struct {
// Host is the origin's hostname
Host string
// Behaviors is the collection of Behaviors associated with this Origin
Behaviors []Behavior
// ResponseTimeout
ResponseTimeout int64
}
Origin represents a CloudFront Origin and aggregates Behaviors associated with it
type OriginBuilder ¶
type OriginBuilder struct {
// contains filtered or unexported fields
}
OriginBuilder allows the construction of a Origin
func NewOriginBuilder ¶
func NewOriginBuilder(host string) OriginBuilder
NewOriginBuilder returns an OriginBuilder for a given host
func (OriginBuilder) Build ¶
func (b OriginBuilder) Build() Origin
Build creates an Origin based on configuration made so far
func (OriginBuilder) WithBehavior ¶
func (b OriginBuilder) WithBehavior(pathPattern string) OriginBuilder
WithBehavior adds a Behavior to the Origin being built given a path pattern the Behavior should respond for
func (OriginBuilder) WithResponseTimeout ¶ added in v0.0.6
func (b OriginBuilder) WithResponseTimeout(rpTimeout int64) OriginBuilder
WithResponseTimeout associates a custom response timeout to custom origin
func (OriginBuilder) WithViewerFunction ¶ added in v0.0.5
func (b OriginBuilder) WithViewerFunction(fnARN string) OriginBuilder
WithViewerFunction associates a function with all viewer requests of all Behaviors in the Origin being built
type OriginRepository ¶
type OriginRepository interface {
// Save ensures the given origin exists on the CloudFront distribution of given ID
Save(id string, o Origin) error
}
OriginRepository provides a repository for manipulating CloudFront distributions to match desired configuration
func NewOriginRepository ¶
func NewOriginRepository(awsClient cloudfrontiface.CloudFrontAPI) OriginRepository
NewOriginRepository creates a new AWS CloudFront Origin repository