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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Domain record] dns_zone is not set in tfstate when using terraform import #1023

Closed
paulden opened this issue Jan 6, 2022 · 0 comments
Closed
Labels
domain Domains issues, bugs and feature requests
Milestone

Comments

@paulden
Copy link
Contributor

paulden commented Jan 6, 2022

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 other comments that do not add relevant new information or questions, 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

Terraform Version

  • Terraform version : 1.0.7
  • Scaleway provider: 2.2.0

Affected Resource(s)

  • scaleway_domain_record

Terraform Configuration Files

resource "scaleway_domain_record" "test" {
  dns_zone = "domain.tld"
  name     = "test"
  data     = "1.2.3.4"
  ttl      = 600
  type     = "A"
}

Expected Behavior

When importing resource to state (using the documentation provided), it should import the dns_zone:

$ terraform import scaleway_domain_record.test domain.tld/11111111-1111-1111-1111-111111111111
$ terraform state show scaleway_domain_record.test
# scaleway_domain_record.records_test:
resource "scaleway_domain_record" "records_test" {
    data       = "1.2.3.4"
    dns_zone   = "domain.tld"
    id         = "11111111-1111-1111-1111-111111111111"
    name       = "test"
    priority   = 0
    project_id = "11111111-1111-1111-1111-111111111111"
    ttl        = 600
    type       = "A"

    timeouts {}
}

Actual Behavior

dns_zone is not present in tfstate after import :

$ terraform import scaleway_domain_record.test domain.tld/11111111-1111-1111-1111-111111111111
$ terraform state show scaleway_domain_record.test
# scaleway_domain_record.records_test:
resource "scaleway_domain_record" "records_test" {
    data       = "1.2.3.4"
    id         = "11111111-1111-1111-1111-111111111111"
    name       = "test"
    priority   = 0
    project_id = "11111111-1111-1111-1111-111111111111"
    ttl        = 600
    type       = "A"

    timeouts {}
}

It causes errors when trying to plan / apply after that since the scaleway-sdk-go cannot read a domain record when not specifying the zone.

Steps to Reproduce

  1. terraform import scaleway_domain_record.test domain.tld/11111111-1111-1111-1111-111111111111
  2. terraform state show scaleway_domain_record.test

References

PR : #1024

@Monitob Monitob added this to the v2.2.1 milestone Jan 7, 2022
@Monitob Monitob closed this as completed Jan 7, 2022
@remyleone remyleone added the domain Domains issues, bugs and feature requests label Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain Domains issues, bugs and feature requests
Projects
None yet
Development

No branches or pull requests

3 participants