Skip to content

Commit 8a5ef6b

Browse files
KALIOP - Fixes & Add support for settings parameters
* feat: add support for custom parameters * fix: Resolve conflict between `private_network` and `network_acls`
1 parent e8339f5 commit 8a5ef6b

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ module "my_cluster" {
4242
| <a name="input_cluster_version"></a> [cluster_version](#input_cluster_version) | Redis's Cluster version (e.g. `6.2.6`). | `string` | `"7.0.5"` | no |
4343
| <a name="input_instance_type"></a> [instance_type](#input_instance_type) | Type of Redis Cluster you want to create. | `string` | `"RED1-MICRO"` | no |
4444
| <a name="input_network_acls"></a> [network_acls](#input_network_acls) | List of acl rules (ie IP addresses authorized to connect to the cluster). | ```list(object({ ip = string description = string }))``` | ```[ { "description": "Allow all", "ip": "0.0.0.0/0" } ]``` | no |
45-
| <a name="input_private_network"></a> [private_network](#input_private_network) | Describes the private network you want to connect to your cluster. If not set, a public network will be provided. | ```object({ id = string service_ips = list(string) })``` | `null` | no |
45+
| <a name="input_private_network"></a> [private_network](#input_private_network) | Describes the private network you want to connect to your cluster. If not set, a public network will be provided. | ```object({ id = string service_ips = optional(list(string)) })``` | `null` | no |
4646
| <a name="input_project_id"></a> [project_id](#input_project_id) | ID of the project the namespace is associated with. Ressource will be created in the project set at the provider level if null. | `string` | `null` | no |
47+
| <a name="input_settings"></a> [settings](#input_settings) | Optional map of settings for the Redis™ cluster. Refer to Scaleway API/CLI for valid settings. | `map(string)` | `null` | no |
4748
| <a name="input_tags"></a> [tags](#input_tags) | Tags associated with the server and dedicated ip address. | `list(string)` | `[]` | no |
4849
| <a name="input_tls_enabled"></a> [tls_enabled](#input_tls_enabled) | Whether TLS is enabled or not. | `bool` | `true` | no |
4950
| <a name="input_zone"></a> [zone](#input_zone) | The zone in which the Redis Cluster should be created. Ressource will be created in the zone set at the provider level if null. | `string` | `null` | no |

main.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ resource "scaleway_redis_cluster" "this" {
1616
zone = var.zone
1717
project_id = var.project_id
1818

19+
# Settings
20+
settings = var.settings
21+
1922
# Network ACLs
2023
dynamic "acl" {
21-
for_each = var.network_acls
24+
for_each = var.private_network != null ? [] : var.network_acls
2225
content {
2326
ip = acl.value["ip"]
2427
description = acl.value["description"]

variables.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ variable "private_network" {
3737
description = "Describes the private network you want to connect to your cluster. If not set, a public network will be provided."
3838
type = object({
3939
id = string
40-
service_ips = list(string)
40+
service_ips = optional(list(string))
4141
})
4242
default = null
4343
}
@@ -54,6 +54,12 @@ variable "zone" {
5454
default = null
5555
}
5656

57+
variable "settings" {
58+
description = "Optional map of settings for the Redis™ cluster. Refer to Scaleway API/CLI for valid settings."
59+
type = map(string)
60+
default = null
61+
}
62+
5763
variable "tags" {
5864
description = "Tags associated with the server and dedicated ip address."
5965
type = list(string)

0 commit comments

Comments
 (0)