Add Azure Bicep recipe for postgreSqlDatabases - #157
Conversation
Add recipes to provision PostgreSQL on Azure (Azure Database for PostgreSQL Flexible Server) and AWS (Amazon RDS for PostgreSQL): - Azure Bicep recipe with size-to-SKU mapping (S/M/L), firewall rule for Azure services, and credentials output via result.secrets - Azure Terraform recipe using azurerm provider with k8s secret-based credentials, flexible server + database + firewall rule - AWS Terraform recipe using terraform-aws-modules/rds/aws with VPC security group, k8s secret-based credentials, and size-to-instance class mapping - Updated README with new recipe entries Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com>
Replace @secure() adminUsername/adminPassword recipe parameters with the connected secrets pattern from the ACI recipe. The recipe now reads USERNAME and PASSWORD from context.resource.connections using the secretName property, which resolves to the Radius.Security/secrets resource backed by Azure Key Vault. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com>
25bcdec to
9a869cb
Compare
|
@copilot - take a look at this PR where an initSql property was added and implemented in the Kubernetes postgreSQL recipe. Please implement the same functionality in the Azure PostreSQL recipe here. |
Agent-Logs-Url: https://github.com/radius-project/resource-types-contrib/sessions/4e0a02eb-63d7-43f4-8e62-3dcaf44942fb Co-authored-by: willtsai <28876888+willtsai@users.noreply.github.com>
Added |
Agent-Logs-Url: https://github.com/radius-project/resource-types-contrib/sessions/33faff8d-1d65-46a4-b719-32407f917194 Co-authored-by: willtsai <28876888+willtsai@users.noreply.github.com>
Replace postgresServer.properties.fullyQualifiedDomainName with a manually constructed FQDN string to avoid ARM reference() calls that fail when Radius deploys the recipe as a nested template. Also use the database variable directly instead of postgresDb.name. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com>
Radius's deployment engine resolves resource IDs differently from standard ARM, causing 'not defined in the template' validation errors when dependsOn references a parent resource. ARM should infer the parent-child ordering from the slash-separated name format. Also add location to firewall rule resource. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com>
…dation Radius's deployment engine cannot resolve ARM child resource references (firewallRules, databases under flexibleServers). Replace them with a single Azure CLI deployment script that creates the firewall rule, database, and runs optional init SQL after the server is provisioned. This avoids parent-child resource type declarations entirely. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com>
Use parent: for child resources and .properties.fullyQualifiedDomainName in the output, matching the proven azure-sqlserverdb.bicep pattern. Remove the resources array from output since the SQL recipe doesn't use it. The earlier 'not defined in template' error was likely caused by the resources array referencing postgresServer.id, not by the parent: syntax itself. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com>
Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com>
Motivation
The
Radius.Data/postgreSqlDatabasesresource type only has recipes for Kubernetes-hosted PostgreSQL instances. This PR adds an Azure recipe that provisions Azure Database for PostgreSQL Flexible Server, giving platform engineers a cloud-managed option for PostgreSQL databases.Approach
The new Bicep recipe at
Data/postgreSqlDatabases/recipes/azure/bicep/azure-postgresql.bicepprovisions:en_US.utf8collationKey design decisions:
USERNAMEandPASSWORDfromcontext.resource.connectionsusing thesecretNameproperty. This works with theRadius.Security/secretsresource backed by Azure Key Vault, so no@secure()recipe parameters are needed.sizeproperty (S/M/L) to Azure SKU tiers: S -> Burstable B1ms, M -> GeneralPurpose D2s_v3, L -> MemoryOptimized E2ds_v4uniqueString(context.resource.id)to generate collision-free server names across environments.?throughout for optional context paths per Bicep best practices, and-instead of/in Azure tag namesNotes
host,port, anddatabaseinresult.values, matching the resource type's read-only properties