» google_storage_hmac_key

The hmacKeys resource represents an HMAC key within Cloud Storage. The resource consists of a secret and HMAC key metadata. HMAC keys can be used as credentials for service accounts.

To get more information about HmacKey, see:

» Example Usage - Storage Hmac Key

resource "google_service_account" "service_account" {
  account_id = "my-svc-acc"
}

resource "google_storage_hmac_key" "key" {
  service_account_email = google_service_account.service_account.email
}

» Argument Reference

The following arguments are supported:


  • state - (Optional) The state of the key. Can be set to one of ACTIVE, INACTIVE. Default value is ACTIVE. Possible values are ACTIVE and INACTIVE.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

» Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format projects/{{project}}/hmacKeys/{{access_id}}

  • secret - HMAC secret key material. Note: This property is sensitive and will not be displayed in the plan.

  • access_id - The access ID of the HMAC Key.

  • time_created - 'The creation time of the HMAC key in RFC 3339 format. '

  • updated - 'The last modification time of the HMAC key metadata in RFC 3339 format.'

» Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 4 minutes.
  • update - Default is 4 minutes.
  • delete - Default is 4 minutes.

» Import

HmacKey can be imported using any of these accepted formats:

$ terraform import google_storage_hmac_key.default projects/{{project}}/hmacKeys/{{access_id}}
$ terraform import google_storage_hmac_key.default {{project}}/{{access_id}}
$ terraform import google_storage_hmac_key.default {{access_id}}

» User Project Overrides

This resource supports User Project Overrides.