forked from GoogleCloudPlatform/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding zone distribution mode in the Cluster resource for Memorystore…
… Redis cluster (GoogleCloudPlatform#10458)
- Loading branch information
Showing
5 changed files
with
142 additions
and
18 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
42 changes: 42 additions & 0 deletions
42
mmv1/templates/terraform/examples/redis_cluster_ha_single_zone.tf.erb
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,42 @@ | ||
resource "google_redis_cluster" "<%= ctx[:primary_resource_id] %>" { | ||
name = "<%= ctx[:vars]['cluster_name'] %>" | ||
shard_count = 3 | ||
psc_configs { | ||
network = google_compute_network.producer_net.id | ||
} | ||
region = "us-central1" | ||
zone_distribution_config { | ||
mode = "SINGLE_ZONE" | ||
zone = "us-central1-f" | ||
} | ||
depends_on = [ | ||
google_network_connectivity_service_connection_policy.default | ||
] | ||
|
||
lifecycle { | ||
prevent_destroy = <%= ctx[:vars]['prevent_destroy'] %> | ||
} | ||
} | ||
|
||
resource "google_network_connectivity_service_connection_policy" "default" { | ||
name = "<%= ctx[:vars]['policy_name'] %>" | ||
location = "us-central1" | ||
service_class = "gcp-memorystore-redis" | ||
description = "my basic service connection policy" | ||
network = google_compute_network.producer_net.id | ||
psc_config { | ||
subnetworks = [google_compute_subnetwork.producer_subnet.id] | ||
} | ||
} | ||
|
||
resource "google_compute_subnetwork" "producer_subnet" { | ||
name = "<%= ctx[:vars]['subnet_name'] %>" | ||
ip_cidr_range = "10.0.0.248/29" | ||
region = "us-central1" | ||
network = google_compute_network.producer_net.id | ||
} | ||
|
||
resource "google_compute_network" "producer_net" { | ||
name = "<%= ctx[: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