-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CMEK support for Redis cluster (#12999)
Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
- Loading branch information
Showing
8 changed files
with
111 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
mmv1/templates/terraform/examples/redis_cluster_cmek.tf.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 | ||
] | ||
} | ||
|
||
|
||
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 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters