Terraform PostgreSQL Provider
Jump to navigation
Jump to search
Arguments
- superuser = false # AWS RDS
Resources (~ 15)[edit]
Examples[edit]
https://github.com/hashicorp/terraform/issues/30559#issuecomment-1045141735
terraform {
required_version = ">= 1.1.6"
required_providers {
postgresql = { # This line is what needs to change.
source = "cyrilgdn/postgresql"
}
}
}
provider "postgresql" {
host = "test"
port = 5432
database = "test"
username = "test"
password = "test"
sslmode = "require"
connect_timeout = 15
}
Using SOPS:
provider "postgresql" {
database = "postgres"
host = aws_db_instance.rds.address
superuser = false
password = data.sops_file.rds_credentials.data["rds.admin.password"]
username = data.sops_file.rds_credentials.data["rds.admin.username"]
}
Errors[edit]
terraform init Initializing the backend... Initializing provider plugins... - Finding latest version of hashicorp/postgresql... ╷ │ Error: Failed to query available provider packages │ │ Could not retrieve the list of available versions for provider hashicorp/postgresql: provider registry registry.terraform.io does not have a │ provider named registry.terraform.io/hashicorp/postgresql │ │ Did you intend to use cyrilgdn/postgresql? If so, you must specify that source address in each module which requires that provider. To see w hich │ modules are currently depending on hashicorp/postgresql, run the following command: │ terraform providers ╵
Related[edit]
See also[edit]
terraform init[-upgrade | -reconfigure | -backend-config | -get-plugins=false | -verify-plugins=false ],--help, Execution examples, Execution with errors,~/.terraformrc, required_providers, provider.tf- Terraform PostgreSQL Provider, cyrilgdn,
postgresql_role, postgresql_grant, postgresql_default_privileges
Advertising: