|
| 1 | +/** |
| 2 | + * Copyright 2024 Google LLC |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +# [START compute_disk_async_replication_parent_tag] |
| 18 | +# [START compute_disk_primary] |
| 19 | +resource "google_compute_disk" "primary_disk" { |
| 20 | + name = "primary-disk" |
| 21 | + type = "pd-ssd" |
| 22 | + zone = "europe-west4-a" |
| 23 | + |
| 24 | + physical_block_size_bytes = 4096 |
| 25 | +} |
| 26 | +# [END compute_disk_primary] |
| 27 | + |
| 28 | +# [START compute_disk_secondary] |
| 29 | +resource "google_compute_disk" "secondary_disk" { |
| 30 | + name = "secondary-disk" |
| 31 | + type = "pd-ssd" |
| 32 | + zone = "europe-west3-a" |
| 33 | + |
| 34 | + async_primary_disk { |
| 35 | + disk = google_compute_disk.primary_disk.id |
| 36 | + } |
| 37 | + |
| 38 | + physical_block_size_bytes = 4096 |
| 39 | +} |
| 40 | +# [END compute_disk_secondary] |
| 41 | + |
| 42 | + |
| 43 | +# [START compute_disk_async_replication] |
| 44 | +resource "google_compute_disk_async_replication" "default" { |
| 45 | + primary_disk = google_compute_disk.primary_disk.id |
| 46 | + secondary_disk { |
| 47 | + disk = google_compute_disk.secondary_disk.id |
| 48 | + } |
| 49 | +} |
| 50 | +# [END compute_disk_async_replication] |
| 51 | +# [END compute_disk_async_replication_parent_tag] |
0 commit comments