blob: f90c2d0f81660f9de92146d972bb095af2c291b8 [file] [log] [blame]
---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in
# .github/CONTRIBUTING.md.
#
# ----------------------------------------------------------------------------
subcategory: "Backup and DR Service"
description: |-
Container to store and organize immutable and indelible backups.
---
# google_backup_dr_backup_vault
Container to store and organize immutable and indelible backups.
~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources.
## Example Usage - Backup Dr Backup Vault Full
```hcl
resource "google_backup_dr_backup_vault" "backup-vault-test" {
provider = google-beta
location = "us-central1"
backup_vault_id = "backup-vault-test"
description = "This is a second backup vault built by Terraform."
backup_minimum_enforced_retention_duration = "100000s"
labels = {
foo = "bar1"
bar = "baz1"
}
annotations = {
annotations1 = "bar1"
annotations2 = "baz1"
}
force_update = "true"
force_delete = "true"
allow_missing = "true"
}
```
## Argument Reference
The following arguments are supported:
* `backup_minimum_enforced_retention_duration` -
(Required)
Required. The default and minimum enforced retention for each backup within the backup vault. The enforced retention for each backup can be extended.
* `location` -
(Required)
The GCP location for the backup vault.
* `backup_vault_id` -
(Required)
Required. ID of the requesting object.
- - -
* `description` -
(Optional)
Optional. The description of the BackupVault instance (2048 characters or less).
* `labels` -
(Optional)
Optional. Resource labels to represent user provided metadata.
**Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field `effective_labels` for all of the labels present on the resource.
* `effective_time` -
(Optional)
Optional. Time after which the BackupVault resource is locked.
* `annotations` -
(Optional)
Optional. User annotations. See https://google.aip.dev/128#annotations
Stores small amounts of arbitrary data.
**Note**: This field is non-authoritative, and will only manage the annotations present in your configuration.
Please refer to the field `effective_annotations` for all of the annotations present on the resource.
* `force_update` -
(Optional)
If set, allow update to extend the minimum enforced retention for backup vault. This overrides
the restriction against conflicting retention periods. This conflict may occur when the
expiration schedule defined by the associated backup plan is shorter than the minimum
retention set by the backup vault.
* `force_delete` -
(Optional)
If set, the following restrictions against deletion of the backup vault instance can be overridden:
* deletion of a backup vault instance containing no backups, but still containing empty datasources.
* deletion of a backup vault instance that is being referenced by an active backup plan.
* `allow_missing` -
(Optional)
Allow idempotent deletion of backup vault. The request will still succeed in case the backup vault does not exist.
* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
## Attributes Reference
In addition to the arguments listed above, the following computed attributes are exported:
* `id` - an identifier for the resource with format `projects/{{project}}/locations/{{location}}/backupVaults/{{backup_vault_id}}`
* `name` -
Output only. Identifier. The resource name.
* `create_time` -
Output only. The time when the instance was created.
* `update_time` -
Output only. The time when the instance was updated.
* `deletable` -
Output only. Set to true when there are no backups nested under this resource.
* `etag` -
Optional. Server specified ETag for the backup vault resource to prevent simultaneous updates from overwiting each other.
* `state` -
Output only. The BackupVault resource instance state.
Possible values:
STATE_UNSPECIFIED
CREATING
ACTIVE
DELETING
ERROR
* `backup_count` -
Output only. The number of backups in this backup vault.
* `service_account` -
Output only. Service account used by the BackupVault Service for this BackupVault. The user should grant this account permissions in their workload project to enable the service to run backups and restores there.
* `total_stored_bytes` -
Output only. Total size of the storage used by all backup resources.
* `uid` -
Output only. Output only Immutable after resource creation until resource deletion.
* `terraform_labels` -
The combination of labels configured directly on the resource
and default labels configured on the provider.
* `effective_labels` -
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
* `effective_annotations` -
All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services.
## Timeouts
This resource provides the following
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
- `create` - Default is 20 minutes.
- `update` - Default is 20 minutes.
- `delete` - Default is 20 minutes.
## Import
BackupVault can be imported using any of these accepted formats:
* `projects/{{project}}/locations/{{location}}/backupVaults/{{backup_vault_id}}`
* `{{project}}/{{location}}/{{backup_vault_id}}`
* `{{location}}/{{backup_vault_id}}`
In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import BackupVault using one of the formats above. For example:
```tf
import {
id = "projects/{{project}}/locations/{{location}}/backupVaults/{{backup_vault_id}}"
to = google_backup_dr_backup_vault.default
}
```
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), BackupVault can be imported using one of the formats above. For example:
```
$ terraform import google_backup_dr_backup_vault.default projects/{{project}}/locations/{{location}}/backupVaults/{{backup_vault_id}}
$ terraform import google_backup_dr_backup_vault.default {{project}}/{{location}}/{{backup_vault_id}}
$ terraform import google_backup_dr_backup_vault.default {{location}}/{{backup_vault_id}}
```
## User Project Overrides
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).