Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 2.94 KB

File metadata and controls

33 lines (23 loc) · 2.94 KB

Radius.Data/postgreSqlDatabases

Overview

The Radius.Data/postgreSqlDatabases resource type represents a PostgreSQL database. It allows developers to create and easily connect to a PostgreSQL database as part of their Radius applications. The developer provides the administrator username and password directly on the resource; the password property is marked x-radius-sensitive, so Radius encrypts it at rest, redacts it on reads, and injects it decrypted only into the platform's Recipe.

Developer documentation is embedded in the resource type definition YAML file and is accessible via the rad resource-type show Radius.Data/postgreSqlDatabases command.

Properties

Property Type Access Description
environment string Required The Radius Environment ID. Typically set by the rad CLI.
application string Optional The Radius Application ID.
username string Required The administrator username for the PostgreSQL database. Passed to the Recipe as {{context.resource.properties.username}}.
password string (x-radius-sensitive) Required The administrator password. Encrypted at rest, redacted on reads, and injected decrypted into the Recipe as {{context.resource.properties.password}}.
database string Optional The name of the database. Defaults to postgres_db.
size string (S, M, L) Optional The size of the PostgreSQL database. Defaults to S. The Recipe maps the size onto a concrete cloud SKU/tier.
initSql string Optional Optional SQL script executed on first initialization to create tables, indexes, and seed data.
host string Read only The host name used to connect to the database. Set from the Recipe module's output.
port integer Read only The port number used to connect to the database. Set from the Recipe module's output.

Recipe Packs

Recipes for this resource type are provided through the platform Recipe Packs at the repository root under recipe-packs/. A platform engineer configures an Environment by deploying the Recipe Pack for their target platform, which registers the Recipe for Radius.Data/postgreSqlDatabases along with the Recipes for every other Resource Type on that platform.

Platform Recipe Pack Recipe source
Azure recipe-packs/azure-aks/azure-aks.bicep Direct module — Azure Verified Module avm/res/db-for-postgre-sql/flexible-server

Using the resource type

Add a postgreSqlDatabases resource to your application and connect a container to it. Radius injects the database's connection properties into the container as environment variables named CONNECTION_<CONNECTION-NAME>_<PROPERTY-NAME> (for example CONNECTION_POSTGRES_HOST, CONNECTION_POSTGRES_PORT, and CONNECTION_POSTGRES_DATABASE). See test/app.bicep for a complete example.