I have configured two weighted records in Route 53 with the same record name and type:
Record name: A
Type: CNAME
Routing policy: Weighted
Weights: 10 and 0
Both records exist in Route 53, but when I query the aws_route53_hosted_zone_resource_record_sets table, only one of these records is returned.
Could you confirm if this is expected behavior for weighted records with the same name, or if there might be an issue with the data synchronization to this table?
First things first, welcome to the CloudQuery community!
The aws_route53_hosted_zone_resource_record_sets table actually uses APIs similar to what the list-resource-record-sets — AWS CLI 2.28.6 Command Reference CLI command would, so could you try that out and let us know if the behaviour is different? Could you share the output with us?
Since the Primary Key on that table is built out of Name and Type, I would expect one of two things to happen:
either both records are returned but the first one is dropped due to the PK conflict, or,
the AWS API & CLI actually only return a single record
@stefan Thanks for checking!
I ran the AWS CLI list-resource-record-sets command, and it returns both records.
It seems like the PK conflict issue you mentioned.
When I run this query, only one record is returned.
SELECT *
FROM public.aws_route53_hosted_zone_resource_record_sets
WHERE EXISTS (
SELECT 1
FROM jsonb_array_elements(resource_records) AS record
WHERE record ->> 'Value' = '<name>'
);
If the intention is to behave similarly to the AWS CLI list-resource-record-sets output, it would be great to have this fixed. Should I open a GitHub issue for it?
@stefan Thanks for the quick fix — I’ve confirmed it works fine with v32.37.0.
FYI, as a side effect of including it in the PK, I’m seeing the following warning log when synchronizing plain (non-weighted) records: WRN resource resolver finished with validation warning error="missing primary key component on columns: [set_identifier]"