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

ibm_cos_bucket documented storge_class flex does not work #3349

Closed
powellquiring opened this issue Nov 19, 2021 · 0 comments · Fixed by #3427
Closed

ibm_cos_bucket documented storge_class flex does not work #3349

powellquiring opened this issue Nov 19, 2021 · 0 comments · Fixed by #3427
Labels
service/Object Storage Issues related to Cloud Object Storage

Comments

@powellquiring
Copy link

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 IBM Provider Version

[

bug-bucket $ tf version
Terraform v1.0.11
on darwin_amd64
+ provider registry.terraform.io/ibm-cloud/ibm v1.36.0

Affected Resource(s)

Full example: https://github.com/powellquiring/tfbugs/tree/master/bug-bucket

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cos_bucket

Specifying the storage_class on a bucket of flex as suggested in the documentation does not work. Using smart or standard works.

bug-bucket $ tf version
Terraform v1.0.11
on darwin_amd64
+ provider registry.terraform.io/ibm-cloud/ibm v1.36.0

bug-bucket $ cat main.tf
...
resource "ibm_cos_bucket" "flowlog" {
  bucket_name          = "${local.name}-000"
  resource_instance_id = ibm_resource_instance.cos.id
  region_location      = local.region
  storage_class        = "flex"
  # storage_class        = "smart"
  # storage_class        = "standard"
  force_delete         = true
}
bug-bucket $ tfa

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:

  # ibm_cos_bucket.flowlog will be created
  + resource "ibm_cos_bucket" "flowlog" {
      + bucket_name          = "tfbug-bucket-000"
      + crn                  = (known after apply)
      + endpoint_type        = "public"
      + force_delete         = true
      + id                   = (known after apply)
      + region_location      = "us-south"
      + resource_instance_id = (known after apply)
      + s3_endpoint_private  = (known after apply)
      + s3_endpoint_public   = (known after apply)
      + storage_class        = "flex"
    }

  # ibm_resource_instance.cos will be created
  + resource "ibm_resource_instance" "cos" {
      + account_id              = (known after apply)
      + allow_cleanup           = (known after apply)
      + created_at              = (known after apply)
      + created_by              = (known after apply)
      + crn                     = (known after apply)
      + dashboard_url           = (known after apply)
      + deleted_at              = (known after apply)
      + deleted_by              = (known after apply)
      + extensions              = (known after apply)
      + guid                    = (known after apply)
      + id                      = (known after apply)
      + last_operation          = (known after apply)
      + location                = "global"
      + locked                  = (known after apply)
      + name                    = "tfbug-bucket"
      + plan                    = "standard"
      + plan_history            = (known after apply)
      + resource_aliases_url    = (known after apply)
      + resource_bindings_url   = (known after apply)
      + resource_controller_url = (known after apply)
      + resource_crn            = (known after apply)
      + resource_group_crn      = (known after apply)
      + resource_group_id       = "b6503f25836d49029966ab5be7fe50b5"
      + resource_group_name     = (known after apply)
      + resource_id             = (known after apply)
      + resource_keys_url       = (known after apply)
      + resource_name           = (known after apply)
      + resource_plan_id        = (known after apply)
      + resource_status         = (known after apply)
      + restored_at             = (known after apply)
      + restored_by             = (known after apply)
      + scheduled_reclaim_at    = (known after apply)
      + scheduled_reclaim_by    = (known after apply)
      + service                 = "cloud-object-storage"
      + service_endpoints       = (known after apply)
      + state                   = (known after apply)
      + status                  = (known after apply)
      + sub_type                = (known after apply)
      + tags                    = (known after apply)
      + target_crn              = (known after apply)
      + type                    = (known after apply)
      + update_at               = (known after apply)
      + update_by               = (known after apply)
    }

Plan: 2 to add, 0 to change, 0 to destroy.
ibm_resource_instance.cos: Creating...
ibm_resource_instance.cos: Still creating... [10s elapsed]
ibm_resource_instance.cos: Creation complete after 16s [id=crn:v1:bluemix:public:cloud-object-storage:global:a/713c783d9a507a53135fe6793c37cc74:b0838da6-2497-4ab0-81d0-5d631d016f8c::]
ibm_cos_bucket.flowlog: Creating...
╷
│ Error: InvalidLocationConstraint: Container storage location with specified provisioning code not available
│ 	status code: 400, request id: d8d03e88-0080-4bd7-8bbf-684d857c8306, host id:
│
│   with ibm_cos_bucket.flowlog,
│   on main.tf line 22, in resource "ibm_cos_bucket" "flowlog":
│   22: resource "ibm_cos_bucket" "flowlog" {
│
╵

Change to smart:

bug-bucket $ cat main.tf
...
resource "ibm_cos_bucket" "flowlog" {
  bucket_name          = "${local.name}-000"
  resource_instance_id = ibm_resource_instance.cos.id
  region_location      = local.region
  # storage_class        = "flex"
  storage_class        = "smart"
  # storage_class        = "standard"
  force_delete         = true
}
bug-bucket $ tfa
ibm_resource_instance.cos: Refreshing state... [id=crn:v1:bluemix:public:cloud-object-storage:global:a/713c783d9a507a53135fe6793c37cc74:b0838da6-2497-4ab0-81d0-5d631d016f8c::]

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:

  # ibm_cos_bucket.flowlog will be created
  + resource "ibm_cos_bucket" "flowlog" {
      + bucket_name          = "tfbug-bucket-000"
      + crn                  = (known after apply)
      + endpoint_type        = "public"
      + force_delete         = true
      + id                   = (known after apply)
      + region_location      = "us-south"
      + resource_instance_id = "crn:v1:bluemix:public:cloud-object-storage:global:a/713c783d9a507a53135fe6793c37cc74:b0838da6-2497-4ab0-81d0-5d631d016f8c::"
      + s3_endpoint_private  = (known after apply)
      + s3_endpoint_public   = (known after apply)
      + storage_class        = "smart"
    }

Plan: 1 to add, 0 to change, 0 to destroy.
ibm_cos_bucket.flowlog: Creating...
ibm_cos_bucket.flowlog: Creation complete after 4s [id=crn:v1:bluemix:public:cloud-object-storage:global:a/713c783d9a507a53135fe6793c37cc74:b0838da6-2497-4ab0-81d0-5d631d016f8c:bucket:tfbug-bucket-000:meta:rl:us-south:public]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
@kavya498 kavya498 added the service/Object Storage Issues related to Cloud Object Storage label Nov 22, 2021
@kavya498 kavya498 mentioned this issue Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/Object Storage Issues related to Cloud Object Storage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants