Skip to content

provider.url: Unmarshaling unknown values is not supported / postpone database connection #80

@adaptivegarage

Description

@adaptivegarage

Hi there,

Terraform Version

1.3.2

Affected Resource(s)

  • sql provider configuration itself

Terraform Configuration Files

provider "sql" {
    url = "postgres://${local.postgresql.login}:${local.postgresql.password}@${local.postgresql.host}:${local.postgresql.port}/postgres?sslmode=${local.postgresql.sslmode}"
}

Expected Behavior

The provider should have been configured.

Actual Behavior

The provider fails to pass configuration invoking this error:

 Error: Plugin error
│ 
│ The plugin returned an unexpected error from plugin6.(*GRPCProvider).ConfigureProvider: rpc error: code = Unknown desc = ConfigureProvider - unable to read url:
│ unmarshaling unknown values is not supported

Steps to Reproduce

Use any variable in the url parameter with a value not known during the planning phase.

Important Factoids

The connection string cannot be passed in advance in my case because the PostgreSQL server is provisioned during apply phase.
Postgresql provider (https://registry.terraform.io/providers/cyrilgdn/postgresql/) is ok with it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions