Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema not being recreated if not found #487

Open
jg-par opened this issue Nov 6, 2024 · 0 comments
Open

Schema not being recreated if not found #487

jg-par opened this issue Nov 6, 2024 · 0 comments

Comments

@jg-par
Copy link

jg-par commented Nov 6, 2024

Hi there,

Thank you for opening an issue. Please provide the following information:

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.

0.14

Affected Resource(s)

Please list the resources as a list, for example:

  • postgresql_grant
  • postgresql_default_privileges

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

Debug Output

Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

What should have happened?

If schema not found, it should be recreated before checking/applying permissions

Actual Behavior

What actually happened?

provider searches for the non-existent schema and errors when it can't find it, also errors when it can't check the permissions on that schema

Error: could not find schema 'example-svc' while looking for owner
on ../../modules/rds-database-users-db-per-service/main.tf line 83, in resource "postgresql_grant" "service-crud":
 83: resource "postgresql_grant" "service-crud" {

Error: could not revoke default privileges: pq: schema "example-svc" does not exist
on ../../modules/rds-database-users-db-per-service/main.tf line 94, in resource "postgresql_default_privileges" "service-schema-default-crud":
94: resource "postgresql_default_privileges" "service-schema-default-crud" {

Error: could not revoke default privileges: pq: schema "example-svc" does not exist
on ../../modules/rds-database-users-db-per-service/main.tf line 117, in resource "postgresql_default_privileges" "service-schema-default-sequence-crud":
117: resource "postgresql_default_privileges" "service-schema-default-sequence-crud" {

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. schema gets deleted externally for whatever reason
  2. run terraform plan or terraform apply

Important Factoids

Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:

  • GH-1234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant