# AlloyDBBackup

| **Property** | **Value** |
|---|---|
| Google Cloud Service Name | AlloyDB for PostgreSQL |
| Google Cloud Service Documentation | [/alloydb/docs/](https://docs.cloud.google.com/alloydb/docs) |
| Google Cloud REST Resource Name | v1.projects.locations.backups |
| Google Cloud REST Resource Documentation | [/alloydb/docs/reference/rest/v1/projects.locations.clusters](https://docs.cloud.google.com/alloydb/docs/reference/rest/v1/projects.locations.backups) |
| Config Connector Resource Short Names | alloydbbackup gcpalloydbbackup gcpalloydbbackups |
| Config Connector Service Name | alloydb.googleapis.com |
| Config Connector Resource Fully Qualified Name | alloydbbackups.alloydb.cnrm.cloud.google.com |
| Can Be Referenced by IAMPolicy/IAMPolicyMember | No |
| Config Connector Default Average Reconcile Interval In Seconds | 600 |

## Custom Resource Definition Properties

### Spec

#### Schema

    clusterNameRef:
      external: string
      name: string
      namespace: string
    description: string
    encryptionConfig:
      kmsKeyName: string
    location: string
    projectRef:
      external: string
      name: string
      namespace: string
    resourceID: string

| Fields ||
|---|---|
| `clusterNameRef` *Required* | `object` The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}). |
| `clusterNameRef.external` *Optional* | `string` A reference to an externally managed AlloyDBCluster resource. Should be in the format "projects/{{projectID}}/locations/{{location}}/clusters/{{clusterID}}". |
| `clusterNameRef.name` *Optional* | `string` The name of an AlloyDBCluster resource. |
| `clusterNameRef.namespace` *Optional* | `string` The namespace of an AlloyDBCluster resource. |
| `description` *Optional* | `string` Immutable. User-provided description of the backup. |
| `encryptionConfig` *Optional* | `object` EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). |
| `encryptionConfig.kmsKeyName` *Optional* | `string` Immutable. 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\]. |
| `location` *Required* | `string` Immutable. The location where the alloydb backup should reside. |
| `projectRef` *Required* | `object` The project that this resource belongs to. |
| `projectRef.external` *Optional* | `string` The \`projectID\` field of a project, when not managed by Config Connector. |
| `projectRef.name` *Optional* | `string` The \`name\` field of a \`Project\` resource. |
| `projectRef.namespace` *Optional* | `string` The \`namespace\` field of a \`Project\` resource. |
| `resourceID` *Optional* | `string` Immutable. Optional. The backupId of the resource. Used for creation and acquisition. When unset, the value of \`metadata.name\` is used as the default. |

### Status

#### Schema

    conditions:
    - lastTransitionTime: string
      message: string
      reason: string
      status: string
      type: string
    createTime: string
    encryptionInfo:
    - encryptionType: string
      kmsKeyVersions:
      - string
    etag: string
    externalRef: string
    name: string
    observedGeneration: integer
    reconciling: boolean
    state: string
    uid: string
    updateTime: string

| Fields ||
|---|---|
| `conditions` | `list (object)` Conditions represent the latest available observations of the AlloyDBBackup's current state. |
| `conditions[]` | `object` <br /> |
| `conditions[].lastTransitionTime` | `string` Last time the condition transitioned from one status to another. |
| `conditions[].message` | `string` Human-readable message indicating details about last transition. |
| `conditions[].reason` | `string` Unique, one-word, CamelCase reason for the condition's last transition. |
| `conditions[].status` | `string` Status is the status of the condition. Can be True, False, Unknown. |
| `conditions[].type` | `string` Type is the type of the condition. |
| `createTime` | `string` Time the Backup was created in UTC. |
| `encryptionInfo` | `list (object)` EncryptionInfo describes the encryption information of a cluster or a backup. |
| `encryptionInfo[]` | `object` <br /> |
| `encryptionInfo[].encryptionType` | `string` Output only. Type of encryption. |
| `encryptionInfo[].kmsKeyVersions` | `list (string)` Output only. Cloud KMS key versions that are being used to protect the database or the backup. |
| `encryptionInfo[].kmsKeyVersions[]` | `string` <br /> |
| `etag` | `string` A hash of the resource. |
| `externalRef` | `string` A unique specifier for the AlloyDBBackup resource in Google Cloud. |
| `name` | `string` Output only. The name of the backup resource with the format: \* projects/{project}/locations/{region}/backups/{backupId}. |
| `observedGeneration` | `integer` ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource. |
| `reconciling` | `boolean` 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. |
| `state` | `string` The current state of the backup. |
| `uid` | `string` 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. |
| `updateTime` | `string` Time the Backup was updated in UTC. |

## Sample YAML(s)

### Typical Use Case

    apiVersion: alloydb.cnrm.cloud.google.com/v1beta1
    kind: AlloyDBBackup
    metadata:
      name: alloydbbackup-sample
    spec:
      clusterNameRef: 
        external: "projects/${PROJECT_ID?}/locations/us-central1/clusters/alloydbbackup-dep"
      location: us-central1
      encryptionConfig:
        kmsKeyNameRef: 
          external: "projects/${PROJECT_ID?}/locations/us-central1/keyRings/alloydbbackup-dep/cryptoKeys/alloydbbackup-dep"
      projectRef:
        external: ${PROJECT_ID?}
    ---
    apiVersion: alloydb.cnrm.cloud.google.com/v1beta1
    kind: AlloyDBCluster
    metadata:
      name: alloydbbackup-dep
    spec:
      location: us-central1
      networkConfig:
        networkRef: 
          name: alloydbbackup-dep
      projectRef:
        external: ${PROJECT_ID?}
    ---
    apiVersion: alloydb.cnrm.cloud.google.com/v1beta1
    kind: AlloyDBInstance
    metadata:
      name: alloydbbackup-dep
    spec:
      clusterRef: 
        name: alloydbbackup-dep
      instanceTypeRef:
        name: alloydbbackup-dep
    ---
    apiVersion: compute.cnrm.cloud.google.com/v1beta1
    kind: ComputeAddress
    metadata:
      name: alloydbbackup-dep
    spec:
      location: global
      addressType: INTERNAL
      networkRef:
        name: alloydbbackup-dep
      prefixLength: 16
      purpose: VPC_PEERING
    ---
    apiVersion: compute.cnrm.cloud.google.com/v1beta1
    kind: ComputeNetwork
    metadata:
      name: alloydbbackup-dep
    ---
    apiVersion: iam.cnrm.cloud.google.com/v1beta1
    kind: IAMPartialPolicy
    metadata:
      name: alloydbbackup-dep
    spec:
      resourceRef:
        apiVersion: kms.cnrm.cloud.google.com/v1beta1
        kind: KMSCryptoKey
        name: alloydbbackup-dep
      bindings:
        - role: roles/cloudkms.cryptoKeyEncrypterDecrypter
          members:
            - member: serviceAccount:service-${PROJECT_NUMBER?}@gcp-sa-alloydb.iam.gserviceaccount.com
    ---
    apiVersion: kms.cnrm.cloud.google.com/v1beta1
    kind: KMSCryptoKey
    metadata:
      labels:
        source: kcc-alloydbbackup-sample
      name: alloydbbackup-dep
    spec:
      keyRingRef:
        name: alloydbbackup-dep
    ---
    apiVersion: kms.cnrm.cloud.google.com/v1beta1
    kind: KMSKeyRing
    metadata:
      name: alloydbbackup-dep
    spec:
      location: us-central1
    ---
    apiVersion: servicenetworking.cnrm.cloud.google.com/v1beta1
    kind: ServiceNetworkingConnection
    metadata:
      name: alloydbbackup-dep
    spec:
      networkRef:
        name: alloydbbackup-dep
      reservedPeeringRanges:
      - external: alloydbbackup-dep
      service: servicenetworking.googleapis.com

> [!NOTE]
> **Note:** If you have any trouble with instantiating the resource, refer to [Troubleshoot Config Connector](https://docs.cloud.google.com/config-connector/docs/troubleshooting).