Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

google_clouddomains_registration is currently unusable on import #18124

Open
jeremad opened this issue May 14, 2024 · 2 comments
Open

google_clouddomains_registration is currently unusable on import #18124

jeremad opened this issue May 14, 2024 · 2 comments

Comments

@jeremad
Copy link

jeremad commented May 14, 2024

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 me too comments, 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.
  • If an issue is assigned to a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Terraform Version & Provider Version(s)

Terraform v1.8.3
on linux_amd64

  • provider registry.terraform.io/hashicorp/google v5.29.0

Affected Resource(s)

google_clouddomains_registration

Terraform Configuration

resource "google_clouddomains_registration" "example" {
  domain_name = "xxx.yyy"
  location    = "global"
  yearly_price {}
  management_settings {
    transfer_lock_state = "LOCKED"
  }
  dns_settings {
    custom_dns {
      name_servers = [
        "...",
      ]
    }
  }
  contact_settings {
    privacy = "PRIVATE_CONTACT_DATA"
    registrant_contact {
      phone_number = "+000"
      email        = "[email protected]"
      postal_address {
        region_code   = "..."
        postal_code   = "..."
        locality      = "..."
        address_lines = ["..."]
        recipients    = ["..."]
      }
    }
    admin_contact {
      phone_number = "+000"
      email        = "[email protected]"
      postal_address {
        region_code   = "..."
        postal_code   = "..."
        locality      = "..."
        address_lines = ["..."]
        recipients    = ["..."]
      }
    }
    technical_contact {
      phone_number = "+000"
      email        = "[email protected]"
      postal_address {
        region_code   = "..."
        postal_code   = "..."
        locality      = "..."
        address_lines = ["..."]
        recipients    = ["..."]
      }
    }
  }
}

Debug Output

No response

Expected Behavior

When I import an existing resource terraform import google_clouddomains_registration.example global/xxx.yyy with a configuration copy/pasted directly from the GCP console, I can apply my configuration without a forces replacement.

yearly_price should absolutely not be a required argument, but rather an attribute.

resource "google_clouddomains_registration" "example" {
      ~ create_time             = "2023-02-08T08:12:39.881634216Z" -> (known after apply)
      ~ effective_labels        = {} -> (known after apply)
      ~ expire_time             = "2025-02-05T23:59:59Z" -> (known after apply)
      ~ id                      = "projects/.../locations/global/registrations/xxx.yyy" -> (known after apply)
      ~ issues                  = [] -> (known after apply)
      - labels                  = {} -> null
      ~ name                    = "projects/.../locations/global/registrations/xxx.yyy" -> (known after apply)
      + register_failure_reason = (known after apply)
      ~ state                   = "ACTIVE" -> (known after apply)
      ~ supported_privacy       = [
          - "PRIVATE_CONTACT_DATA",
          - "PUBLIC_CONTACT_DATA",
        ] -> (known after apply)
      ~ terraform_labels        = {} -> (known after apply)
        # (3 unchanged attributes hidden)

      ~ contact_settings {
            # (1 unchanged attribute hidden)

          ~ admin_contact {
              + phone_number = "+000" # forces replacement
                # (2 unchanged attributes hidden)

              + postal_address { # forces replacement
                  + address_lines = [ # forces replacement
                      + "...",
                    ]
                  + locality      = "..." # forces replacement
                  + postal_code   = "..." # forces replacement
                  + recipients    = [ # forces replacement
                      + "...",
                    ]
                  + region_code   = "..." # forces replacement
                }
            }

          ~ registrant_contact {
              + phone_number = "+000" # forces replacement
                # (2 unchanged attributes hidden)

              + postal_address { # forces replacement
                  + address_lines = [ # forces replacement
                      + "...",
                    ]
                  + locality      = "..." # forces replacement
                  + postal_code   = "..." # forces replacement
                  + recipients    = [ # forces replacement
                      + "...",
                    ]
                  + region_code   = "..." # forces replacement
                }
            }

          ~ technical_contact {
              + phone_number = "+000" # forces replacement
                # (2 unchanged attributes hidden)

              + postal_address { # forces replacement
                  + address_lines = [ # forces replacement
                      + "...",
                    ]
                  + locality      = "..." # forces replacement
                  + postal_code   = "..." # forces replacement
                  + recipients    = [ # forces replacement
                      + "...",
                    ]
                  + region_code   = "..." # forces replacement
                }
            }
        }

      ~ management_settings {
          + preferred_renewal_method = (known after apply)
          ~ renewal_method           = "AUTOMATIC_RENEWAL" -> (known after apply)
            # (1 unchanged attribute hidden)
        }

      + yearly_price {} # forces replacement

        # (1 unchanged block hidden)
    }

Plan: 1 to add, 0 to change, 1 to destroy.

Actual Behavior

No response

Steps to reproduce

  1. terraform import google_clouddomains_registration.example global/xxx.yyy
  2. terraform plan -target google_clouddomains_registration.example

Important Factoids

No response

References

No response

@jeremad jeremad added the bug label May 14, 2024
@jeremad jeremad changed the title google_clouddomains_registration is currently unsuable on import google_clouddomains_registration is currently unusable on import May 14, 2024
@ggtisc ggtisc self-assigned this May 17, 2024
@ggtisc
Copy link
Collaborator

ggtisc commented May 17, 2024

Hi @jeremad please share the output that you got after running the terraform import google_clouddomains_registration.example

Also confirm if you are using only the command terraform import google_clouddomains_registration.example or this other one terraform import google_clouddomains_registration.example xxx.yyy

@jeremad
Copy link
Author

jeremad commented Jun 3, 2024

Here is the output:

...
google_clouddomains_registration.example: Import prepared!
  Prepared google_clouddomains_registration for import
...
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.

Here is the command:
terraform import google_clouddomains_registration.example global/xxx.yyy,

Indeed I miswrote that in the original issue, I'll fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants