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: Add support to store ElasticSearch service credentials in Secrets Manager (#247)
* add service credential to secrets manager in DA
* tests: skipping tests other than TestRunStandardSolutionSchematics
* fix: update secret_manager_service_credential
* feat support to store service credentials in secrets manager
* update test
* test failure work around
* fix: pre-commit failure
* add condition to not create sm credentials
* added back connectionstrings lifecycle ignore
* fix test failure
* update description
* fix: resolve review comments
* fix: add validation
---------
Co-authored-by: Soaib024 <[email protected]>
Co-authored-by: Soaib024 <[email protected]>
## Service credentials <aname="svc-credential-name"></a>
10
11
@@ -130,3 +131,74 @@ The following example shows values for both disk and memory for the `auto_scalin
130
131
}
131
132
}
132
133
```
134
+
135
+
## Service credential secrets <aname="service-credential-secrets"></a>
136
+
137
+
When you add an IBM Databases for Elasticsearch service from the IBM Cloud catalog to an IBM Cloud Projects service, you can configure service credentials. In the edit mode for the projects configuration, select the Configure panel and then click the optional tab.
138
+
139
+
In the configuration, specify the secret group name, whether it already exists or will be created and include all the necessary service credential secrets that need to be created within that secret group.
140
+
141
+
To enter a custom value, use the edit action to open the "Edit Array" panel. Add the service credential secrets configurations to the array here.
142
+
143
+
[Learn more](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/sm_service_credentials_secret) about service credential secrets.
144
+
145
+
- Variable name: `service_credential_secrets`.
146
+
- Type: A list of objects that represent a service credential secret groups and secrets
147
+
- Default value: An empty list (`[]`)
148
+
149
+
### Options for service_credential_secrets
150
+
151
+
-`secret_group_name` (required): A unique human-readable name that identifies this service credential secret group.
152
+
-`secret_group_description` (optional, default = `null`): A human-readable description for this secret group.
153
+
-`existing_secret_group`: (optional, default = `false`): Set to true, if secret group name provided in the variable `secret_group_name` already exists.
154
+
-`service_credentials`: (optional, default = `[]`): A list of object that represents a service credential secret.
155
+
156
+
### Options for service_credentials
157
+
158
+
-`secret_name`: (required): A unique human-readable name of the secret to create.
159
+
-`service_credentials_source_service_role`: (required): The role to give the service credential in the Databases for Elasticsearch service. Acceptable values are `Writer`, `Reader`, `Manager`, and `None`
160
+
-`secret_labels`: (optional, default = `[]`): Labels of the secret to create. Up to 30 labels can be created. Labels can be 2 - 30 characters, including spaces. Special characters that are not permitted include the angled brackets (<>), comma (,), colon (:), ampersand (&), and vertical pipe character (|).
161
+
-`secret_auto_rotation`: (optional, default = `true`): Whether to configure automatic rotation of service credential.
162
+
-`secret_auto_rotation_unit`: (optional, default = `day`): Specifies the unit of time for rotation of a secret. Acceptable values are `day` or `month`.
163
+
-`secret_auto_rotation_interval`: (optional, default = `89`): Specifies the rotation interval for the rotation unit.
164
+
-`service_credentials_ttl`: (optional, default = `7776000`): The time-to-live (TTL) to assign to generated service credentials (in seconds).
165
+
-`service_credential_secret_description`: (optional, default = `null`): Description of the secret to create.
166
+
167
+
The following example includes all the configuration options for four service credentials and two secret groups.
description="Allow Secrets Manager with instance id ${local.existing_secrets_manager_instance_guid} to manage key for the databases-for-elasticsearch instance"
135
+
}
136
+
137
+
# workaround for https://github.com/IBM-Cloud/terraform-provider-ibm/issues/4478
validate_sm_crn=length(local.service_credential_secrets) >0&& var.existing_secrets_manager_instance_crn==null?tobool("`existing_secrets_manager_instance_crn` is required when adding service credentials to a secrets manager secret.") :false
description="The CRN of a Hyper Protect Crypto Services or Key Protect root key to use for disk encryption. If not specified, a root key is created in the KMS instance."
description="Service credential secrets configuration for Databases for Elasticsearch. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-elasticsearch/tree/main/solutions/instance/DA-types.md#service-credential-secrets)."
error_message="service_credentials_source_service_role role must be one of 'Writer', 'Reader', 'Manager', and 'None'."
289
+
290
+
}
291
+
}
292
+
293
+
variable"skip_es_sm_auth_policy" {
294
+
type=bool
295
+
default=false
296
+
description="Whether an IAM authorization policy is created for Secrets Manager instance to create a service credential secrets for Databases for Elasticsearch. Set to `true` to use an existing policy."
297
+
}
298
+
241
299
variable"elser_model_type" {
242
300
type=string
243
301
description="Trained ELSER model to be used for Elastic's Natural Language Processing. Possible values: `.elser_model_1`, `.elser_model_2` and `.elser_model_2_linux-x86_64`. [Learn more](https://www.elastic.co/guide/en/machine-learning/current/ml-nlp-elser.html)"
0 commit comments