Skip to content

The AWS provider is creates NAPTR records using the CRD, but only when the record does not exist. #5003

@woltere

Description

@woltere

What happened:

  1. deployed external-dns on EKS
  2. added parameters --managed-record-types=NAPTR
  3. created a CRD with a record of type NAPTR

The NAPTR and TXT records are correctly created when they do not already exist.
On the next passes it again tries to create the records again and fails with the errors listed below.

time="2025-01-13T21:43:51Z" level=info msg="Desired change: CREATE REDACTED NAPTR" profile=default zoneID=/hostedzone/Z0XXXXXXXXXXXXXXXXXXX zoneName=xxxxxxxxx.xxx.
time="2025-01-13T21:43:51Z" level=info msg="Desired change: CREATE extdns-naptr-xxxxxxxxxxxxxxTXT" profile=default zoneID=/hostedzone/Z0XXXXXXXXXXXXXXXXXXX zoneName=xxxxxxxxxxxxxxx.
time="2025-01-13T21:43:51Z" level=error msg="Failure in zone xxxxxxxxxxxxxxx. when submitting change batch: InvalidChangeBatch: [Tried to create resource record set [name='xxxxxxxxxxxxxxx.', type='NAPTR'] but it already exists, Tried to create resource record set [name='extdns-naptr-xxxxxxxxxxxxxxx', type='TXT'] but it already exists]\n\tstatus code: 400, request id: xxxxxxxxxx-xxxxxx-xxxx-xxxx-xxxxxxxxxxxx" profile=default zoneID=/hostedzone/Z0XXXXXXXXXXXXXXXXXXX zoneName=xxxxxxxxxxxxxxxxx.

The created NAPTR record can't be removed by external-dns.

What you expected to happen:

Once the records exist they should not be created again.

How to reproduce it (as minimally and precisely as possible):

Enable NAPTR using the --managed-record-types argument and provider aws and add crd to sources
Create a CRD with a NAPTR record.

Anything else we need to know?:

Looking at the code of aws provider it seems that the NAPTR records are skipped because p.SupportedRecordType(r.Type) returns false when r.Type equals "NAPTR".
The provider will create the NAPTR record successfully if it not exists.
Because func (p *AWSProvider) records(ctx context.Context, zones map[string]*profiledZone) ([]*endpoint.Endpoint, error) totally skips the NAPTR records they can't be updated or deleted by external-dns

Environment:

  • External-DNS version (use external-dns --version):

v20240904-v0.15.0

  • DNS provider:

aws

  • Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/provider/awsIssues or PRs related to aws providerhelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions