Skip to content

Commit e195fbb

Browse files
shanewxythxCode
authored andcommitted
feat: deafult network id
1 parent 4a4f754 commit e195fbb

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Please read our [contributing guide](./docs/CONTRIBUTING.md) if you're intereste
6565
| <a name="input_context"></a> [context](#input\_context) | Receive contextual information. When Walrus deploys, Walrus will inject specific contextual information into this field.<br><br>Examples:<pre>context:<br> project:<br> name: string<br> id: string<br> environment:<br> name: string<br> id: string<br> resource:<br> name: string<br> id: string</pre> | `map(any)` | `{}` | no |
6666
| <a name="input_database"></a> [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: - \_.<br>The database name cannot be PostgreSQL forbidden keyword. | `string` | `"mydb"` | no |
6767
| <a name="input_engine_version"></a> [engine\_version](#input\_engine\_version) | Specify the deployment engine version, select from https://hub.docker.com/r/bitnami/postgresql/tags. | `string` | `"16"` | no |
68-
| <a name="input_infrastructure"></a> [infrastructure](#input\_infrastructure) | Specify the infrastructure information for deploying.<br><br>Examples:<pre>infrastructure:<br> network_id: string<br> domain_suffix: string, optional</pre> | <pre>object({<br> network_id = string<br> domain_suffix = optional(string, "cluster.local")<br> })</pre> | n/a | yes |
68+
| <a name="input_infrastructure"></a> [infrastructure](#input\_infrastructure) | Specify the infrastructure information for deploying.<br><br>Examples:<pre>infrastructure:<br> network_id: string, optional<br> domain_suffix: string, optional</pre> | <pre>object({<br> network_id = optional(string, "local-walrus")<br> domain_suffix = optional(string, "cluster.local")<br> })</pre> | n/a | yes |
6969
| <a name="input_password"></a> [password](#input\_password) | Specify the account password. The password must be 8-32 characters long and start with any letter, number, or symbols: ! # $ % ^ & * ( ) \_ + - =.<br>If not specified, it will use the first 16 characters of the username md5 hash value. | `string` | `null` | no |
7070
| <a name="input_replication_readonly_replicas"></a> [replication\_readonly\_replicas](#input\_replication\_readonly\_replicas) | Specify the number of read-only replicas under the replication deployment. | `number` | `1` | no |
7171
| <a name="input_resources"></a> [resources](#input\_resources) | Specify the computing resources.<br><br>Examples:<pre>resources:<br> cpu: number, optional<br> memory: number, optional # in megabyte</pre> | <pre>object({<br> cpu = optional(number, 0.25)<br> memory = optional(number, 1024)<br> })</pre> | <pre>{<br> "cpu": 0.25,<br> "memory": 1024<br>}</pre> | no |

main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ locals {
88

99
namespace = join("-", [local.project_name, local.environment_name])
1010
domain_suffix = coalesce(var.infrastructure.domain_suffix, "cluster.local")
11+
network_id = coalesce(var.infrastructure.network_id, "local-walrus")
1112

1213
labels = {
1314
"walrus.seal.io/catalog-name" = "terraform-docker-postgresql"
@@ -29,7 +30,7 @@ locals {
2930
#
3031

3132
data "docker_network" "network" {
32-
name = var.infrastructure.network_id
33+
name = local.network_id
3334

3435
lifecycle {
3536
postcondition {

schema.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ components:
115115
type: object
116116
description: |
117117
Specify the computing resources.
118+
default:
119+
cpu: 0.25
120+
memory: 1024
118121
nullable: true
119122
properties:
120123
cpu:
@@ -145,6 +148,7 @@ components:
145148
description: Specify the configuration to seed the database at first-time
146149
creating. Seeding increases the startup time waiting and also needs proper
147150
permission, like root account.
151+
default: {}
148152
nullable: true
149153
properties:
150154
text:

variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ Specify the infrastructure information for deploying.
3535
Examples:
3636
```
3737
infrastructure:
38-
network_id: string
38+
network_id: string, optional
3939
domain_suffix: string, optional
4040
```
4141
EOF
4242
type = object({
43-
network_id = string
43+
network_id = optional(string, "local-walrus")
4444
domain_suffix = optional(string, "cluster.local")
4545
})
4646
}

0 commit comments

Comments
 (0)