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

access_token

string

The access token used to authenticate.

auth_kind

string / required

The type of credential used.

Choices:

  • "accesstoken"

  • "application"

  • "machineaccount"

  • "serviceaccount"

env_type

string

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.

filters

list / elements=string

A list of filter expression strings used to filter the resources returned by the API.

Each string is a filter expression (e.g. some_field = "SOME_VALUE").

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.

location

string / required

The location where the alloydb cluster should reside.

project

string

The Google Cloud Platform project to use.

scopes

list / elements=string

Array of scopes to be used.

service_account_contents

jsonarg

The contents of a Service Account JSON file,

either in a dictionary or as a JSON string that represents it.

service_account_email

string

An optional service account email address if machineaccount is

selected and the user does not wish to use the default email.

service_account_file

path

The path of a Service Account JSON file if serviceaccount

is selected as type.

Notes

Note

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

changed

boolean

Whether any changes were made (always false for info modules).

Returned: always

resources

list / elements=dictionary

List of Alloydb.Cluster resources matching the supplied filters. May be empty, contain a single resource, or multiple resources.

Returned: always

annotations

dictionary

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

automatedBackupPolicy

dictionary

The automated backup policy for this cluster.

AutomatedBackupPolicy is disabled by default.

Returned: when set

backupWindow

string

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

enabled

boolean

Whether automated backups are enabled.

Returned: when set

encryptionConfig

dictionary

EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key).

Returned: when set

kmsKeyName

string

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

dictionary

Labels to apply to backups created using this configuration.

Returned: when set

location

string

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

quantityBasedRetention

dictionary

Quantity-based Backup retention policy to retain recent backups.

Conflicts with ‘time_based_retention’, both can’t be set together.

Returned: when set

count

integer

The number of backups to retain.

Returned: when set

timeBasedRetention

dictionary

Time-based Backup retention policy.

Conflicts with ‘quantity_based_retention’, both can’t be set together.

Returned: when set

retentionPeriod

string

The retention period.

A duration in seconds with up to nine fractional digits, terminated by ‘s’.

Example: “3.5s”.

Returned: when set

weeklySchedule

dictionary

Weekly schedule for the Backup.

Returned: when set

daysOfWeek

list / elements=string

The days of the week to perform a backup.

At least one day of the week must be provided.

Returned: when set

startTimes

list / elements=dictionary

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

integer

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

integer

Minutes of hour of day.

Currently, only the value 0 is supported.

Returned: when set

nanos

integer

Fractions of seconds in nanoseconds.

Currently, only the value 0 is supported.

Returned: when set

seconds

integer

Seconds of minutes of the time.

Currently, only the value 0 is supported.

Returned: when set

backupdrBackupSource

dictionary

Cluster created from a BackupDR backup.

Returned: success

backup

string

The name of the BackupDR backup resource.

Returned: when set

backupSource

dictionary

Cluster created from backup.

Returned: success

backupName

string

The name of the backup resource.

Returned: when set

clusterType

string

The type of cluster.

If not set, defaults to PRIMARY.

Returned: when set

continuousBackupConfig

dictionary

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

enabled

boolean

Whether continuous backup recovery is enabled.

If not set, defaults to true.

Returned: when set

encryptionConfig

dictionary

EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key).

Returned: when set

kmsKeyName

string

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

recoveryWindowDays

integer

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

dictionary

ContinuousBackupInfo describes the continuous backup properties of a cluster.

Returned: success

earliestRestorableTime

string

The earliest restorable time that can be restored to.

Output only field.

Returned: success

enabledTime

string

When ContinuousBackup was most recently enabled.

Set to null if ContinuousBackup is not enabled.

Returned: success

encryptionInfo

dictionary

Output only.

The encryption information for the WALs and backups required for ContinuousBackup.

Returned: success

encryptionType

string

Output only.

Type of encryption.

Returned: success

kmsKeyVersions

list / elements=string

Output only.

Cloud KMS key versions that are being used to protect the database or the backup.

Returned: success

schedule

list / elements=string

Days of the week on which a continuous backup is taken.

Output only field.

Ignored if passed into the request.

Returned: success

databaseVersion

string

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

dataplexConfig

dictionary

Configuration for Dataplex integration.

This is an optional field.

If not set, Dataplex integration will be enabled by default.

Returned: when set

enabled

boolean

Indicates whether Dataplex integration is enabled for the cluster.

Returned: always

displayName

string

User-settable and human-readable display name for the Cluster.

Returned: when set

encryptionConfig

dictionary

EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key).

Returned: when set

kmsKeyName

string

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

dictionary

EncryptionInfo describes the encryption information of a cluster or a backup.

Returned: success

encryptionType

string

Output only.

Type of encryption.

Returned: success

kmsKeyVersions

list / elements=string

Output only.

Cloud KMS key versions that are being used to protect the database or the backup.

Returned: success

etag

string

For Resource freshness validation (https://google.aip.dev/154).

Returned: when set

labels

dictionary

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

dictionary

MaintenanceUpdatePolicy defines the policy for system updates.

Returned: when set

maintenanceWindows

list / elements=dictionary

Preferred windows to perform maintenance.

Currently limited to 1.

Returned: when set

day

string

Preferred day of the week for maintenance, e.g.

MONDAY, TUESDAY, etc.

Returned: always

startTime

dictionary

Preferred time to start the maintenance operation on the specified day.

Maintenance will start within 1 hour of this time.

Returned: always

hours

integer

Hours of day in 24 hour format.

Should be from 0 to 23.

Returned: always

minutes

integer

Minutes of hour of day.

Currently, only the value 0 is supported.

Returned: when set

nanos

integer

Fractions of seconds in nanoseconds.

Currently, only the value 0 is supported.

Returned: when set

seconds

integer

Seconds of minutes of the time.

Currently, only the value 0 is supported.

Returned: when set

migrationSource

dictionary

Cluster created via DMS migration.

Returned: success

hostPort

string

The host and port of the on-premises instance in host:port format.

Returned: when set

referenceId

string

Place holder for the external source identifier(e.g DMS job name) that created the cluster.

Returned: when set

sourceType

string

Type of migration source.

Returned: when set

name

string

The name of the cluster resource.

Returned: success

networkConfig

dictionary

Metadata related to network configuration.

Returned: when set

allocatedIpRange

string

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

network

string

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

pscConfig

dictionary

Configuration for Private Service Connect (PSC) for the cluster.

Returned: when set

pscEnabled

boolean

Create an instance that allows connections from Private Service Connect endpoints to the instance.

Returned: when set

serviceOwnedProjectNumber

integer

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

reconciling

boolean

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

secondaryConfig

dictionary

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

primaryClusterName

string

Name of the primary cluster must be in the format ‘projects/{project}/locations/{location}/clusters/{cluster_id}’.

Returned: always

state

string

Output only.

The current serving state of the cluster.

Returned: success

subscriptionType

string

The subscrition type of cluster.

Returned: when set

trialMetadata

dictionary

Contains information and all metadata related to TRIAL clusters.

Returned: success

endTime

string

End time of the trial cluster.

Returned: when set

graceEndTime

string

Grace end time of the trial cluster.

Returned: when set

startTime

string

Start time of the trial cluster.

Returned: when set

upgradeTime

string

Upgrade time of the trial cluster to standard cluster.

Returned: when set

uid

string

The system-generated UID of the resource.

Returned: success

Authors

  • Google Inc. (@googlecloudplatform)