akamai / terraform-provider-akamai

Terraform Akamai provider
https://www.terraform.io/docs/providers/akamai/
Mozilla Public License 2.0
110 stars 99 forks source link

Provider produced inconsistent result after apply #54

Closed ericrichtert closed 4 years ago

ericrichtert commented 5 years ago

Terraform Version

Terraform v0.12.7

Affected Resource(s)

akamai_dns_zone akamai_dns_record

Terraform Configuration Files


resource "akamai_dns_zone" "xxx_nl" {
  contract = <cut>
  group    = <cut>

  zone    = "xxx.nl"
  type    = "PRIMARY"
  masters = <cut>

  comment        = <cut>
  sign_and_serve = false
}

resource "akamai_dns_record" "a__xxx_nl" {
  zone       = "xxx.nl"
  name       = "xxx.nl."
  recordtype = "A"
  active     = true
  ttl        = 3600
  target = [
    "1.1.8.4"
  ]
  depends_on = [akamai_dns_zone.xxx_nl]
}

resource "akamai_dns_record" "a_www_xxx_nl" {
  zone       = "xxx.nl"
  name       = "www.xxx.nl."
  recordtype = "A"
  active     = true
  ttl        = 3600
  target = [
    "1.1.8.4"
  ]
  depends_on = [akamai_dns_zone.xxx_nl]
}

###  Output
akamai_dns_zone.xxx_nl: Creating...

akamai_dns_zone.xxx_nl: Creation complete after 2s [id=<cut>]

akamai_dns_record.a_www_xxx_nl: Creating...

akamai_dns_record.a__xxx_nl: Creating...

Error: 
Provider produced inconsistent result after apply

When applying changes to akamai_dns_record.a_www_xxx_nl, provider
"akamai" produced an unexpected new value for was present, but now absent.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.

Error: 
Provider produced inconsistent result after apply

When applying changes to akamai_dns_record.a__xxx_nl, provider "akamai"
produced an unexpected new value for was present, but now absent.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.

### Expected Behavior
1 zone and two records should be created and recorded in the tfstate, without errors

### Actual Behavior
1 zone is created and recorded in the tfstate without errors
2 records are created, not recorded in the tfstate, with errors

### Steps to Reproduce
1. `terraform apply`
martinstibbe commented 5 years ago

If you remove the extra . on end of names parameter this one should match results given back API for A records

provider "akamai" { edgerc = "~/.edgerc" dns_section = "dns" }

locals { zone = "akavadev1.net" }

data "akamai_contract" "contract" { }

data "akamai_group" "group" { }

resource "akamai_dns_record" "a__xxx_nl" { zone = "${local.zone}" name = "${local.zone}" recordtype = "A" active = true ttl = 3600 target = [ "1.1.8.4" ] }

resource "akamai_dns_record" "a_www_xxx_nl" { zone = "${local.zone}" name = "www.${local.zone}" recordtype = "A" active = true ttl = 3600 target = [ "1.1.8.4" ] }

Results from API config-dns/v2/zones/akavadev1.net/recordsets?showAll=true&accept=application/json&types=A

{ "metadata": { "showAll": true, "totalElements": 2 }, "recordsets": [ { "name": "akavadev1.net", "type": "A", "ttl": 3600, "rdata": [ "1.1.8.4" ] }, { "name": "www.akavadev1.net", "type": "A", "ttl": 3600, "rdata": [ "1.1.8.4" ] } ] }