go-gandi / terraform-provider-gandi

Terraform provider for the Gandi Domain services
Mozilla Public License 2.0
153 stars 46 forks source link

Contacts on imported models removed and created in terraform plan #101

Closed jamestait closed 2 years ago

jamestait commented 2 years ago

I have several pre-existing domains that I'm importing into a new terraform config. The initial import of the gandi_domain resources has worked fine, but with no further changes terraform plan shows that the admin, billing, owner and tech attributes will be removed and re-created with identical content:

      - admin {
          - city             = "Derby" -> null
          - country          = "GB" -> null
          - data_obfuscated  = true -> null
          - email            = "me@myemail.address" -> null
          - extra_parameters = {
              - "birth_city"       = "Sometown"
              - "birth_country"    = "GB"
              - "birth_date"       = "1901-01-01"
              - "birth_department" = "99"
            } -> null
          - family_name      = "Tait" -> null
          - given_name       = "James" -> null
          - mail_obfuscated  = true -> null
          - phone            = "+44.12345678" -> null
          - street_addr      = <<-EOT
                My house,
                My town
            EOT -> null
          - type             = "person" -> null
          - zip              = "DE99 9XX" -> null
        }
      + admin {
          + city             = "Derby"
          + country          = "GB"
          + data_obfuscated  = true
          + email            = "me@myemail.address"
          + extra_parameters = {
              + "birth_city"       = "Sometown"
              + "birth_country"    = "GB"
              + "birth_date"       = "1901-01-01"
              + "birth_department" = "99"
            }
          + family_name      = "Tait"
          + given_name       = "James"
          + mail_obfuscated  = true
          + phone            = "+44.12345678"
          + street_addr      = <<-EOT
                My house,
                My town
            EOT
          + type             = "person"
          + zip              = "DE99 9XX"
        }

Is there another resource I need to import in order to prevent this?

keyneston commented 2 years ago

I'm also encountering this issue in quite the similar way. Have domains, imported it:

terraform import --var-file="secrets.tfvars" 'gandi_domain.mydomain[2]' <domain_name>.com

Then I get simliar additions and removals to the ticket.

nlewo commented 2 years ago

Should have been fixed by #123