The module consolidates the management of crypto keys in an existing or new customer-managed key ring in GCP KMS. Keys are supplied as input parameters of the module to keep their management in a single code block. Supported key purpose types: CRYPTO_KEY_PURPOSE_UNSPECIFIED, ENCRYPT_DECRYPT, ASYMMETRIC_SIGN, ASYMMETRIC_DECRYPT, RAW_ENCRYPT_DECRYPT, MAC, KEY_ENCAPSULATION, and AES_WRAPPING.
Once you have a Corewide Solutions Portal account, this one-time action will use your browser session to retrieve credentials:
shellterraform login solutions.corewide.com
Initialize mandatory providers:
Copy and paste into your Terraform configuration and insert the variables:
hclmodule "tf_gcp_kms_key_ring" {
source = "solutions.corewide.com/google-cloud/tf-gcp-kms-key-ring/google"
version = "~> 1.0.0"
# specify module inputs here or try one of the examples below
...
}
Initialize the setup:
shellterraform init
Corewide DevOps team strictly follows Semantic Versioning
Specification
to
provide our clients with products that have predictable upgrades between versions. We
recommend
pinning
patch versions of our modules using pessimistic
constraint operator (~>) to prevent breaking changes during upgrades.
To get new features during the upgrades (without breaking compatibility), use
~> 1.0 and run
terraform init -upgrade
For the safest setup, use strict pinning with version = "1.0.0"
|
Module
83% off
|
$51
|
| TOTAL | $51 |
The module consolidates the management of crypto keys in an existing or new customer-managed key ring in GCP KMS. Keys are supplied as input parameters of the module to keep their management in a single code block. Supported key purpose types: CRYPTO_KEY_PURPOSE_UNSPECIFIED, ENCRYPT_DECRYPT, ASYMMETRIC_SIGN, ASYMMETRIC_DECRYPT, RAW_ENCRYPT_DECRYPT, MAC, KEY_ENCAPSULATION, and AES_WRAPPING.
All notable changes to this project are documented here.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
First stable version
CRYPTO_KEY_PURPOSE_UNSPECIFIED, ENCRYPT_DECRYPT, ASYMMETRIC_SIGN, ASYMMETRIC_DECRYPT, RAW_ENCRYPT_DECRYPT, MAC, KEY_ENCAPSULATION, AES_WRAPPING crypto key typesCreate a KMS key ring with a key:
hclmodule "kms" {
source = "solutions.corewide.com/google-cloud/tf-gcp-kms-key-ring/google"
version = "~> 1.0"
key_ring_name = "foo"
keys = [
{ name = "bar" },
]
}
| Variable | Description | Type | Default | Required | Sensitive |
|---|---|---|---|---|---|
key_ring_name |
The name of the key ring | string |
yes | no | |
add_random_suffix |
Append a random suffix to the managed resource names to ensure uniqueness. Please note: modifying this variable will trigger the re-creation of the resources | bool |
false |
no | no |
create_key_ring |
Toggle key ring creation | bool |
true |
no | no |
keys |
List of keys parameters to create crypto keys | list(object) |
[] |
no | no |
keys[*].name |
Name of the crypto key | string |
yes | no | |
keys[*].purpose |
Determines the cryptographic operations for which the crypto key can be used. Possible values are: CRYPTO_KEY_PURPOSE_UNSPECIFIED, ENCRYPT_DECRYPT, ASYMMETRIC_SIGN, ASYMMETRIC_DECRYPT, RAW_ENCRYPT_DECRYPT, MAC, KEY_ENCAPSULATION, and AES_WRAPPING |
string |
ENCRYPT_DECRYPT |
no | no |
keys[*].rotation_period |
Rotation period in days. Possible values are from 0 to 36500, where 0 means manual rotation |
number |
0 |
no | no |
region |
GCP region to create resources in. Default GCP provider region used if not specified | string |
no | no |
| Output | Description | Type | Sensitive |
|---|---|---|---|
key_ring |
Key ring attributes | computed |
no |
keys |
Crypto keys resource attributes | resource |
no |
| Dependency | Version | Kind |
|---|---|---|
terraform |
>= 1.9 |
CLI |
hashicorp/google |
~> 8.4 |
provider |
hashicorp/random |
~> 3.6 |
provider |