|
| 1 | +--- |
| 2 | +page_title: "Scaleway: scaleway_redis_cluster" |
| 3 | +description: |- |
| 4 | +Manages Scaleway Redis Clusters. |
| 5 | +--- |
| 6 | + |
| 7 | +# scaleway_redis_cluster |
| 8 | + |
| 9 | +Creates and manages Scaleway Redis Clusters. |
| 10 | +For more information, see [the documentation](https://developers.scaleway.com/en/products/redis/api). |
| 11 | + |
| 12 | +## Examples |
| 13 | + |
| 14 | +### Basic |
| 15 | + |
| 16 | +```hcl |
| 17 | +resource "scaleway_redis_cluster" "main" { |
| 18 | + name = "test_redis_basic" |
| 19 | + version = "6.2.6" |
| 20 | + node_type = "MDB-BETA-M" |
| 21 | + user_name = "my_initial_user" |
| 22 | + password = "thiZ_is_v&ry_s3cret" |
| 23 | + tags = [ "test", "redis" ] |
| 24 | + cluster_size = 1 |
| 25 | + tls_enabled = "true" |
| 26 | + |
| 27 | + acl { |
| 28 | + ip = "0.0.0.0/0" |
| 29 | + description = "Allow all" |
| 30 | + } |
| 31 | +} |
| 32 | +``` |
| 33 | + |
| 34 | +### With settings |
| 35 | + |
| 36 | +```hcl |
| 37 | +resource "scaleway_redis_cluster" "main" { |
| 38 | + name = "test_redis_basic" |
| 39 | + version = "6.2.6" |
| 40 | + node_type = "MDB-BETA-M" |
| 41 | + user_name = "my_initial_user" |
| 42 | + password = "thiZ_is_v&ry_s3cret" |
| 43 | + |
| 44 | + settings = { |
| 45 | + "maxclients" = "1000" |
| 46 | + "tcp-keepalive" = "120" |
| 47 | + } |
| 48 | +} |
| 49 | +``` |
| 50 | + |
| 51 | +## Arguments Reference |
| 52 | + |
| 53 | +The following arguments are supported: |
| 54 | + |
| 55 | +- `version` - (Required) Redis's Cluster version (e.g. `6.2.6`). |
| 56 | + |
| 57 | +~> **Important:** Updates to `version` will migrate the Redis Cluster to the desired `version`. Keep in mind that you cannot downgrade a Redis Cluster. |
| 58 | + |
| 59 | +- `node_type` - (Required) The type of Redis Cluster you want to create (e.g. `MDB-BETA-M`). |
| 60 | + |
| 61 | +~> **Important:** Updates to `node_type` will migrate the Redis Cluster to the desired `node_type`. Keep in mind that you cannot downgrade a Redis Cluster. |
| 62 | + |
| 63 | +- `user_name` - (Required) Identifier for the first user of the Redis Cluster. |
| 64 | + |
| 65 | +- `password` - (Required) Password for the first user of the Redis Cluster. |
| 66 | + |
| 67 | +- `name` - (Optional) The name of the Redis Cluster. |
| 68 | + |
| 69 | +- `tags` - (Optional) The tags associated with the Redis Cluster. |
| 70 | + |
| 71 | +- `zone` - (Defaults to [provider](../index.md) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the Redis Cluster should be created. |
| 72 | + |
| 73 | +- `cluster_size` - (Optional) The number of nodes in the Redis Cluster. |
| 74 | + |
| 75 | +~> **Important:** You can set a bigger `cluster_size`, it will migrate the Redis Cluster, but keep in mind that you cannot downgrade a Redis Cluster so setting a smaller `cluster_size` will not have any effect. |
| 76 | + |
| 77 | +- `tls_enabled` - (Defaults to false) Whether TLS is enabled or not. |
| 78 | + |
| 79 | +- `project_id` - (Defaults to [provider](../index.md) `project_id`) The ID of the project the Redis Cluster is associated with. |
| 80 | + |
| 81 | +- `acl` - (Optional) List of acl rules, this is cluster's authorized IPs. |
| 82 | + |
| 83 | +The `acl` block supports: |
| 84 | + |
| 85 | +- `ip` - (Required) The ip range to whitelist in [CIDR notation](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation) |
| 86 | +- `description` - (Optional) A text describing this rule. Default description: `Allow IP` |
| 87 | + |
| 88 | +- `settings` - (Optional) Map of settings for redis cluster. Available settings can be found by listing redis versions with scaleway API or CLI |
| 89 | + |
| 90 | +## Attributes Reference |
| 91 | + |
| 92 | +In addition to all arguments above, the following attributes are exported: |
| 93 | + |
| 94 | +- `id` - The ID of the Database Instance. |
| 95 | +- `created_at` - The date and time of creation of the Redis Cluster. |
| 96 | +- `updated_at` - The date and time of the last update of the Redis Cluster. |
| 97 | + |
| 98 | + |
| 99 | +## Import |
| 100 | + |
| 101 | +Redis Cluster can be imported using the `{zone}/{id}`, e.g. |
| 102 | + |
| 103 | +```bash |
| 104 | +$ terraform import scaleway_redis_cluster.redis01 fr-par/11111111-1111-1111-1111-111111111111 |
| 105 | +``` |
0 commit comments