forked from GoogleCloudPlatform/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathredis_cluster_cmek.tf.tmpl
42 lines (36 loc) · 1.28 KB
/
redis_cluster_cmek.tf.tmpl
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
resource "google_redis_cluster" "{{$.PrimaryResourceId}}" {
name = "{{index $.Vars "cluster_name"}}"
shard_count = 3
psc_configs {
network = google_compute_network.consumer_net.id
}
kms_key = "{{index $.Vars "kms_key_name"}}"
region = "us-central1"
deletion_protection_enabled = {{index $.Vars "deletion_protection_enabled"}}
depends_on = [
google_network_connectivity_service_connection_policy.default,
google_kms_crypto_key_iam_binding.kms_key_iam_decrypter
]
}
data "google_project" "project" {
}
resource "google_network_connectivity_service_connection_policy" "default" {
name = "{{index $.Vars "policy_name"}}"
location = "us-central1"
service_class = "gcp-memorystore-redis"
description = "my basic service connection policy"
network = google_compute_network.consumer_net.id
psc_config {
subnetworks = [google_compute_subnetwork.consumer_subnet.id]
}
}
resource "google_compute_subnetwork" "consumer_subnet" {
name = "{{index $.Vars "subnet_name"}}"
ip_cidr_range = "10.0.0.248/29"
region = "us-central1"
network = google_compute_network.consumer_net.id
}
resource "google_compute_network" "consumer_net" {
name = "{{index $.Vars "network_name"}}"
auto_create_subnetworks = false
}