sbercloud-terraform / terraform-provider-sbercloud

Terraform SberCloud Provider
https://registry.terraform.io/providers/sbercloud-terraform/sbercloud/latest/docs
Mozilla Public License 2.0
34 stars 21 forks source link

[BUG] OBS changing the name field in the lifecycle_rule block via provider version 1.11.6 #271

Open bonjonson opened 8 months ago

bonjonson commented 8 months ago

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Terraform version 1.5.6 Provider version 1.11.6

Affected Resource(s)

Please list the resources as a list, for example:

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resource "sbercloud_obs_bucket" "test" {
  bucket   = "test"
  acl      = "private"
  multi_az = "false"

  lifecycle_rule {
    name    = "test"
    enabled = true

    expiration {
      days = 7
    }
  }
}

Debug Output

╷
│ Error: Error setting lifecycle rules of OBS bucket test: obs: service returned error: Status=400 Bad Request, Code=MalformedXML, Message=The XML you provided was not well-formed or did not validate against our published schema, RequestId=XXX
│ 
│   with sbercloud_obs_bucket.test,
│   on test.tf line 2, in resource "sbercloud_obs_bucket" "test":
│    2: resource "sbercloud_obs_bucket" "test" {
│ 
╵

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

  # sbercloud_obs_bucket.test will be updated in-place
  ~ resource "sbercloud_obs_bucket" "test" {
        id                    = "test"
        tags                  = {}
        # (17 unchanged attributes hidden)
      ~ lifecycle_rule {
          ~ name    = "test1245" -> "test"
            # (1 unchanged attribute hidden)
            # (1 unchanged block hidden)
        }
    }

Actual Behavior

╷
│ Error: Error setting lifecycle rules of OBS bucket test: obs: service returned error: Status=400 Bad Request, Code=MalformedXML, Message=The XML you provided was not well-formed or did not validate against our published schema, RequestId=XXX
│ 
│   with sbercloud_obs_bucket.test,
│   on test.tf line 2, in resource "sbercloud_obs_bucket" "test":
│    2: resource "sbercloud_obs_bucket" "test" {
│ 
╵

Steps to Reproduce

Please list the steps required to reproduce the issue, for example: changing the name field in the lifecycle_rule block

Important Factoids

There is no such problem on provider version 1.11.3

alxrem commented 5 months ago

Got the same error on the lifecycle update by the provider of version 1.12.0

Last working version is 1.11.5

Maybe this bug is caused by upgrade of huaweicloud provider:

1.11.6 (November 20, 2023) ENHANCEMENTS: Upgrade to terraform-provider-huaweicloud v1.57.0

0ohmresistor commented 3 months ago

Hello there! After last provider update, provided manifest will produce following result:

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # sbercloud_obs_bucket.test467321482 will be created
  + resource "sbercloud_obs_bucket" "test467321482" {
      + acl                   = "private"
      + bucket                = "test2143245"
      + bucket_domain_name    = (known after apply)
      + bucket_version        = (known after apply)
      + encryption            = false
      + enterprise_project_id = (known after apply)
      + force_destroy         = false
      + id                    = (known after apply)
      + kms_key_project_id    = (known after apply)
      + multi_az              = false
      + policy                = (known after apply)
      + policy_format         = "obs"
      + quota                 = 0
      + region                = (known after apply)
      + sse_algorithm         = (known after apply)
      + storage_class         = "STANDARD"
      + storage_info          = (known after apply)
      + user_domain_names     = (known after apply)
      + versioning            = false

      + lifecycle_rule {
          + enabled = true
          + name    = "test"

          + expiration {
              + days = 7
            }
        }
    }

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

Please, check that your problem is resolved and close this issue.