Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion solutions/banking/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ module "secrets_manager_secret_ibm_iam" {
endpoint_type = var.secrets_manager_endpoint_type
}

# generate signing key if it is not provided.
module "gpg_signing_key" {
count = var.signing_key == null ? 1 : 0

source = "git::[email protected]:terraform-ibm-modules/terraform-ibm-devsecops-infrastructure.git//gpg-key?ref=v1.3.0"
gpg_name = var.gpg_name
gpg_email = var.gpg_email
}

# secrets manager secrets - IBM signing key
module "secrets_manager_secret_signing_key" {
providers = {
Expand All @@ -59,7 +68,7 @@ module "secrets_manager_secret_signing_key" {
secret_name = "signing-key"
secret_description = "IBM Signing GPG key"
secret_type = "arbitrary" #checkov:skip=CKV_SECRET_6
secret_payload_password = var.signing_key
secret_payload_password = var.signing_key == null ? module.gpg_signing_key[0].gpg_key : var.signing_key
endpoint_type = var.secrets_manager_endpoint_type
}

Expand Down
14 changes: 13 additions & 1 deletion solutions/banking/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,23 @@ variable "watson_machine_learning_instance_resource_name" {
}

variable "signing_key" {
description = "Signing GPG key."
description = "Signing GPG key. If it is not provided by the user, then automation will create one."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is optional, should this take a default?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can feasibly provide a "default" GPG key - either the user provides one, or the system generates one at apply time.

type = string
sensitive = true
}

variable "gpg_name" {
type = string
description = "The name to be associated with the GPG key."
default = "IBMer"
}

variable "gpg_email" {
type = string
description = "The email address associated with the GPG key."
default = "[email protected]"
}

variable "create_secrets" {
description = "Create Secrets in the existing Secrets Manager instance."
type = bool
Expand Down