generated from opsd-io/terraform-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
42 lines (34 loc) · 894 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
terraform {
required_version = ">= 1.5.5"
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
version = ">= 2.34.1"
}
}
}
resource "digitalocean_database_redis_config" "main" {
cluster_id = digitalocean_database_cluster.main.id
maxmemory_policy = "allkeys-lru"
notify_keyspace_events = "KEA"
timeout = 90
}
resource "digitalocean_database_firewall" "main" {
cluster_id = digitalocean_database_cluster.main.id
dynamic "rule" {
for_each = var.firewall_rules
content {
type = "ip_addr"
value = rule.value
}
}
}
resource "digitalocean_database_cluster" "main" {
name = var.cluster_name
engine = "redis"
version = var.redis_version
size = var.node_size
region = var.region
node_count = var.node_count
tags = var.common_tags
}