# terraform-docker-postgresql
**Repository Path**: walrus-catalog/terraform-docker-postgresql
## Basic Information
- **Project Name**: terraform-docker-postgresql
- **Description**: Deploy containerized PostgreSQL service on Docker.
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-01-05
- **Last Updated**: 2024-02-05
## Categories & Tags
**Categories**: Uncategorized
**Tags**: walrus-resource-definition, t-postgresql, c-docker
## README
# Docker PostgreSQL Service
Terraform module which deploys PostgreSQL service on Docker. Powered by [Bitnami PostgreSQL Docker Image](https://hub.docker.com/r/bitnami/postgresql).
- [x] Support standalone(one read-write instance) and replication(one read-write instance and multiple read-only instances, for read write splitting) architecture.
- [x] Support seeding database at first-time creating.
## Usage
```hcl
module "example" {
source = "..."
infrastructure = {
network_id = "..."
}
architecture = "replication"
engine_version = "15.0"
}
```
## Examples
- [Standalone](./examples/standalone)
- [Replication](./examples/replication)
## 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 |
| [docker](#requirement\_docker) | >= 3.0.2 |
## Providers
| Name | Version |
|------|---------|
| [docker](#provider\_docker) | >= 3.0.2 |
## Modules
| Name | Source | Version |
|------|--------|---------|
| [master](#module\_master) | github.com/walrus-catalog/terraform-docker-containerservice | v0.2.1&depth=1 |
| [slave](#module\_slave) | github.com/walrus-catalog/terraform-docker-containerservice | v0.2.1&depth=1 |
## Resources
| Name | Type |
|------|------|
| [docker_network.network](https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs/data-sources/network) | data source |
## 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 2-64 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:|
network_id: string, optional
domain_suffix: string, optional
object({
network_id = optional(string, "local-walrus")
domain_suffix = optional(string, "cluster.local")
}) | {
"domain_suffix": "cluster.local",
"network_id": "local-walrus"
} | no |
| [password](#input\_password) | Specify the account password. The password must be 8-32 characters long and start with any letter, number, or symbols: ! # $ % ^ & * ( ) \_ + - =.resources:|
cpu: number, optional
memory: number, optional # in megabyte
object({
cpu = optional(number, 0.25)
memory = optional(number, 1024)
}) | {
"cpu": 0.25,
"memory": 1024
} | no |
| [seeding](#input\_seeding) | Specify the configuration to seed the database at first-time creating.seeding:|
type: none/url/text
url:
location: string
text:
content: string
object({
type = optional(string, "none")
url = optional(object({
location = string
}))
text = optional(object({
content = string
}))
}) | `{}` | no |
| [username](#input\_username) | Specify the account username. The username must be 2-16 characters long and start with lower letter, combined with number, or symbol: \_.