From d64c893d6b3861430af9e42fb8f208b4b8fec6c1 Mon Sep 17 00:00:00 2001 From: Lyle Xu Date: Wed, 10 Apr 2024 15:02:21 +0800 Subject: [PATCH] split password for eventbus and postgre --- Environments/eShop/main.bicep | 21 ++++++++------------- Environments/eShop/manifest.yaml | 14 ++++++++++++++ Environments/eShop/resources.bicep | 11 ++++++++--- 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/Environments/eShop/main.bicep b/Environments/eShop/main.bicep index 7cf6026e..5dcd9d62 100644 --- a/Environments/eShop/main.bicep +++ b/Environments/eShop/main.bicep @@ -8,18 +8,12 @@ param environmentName string param location string = resourceGroup().location @secure() -@metadata({azd: { - type: 'inputs' - autoGenerate: { - eventbus: { - password: { len: 10 } - } - postgres: { - password: { len: 10 } - } - }} -}) -param inputs object +@minLength(10) +param eventbusPassword string + +@secure() +@minLength(10) +param postgresPassword string var tags = { 'azd-env-name': environmentName @@ -28,9 +22,10 @@ var tags = { module resources 'resources.bicep' = { name: 'resources' params: { + eventbusPassword: eventbusPassword + postgresPassword: postgresPassword location: location tags: tags - inputs: inputs } } diff --git a/Environments/eShop/manifest.yaml b/Environments/eShop/manifest.yaml index d577f2e2..727737e6 100644 --- a/Environments/eShop/manifest.yaml +++ b/Environments/eShop/manifest.yaml @@ -12,9 +12,23 @@ parameters: type: "string" required: true +- id: "eventbusPassword" + name: "Eventbus Password" + description: "Password for the Eventbus" + type: "string" + required: true + +- id: "postgresPassword" + name: "Postgres Password" + description: "Password for the Postgres" + type: "string" + required: true + - id: "location" name: "Region (e.g. eastus)" description: "Region" type: "string" required: false default: "eastus" + + diff --git a/Environments/eShop/resources.bicep b/Environments/eShop/resources.bicep index 7730fc8b..62543b6f 100644 --- a/Environments/eShop/resources.bicep +++ b/Environments/eShop/resources.bicep @@ -3,9 +3,14 @@ param location string = resourceGroup().location @description('Tags that will be applied to all resources') param tags object = {} + @secure() -param inputs object +@minLength(10) +param eventbusPassword string +@secure() +@minLength(10) +param postgresPassword string var resourceToken = uniqueString(resourceGroup().id) @@ -78,7 +83,7 @@ resource eventbus 'Microsoft.App/containerApps@2023-05-02-preview' = { secrets: [ { name: 'rabbitmq-default-pass' - value: inputs.eventbus.password + value: eventbusPassword } ] } @@ -122,7 +127,7 @@ resource postgres 'Microsoft.App/containerApps@2023-05-02-preview' = { secrets: [ { name: 'postgres-password' - value: inputs.postgres.password + value: postgresPassword } ] }