@@ -87,17 +87,56 @@ func TestAccMemorystoreInstance_automatedBackupConfig(t *testing.T) {
87
87
func testAccMemorystoreInstance_automatedBackupConfig (context map [string ]interface {}) string {
88
88
return acctest .Nprintf (`
89
89
// Primary instance
90
- resource "google_memorystore_instance" "primary_instance " {
91
- instance_id = "tf-instance-%{random_suffix}"
90
+ resource "google_memorystore_instance" "test-abc " {
91
+ instance_id = "tf-test- instance-abc -%{random_suffix}"
92
92
shard_count = 1
93
93
location = "us-central1"
94
94
replica_count = 1
95
95
node_type = "SHARED_CORE_NANO"
96
96
deletion_protection_enabled = false
97
+ desired_psc_auto_connections {
98
+ network = google_compute_network.primary_producer_net.id
99
+ project_id = data.google_project.project.project_id
100
+ }
97
101
automated_backup_config {
98
102
automated_backup_mode = "%{automated_backup_mode}"
103
+ retention = "259200s"
104
+ fixed_frequency_schedule {
105
+ start_time {
106
+ hours = 20
107
+ minutes = 30
108
+ seconds = 50
109
+ nanos = 2
110
+ }
111
+ }
112
+ }
113
+ depends_on = [ google_network_connectivity_service_connection_policy.primary_policy ]
114
+ }
115
+
116
+ resource "google_network_connectivity_service_connection_policy" "primary_policy" {
117
+ name = "tf-test-abc-policy-%{random_suffix}"
118
+ location = "us-central1"
119
+ service_class = "gcp-memorystore"
120
+ description = "my basic service connection policy"
121
+ network = google_compute_network.primary_producer_net.id
122
+ psc_config {
123
+ subnetworks = [google_compute_subnetwork.primary_producer_subnet.id]
99
124
}
125
+ }
100
126
127
+ resource "google_compute_subnetwork" "primary_producer_subnet" {
128
+ name = "tf-test-abc-%{random_suffix}"
129
+ ip_cidr_range = "10.0.4.0/29"
130
+ region = "us-central1"
131
+ network = google_compute_network.primary_producer_net.id
132
+ }
133
+
134
+ resource "google_compute_network" "primary_producer_net" {
135
+ name = "tf-test-abc-net-%{random_suffix}"
136
+ auto_create_subnetworks = false
137
+ }
138
+
139
+ data "google_project" "project" {
101
140
}
102
141
` , context )
103
142
}
0 commit comments