Skip to content

Conversation

@revmischa
Copy link

@revmischa revmischa commented Nov 2, 2025

Adds a disabled boolean parameter to the provider configuration that prevents database connections when enabled.

This is needed in my case where I create a database conditionally, and in the case the DB is not created, I don't want this provider to run at all.

When disabled=true, the provider skips connection setup and all operations.

Example usage:

provider "postgresql" {
  disabled = true
}

provider "postgresql" {
  alias = "active"

  scheme    = "awspostgres"
  host      = module.db[0].cluster_endpoint
  port      = module.db[0].port
  database  = module.db[0].database_name
  username  = "postgres"
  password  = module.db[0].postgres_master_password
}

Adds an optional boolean parameter that prevents the provider from
connecting to PostgreSQL when set to true. Useful for temporarily
disabling provider operations without removing configuration.
@revmischa revmischa marked this pull request as ready for review November 3, 2025 16:18
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

Successfully merging this pull request may close these issues.

1 participant