terraform-provider-postgresql
terraform-provider-postgresql copied to clipboard
Parsing error when statement_output is manually set to non 0
Terraform Version
❯ t version
Terraform v1.0.11
on darwin_arm64
+ provider registry.terraform.io/cyrilgdn/postgresql v1.14.0
Affected Resource(s)
- postgresql_role
Terraform Configuration Files
resource "postgresql_role" "this" {
name = var.user
login = true
password = uuid()
roles = var.roles
connection_limit = var.connection_limit
skip_reassign_owned = true
lifecycle {
ignore_changes = [password]
}
}
Expected Behavior
Able to parse the statement_timeout to milliseconds
Actual Behavior
What actually happened?
╷
│ Error: Error reading statement_timeout: strconv.Atoi: parsing "12s": invalid syntax
│
│ with module.postgresql_database_setup.postgresql_role.app[0],
│ on ../../../../modules/postgresql/database_setup/main.tf line 61, in resource "postgresql_role" "app":
│ 61: resource "postgresql_role" "app" {
│
╵
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
- Add the role via terraform
- Manually edit the statement timeout so that the output of
rolconfigis like below:
postgres=> SELECT rolconfig FROM pg_catalog.pg_roles WHERE rolname='therole';
rolconfig
-------------------------------------------------------------------------
{statement_timeout=12s,vacuum_cost_limit=2000,maintenance_work_mem=1GB}
(1 row)
terraform plan
I was able to avoid this issue by setting statement_timeout without units (in milliseconds)