Terraform-provider-aws: feature request: support Route53 Traffic Policies

Created on 11 Dec 2019  路  3Comments  路  Source: hashicorp/terraform-provider-aws

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Traffic Policies are groups of rules and endpoints expressed as a single document that create multiple Resource Record Sets. Traffic Policies are reusable and are attached to Hosted Zones using Traffic Policy Instances. Traffic Policies are immutable and automatically versioned.

New or Affected Resource(s)

  • aws_route53_traffic_policy
  • aws_route53_traffic_policy_document
  • aws_route53_traffic_policy_instance

Potential Terraform Configuration

data "aws_route53_traffic_policy_document" "example" {
  record_type = "A"
  start_rule  = "site_switch"

  endpoint {
    id    = "my_elb"
    type  = "elastic-load-balancer"
    value = "elb-111111.us-east-1.elb.amazonaws.com"
  }

  endpoint {
    id     = "site_down_banner"
    type   = "s3-website"
    region = "us-east-1"
    value  = "www.example.com"
  }

  rule {
    id   = "site_switch"
    type = "failover"
    primary = {
      endpoint_reference = "my_elb"
    }
    secondary = {
      endpoint_reference = "site_down_banner"
    }
  }
}

resource "aws_route53_zone" "main" {
  name = "test.com"
}

resource "aws_route53_traffic_policy" "www" {
  name     = "www"
  document = "${data.aws_route53_traffic_policy_document.example.json}"
}

resource "aws_route53_traffic_policy_instance" "www_main" {
  zone_id        = "${aws_route53_zone.main.zone_id}"
  name           = "${aws_route53_traffic_policy.www.name}_${aws_route53_zone.main.name}"
  policy_id      = "${aws_route53_traffic_policy.www.id}"
  policy_version = "${aws_route53_traffic_policy.www.version}"
}

References

  • 1159

  • enhancement needs-triage servicroute53

    Most helpful comment

    Hi! are there any plans on implementing this?
    thanks

    All 3 comments

    /cc @thetwoj

    Hi! are there any plans on implementing this?
    thanks

    Hi. I started to work on aws_route53_traffic_policy, but cannot provide any date when will be ready (not much time I can spend on this).

    Sidenote: I hit an issue with GetTrafficPolicy - it returns data even for deleted traffic policies - I asked AWS support if it's expected behavior and waiting for a reply (I know I can use ListTrafficPolicies and iterate to check but I prefer to make it clear which one should be used and why)

    Was this page helpful?
    0 / 5 - 0 ratings