This module implements an instance of the IBM Cloud Databases for etcd service.
❗ The module does not support major version upgrades or updates to encryption and backup encryption keys. To upgrade the version, create another instance of Databases for etcd with the updated version.
IBM Cloud Databases supports only Key Protect encryption for backups, not Hyper Protect Crypto Services. If you enable key management encryption and no value is passed for 'backup_encryption_key_crn', the value of 'kms_key_crn' is used. And if a HPCS value is set for kms_key_crn
, the database backup encryption uses the default encryption keys. For more information, see Hyper Protect Crypto Services Integration in the IBM Cloud Docs.
provider "ibm" {
ibmcloud_api_key = "XXXXXXXXXX" # pragma: allowlist secret
region = "us-south"
}
module "ectd_db" {
source = "terraform-ibm-modules/icd-etcd/ibm"
version = "X.X.X" # Replace "X.X.X" with a release version to lock into a specific release
resource_group_id = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX"
name = "my-etcd-instance"
region = "us-south"
}
You need the following permissions to run this module.
- Account Management
- Databases for etcd service
Editor
role access
- Databases for etcd service
Name | Version |
---|---|
terraform | >= 1.3.0, <1.7.0 |
ibm | >= 1.62.0, <2.0.0 |
time | >= 0.9.1 |
Name | Source | Version |
---|---|---|
cbr_rule | terraform-ibm-modules/cbr/ibm//modules/cbr-rule-module | 1.22.0 |
Name | Type |
---|---|
ibm_database.etcd_db | resource |
ibm_iam_authorization_policy.policy | resource |
ibm_resource_key.service_credentials | resource |
ibm_resource_tag.etcd_tag | resource |
time_sleep.wait_for_authorization_policy | resource |
ibm_database_connection.database_connection | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
access_tags | A list of access tags to apply to the etcd db instance created by the module, see https://cloud.ibm.com/docs/account?topic=account-access-tags-tutorial for more details | list(string) |
[] |
no |
admin_pass | The password for the database administrator. If the admin password is null then the admin user ID cannot be accessed. More users can be specified in a user block. | string |
null |
no |
auto_scaling | Optional rules to allow the database to increase resources in response to usage. Only a single autoscaling block is allowed. Make sure you understand the effects of autoscaling, especially for production environments. See https://cloud.ibm.com/docs/databases-for-etcd?topic=databases-for-etcd-autoscaling in the IBM Cloud Docs. | object({ |
null |
no |
backup_crn | The CRN of a backup resource to restore from. The backup is created by a database deployment with the same service ID. The backup is loaded after provisioning and the new deployment starts up that uses that data. A backup CRN is in the format crn:v1:<…>:backup:. If omitted, the database is provisioned empty. | string |
null |
no |
backup_encryption_key_crn | The CRN of a Key Protect key, that you want to use for encrypting disk that holds deployment backups. Only used if var.kms_encryption_enabled is set to true. If no value is passed here, the value passed for the 'kms_key_crn' variable is used, unless 'use_default_backup_encryption_key' is set to 'true'. BYOK for backups is available only in US regions us-south and us-east, and eu-de. Only keys in the us-south and eu-de are durable to region failures. To ensure that your backups are available even if a region failure occurs, you must use a key from us-south or eu-de. Take note that Hyper Protect Crypto Services for IBM Cloud® Databases backups is not currently supported, so if no value is passed here, but a HPCS value is passed for var.kms_key_crn, databases backup encryption will use the default encryption keys. | string |
null |
no |
cbr_rules | (Optional, list) List of CBR rules to create | list(object({ |
[] |
no |
etcd_version | Version of the etcd instance to provision. If no value passed, the current ICD preferred version is used. | string |
null |
no |
existing_kms_instance_guid | The GUID of the Hyper Protect or Key Protect instance in which the key specified in var.kms_key_crn and var.backup_encryption_key_crn is coming from. Only required if var.kms_encryption_enabled is 'true', var.skip_iam_authorization_policy is 'false', and passing a value for var.kms_key_crn and/or var.backup_encryption_key_crn. | string |
null |
no |
kms_encryption_enabled | Set this to true to control the encryption keys used to encrypt the data that you store in IBM Cloud® Databases. If set to false, the data is encrypted by using randomly generated keys. For more info on Key Protect integration, see https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-key-protect. For more info on HPCS integration, see https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-hpcs | bool |
false |
no |
kms_key_crn | The root key CRN of a Key Management Services like Key Protect or Hyper Protect Crypto Service (HPCS) that you want to use for disk encryption. Only used if var.kms_encryption_enabled is set to true. | string |
null |
no |
member_cpu_count | Allocated dedicated CPU per-member. For shared CPU, set to 0. See the following doc for supported values: https://cloud.ibm.com/docs/databases-for-etcd?topic=databases-for-etcd-resources-scaling | number |
0 |
no |
member_disk_mb | Allocated memory per-member. See the following doc for supported values: https://cloud.ibm.com/docs/databases-for-etcd?topic=databases-for-etcd-resources-scaling | number |
20480 |
no |
member_memory_mb | Allocated memory per-member. See the following doc for supported values: https://cloud.ibm.com/docs/databases-for-etcd?topic=databases-for-etcd-resources-scaling | number |
1024 |
no |
members | Allocated number of members. Members can be scaled up but not down. | number |
3 |
no |
name | The name to give the etcd instance. | string |
n/a | yes |
region | The region where you want to deploy your instance. | string |
"us-south" |
no |
resource_group_id | The resource group ID where the etcd instance will be created. | string |
n/a | yes |
service_credential_names | Map of name, role for service credentials that you want to create for the database | map(string) |
{} |
no |
service_endpoints | Specify whether you want to enable the public, private, or both service endpoints. Supported values are 'public', 'private', or 'public-and-private'. | string |
"private" |
no |
skip_iam_authorization_policy | Set to true to skip the creation of an IAM authorization policy that permits all etcd database instances in the given resource group to read the encryption key from the Hyper Protect or Key Protect instance passed in var.existing_kms_instance_guid. If set to 'false', a value must be passed for var.existing_kms_instance_guid. No policy is created if var.kms_encryption_enabled is set to 'false'. | bool |
false |
no |
tags | Optional list of tags to be added to the etcd instance. | list(any) |
[] |
no |
use_default_backup_encryption_key | Set to true to use default ICD randomly generated keys. | bool |
false |
no |
users | A list of users that you want to create on the database. Multiple blocks are allowed. The user password must be in the range of 10-32 characters. Be warned that in most case using IAM service credentials (via the var.service_credential_names) is sufficient to control access to the Etcd instance. This blocks creates native etcd database users, more info on that can be found here https://cloud.ibm.com/docs/databases-for-etcd?topic=databases-for-etcd-user-management | list(object({ |
[] |
no |
Name | Description |
---|---|
adminuser | Database admin user name |
cbr_rule_ids | CBR rule ids created to restrict etcd |
certificate_base64 | Database connection certificate |
crn | etcd instance crn |
guid | etcd instance guid |
hostname | Database connection hostname |
id | etcd instance id |
port | Database connection port |
service_credentials_json | Service credentials json map |
service_credentials_object | Service credentials object |
version | etcd instance version |
You can report issues and request features for this module in GitHub issues in the module repo. See Report an issue or request a feature.
To set up your local development environment, see Local development setup in the project documentation.