https://pulumi.com logo
#general
Title
# general
b

billions-yak-67755

03/26/2021, 2:49 PM
Trying to create an alias record in AWS and Python is returning this error. I have tried the "dualstack" address, the actual DNS name, etc. Always something like:
Copy code
* [ERR]: Error building changeset: InvalidChangeBatch: [Tried to create an alias that targets myelbname.us-west-2.elb.amazonaws.com., type A in zone myzoneid, but the alias target name does not lie within the target zone, Tried to create an alias that targets myelbname.us-west-2.elb.amazonaws.com., type A in zone myzoneid, but that target was not found]
The code:
Copy code
a_record = aws.route53.Record(
        'my-a-record',
        allow_overwrite=True,
        name=my_domain,
        aliases=[aws.route53.RecordAliasArgs(
            evaluate_target_health=False,
            name=the_elb_dns,
            zone_id=my_zone
        )],
        type='A',
        zone_id=my_zone
    )
Docs say:
DNS domain name for a CloudFront distribution, S3 bucket, ELB, or another resource record set in this hosted zone.
https://www.pulumi.com/docs/reference/pkg/aws/route53/record/#recordalias Is there something I am obviously doing wrong here? It seems to me that the change is only looking for other resource record sets, not ELB resources?
c

cool-fireman-90027

03/26/2021, 4:22 PM
How are you setting the
zone_id=my_zone
? You would have to set this from the zone_id output from the elb. https://www.pulumi.com/docs/reference/pkg/aws/elb/loadbalancer/#zone_id_python something like:
Copy code
zone_id=myelb.zone_id
where
Copy code
myelb=aws.elb.LoadBalancer("main"...)
b

billions-yak-67755

03/27/2021, 3:42 AM
Ohhhh interesting! Good to know, thank you! I was thinking that was the hosted zone 🙈
2 Views