From 302770c516976df3250798c05b7210bcd4f6ed21 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Wed, 11 Oct 2023 00:12:43 +0100 Subject: [PATCH] Updating recipes to work for eshop (#29) --- aws/sqldatabases.bicep | 2 +- local-dev/sqldatabases.bicep | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/aws/sqldatabases.bicep b/aws/sqldatabases.bicep index 173dd8f..c8a1e59 100644 --- a/aws/sqldatabases.bicep +++ b/aws/sqldatabases.bicep @@ -51,7 +51,7 @@ param allocatedStorage string = '20' param licenseModel string = 'license-included' @description('Database port') -param port string = '1433' +param port int = 1433 resource eksCluster 'AWS.EKS/Cluster@default' existing = { alias: eksClusterName diff --git a/local-dev/sqldatabases.bicep b/local-dev/sqldatabases.bicep index e25d4ed..9b97e75 100644 --- a/local-dev/sqldatabases.bicep +++ b/local-dev/sqldatabases.bicep @@ -20,6 +20,9 @@ param context object @description('Name of the SQL database. Defaults to the name of the Radius SQL resource.') param database string = context.resource.name +@description('SQL administrator username') +param adminLogin string = 'sa' + @description('SQL administrator password') @secure() #disable-next-line secure-parameter-default @@ -39,7 +42,6 @@ import kubernetes as kubernetes { namespace: context.runtime.kubernetes.namespace } -var adminUsername = 'sa' var uniqueName = 'sql-${uniqueString(context.resource.id)}' var port = 1433 @@ -133,12 +135,12 @@ output result object = { server: '${svc.metadata.name}.${svc.metadata.namespace}.svc.cluster.local' port: port database: database - username: adminUsername + username: adminLogin } secrets: { #disable-next-line outputs-should-not-contain-secrets password: adminPassword #disable-next-line outputs-should-not-contain-secrets - connectionString: 'Server=tcp:${svc.metadata.name}.${svc.metadata.namespace}.svc.cluster.local,${port};Initial Catalog=${database};User Id=${adminUsername};Password=${adminPassword};Encrypt=false' + connectionString: 'Server=tcp:${svc.metadata.name}.${svc.metadata.namespace}.svc.cluster.local,${port};Initial Catalog=${database};User Id=${adminLogin};Password=${adminPassword};Encrypt=false' } }