Hello all
I am new to terraform and I have a maybe simple question.
I want to create schema and policies for postgres:
https://registry.terraform.io/providers/cyrilgdn/postgresql/latest/docs/resources/postgresql_schema
My question, how would be the variable look like for schema object (see sample ressource at the end) ?
I have a problem with policy blocks, have to start with policy then policy in {} and if there are more than one no comma ( maybe wrong in documentation?)
policy {
create = true
usage = true
role = "${postgresql_role.app_releng.name}"
}
policy {
create = true
usage = true
role = "${postgresql_role.app_releng.name}"
}
The whole example :
resource "postgresql_schema" "my_schema" {
name = "my_schema"
owner = "postgres"
policy {
usage = true
role = "${postgresql_role.app_www.name}"
}
# app_releng can create new objects in the schema. This is the role that
# migrations are executed as.
policy {
create = true
usage = true
role = "${postgresql_role.app_releng.name}"
}
policy {
create_with_grant = true
usage_with_grant = true
role = "${postgresql_role.app_dba.name}"
}
}