The AWS provider is creates NAPTR records using the CRD, but only when the record does not exist. #5003
Labels
area/provider/aws
Issues or PRs related to aws provider
help wanted
Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
kind/bug
Categorizes issue or PR as related to a bug.
What happened:
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
):v20240904-v0.15.0
aws
The text was updated successfully, but these errors were encountered: