1

I am using IBM Cloud Object Storage (COS) to store files on IBM Cloud. I have used Terraform to provision the service and to create the storage bucket. How can I create credentials including the HMAC portion using Terraform?

This is how to create the resource key (credentials):

# service access key for COS
resource "ibm_resource_key" "MyCos" {
  name                 = "my-accKey-cos"
  role                 = "Writer"
  resource_instance_id = ibm_resource_instance.cos.id
}
data_henrik
  • 16,724
  • 2
  • 28
  • 49

1 Answers1

1

The key to creating HMAC credentials is to have the right parameters for ibm_resource_key.

# service access key for COS
resource "ibm_resource_key" "MyCos" {
  name                 = "my-accKey-cos"
  role                 = "Writer"
  resource_instance_id = ibm_resource_instance.cos.id
  parameters           = { HMAC = true }
}

With the added parameter for HMAC it works.

In that sense it is similar to using the CLI.

data_henrik
  • 16,724
  • 2
  • 28
  • 49