terraform-provider-linode
terraform-provider-linode copied to clipboard
new: Provider-level Object Storage Keys
📝 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:
- 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"
}
}
}
- Observe that object bucket is created successfully without any error raised.
- Destroy the resource to clean up.
- Test that object credentials by exporting from environment
export LINODE_OBJ_ACCESS_KEY=$YOUR_ACCESS_KEY
export LINODE_OBJ_SECRET_KEY=$YOUR_SECRET_KEY
- 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"
}
}
}
- Observe that object bucket is created successfully without any error raised.
- Destroy the resource to clean up.