# terraform-google-postgresql
**Repository Path**: walrus-catalog/terraform-google-postgresql
## Basic Information
- **Project Name**: terraform-google-postgresql
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-03-15
- **Last Updated**: 2024-03-15
## Categories & Tags
**Categories**: Uncategorized
**Tags**: walrus-resource-definition, c-google, t-postgresql
## README
# Google PostgreSQL Server
Terrafom module to deploy a PostgreSQL Server on Google Cloud.
- [x] Support standalone(one read-write instance) and replication(one read-write instance and multiple read-only instances, for read write splitting).
## Usage
```hcl
module "postgresql" {
source = "..."
infrastructure = {
vpc_id = "..."
}
}
```
## Examples
- [Replication](./examples/replication)
- [Standalone](./examples/standalone)
## Contributing
Please read our [contributing guide](./docs/CONTRIBUTING.md) if you're interested in contributing to Walrus template.
## Requirements
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.0 |
| [google](#requirement\_google) | >= 3.5.0 |
| [random](#requirement\_random) | >= 3.5.1 |
## Providers
| Name | Version |
|------|---------|
| [google](#provider\_google) | >= 3.5.0 |
| [random](#provider\_random) | >= 3.5.1 |
## Modules
No modules.
## Resources
| Name | Type |
|------|------|
| [google_compute_global_address.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_global_address) | resource |
| [google_compute_network.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_network) | resource |
| [google_service_networking_connection.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/service_networking_connection) | resource |
| [google_sql_database.database](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/sql_database) | resource |
| [google_sql_database_instance.primary](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/sql_database_instance) | resource |
| [google_sql_database_instance.secondary](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/sql_database_instance) | resource |
| [google_sql_user.users](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/sql_user) | resource |
| [random_password.password](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) | resource |
| [random_string.name_suffix](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [architecture](#input\_architecture) | Specify the deployment architecture, select from standalone or replication. | `string` | `"standalone"` | no |
| [context](#input\_context) | Receive contextual information. When Walrus deploys, Walrus will inject specific contextual information into this field.
Examples:
context:| `map(any)` | `{}` | no | | [database](#input\_database) | Specify the database name. The database name must be 1-60 characters long and start with any lower letter, combined with number, or symbols: - \_.
project:
name: string
id: string
environment:
name: string
id: string
resource:
name: string
id: string
infrastructure:|
vpc_id: string, optional # the ID of the VPC where the PostgreSQL service applies. It is a fully-qualified resource name, such as projects/{project_id}/global/networks/{network_id}.
object({
vpc_id = optional(string)
}) | `{}` | no |
| [password](#input\_password) | Specify the account password. The password must be 8-128 characters long and start with any letter, number, or symbols: ! # $ % ^ & * ( ) \_ + - =.resources:|
class: string, optional # https://cloud.google.com/sql/docs/postgres/instance-settings
object({
class = optional(string, "db-f1-micro")
}) | {
"class": "db-f1-micro"
} | no |
| [storage](#input\_storage) | Specify the storage resources, select from PD\_SSD or PD\_HDD.storage:|
class: string, optional # https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/sql_database_instance#disk_type
size: number, optional # in megabyte
object({
class = optional(string, "PD_SSD")
size = optional(number, 10 * 1024)
}) | {
"class": "PD_SSD",
"size": 10240
} | no |
| [username](#input\_username) | Specify the account username. The username must be 1-32 characters long and start with lower letter, combined with number.