diff --git a/README.md b/README.md index 8a0a2d64..39de45c6 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This intent of this fork is to maintain a working version of the provider while This repository aims to be up to date with the original one, and also to add some features that are needed for our use cases. We re-integrated the following PRs that were open on the original repository: -- [Use object-level locks for concurrent grants to improve parallelism](https://github.com/cyrilgdn/terraform-provider-postgresql/pull/595) +- [Use object-level locks for concurrent grants to improve parallelism](https://github.com/cyrilgdn/terraform-provider-postgresql/pull/595) ✅ - [Support role configuration parameters](https://github.com/cyrilgdn/terraform-provider-postgresql/pull/305) --- diff --git a/examples/issues/178/dev.tfrc b/examples/issues/178/dev.tfrc new file mode 100644 index 00000000..53cb5de4 --- /dev/null +++ b/examples/issues/178/dev.tfrc @@ -0,0 +1,6 @@ +provider_installation { + dev_overrides { + "cyrilgdn/postgresql" = "../../../" + } + direct {} +} diff --git a/examples/issues/178/locals.tf b/examples/issues/178/locals.tf new file mode 100644 index 00000000..1c78652e --- /dev/null +++ b/examples/issues/178/locals.tf @@ -0,0 +1,4 @@ +locals { + read_only_users = toset([for i in range(var.user_ro_count) : "user_ro_${i}"]) + read_write_users = toset([for i in range(var.user_rw_count) : "user_rw_${i}"]) +} diff --git a/examples/issues/178/main.tf b/examples/issues/178/main.tf new file mode 100644 index 00000000..4b2db2c7 --- /dev/null +++ b/examples/issues/178/main.tf @@ -0,0 +1,191 @@ +terraform { + required_providers { + docker = { + source = "kreuzwerker/docker" + version = ">= 3.0.2" + } + postgresql = { + source = "cyrilgdn/postgresql" + version = ">= 1.25" + } + } +} + +provider "docker" { + host = var.docker_host +} + +resource "docker_image" "postgres" { + name = var.postgres_image + keep_locally = var.keep_image +} + +resource "docker_container" "postgres" { + image = docker_image.postgres.image_id + name = "postgres" + wait = true + ports { + internal = var.POSTGRES_PORT + external = var.POSTGRES_PORT + } + env = [ + "POSTGRES_PASSWORD=${var.POSTGRES_PASSWORD}" + ] + healthcheck { + test = ["CMD-SHELL", "pg_isready"] + interval = "5s" + timeout = "5s" + retries = 5 + start_period = "2s" + } + upload { + file = "/docker-entrypoint-initdb.d/mock-tables.sql" + content = <