You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 14, 2020. It is now read-only.
Various postgresql resources... usually gets stuck on a postgresql_role
Terraform Configuration Files
This is the main roles module we use, which is instantiated for each database on each server (so about 15 times or so per plan/apply)
# The Schema Admin role (for each database) is specifically a way to allow other users permission to alter# tables in the given database, which, currently, are all owned by 'postgres'.resource"postgresql_role""schema_admins" {
for_each=var.databasesname="ss_${each.key}_schema_admins"inherit=falseroles=["postgres"]
}
# The Admin Role (for each database) grants read and write access to all tables in the public schema of the given databaseresource"postgresql_role""admins" {
for_each=var.databasesname="ss_${each.key}_admins"
}
# The Reader Role (for each database) grands read-only access to all tables in the public schema of the given databaseresource"postgresql_role""readers" {
for_each=var.databasesname="ss_${each.key}_readers"
}
# Grants Section (enables the access described above)resource"postgresql_grant""admin_tables" {
for_each=var.databasesdatabase=each.valuerole=postgresql_role.admins[each.key].nameschema="public"object_type="table"privileges=["SELECT", "INSERT", "DELETE", "UPDATE"]
}
resource"postgresql_grant""admin_sequences" {
for_each=var.databasesdatabase=each.valuerole=postgresql_role.admins[each.key].nameschema="public"object_type="sequence"privileges=["USAGE", "SELECT", "UPDATE"]
}
resource"postgresql_grant""read_tables" {
for_each=var.databasesdatabase=each.valuerole=postgresql_role.readers[each.key].nameschema="public"object_type="table"privileges=["SELECT"]
}
# This section defines default privileges for the 'postgres' user, so that admins and readers have access# to read/write any new tables/sequences created by the 'postgres' userresource"postgresql_default_privileges""root_admin_tables" {
for_each=var.databasesdatabase=each.valuerole=postgresql_role.admins[each.key].nameschema="public"owner=var.usernameobject_type="table"privileges=["SELECT", "INSERT", "DELETE", "UPDATE"]
}
resource"postgresql_default_privileges""root_admin_sequences" {
for_each=var.databasesdatabase=each.valuerole=postgresql_role.admins[each.key].nameschema="public"owner=var.usernameobject_type="sequence"privileges=["SELECT", "UPDATE", "USAGE"]
}
resource"postgresql_default_privileges""root_read_tables" {
for_each=var.databasesdatabase=each.valuerole=postgresql_role.readers[each.key].nameschema="public"owner=var.usernameobject_type="table"privileges=["SELECT"]
}
And then we also have some individual resources that look like this:
It should connect to all my databases in an efficient, logical way, without using up all the connections
Actual Behavior
It seems like it failed to finish the plan due to some error from the database saying that all remaining connections are reserved for superuser accounts.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
`cloud_sql_proxy -instances=...=tcp:5404 # setup cloud_sql_proxy for databases
terraform plan
Important Factoids
We're running the database on Google Cloud, and have to connect through cloud_sql_proxy (which I always start locally before running terraform)
References
None that I know of
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Terraform Version
Terraform v0.13.0-beta2
Affected Resource(s)
Various postgresql resources... usually gets stuck on a postgresql_role
Terraform Configuration Files
This is the main roles module we use, which is instantiated for each database on each server (so about 15 times or so per plan/apply)
And then we also have some individual resources that look like this:
Debug Output
https://gist.githubusercontent.com/mltsy/86ae6c5d3361d398b13f58fa433dd458/raw/89a96df95893337b8dfe031dd30fc6da7acd4dfe/tfdebug.log
Expected Behavior
It should connect to all my databases in an efficient, logical way, without using up all the connections
Actual Behavior
It seems like it failed to finish the plan due to some error from the database saying that all remaining connections are reserved for superuser accounts.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform plan
Important Factoids
We're running the database on Google Cloud, and have to connect through cloud_sql_proxy (which I always start locally before running terraform)
References
None that I know of
The text was updated successfully, but these errors were encountered: