terraform-provider-linode icon indicating copy to clipboard operation
terraform-provider-linode copied to clipboard

new: Provider-level Object Storage Keys

Open yec-akamai opened this issue 11 months ago • 0 comments

📝 Description

This change allows user to specify object storage keys at provider-level. The access and secret keys can be used in linode_object_storage_bucket and linode_object_storage_object resource. We aim to simplify the object key management and avoid issue like circular dependency. The keys then can be specified in the provider configuration, or can be exported as an environment variable.

Addressed issue #1172.

✔️ How to Test

make int-test PKG_NAME="linode/obj" make int-test PKG_NAME="linode/objbucket"

Manual Test:

  1. In a sandbox environment, i.e. dx-devenv, use the following configuration to create an object bucket with lifecycle policy:
provider "linode" {
    obj_access_key = ${your-access-key}
    obj_secret_key = ${your-secret-key}
}

resource "linode_object_storage_bucket" "test" {
    cluster = "us-mia-1"
    label = "test-obj-bucket"

    lifecycle_rule {
        prefix = "tf"
        enabled = true

        abort_incomplete_multipart_upload_days = 5

        expiration {
            date = "2024-03-21"
        }
    }
}
  1. Observe that object bucket is created successfully without any error raised.
  2. Destroy the resource to clean up.
  3. Test that object credentials by exporting from environment export LINODE_OBJ_ACCESS_KEY=$YOUR_ACCESS_KEY export LINODE_OBJ_SECRET_KEY=$YOUR_SECRET_KEY
  4. Put the configuration without provider metadata
resource "linode_object_storage_bucket" "test" {
    cluster = "us-mia-1"
    label = "test-obj-bucket"

    lifecycle_rule {
        prefix = "tf"
        enabled = true

        abort_incomplete_multipart_upload_days = 5

        expiration {
            date = "2024-03-21"
        }
    }
}
  1. Observe that object bucket is created successfully without any error raised.
  2. Destroy the resource to clean up.

yec-akamai avatar Mar 04 '24 22:03 yec-akamai