| 
 | 1 | +# Configuring complex inputs in Databases for Elasticsearch  | 
 | 2 | + | 
 | 3 | +Several optional input variables in the IBM Cloud [Databases for Elasticsearch deployable architecture](https://cloud.ibm.com/catalog#deployable_architecture) use complex object types. You specify these inputs when you configure you deployable architecture.  | 
 | 4 | + | 
 | 5 | +- [Service credentials](#svc-credential-name) (`service_credential_names`)  | 
 | 6 | +- [Users](#users) (`users`)  | 
 | 7 | +- [Autoscaling](#autoscaling) (`auto_scaling`)  | 
 | 8 | + | 
 | 9 | +## Service credentials <a name="svc-credential-name"></a>  | 
 | 10 | + | 
 | 11 | +You can specify a set of IAM credentials to connect to the database with the `service_credential_names` input variable. Include a credential name and IAM service role for each key-value pair. Each role provides a specific level of access to the database. For more information, see [Adding and viewing credentials](https://cloud.ibm.com/docs/account?topic=account-service_credentials&interface=ui).  | 
 | 12 | + | 
 | 13 | +- Variable name: `service_credential_names`.  | 
 | 14 | +- Type: A map. The key is the name of the service credential. The value is the role that is assigned to that credential.  | 
 | 15 | +- Default value: An empty map (`{}`).  | 
 | 16 | + | 
 | 17 | +### Options for service_credential_names  | 
 | 18 | + | 
 | 19 | +- Key (required): The name of the service credential.  | 
 | 20 | +- Value (required): The IAM service role that is assigned to the credential. For more information, see [IBM Cloud IAM roles](https://cloud.ibm.com/docs/account?topic=account-userroles).  | 
 | 21 | + | 
 | 22 | +### Example service credential  | 
 | 23 | + | 
 | 24 | +```hcl  | 
 | 25 | +  {  | 
 | 26 | +      "es_admin" : "Administrator",  | 
 | 27 | +      "es_reader" : "Operator",  | 
 | 28 | +      "es_viewer" : "Viewer",  | 
 | 29 | +      "es_editor" : "Editor"  | 
 | 30 | +  }  | 
 | 31 | +```  | 
 | 32 | + | 
 | 33 | + | 
 | 34 | +## Users <a name="users"></a>  | 
 | 35 | + | 
 | 36 | +If you can't use the IAM-enabled `service_credential_names` input variable for access, you can create users and roles directly in the database. For more information, see [Managing users and roles](https://cloud.ibm.com/docs/databases-for-elasticsearch?topic=databases-for-elasticsearch-user-management&interface=ui).  | 
 | 37 | + | 
 | 38 | +:exclamation: **Important:** The `users` input contains sensitive information (the user's password).  | 
 | 39 | + | 
 | 40 | +- Variable name: `users`.  | 
 | 41 | +- Type: A list of objects that represent a user  | 
 | 42 | +- Default value: An empty list (`[]`)  | 
 | 43 | + | 
 | 44 | +### Options for users  | 
 | 45 | + | 
 | 46 | + - `name` (required): The username for the user account.  | 
 | 47 | + - `password` (required): The password for the user account in the range of 10-32 characters.  | 
 | 48 | + - `type` (required): The user type. The "type" field is required to generate the connection string for the outputs.  | 
 | 49 | + - `role`: The user role. The role determines the user's access level and permissions.  | 
 | 50 | + | 
 | 51 | +### Example users  | 
 | 52 | + | 
 | 53 | + | 
 | 54 | +```hcl  | 
 | 55 | +[  | 
 | 56 | +  {  | 
 | 57 | +    "name": "es_admin",  | 
 | 58 | +    "password": "securepassword123",  | 
 | 59 | +    "type": "database",  | 
 | 60 | +  },  | 
 | 61 | +  {  | 
 | 62 | +    "name": "es_reader",  | 
 | 63 | +    "password": "readpassword123",  | 
 | 64 | +    "type": "ops_manager"  | 
 | 65 | +  }  | 
 | 66 | +]  | 
 | 67 | +```  | 
 | 68 | + | 
 | 69 | +## Autoscaling <a name="autoscaling"></a>  | 
 | 70 | + | 
 | 71 | +The Autoscaling variable sets the rules for how database increase resources in response to usage. Make sure you understand the effects of autoscaling, especially for production environments. For more information, see [Autoscaling](https://cloud.ibm.com/docs/databases-for-elasticsearch?topic=databases-for-elasticsearch-autoscaling&interface=cli#autoscaling-considerations).  | 
 | 72 | + | 
 | 73 | +- Variable name: `auto_scaling`  | 
 | 74 | +- Type: An object with `disk` and `memory` configurations  | 
 | 75 | + | 
 | 76 | +### Disk options for auto_scaling  | 
 | 77 | + | 
 | 78 | +Disk autoscaling specifies thresholds when scaling can occur based on disk usage, disk I/O utilization, or both.  | 
 | 79 | + | 
 | 80 | +The disk object in the `auto_scaling` input contains the following options. All options are optional.  | 
 | 81 | + | 
 | 82 | +- `capacity_enabled`: Whether disk capacity autoscaling is enabled (default: `false`).  | 
 | 83 | +- `free_space_less_than_percent`: The percentage of free disk space that triggers autoscaling (default: `10`).  | 
 | 84 | +- `io_above_percent`: The percentage of I/O (input/output) disk usage that triggers autoscaling (default: `90`).  | 
 | 85 | +- `io_enabled`: Indicates whether IO-based autoscaling is enabled (default: `false`).  | 
 | 86 | +- `io_over_period`: How long I/O usage is evaluated for autoscaling (default: `"15m"` (15 minutes)).  | 
 | 87 | +- `rate_increase_percent`: The percentage increase in disk capacity when autoscaling is triggered (default: `10`).  | 
 | 88 | +- `rate_limit_mb_per_member`: The limit in megabytes for the rate of disk increase per member (default: `3670016`).  | 
 | 89 | +- `rate_period_seconds`: How long (in seconds) the rate limit is applied for disk (default: `900` (15 minutes)).  | 
 | 90 | +- `rate_units`: The units to use for the rate increase (default: `"mb"` (megabytes)).  | 
 | 91 | + | 
 | 92 | + | 
 | 93 | +### Memory options for auto_scaling  | 
 | 94 | + | 
 | 95 | +The memory object within auto_scaling contains the following options. All options are optional.  | 
 | 96 | + | 
 | 97 | +- `io_above_percent`: The percentage of I/O memory usage that triggers autoscaling (default: `90`).  | 
 | 98 | +- `io_enabled`: Whether IO-based autoscaling for memory is enabled (default: `false`).  | 
 | 99 | +- `io_over_period`: How long I/O usage is evaluated for memory autoscaling (default: `"15m"` (15 minutes)).  | 
 | 100 | +- `rate_increase_percent`: The percentage increase in memory capacity that triggers autoscaling (default: `10`).  | 
 | 101 | +- `rate_limit_mb_per_member`: The limit in megabytes for the rate of memory increase per member (default: `114688`).  | 
 | 102 | +- `rate_period_seconds`: How long (in seconds) the rate limit is applied for memory (default: `900` (15 minutes)).  | 
 | 103 | +- `rate_units`: The memory size units to use for the rate increase (default: `"mb"` (megabytes)).  | 
 | 104 | + | 
 | 105 | +### Example autoscaling  | 
 | 106 | + | 
 | 107 | +The following example shows values for both disk and memory for the `auto_scaling` input.  | 
 | 108 | + | 
 | 109 | +```hcl  | 
 | 110 | +{  | 
 | 111 | +  "disk": {  | 
 | 112 | +      "capacity_enabled": true,  | 
 | 113 | +      "free_space_less_than_percent": 15,  | 
 | 114 | +      "io_above_percent": 85,  | 
 | 115 | +      "io_enabled": true,  | 
 | 116 | +      "io_over_period": "15m",  | 
 | 117 | +      "rate_increase_percent": 15,  | 
 | 118 | +      "rate_limit_mb_per_member": 3670016,  | 
 | 119 | +      "rate_period_seconds": 900,  | 
 | 120 | +      "rate_units": "mb"  | 
 | 121 | +  },  | 
 | 122 | +  "memory": {  | 
 | 123 | +      "io_above_percent": 90,  | 
 | 124 | +      "io_enabled": true,  | 
 | 125 | +      "io_over_period": "15m",  | 
 | 126 | +      "rate_increase_percent": 10,  | 
 | 127 | +      "rate_limit_mb_per_member": 114688,  | 
 | 128 | +      "rate_period_seconds": 900,  | 
 | 129 | +      "rate_units": "mb"  | 
 | 130 | +  }  | 
 | 131 | +}  | 
 | 132 | +```  | 
0 commit comments