google.cloud.gcp_alloydb_cluster_info module – List Alloydb.Cluster resources
Note
This module is part of the google.cloud collection (version 1.15.0).
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_cluster_info.
Synopsis
A managed alloydb cluster.
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. |
|
The type of credential used. Choices:
|
|
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. |
|
A list of filter expression strings used to filter the resources returned by the API. Each string is a filter expression (e.g. Multiple expressions are combined with a logical AND. Refer to the filter topic documentation https://cloud.google.com/sdk/gcloud/reference/topic/filters. Refer to the AIP-160 filter syntax documentation https://google.aip.dev/160. |
|
The location where the alloydb cluster 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. |
Notes
Note
API Reference: https://cloud.google.com/alloydb/docs/reference/rest/v1/projects.locations.clusters/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: List all gcp_alloydb_cluster_info resources
google.cloud.gcp_alloydb_cluster_info:
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
register: result
- name: List gcp_alloydb_cluster_info resources matching given filters
google.cloud.gcp_alloydb_cluster_info:
filters:
- display_name = "my-resource"
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
register: result
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Whether any changes were made (always false for info modules). Returned: always |
|
List of Alloydb.Cluster resources matching the supplied filters. May be empty, contain a single resource, or multiple resources. Returned: always |
|
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” }. **Note**: This field is non-authoritative, and will only manage the annotations present in your configuration. Returned: when set |
|
The automated backup policy for this cluster. AutomatedBackupPolicy is disabled by default. Returned: when set |
|
The length of the time window during which a backup can be taken. If a backup does not succeed within this time window, it will be canceled and considered failed. The backup window must be at least 5 minutes long. There is no upper bound on the window. If not set, it will default to 1 hour. A duration in seconds with up to nine fractional digits, terminated by ‘s’. Example: “3.5s”. Returned: when set |
|
Whether automated backups are enabled. Returned: when set |
|
EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). Returned: when set |
|
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]. Returned: when set |
|
Labels to apply to backups created using this configuration. Returned: when set |
|
The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster. Returned: when set |
|
Quantity-based Backup retention policy to retain recent backups. Conflicts with ‘time_based_retention’, both can’t be set together. Returned: when set |
|
The number of backups to retain. Returned: when set |
|
Time-based Backup retention policy. Conflicts with ‘quantity_based_retention’, both can’t be set together. Returned: when set |
|
The retention period. A duration in seconds with up to nine fractional digits, terminated by ‘s’. Example: “3.5s”. Returned: when set |
|
Weekly schedule for the Backup. Returned: when set |
|
The days of the week to perform a backup. At least one day of the week must be provided. Returned: when set |
|
The times during the day to start a backup. At least one start time must be provided. The start times are assumed to be in UTC and to be an exact hour (e.g., 04:00:00). Returned: always |
|
Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value “24:00:00” for scenarios like business closing time. Returned: when set |
|
Minutes of hour of day. Currently, only the value 0 is supported. Returned: when set |
|
Fractions of seconds in nanoseconds. Currently, only the value 0 is supported. Returned: when set |
|
Seconds of minutes of the time. Currently, only the value 0 is supported. Returned: when set |
|
Cluster created from a BackupDR backup. Returned: success |
|
The name of the BackupDR backup resource. Returned: when set |
|
Cluster created from backup. Returned: success |
|
The name of the backup resource. Returned: when set |
|
The type of cluster. If not set, defaults to PRIMARY. Returned: when set |
|
The continuous backup config for this cluster. If no policy is provided then the default policy will be used. The default policy takes one backup a day and retains backups for 14 days. Returned: when set |
|
Whether continuous backup recovery is enabled. If not set, defaults to true. Returned: when set |
|
EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). Returned: when set |
|
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]. Returned: when set |
|
The numbers of days that are eligible to restore from using PITR. To support the entire recovery window, backups and logs are retained for one day more than the recovery window. If not set, defaults to 14 days. Returned: when set |
|
ContinuousBackupInfo describes the continuous backup properties of a cluster. Returned: success |
|
The earliest restorable time that can be restored to. Output only field. Returned: success |
|
When ContinuousBackup was most recently enabled. Set to null if ContinuousBackup is not enabled. Returned: success |
|
Output only. The encryption information for the WALs and backups required for ContinuousBackup. 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 |
|
Days of the week on which a continuous backup is taken. Output only field. Ignored if passed into the request. Returned: success |
|
The database engine major version. This is an optional field and it’s populated at the Cluster creation time. Note: Changing this field to a higer version results in upgrading the AlloyDB cluster which is an irreversible change. Returned: when set |
|
Configuration for Dataplex integration. This is an optional field. If not set, Dataplex integration will be enabled by default. Returned: when set |
|
Indicates whether Dataplex integration is enabled for the cluster. Returned: always |
|
User-settable and human-readable display name for the Cluster. Returned: when set |
|
EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). Returned: when set |
|
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]. Returned: when set |
|
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: when set |
|
User-defined labels for the alloydb cluster. **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. Returned: when set |
|
MaintenanceUpdatePolicy defines the policy for system updates. Returned: when set |
|
Preferred windows to perform maintenance. Currently limited to 1. Returned: when set |
|
Preferred day of the week for maintenance, e.g. MONDAY, TUESDAY, etc. Returned: always |
|
Preferred time to start the maintenance operation on the specified day. Maintenance will start within 1 hour of this time. Returned: always |
|
Hours of day in 24 hour format. Should be from 0 to 23. Returned: always |
|
Minutes of hour of day. Currently, only the value 0 is supported. Returned: when set |
|
Fractions of seconds in nanoseconds. Currently, only the value 0 is supported. Returned: when set |
|
Seconds of minutes of the time. Currently, only the value 0 is supported. Returned: when set |
|
Cluster created via DMS migration. Returned: success |
|
The host and port of the on-premises instance in host:port format. Returned: when set |
|
Place holder for the external source identifier(e.g DMS job name) that created the cluster. Returned: when set |
|
Type of migration source. Returned: when set |
|
The name of the cluster resource. Returned: success |
|
Metadata related to network configuration. Returned: when set |
|
The name of the allocated IP range for the private IP AlloyDB cluster. For example: “google-managed-services-default”. If set, the instance IPs for this cluster will be created in the allocated range. Returned: when set |
|
The resource link for the VPC network in which cluster resources are created and from which they are accessible via Private IP. The network must belong to the same project as the cluster. It is specified in the form: “projects/{projectNumber}/global/networks/{network_id}”. Returned: when set |
|
Configuration for Private Service Connect (PSC) for the cluster. Returned: when set |
|
Create an instance that allows connections from Private Service Connect endpoints to the instance. Returned: when set |
|
The project number that needs to be allowlisted on the network attachment to enable outbound connectivity, if the network attachment is configured to ACCEPT_MANUAL connections. In case the network attachment is configured to ACCEPT_AUTOMATIC, this project number does not need to be allowlisted explicitly. Returned: success |
|
Output only. Reconciling (https://google.aip.dev/128#reconciliation). Set to true if the current state of Cluster does not match the user’s intended state, and the service is actively updating the resource to reconcile them. This can happen due to user-triggered updates or system actions like failover or maintenance. Returned: success |
|
Configuration of the secondary cluster for Cross Region Replication. This should be set if and only if the cluster is of type SECONDARY. Returned: when set |
|
Name of the primary cluster must be in the format ‘projects/{project}/locations/{location}/clusters/{cluster_id}’. Returned: always |
|
Output only. The current serving state of the cluster. Returned: success |
|
The subscrition type of cluster. Returned: when set |
|
Contains information and all metadata related to TRIAL clusters. Returned: success |
|
End time of the trial cluster. Returned: when set |
|
Grace end time of the trial cluster. Returned: when set |
|
Start time of the trial cluster. Returned: when set |
|
Upgrade time of the trial cluster to standard cluster. Returned: when set |
|
The system-generated UID of the resource. Returned: success |