terraform-provider-openstack / terraform-provider-openstack

Terraform OpenStack provider
https://registry.terraform.io/providers/terraform-provider-openstack/openstack/latest/docs
Mozilla Public License 2.0
387 stars 362 forks source link

[swift v1]: move container temp-url-key's into a separate resource arguments #1536

Open kayrus opened 1 year ago

kayrus commented 1 year ago

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 "openstack_objectstorage_container_v1" "container_1" {
  name = "my-container"
  metadata = {
    Temp-URL-Key   = "testkey"
    Temp-URL-Key-2 = "testkey"
  }
}

Expected Behavior

terraform state show openstack_objectstorage_container_v1.container_1 should mask tempurl keys:

Actual Behavior

terraform state show openstack_objectstorage_container_v1.container_1 prints sensitive tempurl keys right away:

# openstack_objectstorage_container_v1.container_1:
resource "openstack_objectstorage_container_v1" "container_1" {
    force_destroy  = false
    id             = "my-container"
    metadata       = {
        "Temp-URL-Key"   = "very-secret"
        "Temp-URL-Key-2" = "very-very-secret"
    }
    name           = "my-container"
    region         = "region1"
    storage_policy = "default"
    versioning     = false
}

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

This would be a breaking change.

Current docs don't have an example on how to set temp-url keys to a container.

We also need to update gophercloud to unset the container metadata, since it doesn't work right now.

References

https://github.com/gophercloud/gophercloud/pull/1865 https://github.com/gophercloud/gophercloud/pull/2218

kayrus commented 2 months ago

We don't have a capacity to implement this. Besides implementing this will definitely break backwards capability with existing openstack_objectstorage_container_v1 behavior. Let's postpone this for the next major releaser.