-
Notifications
You must be signed in to change notification settings - Fork 3
feat: expose access group support in DA #314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
8b3eff2
c155497
c6446a8
f7a8799
0fd93ab
42e665f
3675d8d
641648d
edb8fc4
21beb0e
c303ae5
2a0596b
40c346d
ec18731
5042751
424c45e
3046c6c
fee85f7
f8df202
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ This solution supports the following: | |
| | <a name="module_kms_key_crn_parser"></a> [kms\_key\_crn\_parser](#module\_kms\_key\_crn\_parser) | terraform-ibm-modules/common-utilities/ibm//modules/crn-parser | 1.1.0 | | ||
| | <a name="module_resource_group"></a> [resource\_group](#module\_resource\_group) | terraform-ibm-modules/resource-group/ibm | 1.1.6 | | ||
| | <a name="module_secrets_manager"></a> [secrets\_manager](#module\_secrets\_manager) | ../.. | n/a | | ||
| | <a name="module_secrets_manager_group"></a> [secrets\_manager\_group](#module\_secrets\_manager\_group) | terraform-ibm-modules/secrets-manager-secret-group/ibm | 1.3.2 | | ||
|
|
||
| ### Resources | ||
|
|
||
|
|
@@ -48,6 +49,8 @@ This solution supports the following: | |
| | Name | Description | Type | Default | Required | | ||
| |------|-------------|------|---------|:--------:| | ||
| | <a name="input_allowed_network"></a> [allowed\_network](#input\_allowed\_network) | The types of service endpoints to set on the Secrets Manager instance. Possible values are `private-only` or `public-and-private`. | `string` | `"private-only"` | no | | ||
| | <a name="input_create_general_secret_group"></a> [create\_general\_secret\_group](#input\_create\_general\_secret\_group) | Whether to create a secret group named 'General' in your Secrets Manager instance. | `bool` | `true` | no | | ||
| | <a name="input_create_general_secret_group_access_group"></a> [create\_general\_secret\_group\_access\_group](#input\_create\_general\_secret\_group\_access\_group) | Whether to create an access group with 'SecretsReader' access to the 'General' secret group. | `bool` | `true` | no | | ||
| | <a name="input_event_notifications_email_list"></a> [event\_notifications\_email\_list](#input\_event\_notifications\_email\_list) | The list of email address to target out when Secrets Manager triggers an event | `list(string)` | `[]` | no | | ||
| | <a name="input_event_notifications_from_email"></a> [event\_notifications\_from\_email](#input\_event\_notifications\_from\_email) | The email address used to send any Secrets Manager event coming via Event Notifications | `string` | `"[email protected]"` | no | | ||
| | <a name="input_event_notifications_reply_to_email"></a> [event\_notifications\_reply\_to\_email](#input\_event\_notifications\_reply\_to\_email) | The email address specified in the 'reply\_to' section for any Secret Manager event coming via Event Notifications | `string` | `"[email protected]"` | no | | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -162,6 +162,7 @@ locals { | |
| secrets_manager_guid = var.existing_secrets_manager_crn != null ? (length(local.parsed_existing_secrets_manager_crn) > 0 ? local.parsed_existing_secrets_manager_crn[7] : null) : module.secrets_manager.secrets_manager_guid | ||
| secrets_manager_crn = var.existing_secrets_manager_crn != null ? var.existing_secrets_manager_crn : module.secrets_manager.secrets_manager_crn | ||
| secrets_manager_region = var.existing_secrets_manager_crn != null ? (length(local.parsed_existing_secrets_manager_crn) > 0 ? local.parsed_existing_secrets_manager_crn[5] : null) : module.secrets_manager.secrets_manager_region | ||
| secrets_manager_endpoint_type = var.existing_secrets_manager_crn != null ? (length(local.parsed_existing_secrets_manager_crn) > 0 ? local.parsed_existing_secrets_manager_crn[3] : null) : var.secrets_manager_endpoint_type | ||
| enable_event_notifications = var.existing_event_notifications_instance_crn != null ? true : false | ||
| } | ||
|
|
||
|
|
@@ -194,6 +195,22 @@ data "ibm_resource_instance" "existing_sm" { | |
| identifier = var.existing_secrets_manager_crn | ||
| } | ||
|
|
||
| module "secrets_manager_group" { | ||
| depends_on = [module.secrets_manager] | ||
|
||
| count = var.create_general_secret_group ? 1 : 0 | ||
| source = "terraform-ibm-modules/secrets-manager-secret-group/ibm" | ||
| version = "1.3.2" | ||
| region = local.secrets_manager_region | ||
| secrets_manager_guid = local.secrets_manager_guid | ||
| #tfsec:ignore:general-secrets-no-plaintext-exposure | ||
| secret_group_name = "General" #checkov:skip=CKV_SECRET_6: does not require high entropy string as is static value | ||
| secret_group_description = "Initially created secret group" #tfsec:ignore:general-secrets-no-plaintext-exposure | ||
| create_access_group = var.create_general_secret_group_access_group | ||
| access_group_name = "${var.prefix}-General-secrets-group-access-group" | ||
|
||
| access_group_roles = ["SecretsReader"] | ||
| endpoint_type = local.secrets_manager_endpoint_type | ||
| } | ||
|
|
||
| ####################################################################################################################### | ||
| # Secrets Manager Event Notifications Configuration | ||
| ####################################################################################################################### | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -105,6 +105,18 @@ variable "allowed_network" { | |
| } | ||
| } | ||
|
|
||
| variable "create_general_secret_group" { | ||
| type = bool | ||
| description = "Whether to create a secret group named 'General' in your Secrets Manager instance." | ||
| default = true | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this has to be set to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ocofaigh Is it possible to set one field inside the variable as not nullable?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no, but the whole variable should be set to |
||
|
|
||
| variable "create_general_secret_group_access_group" { | ||
| type = bool | ||
| description = "Whether to create an access group with 'SecretsReader' access to the 'General' secret group." | ||
| default = true | ||
| } | ||
|
|
||
| ######################################################################################################################## | ||
| # Key Protect | ||
| ######################################################################################################################## | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already a variable for this
var.secrets_manager_endpoint_type