From 4b008e176dc9c9f4355b7b101c8a192e357e63fb Mon Sep 17 00:00:00 2001 From: Are Almaas Date: Wed, 10 Apr 2024 12:53:32 +0200 Subject: [PATCH] feat(azure): add azure service bus (#601) Creates the ServiceBus resource in Azure. This would be the place to define queues/topics/subscriptions as well, so we need to figure out pattern/queues/subscriptions/topics as well later. I can take that with @MagnusSandgren next time he's on :) --- .azure/infrastructure/main.bicep | 13 +++++++++++++ .azure/infrastructure/production.bicepparam | 6 ++++++ .azure/infrastructure/soak.bicepparam | 6 ++++++ .azure/infrastructure/staging.bicepparam | 6 ++++++ .azure/infrastructure/test.bicepparam | 6 ++++++ .azure/modules/serviceBus/main.bicep | 21 +++++++++++++++++++++ 6 files changed, 58 insertions(+) create mode 100644 .azure/modules/serviceBus/main.bicep diff --git a/.azure/infrastructure/main.bicep b/.azure/infrastructure/main.bicep index 5830dea2a..a4b5f0d9f 100644 --- a/.azure/infrastructure/main.bicep +++ b/.azure/infrastructure/main.bicep @@ -34,6 +34,9 @@ param slackNotifierSku SlackNotifierSku import { Sku as PostgresSku } from '../modules/postgreSql/create.bicep' param postgresSku PostgresSku +import { Sku as ServiceBusSku } from '../modules/serviceBus/main.bicep' +param serviceBusSku ServiceBusSku + import { Sku as RedisSku } from '../modules/redis/main.bicep' param redisSku RedisSku @minLength(1) @@ -84,6 +87,16 @@ module appInsights '../modules/applicationInsights/create.bicep' = { } } +module serviceBus '../modules/serviceBus/main.bicep' = { + scope: resourceGroup + name: 'serviceBus' + params: { + namePrefix: namePrefix + location: location + sku: serviceBusSku + } +} + // ####################################### // Create references to existing resources // ####################################### diff --git a/.azure/infrastructure/production.bicepparam b/.azure/infrastructure/production.bicepparam index 320a69244..288bd3d98 100644 --- a/.azure/infrastructure/production.bicepparam +++ b/.azure/infrastructure/production.bicepparam @@ -38,3 +38,9 @@ param redisSku = { family: 'C' capacity: 1 } + +param serviceBusSku = { + name: 'Standard' + tier: 'Standard' + capacity: 1 +} diff --git a/.azure/infrastructure/soak.bicepparam b/.azure/infrastructure/soak.bicepparam index dd737f9c1..3328cdac7 100644 --- a/.azure/infrastructure/soak.bicepparam +++ b/.azure/infrastructure/soak.bicepparam @@ -38,3 +38,9 @@ param redisSku = { family: 'C' capacity: 1 } + +param serviceBusSku = { + name: 'Standard' + tier: 'Standard' + capacity: 1 +} diff --git a/.azure/infrastructure/staging.bicepparam b/.azure/infrastructure/staging.bicepparam index 2f8855a55..946a8cd19 100644 --- a/.azure/infrastructure/staging.bicepparam +++ b/.azure/infrastructure/staging.bicepparam @@ -38,3 +38,9 @@ param redisSku = { family: 'C' capacity: 1 } + +param serviceBusSku = { + name: 'Standard' + tier: 'Standard' + capacity: 1 +} diff --git a/.azure/infrastructure/test.bicepparam b/.azure/infrastructure/test.bicepparam index fa52bb031..f727305d5 100644 --- a/.azure/infrastructure/test.bicepparam +++ b/.azure/infrastructure/test.bicepparam @@ -38,3 +38,9 @@ param redisSku = { family: 'C' capacity: 1 } + +param serviceBusSku = { + name: 'Standard' + tier: 'Standard' + capacity: 1 +} diff --git a/.azure/modules/serviceBus/main.bicep b/.azure/modules/serviceBus/main.bicep new file mode 100644 index 000000000..286699926 --- /dev/null +++ b/.azure/modules/serviceBus/main.bicep @@ -0,0 +1,21 @@ +param namePrefix string +param location string + +@export() +type Sku = { + name: 'Basic' | 'Standard' | 'Premium' + tier: 'Basic' | 'Standard' | 'Premium' + @minValue(1) + capacity: int +} +param sku Sku + +resource serviceBusNamespace 'Microsoft.ServiceBus/namespaces@2022-10-01-preview' = { + name: '${namePrefix}-service-bus' + location: location + sku: sku + identity: { + type: 'SystemAssigned' + } + properties: {} +}