exoscale_database_uri (Data Source)
Fetch Exoscale Database URI data.
Corresponding resource: exoscale_database.
!> WARNING: This datasource stores sensitive information in your Terraform state. Please be sure to correctly understand implications and how to mitigate potential risks before using it.
Example Usage
resource "exoscale_database" "my_database" {
zone = "ch-gva-2"
name = "my-database"
type = "pg"
plan = "startup-4"
maintenance_dow = "sunday"
maintenance_time = "23:00:00"
termination_protection = true
pg {
version = "13"
backup_schedule = "04:00"
ip_filter = [
"1.2.3.4/32",
"5.6.7.8/32",
]
pg_settings = jsonencode({
timezone : "Europe/Zurich"
})
}
}
data "exoscale_database_uri" "my_database" {
name = "my-database"
type = "pg"
zone = "ch-gva-2"
}
output "my_database_uri" {
value = data.exoscale_database_uri.my_database.uri
}
Schema
Required
name
(String) Name of database service to match.type
(String) The type of the database service (kafka
,mysql
,opensearch
,pg
,redis
).zone
(String) The Exoscale Zone name.
Optional
timeouts
(Block, Optional) (see below for nested schema)
Read-Only
db_name
(String) Default database namehost
(String) Database service hostnameid
(String) The ID of this resource.password
(String, Sensitive) Admin user passwordport
(Number) Database service portschema
(String) Database service connection schemauri
(String, Sensitive) Database service connection URI.username
(String) Admin user username
Nested Schema for timeouts
Optional:
read
(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as “30s” or “2h45m”. Valid time units are “s” (seconds), “m” (minutes), “h” (hours). Read operations occur during any refresh or planning operation when refresh is enabled.