Skip to content

Commit

Permalink
split password for eventbus and postgre
Browse files Browse the repository at this point in the history
  • Loading branch information
luxu-ms committed Apr 10, 2024
1 parent 3fb5278 commit d64c893
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 16 deletions.
21 changes: 8 additions & 13 deletions Environments/eShop/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -28,9 +22,10 @@ var tags = {
module resources 'resources.bicep' = {
name: 'resources'
params: {
eventbusPassword: eventbusPassword
postgresPassword: postgresPassword
location: location
tags: tags
inputs: inputs
}
}

Expand Down
14 changes: 14 additions & 0 deletions Environments/eShop/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"


11 changes: 8 additions & 3 deletions Environments/eShop/resources.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -78,7 +83,7 @@ resource eventbus 'Microsoft.App/containerApps@2023-05-02-preview' = {
secrets: [
{
name: 'rabbitmq-default-pass'
value: inputs.eventbus.password
value: eventbusPassword
}
]
}
Expand Down Expand Up @@ -122,7 +127,7 @@ resource postgres 'Microsoft.App/containerApps@2023-05-02-preview' = {
secrets: [
{
name: 'postgres-password'
value: inputs.postgres.password
value: postgresPassword
}
]
}
Expand Down

0 comments on commit d64c893

Please sign in to comment.