Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions infra/azure/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ module containerApp 'modules/container-app.bicep' = {
userAssignedIdentityId: identity.outputs.id
userAssignedIdentityClientId: identity.outputs.clientId
keyVaultUri: keyVault.outputs.uri
stripeEnabled: !empty(stripeSecretKey) && !empty(stripeWebhookSecret)
}
}

Expand Down
12 changes: 8 additions & 4 deletions infra/azure/modules/container-app.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ param userAssignedIdentityId string
param userAssignedIdentityClientId string
param keyVaultUri string

@description('True when real Stripe secrets were supplied to the deploy. While false the app gets no Key Vault secret references and runs in simulation mode.')
param stripeEnabled bool = false

// Pinned to 1 replica: joltrin's embedded B-Tree engine has no documented
// multi-process write-safety guarantee, and this deployment optimizes for
// lowest cost over horizontal scale. CPU/memory/concurrency limits below
Expand Down Expand Up @@ -43,7 +46,7 @@ resource containerApp 'Microsoft.App/containerApps@2023-11-02-preview' = {
identity: userAssignedIdentityId
}
]
secrets: [
secrets: stripeEnabled ? [
{
name: 'stripe-secret-key'
keyVaultUrl: '${keyVaultUri}secrets/stripe-secret-key'
Expand All @@ -59,7 +62,7 @@ resource containerApp 'Microsoft.App/containerApps@2023-11-02-preview' = {
keyVaultUrl: '${keyVaultUri}secrets/stripe-publishable-key'
identity: userAssignedIdentityId
}
]
] : []
ingress: {
external: true
targetPort: 8080
Expand All @@ -84,7 +87,7 @@ resource containerApp 'Microsoft.App/containerApps@2023-11-02-preview' = {
'8080'
'-open-browser=false'
]
env: [
env: concat(stripeEnabled ? [
{
name: 'STRIPE_SECRET_KEY'
secretRef: 'stripe-secret-key'
Expand All @@ -97,11 +100,12 @@ resource containerApp 'Microsoft.App/containerApps@2023-11-02-preview' = {
name: 'STRIPE_PUBLISHABLE_KEY'
secretRef: 'stripe-publishable-key'
}
] : [], [
{
name: 'AZURE_CLIENT_ID'
value: userAssignedIdentityClientId
}
]
])
// 0.5 vCPU / 1.0 GiB: matches the requested cost-containment
// sizing. Combined GB-CPU pairing is one of ACA's valid
// combinations (0.5 vCPU pairs with 1Gi).
Expand Down
Loading