Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(infrastructure): add availability test for apim #1327

Merged
merged 4 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
15 changes: 15 additions & 0 deletions .azure/infrastructure/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ param sourceKeyVaultSshJumperSshPublicKey string
@description('The object ID of the group to assign the Admin Login role for SSH Jumper')
param sshJumperAdminLoginGroupObjectId string

@description('The URL of the APIM instance')
param apimUrl string

import { Sku as KeyVaultSku } from '../modules/keyvault/create.bicep'
param keyVaultSku KeyVaultSku

Expand Down Expand Up @@ -117,6 +120,18 @@ module appInsights '../modules/applicationInsights/create.bicep' = {
}
}

module apimAvailabilityTest '../modules/applicationInsights/availabilityTest.bicep' = {
scope: resourceGroup
name: 'apimAvailabilityTest'
params: {
name: '${namePrefix}-dialogporten-health-test'
location: location
tags: tags
appInsightsId: appInsights.outputs.appInsightsId
url: '${apimUrl}/health/deep'
}
}

module serviceBus '../modules/serviceBus/main.bicep' = {
scope: resourceGroup
name: 'serviceBus'
Expand Down
2 changes: 2 additions & 0 deletions .azure/infrastructure/prod.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ param serviceBusSku = {

// Altinn Product Dialogporten: Developers Prod
param sshJumperAdminLoginGroupObjectId = 'a94de4bf-0a83-4d30-baba-0c6a7365571c'

param apimUrl = 'https://platform.altinn.no/dialogporten'
2 changes: 2 additions & 0 deletions .azure/infrastructure/staging.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ param serviceBusSku = {
}
// Altinn Product Dialogporten: Developers Prod
param sshJumperAdminLoginGroupObjectId = 'a94de4bf-0a83-4d30-baba-0c6a7365571c'

param apimUrl = 'https://platform.tt02.altinn.no/dialogporten'
2 changes: 2 additions & 0 deletions .azure/infrastructure/test.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ param serviceBusSku = {

// Altinn Product Dialogporten: Developers Dev
param sshJumperAdminLoginGroupObjectId = 'c12e51e3-5cbd-4229-8a31-5394c423fb5f'

param apimUrl = 'https://altinn-dev-api.azure-api.net/dialogporten'
2 changes: 2 additions & 0 deletions .azure/infrastructure/yt01.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ param serviceBusSku = {
}
// Altinn Product Dialogporten: Developers Dev
param sshJumperAdminLoginGroupObjectId = 'c12e51e3-5cbd-4229-8a31-5394c423fb5f'

param apimUrl = 'https://platform.yt01.altinn.cloud/dialogporten'
49 changes: 49 additions & 0 deletions .azure/modules/applicationInsights/availabilityTest.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
@description('The name of the availability test')
param name string

@description('The location where the resources will be deployed')
param location string

@description('Tags to apply to resources')
param tags object

@description('The ID of the Application Insights resource')
param appInsightsId string


@description('The URL of the availability test')
param url string

resource availabilityTest 'Microsoft.Insights/webtests@2022-06-15' = {
name: name
location: location
tags: union(tags, {
'hidden-link:${appInsightsId}': 'Resource'
})
kind: 'standard'
properties: {
Enabled: true
SyntheticMonitorId: name
Name: name
Description: 'Availability test for ${name}'
Frequency: 120 // Run test every 2 minutes
Timeout: 60 // 1 minute timeout
arealmaas marked this conversation as resolved.
Show resolved Hide resolved
Kind: 'standard'
RetryEnabled: true
Locations: [
{ Id: 'emea-nl-ams-azr' } // Amsterdam
{ Id: 'emea-se-sto-edge' } // Stockholm
{ Id: 'emea-gb-db3-azr' } // Dublin
]
arealmaas marked this conversation as resolved.
Show resolved Hide resolved
Request: {
RequestUrl: url
HttpVerb: 'GET'
ParseDependentRequests: false
}
ValidationRules: {
ExpectedHttpStatusCode: 200
SSLCheck: true
SSLCertRemainingLifetimeCheck: 7
}
}
}
1 change: 1 addition & 0 deletions .azure/modules/applicationInsights/create.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ resource appInsights 'Microsoft.Insights/components@2020-02-02' = {
output connectionString string = appInsights.properties.ConnectionString
output appInsightsWorkspaceName string = appInsightsWorkspace.name
output appInsightsName string = appInsights.name
output appInsightsId string = appInsights.id
Loading