You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: added support to configure Secrets Manager with the Event Notifications service using new input variables: enable_event_notification, existing_en_instance_crn, endpoint_type, skip_en_iam_authorization_policy.<br><br>**NOTE:** skip_iam_authorization_policy has been renamed to skip_kms_iam_authorization_policy to keep naming consistent now that module supports creating multiple auth policies. (#26)
| <aname="input_cbr_rules"></a> [cbr\_rules](#input\_cbr\_rules)| (Optional, list) List of CBR rules to create | <pre>list(object({<br> description = string<br> account_id = string<br> rule_contexts = list(object({<br> attributes = optional(list(object({<br> name = string<br> value = string<br> }))) }))<br> enforcement_mode = string<br> }))</pre> |`[]`| no |
88
-
| <aname="input_existing_kms_instance_guid"></a> [existing\_kms\_instance\_guid](#input\_existing\_kms\_instance\_guid)| The GUID of the Hyper Protect Crypto Services or Key Protect instance in which the key specified in `kms_key_crn` is coming from. Required only if `kms_encryption_enabled` is set to true, and `skip_iam_authorization_policy` is set to false. |`string`|`null`| no |
90
+
| <aname="input_enable_event_notification"></a> [enable\_event\_notification](#input\_enable\_event\_notification)| Set this to true to enable lifecycle notifications for your Secrets Manager instance by connecting an Event Notifications service. When setting this to true, a value must be passed for `existing_en_instance_crn` variable. |`bool`|`false`| no |
91
+
| <aname="input_endpoint_type"></a> [endpoint\_type](#input\_endpoint\_type)| The endpoint type of the Secrets Manager instance required for establishing a connection between an Event Notifications service. Possible values are `public`, `private`. |`string`|`"public"`| no |
92
+
| <aname="input_existing_en_instance_crn"></a> [existing\_en\_instance\_crn](#input\_existing\_en\_instance\_crn)| The CRN of the Event Notifications service to enable lifecycle notifications for your Secrets Manager instance. |`string`|`null`| no |
93
+
| <aname="input_existing_kms_instance_guid"></a> [existing\_kms\_instance\_guid](#input\_existing\_kms\_instance\_guid)| The GUID of the Hyper Protect Crypto Services or Key Protect instance in which the key specified in `kms_key_crn` is coming from. Required only if `kms_encryption_enabled` is set to true, and `skip_kms_iam_authorization_policy` is set to false. |`string`|`null`| no |
89
94
| <aname="input_kms_encryption_enabled"></a> [kms\_encryption\_enabled](#input\_kms\_encryption\_enabled)| Set this to true to control the encryption keys used to encrypt the data that you store in Secrets Manager. If set to false, the data that you store is encrypted at rest by using envelope encryption. For more details, see https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-mng-data&interface=ui#about-encryption.|`bool`|`false`| no |
90
95
| <aname="input_kms_key_crn"></a> [kms\_key\_crn](#input\_kms\_key\_crn)| The root key CRN of a Key Management Service like Key Protect or Hyper Protect Crypto Services (HPCS) that you want to use for encryption. Only used if `kms_encryption_enabled` is set to true. |`string`|`null`| no |
91
96
| <aname="input_region"></a> [region](#input\_region)| The region to provision the Secrets Manager instance to. |`string`| n/a | yes |
92
97
| <aname="input_resource_group_id"></a> [resource\_group\_id](#input\_resource\_group\_id)| The ID of the resource group to provision the Secrets Manager instance to. |`string`| n/a | yes |
93
98
| <aname="input_secrets_manager_name"></a> [secrets\_manager\_name](#input\_secrets\_manager\_name)| The name to give the Secrets Manager instance. |`string`| n/a | yes |
94
99
| <aname="input_service_endpoints"></a> [service\_endpoints](#input\_service\_endpoints)| The types of service endpoints to set on the Secrets Manager instance. Possible values are `public`, `private` or `public-and-private`. |`string`|`"public-and-private"`| no |
95
-
| <aname="input_skip_iam_authorization_policy"></a> [skip\_iam\_authorization\_policy](#input\_skip\_iam\_authorization\_policy)| Set to true to skip the creation of an IAM authorization policy that permits all Secrets Manager instances in the resource group to read the encryption key from the KMS instance. If set to false, pass in a value for the KMS instance in the `existing_kms_instance_guid` variable. In addition, no policy is created if `kms_encryption_enabled` is set to false. |`bool`|`false`| no |
100
+
| <aname="input_skip_en_iam_authorization_policy"></a> [skip\_en\_iam\_authorization\_policy](#input\_skip\_en\_iam\_authorization\_policy)| Set to true to skip the creation of an IAM authorization policy that permits all Secrets Manager instances (scoped to the resource group) an 'Event Source Manager' role to the given Event Notifications instance passed in the `existing_en_instance_crn` input variable. In addition, no policy is created if `enable_event_notification` is set to false. |`bool`|`false`| no |
101
+
| <aname="input_skip_kms_iam_authorization_policy"></a> [skip\_kms\_iam\_authorization\_policy](#input\_skip\_kms\_iam\_authorization\_policy)| Set to true to skip the creation of an IAM authorization policy that permits all Secrets Manager instances in the resource group to read the encryption key from the KMS instance. If set to false, pass in a value for the KMS instance in the `existing_kms_instance_guid` variable. In addition, no policy is created if `kms_encryption_enabled` is set to false. |`bool`|`false`| no |
96
102
| <aname="input_sm_service_plan"></a> [sm\_service\_plan](#input\_sm\_service\_plan)| The Secrets Manager plan to provision. |`string`|`"standard"`| no |
97
103
| <aname="input_sm_tags"></a> [sm\_tags](#input\_sm\_tags)| The list of resource tags that you want to associate with your Secrets Manager instance. |`list(string)`|`[]`| no |
Copy file name to clipboardExpand all lines: main.tf
+35-6Lines changed: 35 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -12,13 +12,16 @@ locals {
12
12
# tflint-ignore: terraform_unused_declarations
13
13
validate_kms_vars=var.kms_encryption_enabled&& var.kms_key_crn==null?tobool("When setting var.kms_encryption_enabled to true, a value must be passed for var.kms_key_crn") :true
14
14
# tflint-ignore: terraform_unused_declarations
15
-
validate_auth_policy=var.kms_encryption_enabled&& var.skip_iam_authorization_policy==false&& var.existing_kms_instance_guid==null?tobool("When var.skip_iam_authorization_policy is set to false, and var.kms_encryption_enabled to true, a value must be passed for var.existing_kms_instance_guid in order to create the auth policy.") :true
16
-
15
+
validate_auth_policy=var.kms_encryption_enabled&& var.skip_kms_iam_authorization_policy==false&& var.existing_kms_instance_guid==null?tobool("When var.skip_kms_iam_authorization_policy is set to false, and var.kms_encryption_enabled to true, a value must be passed for var.existing_kms_instance_guid in order to create the auth policy.") :true
16
+
# tflint-ignore: terraform_unused_declarations
17
+
validate_event_notification=var.enable_event_notification&& var.existing_en_instance_crn==null?tobool("When setting var.enable_event_notification to true, a value must be passed for var.existing_en_instance_crn") :true
18
+
# tflint-ignore: terraform_unused_declarations
19
+
validate_endpoint=var.enable_event_notification&& (var.endpoint_type=="public"&& var.service_endpoints=="private") || (var.endpoint_type=="private"&& var.service_endpoints=="public") ?tobool("It is not allowed to have conflicting var.endpoint_type and var.service_endpoints values.") :true
description="Allow all Secrets Manager instances in the resource group ${var.resource_group_id} 'Event Source Manager' role access on the Event Notification instance GUID ${regex(".*:(.*)::", var.existing_en_instance_crn)[0]}"
description="Set to true to skip the creation of an IAM authorization policy that permits all Secrets Manager instances in the resource group to read the encryption key from the KMS instance. If set to false, pass in a value for the KMS instance in the `existing_kms_instance_guid` variable. In addition, no policy is created if `kms_encryption_enabled` is set to false."
55
55
default=false
56
56
}
57
57
58
58
variable"existing_kms_instance_guid" {
59
59
type=string
60
-
description="The GUID of the Hyper Protect Crypto Services or Key Protect instance in which the key specified in `kms_key_crn` is coming from. Required only if `kms_encryption_enabled` is set to true, and `skip_iam_authorization_policy` is set to false."
60
+
description="The GUID of the Hyper Protect Crypto Services or Key Protect instance in which the key specified in `kms_key_crn` is coming from. Required only if `kms_encryption_enabled` is set to true, and `skip_kms_iam_authorization_policy` is set to false."
description="Set to true to skip the creation of an IAM authorization policy that permits all Secrets Manager instances (scoped to the resource group) an 'Event Source Manager' role to the given Event Notifications instance passed in the `existing_en_instance_crn` input variable. In addition, no policy is created if `enable_event_notification` is set to false."
97
+
default=false
98
+
}
99
+
100
+
variable"enable_event_notification" {
101
+
type=bool
102
+
default=false
103
+
description="Set this to true to enable lifecycle notifications for your Secrets Manager instance by connecting an Event Notifications service. When setting this to true, a value must be passed for `existing_en_instance_crn` variable."
104
+
}
105
+
106
+
variable"existing_en_instance_crn" {
107
+
type=string
108
+
default=null
109
+
description="The CRN of the Event Notifications service to enable lifecycle notifications for your Secrets Manager instance."
110
+
}
111
+
112
+
variable"endpoint_type" {
113
+
type=string
114
+
description="The endpoint type of the Secrets Manager instance required for establishing a connection between an Event Notifications service. Possible values are `public`, `private`."
0 commit comments