Skip to content

Commit 9db51ed

Browse files
authored
feat: Add support to DA to provision IAM engine (#89)
1 parent 1f9ff19 commit 9db51ed

File tree

7 files changed

+35
-2
lines changed

7 files changed

+35
-2
lines changed

ibm_catalog.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
"title": "Creates a Secrets Manager instance.",
3030
"description": "Creates an IBM Secrets Manager instance."
3131
},
32+
{
33+
"title": "Optionally configure an IBM Secrets Manager IAM credentials engine to an IBM Secrets Manager instance.",
34+
"description": "Optionally configure an IBM Secrets Manager IAM credentials engine to an IBM Secrets Manager instance."
35+
},
3236
{
3337
"title": "Sets up authorization policy.",
3438
"description": "Sets up IBM IAM authorization policy between IBM Secrets Manager instance and IBM Key Management Service (KMS) instance. It also supports Event Notification authorization policy."
@@ -60,6 +64,10 @@
6064
"title": "Creates a Secrets Manager instance.",
6165
"description": "Creates and configures an IBM Secrets Manager instance."
6266
},
67+
{
68+
"title": "Optionally configure an IBM Secrets Manager IAM credentials engine to an IBM Secrets Manager instance.",
69+
"description": "Optionally configure an IBM Secrets Manager IAM credentials engine to an IBM Secrets Manager instance."
70+
},
6371
{
6472
"title": "Sets up authorization policy.",
6573
"description": "Sets up IBM IAM authorization policy between IBM Secrets Manager instance and IBM Key Management Service (KMS) instance. It also supports Event Notification authorization policy."

reference-architecture/secrets_manager.svg

Lines changed: 1 addition & 1 deletion
Loading

solutions/standard/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
This solution supports the following:
44
- Creating a new resource group, or taking in an existing one.
55
- Provisioning and configuring of a Secrets Manager instance.
6+
- Optionally configure an IBM Secrets Manager IAM credentials engine to an IBM Secrets Manager instance.
67
- Configuring KMS encryption using a newly created key, or passing an existing key.
78

89
**NB:** This solution is not intended to be called by one or more other modules since it contains a provider configurations, meaning it is not compatible with the `for_each`, `count`, and `depends_on` arguments. For more information see [Providers Within Modules](https://developer.hashicorp.com/terraform/language/modules/develop/providers)

solutions/standard/main.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,14 @@ module "secrets_manager" {
6969
skip_en_iam_authorization_policy = var.skip_en_iam_authorization_policy
7070
endpoint_type = var.allowed_network == "private-only" ? "private" : "public"
7171
}
72+
73+
# Configure an IBM Secrets Manager IAM credentials engine for an existing IBM Secrets Manager instance.
74+
module "iam_secrets_engine" {
75+
count = var.iam_engine_enabled ? 1 : 0
76+
source = "terraform-ibm-modules/secrets-manager-iam-engine/ibm"
77+
version = "1.1.0"
78+
region = var.region
79+
iam_engine_name = var.iam_engine_name
80+
secrets_manager_guid = module.secrets_manager.secrets_manager_guid
81+
endpoint_type = var.allowed_network == "private-only" ? "private" : "public"
82+
}

solutions/standard/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,18 @@ variable "secret_manager_tags" {
6161
default = []
6262
}
6363

64+
variable "iam_engine_enabled" {
65+
type = bool
66+
description = "Set this to true to to configure an IBM Secrets Manager IAM credentials engine. If set to false, no iam engine will be configured for your secrets manager instance. For more details, see https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-configure-iam-engine."
67+
default = false
68+
}
69+
70+
variable "iam_engine_name" {
71+
type = string
72+
description = "The name of the IAM Engine used to configure an IBM Secrets Manager IAM credentials engine."
73+
default = "base-sm-iam-engine"
74+
}
75+
6476
########################################################################################################################
6577
# Key Protect
6678
########################################################################################################################

tests/pr_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ func TestRunDASolutionSchematics(t *testing.T) {
134134
{Name: "allowed_network", Value: "private-only", DataType: "string"},
135135
{Name: "existing_kms_guid", Value: permanentResources["hpcs_south"], DataType: "string"},
136136
{Name: "kms_region", Value: "us-south", DataType: "string"}, // KMS instance is in us-south
137+
{Name: "iam_engine_enabled", Value: true, DataType: "bool"},
137138
}
138139

139140
err := options.RunSchematicTest()

0 commit comments

Comments
 (0)