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

try to modify 'product_code' instead of recreating #357

Open
teacherSsamko opened this issue Aug 21, 2023 · 0 comments
Open

try to modify 'product_code' instead of recreating #357

teacherSsamko opened this issue Aug 21, 2023 · 0 comments

Comments

@teacherSsamko
Copy link
Contributor

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 CLI and Terraform Ncloud Provider Version

Terraform version : v1.5.5 on darwin_arm64
Ncloud Provider version : v2.3.18

Affected Resource(s)

  • ncloud_server

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp
...

resource "ncloud_server" "server" {
  subnet_no                 = ncloud_subnet.test.id
  name                      = "my-tf-server"
  server_image_product_code = "SW.VSVR.OS.LNX64.UBNTU.SVR2004.B050"
  server_product_code = data.ncloud_server_products.spec.server_products[0].product_code
  login_key_name            = ncloud_login_key.loginkey.key_name
  init_script_no = ncloud_init_script.init.init_script_no
}

data "ncloud_server_products" "spec" {
  server_image_product_code = "SW.VSVR.OS.LNX64.UBNTU.SVR2004.B050"

  filter {
    name   = "product_code"
    values = ["SSD"]
    regex  = true
  }

  filter {
    name   = "cpu_count"
    values = ["2"]
  }

  filter {
    name   = "memory_size"
    values = ["4GB"]
  }

  filter {
    name   = "base_block_storage_size"
    values = ["50GB"]
  }

  filter {
    name   = "product_type"
    values = ["HICPU"]
  }

  output_file = "product.json"
}

Debug Output

Terraform used the selected providers to generate the following execution plan. Resource
actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # ncloud_server.server will be updated in-place
  ~ resource "ncloud_server" "server" {
        id                                  = "19086360"
        name                                = "my-tf-server"
      ~ server_product_code                 = "SVR.VSVR.STAND.C002.M008.NET.SSD.B050.G002" -> "SVR.VSVR.HICPU.C002.M004.NET.SSD.B050.G002"
        # (13 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

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

Panic Output

Expected Behavior

when 'product_code' has changed, it should destroy old server and create new one with new 'product_code'.

Actual Behavior

But, it try to modify 'product_code' and it goes fail

Steps to Reproduce

  1. Change 'product_code'
  2. terraform apply

Important Factoids

References

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

No branches or pull requests

1 participant