generated from terraform-ibm-modules/terraform-ibm-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add new example to use existing kms (#389)
* fix: add new example to use existing kms" * fix: pre-commit failure --------- Co-authored-by: shikha-mah <shikha.mah@in.ibm.com>
- Loading branch information
1 parent
0ce8804
commit e28c1cd
Showing
7 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# An example that uses existing KMS | ||
|
||
An example that uses the existing KMS and create a Key Ring within the provided KMS Instance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
|
||
############################################################################## | ||
# Key Ring module | ||
############################################################################## | ||
|
||
module "kms_key_ring" { | ||
source = "../.." | ||
instance_id = var.existing_kms_instance_guid | ||
key_ring_id = "${var.prefix}-key-ring" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
############################################################################## | ||
# Outputs | ||
############################################################################## | ||
|
||
output "kms_key_ring_id" { | ||
description = "KMS Key Ring ID" | ||
value = module.kms_key_ring.key_ring_id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
provider "ibm" { | ||
ibmcloud_api_key = var.ibmcloud_api_key | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
variable "ibmcloud_api_key" { | ||
type = string | ||
description = "The IBM Cloud API Key" | ||
sensitive = true | ||
} | ||
|
||
variable "prefix" { | ||
type = string | ||
description = "Prefix to append to all resources created by this example" | ||
default = "kms-kr" | ||
} | ||
|
||
variable "existing_kms_instance_guid" { | ||
type = string | ||
description = "GUID of an existing KMS instance." | ||
default = null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
terraform { | ||
required_version = ">= 1.3.0" | ||
required_providers { | ||
# Pin to the lowest provider version of the range defined in the main module's version.tf to ensure lowest version still works | ||
ibm = { | ||
source = "IBM-Cloud/ibm" | ||
version = "1.49.0" | ||
} | ||
} | ||
} |