File tree Expand file tree Collapse file tree 7 files changed +53
-0
lines changed
Expand file tree Collapse file tree 7 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ You need the following permissions to run this module.
4242## Examples
4343
4444- [ End to end example with default values] ( examples/default )
45+ - [ An example that uses existing KMS] ( examples/existing-kms )
4546<!-- END EXAMPLES HOOK -->
4647<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
4748## Requirements
Original file line number Diff line number Diff line change 1+ # An example that uses existing KMS
2+
3+ An example that uses the existing KMS and create a Key Ring within the provided KMS Instance.
Original file line number Diff line number Diff line change 1+
2+
3+ # #############################################################################
4+ # Key Ring module
5+ # #############################################################################
6+
7+ module "kms_key_ring" {
8+ source = " ../.."
9+ instance_id = var. existing_kms_instance_guid
10+ key_ring_id = " ${ var . prefix } -key-ring"
11+ }
Original file line number Diff line number Diff line change 1+ # #############################################################################
2+ # Outputs
3+ # #############################################################################
4+
5+ output "kms_key_ring_id" {
6+ description = " KMS Key Ring ID"
7+ value = module. kms_key_ring . key_ring_id
8+ }
Original file line number Diff line number Diff line change 1+ provider "ibm" {
2+ ibmcloud_api_key = var. ibmcloud_api_key
3+ }
Original file line number Diff line number Diff line change 1+ variable "ibmcloud_api_key" {
2+ type = string
3+ description = " The IBM Cloud API Key"
4+ sensitive = true
5+ }
6+
7+ variable "prefix" {
8+ type = string
9+ description = " Prefix to append to all resources created by this example"
10+ default = " kms-kr"
11+ }
12+
13+ variable "existing_kms_instance_guid" {
14+ type = string
15+ description = " GUID of an existing KMS instance."
16+ default = null
17+ }
Original file line number Diff line number Diff line change 1+ terraform {
2+ required_version = " >= 1.3.0"
3+ required_providers {
4+ # Pin to the lowest provider version of the range defined in the main module's version.tf to ensure lowest version still works
5+ ibm = {
6+ source = " IBM-Cloud/ibm"
7+ version = " 1.49.0"
8+ }
9+ }
10+ }
You can’t perform that action at this time.
0 commit comments