|
| 1 | +--- |
| 2 | +# ---------------------------------------------------------------------------- |
| 3 | +# |
| 4 | +# *** AUTO GENERATED CODE *** Type: MMv1 *** |
| 5 | +# |
| 6 | +# ---------------------------------------------------------------------------- |
| 7 | +# |
| 8 | +# This file is automatically generated by Magic Modules and manual |
| 9 | +# changes will be clobbered when the file is regenerated. |
| 10 | +# |
| 11 | +# Please read more about how to change this file in |
| 12 | +# .github/CONTRIBUTING.md. |
| 13 | +# |
| 14 | +# ---------------------------------------------------------------------------- |
| 15 | +subcategory: "AlloyDB" |
| 16 | +page_title: "Google: google_alloydb_backup" |
| 17 | +description: |- |
| 18 | + An AlloyDB Backup. |
| 19 | +--- |
| 20 | + |
| 21 | +# google\_alloydb\_backup |
| 22 | + |
| 23 | +An AlloyDB Backup. |
| 24 | + |
| 25 | +~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider. |
| 26 | +See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources. |
| 27 | + |
| 28 | +To get more information about Backup, see: |
| 29 | + |
| 30 | +* [API documentation](https://cloud.google.com/alloydb/docs/reference/rest/v1beta/projects.locations.backups/create) |
| 31 | +* How-to Guides |
| 32 | + * [AlloyDB](https://cloud.google.com/alloydb/docs/) |
| 33 | + |
| 34 | +<div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| 35 | + <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.jpy.wang%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=alloydb_backup_full&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank"> |
| 36 | + <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| 37 | + </a> |
| 38 | +</div> |
| 39 | +## Example Usage - Alloydb Backup Full |
| 40 | + |
| 41 | + |
| 42 | +```hcl |
| 43 | +resource "google_alloydb_backup" "default" { |
| 44 | + provider = google-beta |
| 45 | + location = "us-central1" |
| 46 | + backup_id = "alloydb-backup" |
| 47 | + cluster_name = google_alloydb_cluster.default.name |
| 48 | +
|
| 49 | + description = "example description" |
| 50 | + labels = { |
| 51 | + "label" = "key" |
| 52 | + } |
| 53 | + depends_on = [google_alloydb_instance.default] |
| 54 | +} |
| 55 | +
|
| 56 | +resource "google_alloydb_cluster" "default" { |
| 57 | + provider = google-beta |
| 58 | + cluster_id = "alloydb-cluster" |
| 59 | + location = "us-central1" |
| 60 | + network = data.google_compute_network.default.id |
| 61 | +} |
| 62 | +
|
| 63 | +resource "google_alloydb_instance" "default" { |
| 64 | + provider = google-beta |
| 65 | + cluster = google_alloydb_cluster.default.name |
| 66 | + instance_id = "alloydb-instance" |
| 67 | + instance_type = "PRIMARY" |
| 68 | +
|
| 69 | + depends_on = [google_service_networking_connection.vpc_connection] |
| 70 | +} |
| 71 | +
|
| 72 | +resource "google_compute_global_address" "private_ip_alloc" { |
| 73 | + provider = google-beta |
| 74 | + name = "alloydb-cluster" |
| 75 | + address_type = "INTERNAL" |
| 76 | + purpose = "VPC_PEERING" |
| 77 | + prefix_length = 16 |
| 78 | + network = data.google_compute_network.default.id |
| 79 | +} |
| 80 | +
|
| 81 | +resource "google_service_networking_connection" "vpc_connection" { |
| 82 | + provider = google-beta |
| 83 | + network = data.google_compute_network.default.id |
| 84 | + service = "servicenetworking.googleapis.com" |
| 85 | + reserved_peering_ranges = [google_compute_global_address.private_ip_alloc.name] |
| 86 | +} |
| 87 | +
|
| 88 | +data "google_compute_network" "default" { |
| 89 | + provider = google-beta |
| 90 | + name = "alloydb-network" |
| 91 | +} |
| 92 | +``` |
| 93 | + |
| 94 | +## Argument Reference |
| 95 | + |
| 96 | +The following arguments are supported: |
| 97 | + |
| 98 | + |
| 99 | +* `cluster_name` - |
| 100 | + (Required) |
| 101 | + The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}). |
| 102 | + |
| 103 | +* `backup_id` - |
| 104 | + (Required) |
| 105 | + The ID of the alloydb backup. |
| 106 | + |
| 107 | + |
| 108 | +- - - |
| 109 | + |
| 110 | + |
| 111 | +* `labels` - |
| 112 | + (Optional) |
| 113 | + User-defined labels for the alloydb backup. |
| 114 | + |
| 115 | +* `description` - |
| 116 | + (Optional) |
| 117 | + User-provided description of the backup. |
| 118 | + |
| 119 | +* `location` - |
| 120 | + (Optional) |
| 121 | + The location where the alloydb backup should reside. |
| 122 | + |
| 123 | +* `project` - (Optional) The ID of the project in which the resource belongs. |
| 124 | + If it is not provided, the provider project is used. |
| 125 | + |
| 126 | + |
| 127 | +## Attributes Reference |
| 128 | + |
| 129 | +In addition to the arguments listed above, the following computed attributes are exported: |
| 130 | + |
| 131 | +* `id` - an identifier for the resource with format `projects/{{project}}/locations/{{location}}/backups/{{backup_id}}` |
| 132 | + |
| 133 | +* `name` - |
| 134 | + Output only. The name of the backup resource with the format: * projects/{project}/locations/{region}/backups/{backupId} |
| 135 | + |
| 136 | +* `uid` - |
| 137 | + Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted. |
| 138 | + |
| 139 | +* `create_time` - |
| 140 | + Time the Backup was created in UTC. |
| 141 | + |
| 142 | +* `update_time` - |
| 143 | + Time the Backup was updated in UTC. |
| 144 | + |
| 145 | +* `state` - |
| 146 | + The current state of the backup. |
| 147 | + |
| 148 | +* `reconciling` - |
| 149 | + If true, indicates that the service is actively updating the resource. This can happen due to user-triggered updates or system actions like failover or maintenance. |
| 150 | + |
| 151 | +* `etag` - |
| 152 | + A hash of the resource. |
| 153 | + |
| 154 | + |
| 155 | +## Timeouts |
| 156 | + |
| 157 | +This resource provides the following |
| 158 | +[Timeouts](/docs/configuration/resources.html#timeouts) configuration options: |
| 159 | + |
| 160 | +- `create` - Default is 10 minutes. |
| 161 | +- `update` - Default is 10 minutes. |
| 162 | +- `delete` - Default is 10 minutes. |
| 163 | + |
| 164 | +## Import |
| 165 | + |
| 166 | + |
| 167 | +Backup can be imported using any of these accepted formats: |
| 168 | + |
| 169 | +``` |
| 170 | +$ terraform import google_alloydb_backup.default projects/{{project}}/locations/{{location}}/backups/{{backup_id}} |
| 171 | +$ terraform import google_alloydb_backup.default {{project}}/{{location}}/{{backup_id}} |
| 172 | +$ terraform import google_alloydb_backup.default {{location}}/{{backup_id}} |
| 173 | +``` |
| 174 | + |
| 175 | +## User Project Overrides |
| 176 | + |
| 177 | +This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override). |
0 commit comments