Skip to content

Commit 63cb63e

Browse files
committed
Add separate example for standalone change endpoints to output only.
1 parent aacb5ea commit 63cb63e

File tree

3 files changed

+74
-1
lines changed

3 files changed

+74
-1
lines changed

mmv1/products/memorystore/Instance.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,8 @@ properties:
345345
- name: 'endpoints'
346346
type: Array
347347
description: "Endpoints for the instance."
348+
min_version: 'beta'
349+
output: true
348350
item_type:
349351
type: Array
350352
description: "A group of PSC connections. They are created in the same VPC network, one for each service attachment in the cluster."

mmv1/templates/terraform/examples/memorystore_instance_full.tf.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ resource "google_memorystore_instance" "{{$.PrimaryResourceId}}" {
2020
}
2121
engine_version = "VALKEY_7_2"
2222
deletion_protection_enabled = false
23-
mode = "STANDALONE"
23+
mode = "CLUSTER"
2424
persistence_config {
2525
mode = "RDB"
2626
rdb_config {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
resource "google_memorystore_instance" "{{$.PrimaryResourceId}}" {
2+
provider = google-beta
3+
instance_id = "{{index $.Vars "instance_name"}}"
4+
shard_count = 1
5+
desired_psc_auto_connections {
6+
network = google_compute_network.producer_net.id
7+
project_id = data.google_project.project.project_id
8+
}
9+
location = "us-central1"
10+
replica_count = 2
11+
node_type = "SHARED_CORE_NANO"
12+
transit_encryption_mode = "TRANSIT_ENCRYPTION_DISABLED"
13+
authorization_mode = "AUTH_DISABLED"
14+
engine_configs = {
15+
maxmemory-policy = "volatile-ttl"
16+
}
17+
zone_distribution_config {
18+
mode = "SINGLE_ZONE"
19+
zone = "us-central1-b"
20+
}
21+
engine_version = "VALKEY_7_2"
22+
deletion_protection_enabled = false
23+
mode = "STANDALONE"
24+
persistence_config {
25+
mode = "RDB"
26+
rdb_config {
27+
rdb_snapshot_period = "ONE_HOUR"
28+
rdb_snapshot_start_time = "2024-10-02T15:01:23Z"
29+
}
30+
}
31+
labels = {
32+
"abc" : "xyz"
33+
}
34+
depends_on = [
35+
google_network_connectivity_service_connection_policy.default
36+
]
37+
38+
lifecycle {
39+
prevent_destroy = "{{index $.Vars "prevent_destroy"}}"
40+
}
41+
}
42+
43+
resource "google_network_connectivity_service_connection_policy" "default" {
44+
provider = google-beta
45+
name = "{{index $.Vars "policy_name"}}"
46+
location = "us-central1"
47+
service_class = "gcp-memorystore"
48+
description = "my basic service connection policy"
49+
network = google_compute_network.producer_net.id
50+
psc_config {
51+
subnetworks = [google_compute_subnetwork.producer_subnet.id]
52+
}
53+
}
54+
55+
resource "google_compute_subnetwork" "producer_subnet" {
56+
provider = google-beta
57+
name = "{{index $.Vars "subnet_name"}}"
58+
ip_cidr_range = "10.0.0.248/29"
59+
region = "us-central1"
60+
network = google_compute_network.producer_net.id
61+
}
62+
63+
resource "google_compute_network" "producer_net" {
64+
provider = google-beta
65+
name = "{{index $.Vars "network_name"}}"
66+
auto_create_subnetworks = false
67+
}
68+
69+
data "google_project" "project" {
70+
provider = google-beta
71+
}

0 commit comments

Comments
 (0)