Skip to content

Commit 8723707

Browse files
feat: Add connection to private networks. (#2)
1 parent f992294 commit 8723707

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ 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 |
4546
| <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 |
4647
| <a name="input_tags"></a> [tags](#input_tags) | Tags associated with the server and dedicated ip address. | `list(string)` | `[]` | no |
4748
| <a name="input_tls_enabled"></a> [tls_enabled](#input_tls_enabled) | Whether TLS is enabled or not. | `bool` | `true` | no |

main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,12 @@ resource "scaleway_redis_cluster" "this" {
2424
description = acl.value["description"]
2525
}
2626
}
27+
28+
dynamic "private_network" {
29+
for_each = var.private_network != null ? [1] : []
30+
content {
31+
id = try(var.private_network.id, null)
32+
service_ips = try(var.private_network.service_ips, null)
33+
}
34+
}
2735
}

variables.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ variable "network_acls" {
3333
}]
3434
}
3535

36+
variable "private_network" {
37+
description = "Describes the private network you want to connect to your cluster. If not set, a public network will be provided."
38+
type = object({
39+
id = string
40+
service_ips = list(string)
41+
})
42+
default = null
43+
}
44+
3645
variable "project_id" {
3746
description = "ID of the project the namespace is associated with. Ressource will be created in the project set at the provider level if null."
3847
type = string

0 commit comments

Comments
 (0)