google::database-instance¶
Creates a database instance.
Example¶
google::database-instance database-instance-example
name: "gyro-db-test"
settings
activation-policy: "ALWAYS"
availability-type: "REGIONAL"
connector-enforcement: "NOT_REQUIRED"
data-disk-size-gb: 20
data-disk-type: 'PD_SSD'
deletion-protection-enabled: false
pricing-plan: "PER_USE"
storage-auto-resize: true
storage-auto-resize-limit: 100
tier: "db-perf-optimized-N-2"
edition: "ENTERPRISE_PLUS"
data-cache-config
data-cache-enabled: true
end
backup-configuration
enabled: true
start-time: "09:00"
transaction-log-retention-days: 14
binary-log-enabled: true
backup-retention-settings
retention-unit: "COUNT"
retained-backups: 15
end
end
user-labels: {
"example": "example"
}
ip-configuration
ipv4-enabled: true
server-ca-mode: 'GOOGLE_MANAGED_INTERNAL_CA'
ssl-mode: 'ALLOW_UNENCRYPTED_AND_ENCRYPTED'
private-network: $(external-query google::compute-network { name: "test-db" })
authorized-networks
name: "example-QA-enviroment"
value: "3.131.207.174/32"
end
end
location-preference
zone: 'us-central1-c'
secondary-zone: 'us-central1-b'
end
password-validation-policy
complexity: "COMPLEXITY_DEFAULT"
disallow-username-substring: true
enable-password-policy: true
min-length: 8
reuse-interval: 1
end
end
database-version: "MYSQL_8_0_31"
gce-zone: "us-central1-c"
secondary-gce-zone: "us-central1-b"
instance-type: "CLOUD_SQL_INSTANCE"
region: "us-central1"
backend-type: "SECOND_GEN"
scheduled-maintenance
can-reschedule: true
schedule-deadline-time: "2025-02-31T23:59:59.00Z"
start-time: "2024-12-31T23:59:59.00Z"
end
end
google::database-instance database-instance-example-replica
name: "gyro-db-test-replica"
master-instance: $(google::database-instance database-instance-example)
settings
edition: "ENTERPRISE_PLUS"
tier: "db-perf-optimized-N-2"
ip-configuration
ipv4-enabled: true
end
location-preference
zone: 'us-central1-c'
secondary-zone: 'us-central1-b'
end
end
end
Attributes¶
| Attribute | Description |
|---|---|
| backend-type | The type of the backend that is used for this instance. Valid values are SECOND_GEN or EXTERNAL. |
| database-version | The database version for this instance. Valid values are MYSQL_5_6, MYSQL_5_7, MYSQL_8_0, MYSQL_8_0_18, MYSQL_8_0_26, MYSQL_8_0_27, MYSQL_8_0_28, MYSQL_8_0_29, MYSQL_8_0_30, MYSQL_8_0_31, MYSQL_8_0_32, MYSQL_8_0_33, MYSQL_8_0_34, MYSQL_8_0_35, MYSQL_8_0_36, MYSQL_8_0_37, POSTGRES_9_6, POSTGRES_10, POSTGRES_11, POSTGRES_12, POSTGRES_13, POSTGRES_14, POSTGRES_15, SQLSERVER_2017_STANDARD, SQLSERVER_2017_ENTERPRISE, SQLSERVER_2017_EXPRESS, SQLSERVER_2017_WEB, SQLSERVER_2019_STANDARD, SQLSERVER_2019_ENTERPRISE, SQLSERVER_2019_EXPRESS, SQLSERVER_2019_WEB, SQLSERVER_2022_STANDARD, SQLSERVER_2022_ENTERPRISE, SQLSERVER_2022_EXPRESS or SQLSERVER_2022_WEB. |
| disk-encryption-configuration subresource | The disk encryption configuration for this instance.
|
| disk-encryption-status subresource | The disk encryption status for this instance.
|
| failover-replica subresource | The failover replica for this instance.
|
| region | The region for this instance. Defaults to us-central1. |
| gce-zone | The GCE zone for this instance. |
| secondary-gce-zone | The secondary GCE zone for this instance. |
| instance-type | The type of the instance. Valid values are CLOUD_SQL_INSTANCE, ON_PREMISES_INSTANCE or READ_REPLICA_INSTANCE. |
| master-instance resource | google::database-instance resource The instance which will act as primary in the replication setup. |
| name | The name of the instance. (Required) |
| on-premises-configuration subresource | The on-premises configuration for this instance.
|
| replica-configuration subresource | The configuration specific to failover replicas and read replicas.
|
| replication-cluster subresource | The replication cluster for this instance. This field can not be set on creation.
|
| root-password | The initial root password for this instance. |
| scheduled-maintenance subresource | The scheduled maintenance period for this instance.
|
| settings subresource | The settings for this instance. (Required)
|
| switch-transaction-logs-to-cloud-storage-enabled | When set to true, the point-in-time recovery log files are switched from a sata disk to Cloud Storage. |
Outputs¶
| Attribute | Description |
|---|---|
| suspension-reason list | The reason for suspension of this instance. Valid values are BILLING_ISSUE, LEGAL_ISSUE, OPERATIONAL_ISSUE and KMS_KEY_ISSUE. |
| self-link | The URI for this instance. |
| service-account-email-address | The service account email address for this instance. |
| server-ca-cert subresource | The server CA certificate for this instance.
|
| state | The state of this instance. |
| maintenance-version | The maintenance version for this instance. |
| available-maintenance-versions list | The list of available maintenance versions for this instance. |
| create-time | The current create time for this instance. |
| database-installed-version | The current database version running on the instance including minor version |
| dns-name | The DNS name for this instance. |
| psc-service-attachment-link | The link to the PSC service attachment for this instance. |
| upgradable-database-versions list subresource | The list of upgradable database versions for this instance.
|
| write-endpoint | The write endpoint for this instance. |
| connection-name | The connection name of the instance to be used in connection strings. |
| gemini-config subresource | The Gemini instance configuration for this instance.
|
| out-of-disk-report subresource | The out of disk report for this instance.
|
| replica-names list | The list of replica names for this instance. |
| satisfies-pzi | When set to true, the instance satisfies PZI. |
| satisfies-pzs | When set to true, the instance satisfies PZS. |
| sql-network-architecture | The SQL network architecture for this instance. |
| ip-addresses list subresource | The list of IP addresses for this instance. |