google.cloud.gcp_alloydb_backup module – Creates a GCP Alloydb.Backup resource
Note
This module is part of the google.cloud collection (version 1.10.2).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install google.cloud.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: google.cloud.gcp_alloydb_backup.
Synopsis
An AlloyDB Backup.
Requirements
The below requirements are needed on the host that executes this module.
python >= 3.8
requests >= 2.18.4
google-auth >= 2.25.1
Parameters
Parameter |
Comments |
|---|---|
The access token used to authenticate. |
|
Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels. https://google.aip.dev/128 An object containing a list of “key”: value pairs. Example: { “name”: “wrench”, “mass”: “1.3kg”, “count”: “3” }. |
|
The type of credential used. Choices:
|
|
The ID of the alloydb backup. |
|
The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}). |
|
User-provided description of the backup. |
|
User-settable and human-readable display name for the Backup. |
|
EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). |
|
The fully-qualified resource name of the KMS key. Each Cloud KMS key is regionalized and has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]. |
|
Specifies which Ansible environment you’re running this module within. This should not be set unless you know what you’re doing. This only alters the User Agent string for any API requests. |
|
User-defined labels for the alloydb backup. An object containing a list of “key”: value pairs. Example: { “name”: “wrench”, “mass”: “1.3kg”, “count”: “3” }. |
|
The location where the alloydb backup should reside. |
|
The Google Cloud Platform project to use. |
|
Array of scopes to be used. |
|
The contents of a Service Account JSON file, either in a dictionary or as a JSON string that represents it. |
|
An optional service account email address if machineaccount is selected and the user does not wish to use the default email. |
|
The path of a Service Account JSON file if serviceaccount is selected as type. |
|
Whether the resource should exist in GCP. Choices:
|
|
The backup type, which suggests the trigger for the backup. Choices:
|
Notes
Note
API Reference: https://cloud.google.com/alloydb/docs/reference/rest/v1/projects.locations.backups/create
AlloyDB Guide: https://cloud.google.com/alloydb/docs/
For authentication, you can set auth_kind using the
GCP_AUTH_KINDenv variable.For authentication, you can set service_account_file using the
GCP_SERVICE_ACCOUNT_FILEenv variable.For authentication, you can set service_account_contents using the
GCP_SERVICE_ACCOUNT_CONTENTSenv variable.For authentication, you can set service_account_email using the
GCP_SERVICE_ACCOUNT_EMAILenv variable.For authentication, you can set access_token using the
GCP_ACCESS_TOKENenv variable.For authentication, you can set scopes using the
GCP_SCOPESenv variable.Environment variables values will only be used if the playbook values are not set.
The
service_account_email,service_account_file,service_account_fileandaccess_tokenoptions are mutually exclusive.
Examples
- name: Create an on-demand backup for a cluster
google.cloud.gcp_alloydb_backup:
backup_id: my-backup
state: present
cluster_name: projects/my-project/locations/us-central1/clusters/my-cluster
type: ON_DEMAND
location: us-central1
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Whether the resource was changed. Returned: always |
|
Output only. The system-generated UID of the cluster which was used to create this resource. Returned: success |
|
Output only. Create time stamp. A timestamp in RFC3339 UTC “Zulu” format, with nanosecond resolution and up to nine fractional digits. Examples: “2014-10-02T15:01:23Z” and “2014-10-02T15:01:23.045123456Z”. Returned: success |
|
Output only. Delete time stamp. A timestamp in RFC3339 UTC “Zulu” format, with nanosecond resolution and up to nine fractional digits. Examples: “2014-10-02T15:01:23Z” and “2014-10-02T15:01:23.045123456Z”. Returned: success |
|
EncryptionInfo describes the encryption information of a cluster or a backup. Returned: success |
|
Output only. Type of encryption. Returned: success |
|
Output only. Cloud KMS key versions that are being used to protect the database or the backup. Returned: success |
|
For Resource freshness validation (https://google.aip.dev/154). Returned: success |
|
Output only. The QuantityBasedExpiry of the backup, specified by the backup’s retention policy. Once the expiry quantity is over retention, the backup is eligible to be garbage collected. Returned: success |
|
Output only. The backup’s position among its backups with the same source cluster and type, by descending chronological order create time (i.e. newest first). Returned: success |
|
Output only. The length of the quantity-based queue, specified by the backup’s retention policy. Returned: success |
|
Output only. The time at which after the backup is eligible to be garbage collected. It is the duration specified by the backup’s retention policy, added to the backup’s createTime. Returned: success |
|
Output only. The name of the backup resource with the format: * projects/{project}/locations/{region}/backups/{backupId}. Returned: success |
|
Output only. Reconciling (https://google.aip.dev/128#reconciliation), 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. Returned: success |
|
Output only. The size of the backup in bytes. Returned: success |
|
Output only. The current state of the backup. Returned: success |
|
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. Returned: success |
|
Output only. Update time stamp. A timestamp in RFC3339 UTC “Zulu” format, with nanosecond resolution and up to nine fractional digits. Examples: “2014-10-02T15:01:23Z” and “2014-10-02T15:01:23.045123456Z”. Returned: success |