alloydb-create-instance

The “alloydb-create-instance” tool creates a new AlloyDB instance within a specified cluster.

About

The alloydb-create-instance tool creates a new AlloyDB instance (PRIMARY or READ_POOL) within a specified cluster. It is compatible with alloydb-admin source. This tool provisions a new instance with a public IP address.

Permissions & APIs Required: Before using, ensure the following on your GCP project:

  1. The AlloyDB API is enabled.

  2. The user or service account executing the tool has one of the following IAM roles:

    • roles/alloydb.admin (the AlloyDB Admin predefined IAM role)
    • roles/owner (the Owner basic IAM role)
    • roles/editor (the Editor basic IAM role)

The tool takes the following input parameters:

ParameterTypeDescriptionRequired
projectstringThe GCP project ID where the cluster exists.Yes
locationstringThe GCP location where the cluster exists (e.g., us-central1).Yes
clusterstringThe ID of the existing cluster to add this instance to.Yes
instancestringA unique identifier for the new AlloyDB instance.Yes
instanceTypestringThe type of instance. Valid values are: PRIMARY and READ_POOL. Default: PRIMARYNo
displayNamestringAn optional, user-friendly name for the instance.No
nodeCountintThe number of nodes for a read pool. Required only if instanceType is READ_POOL. Default: 1No

Note The tool sets the password.enforce_complexity database flag to on, requiring new database passwords to meet complexity rules.

Example

tools:
  create_instance:
    kind: alloydb-create-instance
    source: alloydb-admin-source
    description: Use this tool to create a new AlloyDB instance within a specified cluster.

Reference

fieldtyperequireddescription
kindstringtrueMust be alloydb-create-instance.
sourcestringtrueThe name of an alloydb-admin source.
descriptionstringfalseDescription of the tool that is passed to the agent.