blob: e86af5427e6f43974e4486f1aebd740aad1d41bb [file] [log] [blame]
---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in
# .github/CONTRIBUTING.md.
#
# ----------------------------------------------------------------------------
subcategory: "Cloud Key Management Service"
description: |-
A `KeyRing` is a toplevel logical grouping of `CryptoKeys`.
---
# google\_kms\_key\_ring
A `KeyRing` is a toplevel logical grouping of `CryptoKeys`.
~> **Note:** KeyRings cannot be deleted from Google Cloud Platform.
Destroying a Terraform-managed KeyRing will remove it from state but
*will not delete the resource from the project.*
To get more information about KeyRing, see:
* [API documentation](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings)
* How-to Guides
* [Creating a key ring](https://cloud.google.com/kms/docs/creating-keys#create_a_key_ring)
## Example Usage - Kms Key Ring Basic
```hcl
resource "google_kms_key_ring" "example-keyring" {
name = "keyring-example"
location = "global"
}
```
## Argument Reference
The following arguments are supported:
* `name` -
(Required)
The resource name for the KeyRing.
* `location` -
(Required)
The location for the KeyRing.
A full list of valid locations can be found by running `gcloud kms locations list`.
- - -
* `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}}/locations/{{location}}/keyRings/{{name}}`
## Timeouts
This resource provides the following
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
- `create` - Default is 20 minutes.
- `delete` - Default is 20 minutes.
## Import
KeyRing can be imported using any of these accepted formats:
* `projects/{{project}}/locations/{{location}}/keyRings/{{name}}`
* `{{project}}/{{location}}/{{name}}`
* `{{location}}/{{name}}`
In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import KeyRing using one of the formats above. For example:
```tf
import {
id = "projects/{{project}}/locations/{{location}}/keyRings/{{name}}"
to = google_kms_key_ring.default
}
```
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), KeyRing can be imported using one of the formats above. For example:
```
$ terraform import google_kms_key_ring.default projects/{{project}}/locations/{{location}}/keyRings/{{name}}
$ terraform import google_kms_key_ring.default {{project}}/{{location}}/{{name}}
$ terraform import google_kms_key_ring.default {{location}}/{{name}}
```
## User Project Overrides
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).