Documentation ¶
Index ¶
- func CleanAzureError(err error) error
- func ExtractAzureTargets(recordSet *dns.RecordSet) []string
- func FormatAzureDNSName(recordName, zoneName string) string
- type AzureChangeMap
- type AzureProvider
- func (p *AzureProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) error
- func (p *AzureProvider) DeleteRecords(ctx context.Context, deleted AzureChangeMap)
- func (p *AzureProvider) MapChanges(zones []dns.Zone, changes *plan.Changes) (AzureChangeMap, AzureChangeMap)
- func (p *AzureProvider) NewRecordSet(endpoint *endpoint.Endpoint) (dns.RecordSet, error)
- func (p *AzureProvider) RecordSetNameForZone(zone string, endpoint *endpoint.Endpoint) string
- func (p *AzureProvider) Records(ctx context.Context) (endpoints []*endpoint.Endpoint, _ error)
- func (p *AzureProvider) SupportedRecordType(recordType string) bool
- func (p *AzureProvider) UpdateRecords(ctx context.Context, updated AzureChangeMap)
- func (p *AzureProvider) Zones(ctx context.Context) ([]dns.Zone, error)
- type Config
- type RecordSetsClient
- type ZonesClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanAzureError ¶ added in v0.7.0
func ExtractAzureTargets ¶ added in v0.6.0
Helper function (shared with test code)
func FormatAzureDNSName ¶ added in v0.6.0
Helper function (shared with test code)
Types ¶
type AzureChangeMap ¶ added in v0.6.0
type AzureProvider ¶
type AzureProvider struct { provider.BaseProvider DomainFilter endpoint.DomainFilter ZoneNameFilter endpoint.DomainFilter DryRun bool ResourceGroup string RecordSetsClient RecordSetsClient TrafficManagerEndpointsClient *armtrafficmanager.EndpointsClient TrafficManagerGeographicClient *armtrafficmanager.GeographicHierarchiesClient TrafficManagerProfilesClient *armtrafficmanager.ProfilesClient // contains filtered or unexported fields }
AzureProvider implements the DNS provider for Microsoft's Azure cloud platform.
func NewAzureProvider ¶
func NewAzureProvider(ctx context.Context, configFile string, domainFilter endpoint.DomainFilter, zoneNameFilter endpoint.DomainFilter, zoneIDFilter provider.ZoneIDFilter, resourceGroup string, userAssignedIdentityClientID string, dryRun bool) (*AzureProvider, error)
NewAzureProvider creates a new Azure provider.
Returns the provider or an error if a provider could not be created.
func NewAzureProviderFromConfig ¶
func NewAzureProviderFromConfig(ctx context.Context, azureConfig Config) (*AzureProvider, error)
func (*AzureProvider) ApplyChanges ¶
ApplyChanges applies the given changes.
Returns nil if the operation was successful or an error if the operation failed.
func (*AzureProvider) DeleteRecords ¶ added in v0.6.0
func (p *AzureProvider) DeleteRecords(ctx context.Context, deleted AzureChangeMap)
func (*AzureProvider) MapChanges ¶ added in v0.6.0
func (p *AzureProvider) MapChanges(zones []dns.Zone, changes *plan.Changes) (AzureChangeMap, AzureChangeMap)
func (*AzureProvider) NewRecordSet ¶ added in v0.6.0
func (*AzureProvider) RecordSetNameForZone ¶ added in v0.6.0
func (p *AzureProvider) RecordSetNameForZone(zone string, endpoint *endpoint.Endpoint) string
func (*AzureProvider) Records ¶
Records gets the current records.
Returns the current records or an error if the operation failed.
func (*AzureProvider) SupportedRecordType ¶
func (p *AzureProvider) SupportedRecordType(recordType string) bool
func (*AzureProvider) UpdateRecords ¶ added in v0.6.0
func (p *AzureProvider) UpdateRecords(ctx context.Context, updated AzureChangeMap)
type Config ¶
type Config struct { Cloud string `json:"cloud" yaml:"cloud"` TenantID string `json:"tenantId" yaml:"tenantId"` SubscriptionID string `json:"subscriptionId" yaml:"subscriptionId"` ResourceGroup string `json:"resourceGroup" yaml:"resourceGroup"` Location string `json:"location" yaml:"location"` ClientID string `json:"aadClientId" yaml:"aadClientId"` ClientSecret string `json:"aadClientSecret" yaml:"aadClientSecret"` UseManagedIdentityExtension bool `json:"useManagedIdentityExtension" yaml:"useManagedIdentityExtension"` UseWorkloadIdentityExtension bool `json:"useWorkloadIdentityExtension" yaml:"useWorkloadIdentityExtension"` UserAssignedIdentityID string `json:"userAssignedIdentityID" yaml:"userAssignedIdentityID"` DomainFilter endpoint.DomainFilter ZoneNameFilter endpoint.DomainFilter IDFilter provider.ZoneIDFilter DryRun bool Transporter policy.Transporter }
Config represents common config items for Azure DNS and Azure Private DNS
type RecordSetsClient ¶
type RecordSetsClient interface { NewListAllByDNSZonePager(resourceGroupName string, zoneName string, options *dns.RecordSetsClientListAllByDNSZoneOptions) *azcoreruntime.Pager[dns.RecordSetsClientListAllByDNSZoneResponse] Delete(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType dns.RecordType, options *dns.RecordSetsClientDeleteOptions) (dns.RecordSetsClientDeleteResponse, error) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType dns.RecordType, parameters dns.RecordSet, options *dns.RecordSetsClientCreateOrUpdateOptions) (dns.RecordSetsClientCreateOrUpdateResponse, error) }
RecordSetsClient is an interface of dns.RecordSetsClient that can be stubbed for testing.
type ZonesClient ¶
type ZonesClient interface {
NewListByResourceGroupPager(resourceGroupName string, options *dns.ZonesClientListByResourceGroupOptions) *azcoreruntime.Pager[dns.ZonesClientListByResourceGroupResponse]
}
ZonesClient is an interface of dns.ZoneClient that can be stubbed for testing.