aws

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSConfig

type AWSConfig struct {
	DomainFilter         endpoint.DomainFilter
	ZoneIDFilter         provider.ZoneIDFilter
	ZoneTypeFilter       provider.ZoneTypeFilter
	ZoneTagFilter        provider.ZoneTagFilter
	BatchChangeSize      int
	BatchChangeInterval  time.Duration
	EvaluateTargetHealth bool
	PreferCNAME          bool
	DryRun               bool
	ZoneCacheDuration    time.Duration
}

AWSConfig contains configuration to create a new AWS provider.

type AWSProvider

type AWSProvider struct {
	provider.BaseProvider
	// contains filtered or unexported fields
}

AWSProvider is an implementation of Provider for AWS Route53.

func NewAWSProvider

func NewAWSProvider(ctx context.Context, awsConfig AWSConfig, client Route53API) (*AWSProvider, error)

NewAWSProvider initializes a new AWS Route53 based Provider.

func (*AWSProvider) AdjustEndpoints

func (p *AWSProvider) AdjustEndpoints(endpoints []*endpoint.Endpoint) ([]*endpoint.Endpoint, error)

AdjustEndpoints modifies the provided endpoints (coming from various sources) to match the endpoints that the provider returns in `Records` so that the change plan will not have unneeded (potentially failing) changes. Example: CNAME endpoints pointing to ELBs will have a `alias` provider-specific property added to match the endpoints generated from existing alias records in Route53.

func (*AWSProvider) ApplyChanges

func (p *AWSProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) error

ApplyChanges applies a given set of changes in a given zone.

func (*AWSProvider) GetDomainFilter

func (p *AWSProvider) GetDomainFilter() endpoint.DomainFilter

GetDomainFilter generates a filter to exclude any domain that is not controlled by the provider

func (*AWSProvider) Records

func (p *AWSProvider) Records(ctx context.Context) (endpoints []*endpoint.Endpoint, _ error)

Records returns the list of records in a given hosted zone.

func (*AWSProvider) SupportedRecordType

func (p *AWSProvider) SupportedRecordType(recordType string) bool

func (*AWSProvider) Zones

func (p *AWSProvider) Zones(ctx context.Context) (map[string]*route53.HostedZone, error)

Zones returns the list of hosted zones.

type Route53API

type Route53API interface {
	ListResourceRecordSetsPagesWithContext(ctx context.Context, input *route53.ListResourceRecordSetsInput, fn func(resp *route53.ListResourceRecordSetsOutput, lastPage bool) (shouldContinue bool), opts ...request.Option) error
	ChangeResourceRecordSetsWithContext(ctx context.Context, input *route53.ChangeResourceRecordSetsInput, opts ...request.Option) (*route53.ChangeResourceRecordSetsOutput, error)
	CreateHostedZoneWithContext(ctx context.Context, input *route53.CreateHostedZoneInput, opts ...request.Option) (*route53.CreateHostedZoneOutput, error)
	ListHostedZonesPagesWithContext(ctx context.Context, input *route53.ListHostedZonesInput, fn func(resp *route53.ListHostedZonesOutput, lastPage bool) (shouldContinue bool), opts ...request.Option) error
	ListTagsForResourceWithContext(ctx context.Context, input *route53.ListTagsForResourceInput, opts ...request.Option) (*route53.ListTagsForResourceOutput, error)
}

Route53API is the subset of the AWS Route53 API that we actually use. Add methods as required. Signatures must match exactly. mostly taken from: https://github.com/kubernetes/kubernetes/blob/853167624edb6bc0cfdcdfb88e746e178f5db36c/federation/pkg/dnsprovider/providers/aws/route53/stubs/route53api.go

type Route53Change

type Route53Change struct {
	route53.Change
	OwnedRecord string
}

wrapper to handle ownership relation throughout the provider implementation

type Route53Changes

type Route53Changes []*Route53Change

func (Route53Changes) Route53Changes

func (cs Route53Changes) Route53Changes() []*route53.Change

Jump to

Keyboard shortcuts

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