Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

feat: Provide resources for Azure Database for MariaDB, CDN & VNET #14

Merged
merged 3 commits into from
Dec 1, 2021
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
3 changes: 2 additions & 1 deletion .github/workflows/deploy-test-resources-to-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }}
resourceGroupName: ${{ env.AZURE_RESOURCEGROUP_NAME }}
template: ./deploy/us.bicep
parameters: mariaDbServerPassword=${{ secrets.AZURE_MARIADB_SERVER_PASSWORD }}
deploymentName: us-run-${{ github.run_number }}
deploymentMode: Complete
failOnStdErr: false
Expand Down Expand Up @@ -63,8 +64,8 @@ jobs:
with:
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }}
resourceGroupName: ${{ env.AZURE_RESOURCEGROUP_NAME }}
parameters: sqlServerPassword=${{ secrets.SQL_PASSWORD }}
template: ./deploy/europe.bicep
parameters: sqlServerPassword=${{ secrets.SQL_PASSWORD }}
deploymentName: europe-run-${{ github.run_number }}
deploymentMode: Complete
failOnStdErr: false
90 changes: 90 additions & 0 deletions deploy/us.bicep
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
@secure()
param mariaDbServerPassword string

param location string = resourceGroup().location
param resourceNamePrefix string = 'promitor-testing-resource-${geo}'
param region string = 'USA'
Expand Down Expand Up @@ -28,6 +31,10 @@ resource workflow 'Microsoft.Logic/workflows@2019-05-01' = [for i in range(1, 3)
resource serverlessAppPlan 'Microsoft.Web/serverfarms@2021-01-15' = {
name: '${resourceNamePrefix}-serverless-app-plan'
location: location
tags: {
region: region
app: 'promitor-resource-discovery-tests'
}
sku: {
name: 'Y1'
tier: 'Dynamic'
Expand All @@ -44,9 +51,92 @@ resource functionApp 'Microsoft.Web/sites@2021-01-15' = {
name: '${resourceNamePrefix}-serverless-functions'
location: location
kind: 'functionapp'
tags: {
region: region
app: 'promitor-resource-discovery-tests'
}
properties: {
serverFarmId: serverlessAppPlan.id
reserved: true
keyVaultReferenceIdentity: 'SystemAssigned'
}
}

resource vnet 'Microsoft.Network/virtualNetworks@2021-03-01' = {
name: '${resourceNamePrefix}-vnet'
location: location
tags: {
region: region
app: 'promitor-resource-discovery-tests'
}
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/16'
]
}
subnets: [
{
name: 'subnet-1'
properties: {
addressPrefix: '10.0.0.0/24'
}
}
{
name: 'subnet-2'
properties: {
addressPrefix: '10.0.1.0/24'
}
}
]
}
}

resource cdn 'Microsoft.Cdn/profiles@2019-04-15' = {
name: '${resourceNamePrefix}-cdn'
location: location
tags: {
region: region
app: 'promitor-resource-discovery-tests'
}
sku: {
name: 'Standard_Microsoft'
}
properties: {}
}

resource mariaDbServer 'Microsoft.DBforMariaDB/servers@2018-06-01' = {
name: '${resourceNamePrefix}-mariadb-server'
location: location
tags: {
region: region
app: 'promitor-resource-discovery-tests'
}
sku: {
capacity: 1
family: 'Gen5'
name: 'B_Gen5_1'
size: '51200'
tier: 'Basic'
}
properties: {
storageProfile: {
backupRetentionDays: 7
geoRedundantBackup: 'Disabled'
storageAutogrow: 'Enabled'
}
version: '10.3'
createMode: 'Default'
administratorLogin: 'tom'
administratorLoginPassword: mariaDbServerPassword
}
}

resource mariaDbDatabase 'Microsoft.DBforMariaDB/servers/databases@2018-06-01' = {
name: 'example-db-1'
parent: mariaDbServer
properties: {
charset: 'utf8'
collation: 'utf8_general_ci'
}
}