d-velop / dvelop-app-template-cs

This template contains everything you need to write an app for d.velop cloud in C#
Apache License 2.0
16 stars 7 forks source link

Modul hosted_zone does not work with Terraform AWS Provider 2.0 #39

Closed tobiwsta closed 4 years ago

tobiwsta commented 5 years ago
* aws_route53_record.ns: [ERR]: Error building changeset: InvalidChangeBatch: [Tried to create resource record set [name='app1.example.com.', type='NS'] but it already exists]
    status code: 400, request id: XXXXXX

See https://github.com/terraform-providers/terraform-provider-aws/issues/8778

The resource aws_route53_record requires an allow_overwrite = true.

resource "aws_route53_record" "ns" {
  allow_overwrite = true
  zone_id = "${aws_route53_zone.hosted_zone.zone_id}"
  name    = "${aws_route53_zone.hosted_zone.name}"
  type    = "NS"
  ttl     = "30"

  records = [
    "${aws_route53_zone.hosted_zone.name_servers.0}",
    "${aws_route53_zone.hosted_zone.name_servers.1}",
    "${aws_route53_zone.hosted_zone.name_servers.2}",
    "${aws_route53_zone.hosted_zone.name_servers.3}",
  ]
}

The resource aws_route53_zone implicitly creates a nameserver.

Prior to version 2.0.0 of Terraform AWS Provider, the resource would automatically perform an UPSERT operation on Route 53 when creating a Terraform aws_route53_record resource instead of a CREATE operation.

ckuetbach commented 4 years ago

Fixed with #46