|
| 1 | +resource "google_redis_cluster" "cluster-rdb" { |
| 2 | + name = "rdb-cluster-${local.name_suffix}" |
| 3 | + shard_count = 3 |
| 4 | + psc_configs { |
| 5 | + network = google_compute_network.producer_net.id |
| 6 | + } |
| 7 | + region = "us-central1" |
| 8 | + replica_count = 0 |
| 9 | + node_type = "REDIS_SHARED_CORE_NANO" |
| 10 | + transit_encryption_mode = "TRANSIT_ENCRYPTION_MODE_DISABLED" |
| 11 | + authorization_mode = "AUTH_MODE_DISABLED" |
| 12 | + redis_configs = { |
| 13 | + maxmemory-policy = "volatile-ttl" |
| 14 | + } |
| 15 | + deletion_protection_enabled = false |
| 16 | + |
| 17 | + zone_distribution_config { |
| 18 | + mode = "MULTI_ZONE" |
| 19 | + } |
| 20 | + maintenance_policy { |
| 21 | + weekly_maintenance_window { |
| 22 | + day = "MONDAY" |
| 23 | + start_time { |
| 24 | + hours = 1 |
| 25 | + minutes = 0 |
| 26 | + seconds = 0 |
| 27 | + nanos = 0 |
| 28 | + } |
| 29 | + } |
| 30 | + } |
| 31 | + persistence_config { |
| 32 | + mode = "RDB" |
| 33 | + rdb_config { |
| 34 | + rdb_snapshot_period = "ONE_HOUR" |
| 35 | + rdb_snapshot_start_time = "2024-10-02T15:01:23Z" |
| 36 | + } |
| 37 | + } |
| 38 | + depends_on = [ |
| 39 | + google_network_connectivity_service_connection_policy.default |
| 40 | + ] |
| 41 | +} |
| 42 | + |
| 43 | +resource "google_network_connectivity_service_connection_policy" "default" { |
| 44 | + name = "mypolicy-${local.name_suffix}" |
| 45 | + location = "us-central1" |
| 46 | + service_class = "gcp-memorystore-redis" |
| 47 | + description = "my basic service connection policy" |
| 48 | + network = google_compute_network.producer_net.id |
| 49 | + psc_config { |
| 50 | + subnetworks = [google_compute_subnetwork.producer_subnet.id] |
| 51 | + } |
| 52 | +} |
| 53 | + |
| 54 | +resource "google_compute_subnetwork" "producer_subnet" { |
| 55 | + name = "mysubnet-${local.name_suffix}" |
| 56 | + ip_cidr_range = "10.0.0.248/29" |
| 57 | + region = "us-central1" |
| 58 | + network = google_compute_network.producer_net.id |
| 59 | +} |
| 60 | + |
| 61 | +resource "google_compute_network" "producer_net" { |
| 62 | + name = "mynetwork-${local.name_suffix}" |
| 63 | + auto_create_subnetworks = false |
| 64 | +} |
0 commit comments