Constellix / terraform-provider-constellix

Terraform Constellix provider
https://www.terraform.io/docs/providers/constellix/
Mozilla Public License 2.0
7 stars 21 forks source link

srv_record not imported correctly #12

Open LanceSandino opened 3 years ago

LanceSandino commented 3 years ago

When importing SRV record, roundRobin info does not import.

sandino@host dns % terraform import --allow-missing-config constellix_srv_record.srv_record domains:<parent-id>:<record-id>
constellix_srv_record.srv_record: Importing from ID "domains:<parent-id>:<record-id>"...
constellix_srv_record.srv_record: Import prepared!
  Prepared constellix_srv_record for import
constellix_srv_record.srv_record: Refreshing state... [id=<record-id>]

Import successful!

The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.

----------------

sandino@host dns % terraform state show 'constellix_srv_record.srv_record'
# constellix_srv_record.srv_record:
resource "constellix_srv_record" "srv_record" {
    domain_id   = "<parent-id>"
    gtd_region  = 1
    id          = "<record-id>"
    name        = "value"
    noanswer    = false
    source_type = "domains"
    ttl         = 1800
    type        = "SRV"
}
nicksantamaria commented 3 years ago

I'm seeing the same problem with constellix_aname_record resources

resource "constellix_aname_record" "w" {
  domain_id     = constellix_domain.main.id
  name          = "w"
  source_type   = "domains"
  record_option = "roundRobin"
  ttl           = 3600
  note          = ""
  roundrobin {
    value        = "foo.bar.ap-southeast-2.elb.amazonaws.com."
    disable_flag = "false"
  }
}

After import, this is the delta detected after running terraform plan.

  # module.foo.constellix_aname_record.w will be updated in-place
  ~ resource "constellix_aname_record" "w" {
        contact_ids                  = []
        domain_id                    = "460964"
        geo_location                 = {}
        gtd_region                   = 1
        id                           = "6555475"
        name                         = "w"
        noanswer                     = false
        pools                        = []
        record_failover_disable_flag = "false"
        record_option                = "roundRobin"
        source_type                  = "domains"
        ttl                          = 3600
        type                         = "ANAME"

      + roundrobin {
          + disable_flag = false
          + value        = "foo.bar.ap-southeast-2.elb.amazonaws.com."
        }
    }

terraform show is missing the roundrobin block.

# module.foo.constellix_aname_record.w:
resource "constellix_aname_record" "w" {
    contact_ids                  = []
    domain_id                    = "460964"
    geo_location                 = {}
    gtd_region                   = 1
    id                           = "6555475"
    name                         = "w"
    noanswer                     = false
    pools                        = []
    record_failover_disable_flag = "false"
    record_option                = "roundRobin"
    source_type                  = "domains"
    ttl                          = 3600
    type                         = "ANAME"
}