https://pulumi.com logo
#python
Title
# python
s

straight-napkin-70642

05/13/2019, 7:16 PM
Hi, I'm trying to use aws provider to setup a domain, I don't know how to translate a alias in pulumi python, could someone give a pointer?
Copy code
# Example DNS record using Route53.
# Route53 is not specifically required; any DNS host can be used.
resource "aws_route53_record" "example" {
  name    = "${aws_api_gateway_domain_name.example.domain_name}"
  type    = "A"
  zone_id = "${aws_route53_zone.example.id}"

  alias {
    evaluate_target_health = true
    name                   = "${aws_api_gateway_domain_name.example.cloudfront_domain_name}"
    zone_id                = "${aws_api_gateway_domain_name.example.cloudfront_zone_id}"
  }
}
Example from https://www.terraform.io/docs/providers/aws/r/api_gateway_domain_name.html
so creating 2 resources it's the same
sorry for the noise, I assumed that learning pulumi I'll avoid learning terraform 😄
grrrr. Nop, they are record aliases in route53 , I don't know how to translate them https://www.terraform.io/docs/providers/aws/r/route53_record.html#alias-record
Copy code
api_record = route53.Record(
    'api_record',
    name=domain.domain_name,
    type='A',
    zone_id=zone.id,
    aliases=[{
        "name": domain.cloudfront_domain_name,
        "zone_id": domain.cloudfront_zone_id,
        "evaluate_target_health": True
    }]
)
worked
👍 1