Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
6 changes: 3 additions & 3 deletions solutions/fully-configurable/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "ibm_iam_authorization_policy" "kms_policy" {
provider = ibm.kms
source_service_account = data.ibm_iam_account_settings.iam_account_settings[0].account_id
source_service_name = "secrets-manager"
source_resource_group_id = module.resource_group[0].resource_group_id
source_resource_group_id = module.resource_group.resource_group_id
roles = ["Reader"]
description = "Allow all Secrets Manager instances in the resource group ${local.kms_account_id} to read the ${local.kms_service_name} key ${local.kms_key_id} from the instance GUID ${local.kms_instance_guid}"
resource_attributes {
Expand Down Expand Up @@ -109,11 +109,11 @@ resource "ibm_iam_authorization_policy" "secrets_manager_hpcs_policy" {
provider = ibm.kms
source_service_account = data.ibm_iam_account_settings.iam_account_settings[0].account_id
source_service_name = "secrets-manager"
source_resource_group_id = module.resource_group[0].resource_group_id
source_resource_group_id = module.resource_group.resource_group_id
target_service_name = local.kms_service_name
target_resource_instance_id = local.kms_instance_guid
roles = ["Viewer"]
description = "Allow all Secrets Manager instances in the resource group ${module.resource_group[0].resource_group_id} in the account ${local.kms_account_id} to view from the ${local.kms_service_name} instance GUID ${local.kms_instance_guid}"
description = "Allow all Secrets Manager instances in the resource group ${module.resource_group.resource_group_id} in the account ${local.kms_account_id} to view from the ${local.kms_service_name} instance GUID ${local.kms_instance_guid}"
}

# workaround for https://github.com/IBM-Cloud/terraform-provider-ibm/issues/4478
Expand Down
8 changes: 6 additions & 2 deletions solutions/fully-configurable/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ variable "skip_secrets_manager_iam_auth_policy" {
}

variable "secrets_manager_resource_tags" {
type = list(any)
type = list(string)
description = "The list of resource tags you want to associate with your Secrets Manager instance. Applies only if `existing_secrets_manager_crn` is not provided."
default = []
}
Expand Down Expand Up @@ -119,7 +119,7 @@ variable "secret_groups" {
access_group_roles = optional(list(string), ["SecretsReader"])
access_group_tags = optional(list(string))
}))
description = "Secret Manager secret group and access group configurations. If a prefix input variable is specified, it is added to the `access_group_name` value in the `<prefix>-value` format. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-secrets-manager/tree/main/solutions/fully-configurable/provisioning_secrets_groups.md)."
description = "Secret Manager secret group and access group configurations. If a prefix input variable is specified, it is added to the `access_group_name` value in the `<prefix>-value` format. If you do not wish to create any groups, et the value to `[]`. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-secrets-manager/tree/main/solutions/fully-configurable/provisioning_secrets_groups.md)."
Copy link
Member

Choose a reason for hiding this comment

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

set the value...

nullable = false
default = [
{
Expand All @@ -130,6 +130,10 @@ variable "secret_groups" {
access_group_roles = ["SecretsReader"]
}
]
validation {
error_message = "The value of secret_groups cannot be an empty string. If you do not want to create any groups, set the value to []."
condition = var.secret_groups == ""
}
validation {
error_message = "The name of the secret group cannot be null or empty string."
condition = length([
Expand Down
4 changes: 2 additions & 2 deletions solutions/security-enforced/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ No resources.
| <a name="input_kms_key_ring_name"></a> [kms\_key\_ring\_name](#input\_kms\_key\_ring\_name) | The name for the new key ring to store the key. Applies only if `existing_secrets_manager_kms_key_crn` is not specified. If a prefix input variable is passed, it is added to the value in the `<prefix>-value` format. . | `string` | `"secrets-manager-key-ring"` | no |
| <a name="input_prefix"></a> [prefix](#input\_prefix) | The prefix to be added to all resources created by this solution. To skip using a prefix, set this value to null or an empty string. The prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It should not exceed 16 characters, must not end with a hyphen('-'), and can not contain consecutive hyphens ('--'). Example: sm-0205. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md). | `string` | n/a | yes |
| <a name="input_region"></a> [region](#input\_region) | The region to provision resources to. | `string` | `"us-south"` | no |
| <a name="input_secret_groups"></a> [secret\_groups](#input\_secret\_groups) | Secret Manager secret group and access group configurations. If a prefix input variable is specified, it is added to the `access_group_name` value in the `<prefix>-value` format. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-secrets-manager/tree/main/solutions/fully-configurable/provisioning_secrets_groups.md). | <pre>list(object({<br/> secret_group_name = string<br/> secret_group_description = optional(string)<br/> create_access_group = optional(bool, true)<br/> access_group_name = optional(string)<br/> access_group_roles = optional(list(string), ["SecretsReader"])<br/> access_group_tags = optional(list(string))<br/> }))</pre> | <pre>[<br/> {<br/> "access_group_name": "general-secrets-group-access-group",<br/> "access_group_roles": [<br/> "SecretsReader"<br/> ],<br/> "create_access_group": true,<br/> "secret_group_description": "A general purpose secrets group with an associated access group which has a secrets reader role",<br/> "secret_group_name": "General"<br/> }<br/>]</pre> | no |
| <a name="input_secret_groups"></a> [secret\_groups](#input\_secret\_groups) | Secret Manager secret group and access group configurations. If a prefix input variable is specified, it is added to the `access_group_name` value in the `<prefix>-value` format. If you do not wish to create any groups, et the value to `[]`. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-secrets-manager/tree/main/solutions/fully-configurable/provisioning_secrets_groups.md). | <pre>list(object({<br/> secret_group_name = string<br/> secret_group_description = optional(string)<br/> create_access_group = optional(bool, true)<br/> access_group_name = optional(string)<br/> access_group_roles = optional(list(string), ["SecretsReader"])<br/> access_group_tags = optional(list(string))<br/> }))</pre> | <pre>[<br/> {<br/> "access_group_name": "general-secrets-group-access-group",<br/> "access_group_roles": [<br/> "SecretsReader"<br/> ],<br/> "create_access_group": true,<br/> "secret_group_description": "A general purpose secrets group with an associated access group which has a secrets reader role",<br/> "secret_group_name": "General"<br/> }<br/>]</pre> | no |
| <a name="input_secrets_manager_cbr_rules"></a> [secrets\_manager\_cbr\_rules](#input\_secrets\_manager\_cbr\_rules) | (Optional, list) List of CBR rules to create. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-secrets-manager/blob/main/solutions/fully-configurable/DA-cbr_rules.md) | <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/> operations = optional(list(object({<br/> api_types = list(object({<br/> api_type_id = string<br/> }))<br/> })))<br/> }))</pre> | `[]` | no |
| <a name="input_secrets_manager_instance_name"></a> [secrets\_manager\_instance\_name](#input\_secrets\_manager\_instance\_name) | The name to give the Secrets Manager instance provisioned by this solution. If a prefix input variable is specified, it is added to the value in the `<prefix>-value` format. Applies only if `existing_secrets_manager_crn` is not provided. | `string` | `"secrets-manager"` | no |
| <a name="input_secrets_manager_resource_tags"></a> [secrets\_manager\_resource\_tags](#input\_secrets\_manager\_resource\_tags) | The list of resource tags you want to associate with your Secrets Manager instance. Applies only if `existing_secrets_manager_crn` is not provided. | `list(any)` | `[]` | no |
| <a name="input_secrets_manager_resource_tags"></a> [secrets\_manager\_resource\_tags](#input\_secrets\_manager\_resource\_tags) | The list of resource tags you want to associate with your Secrets Manager instance. Applies only if `existing_secrets_manager_crn` is not provided. | `list(string)` | `[]` | no |
| <a name="input_service_plan"></a> [service\_plan](#input\_service\_plan) | The pricing plan to use when provisioning a Secrets Manager instance. Possible values: `standard`, `trial`. You can create only one Trial instance of Secrets Manager per account. Before you can create a new Trial instance, you must delete the existing Trial instance and its reclamation. [Learn more](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-create-instance&interface=ui#upgrade-instance-standard). | `string` | n/a | yes |
| <a name="input_skip_secrets_manager_event_notifications_iam_auth_policy"></a> [skip\_secrets\_manager\_event\_notifications\_iam\_auth\_policy](#input\_skip\_secrets\_manager\_event\_notifications\_iam\_auth\_policy) | If set to true, this skips the creation of a service to service authorization from Secrets Manager to Event Notifications. If false, the service to service authorization is created. | `bool` | `false` | no |
| <a name="input_skip_secrets_manager_iam_auth_policy"></a> [skip\_secrets\_manager\_iam\_auth\_policy](#input\_skip\_secrets\_manager\_iam\_auth\_policy) | Whether to skip the creation of the IAM authorization policies required to enable the IAM credentials engine (if you are using an existing Secrets Manager isntance, attempting to re-create can cause conflicts if the policies already exist). If set to false, policies will be created that grants the Secrets Manager instance 'Operator' access to the IAM identity service, and 'Groups Service Member Manage' access to the IAM groups service. | `bool` | `false` | no |
Expand Down
8 changes: 6 additions & 2 deletions solutions/security-enforced/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ variable "skip_secrets_manager_iam_auth_policy" {
}

variable "secrets_manager_resource_tags" {
type = list(any)
type = list(string)
description = "The list of resource tags you want to associate with your Secrets Manager instance. Applies only if `existing_secrets_manager_crn` is not provided."
default = []
}
Expand All @@ -88,7 +88,7 @@ variable "secret_groups" {
access_group_roles = optional(list(string), ["SecretsReader"])
access_group_tags = optional(list(string))
}))
description = "Secret Manager secret group and access group configurations. If a prefix input variable is specified, it is added to the `access_group_name` value in the `<prefix>-value` format. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-secrets-manager/tree/main/solutions/fully-configurable/provisioning_secrets_groups.md)."
description = "Secret Manager secret group and access group configurations. If a prefix input variable is specified, it is added to the `access_group_name` value in the `<prefix>-value` format. If you do not wish to create any groups, et the value to `[]`. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-secrets-manager/tree/main/solutions/fully-configurable/provisioning_secrets_groups.md)."
Copy link
Member

Choose a reason for hiding this comment

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

set the value...

nullable = false
default = [
{
Expand All @@ -99,6 +99,10 @@ variable "secret_groups" {
access_group_roles = ["SecretsReader"]
}
]
validation {
error_message = "The value of secret_groups cannot be an empty string. If you do not want to create any groups, set the value to []."
condition = var.secret_groups == ""
}
validation {
error_message = "The name of the secret group cannot be null or empty string."
condition = length([
Expand Down