diff --git a/client.go b/client.go index fabfc86..8bb6936 100644 --- a/client.go +++ b/client.go @@ -201,6 +201,10 @@ func (p *Provider) getRecords(ctx context.Context, zoneID string, _ string) ([]l } func (p *Provider) getZoneID(ctx context.Context, zoneName string) (string, error) { + if p.HostedZoneID != "" { + return "/hostedzone/" + p.HostedZoneID, nil + } + getZoneInput := &r53.ListHostedZonesByNameInput{ DNSName: aws.String(zoneName), MaxItems: aws.Int32(1), diff --git a/provider.go b/provider.go index 1057713..e987a1f 100644 --- a/provider.go +++ b/provider.go @@ -58,6 +58,13 @@ type Provider struct { // WaitForPropagation if set to true, it will wait for the record to be // propagated before returning. WaitForPropagation bool `json:"wait_for_propagation,omitempty"` + + // HostedZoneID is the ID of the hosted zone to use. If not set, it will + // be discovered from the zone name. + // + // This option should contain only the ID; the "/hostedzone/" prefix + // will be added automatically. + HostedZoneID string `json:"hosted_zone_id,omitempty"` } // GetRecords lists all the records in the zone.