-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(infrastructure): add availability test for apim (#1327)
<!--- Provide a general summary of your changes in the Title above --> ## Description <!--- Describe your changes in detail --> An availability test for the backend. For now will send a health-check request to web-api-so so verify that the service is up and running with the all dependencies. The health-endpoint in APIM will send requests to web-api-so by default, the other services are not exposed yet. - Adds an availability test towards our APIM. Will probe the deep version of the health-checks which checks third party URLs together with Redis and Postgres. - Will now only target web-api-so as it is the default backend. Should expose all services like this. <img width="612" alt="image" src="https://github.com/user-attachments/assets/a368ed4d-78c5-4966-b363-493c85bd4568"> The frontend availability test: ![image](https://github.com/user-attachments/assets/55cbe387-d246-4b45-bbd4-17722f4117ab) ## Related Issue(s) - #292 ## Verification - [ ] **Your** code builds clean without any errors or warnings - [ ] Manual testing done (required) - [ ] Relevant automated test added (if you find this hard, leave it and we'll help out) ## Documentation - [ ] Documentation is updated (either in `docs`-directory, Altinnpedia or a separate linked PR in [altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if applicable) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new parameter `apimUrl` for capturing the APIM instance URL across various environments (production, staging, test, yt01). - Added a new module for creating an availability test for the APIM instance, enhancing monitoring capabilities. - **Enhancements** - New output declaration for the Application Insights resource ID, allowing easier access to the resource identifier post-deployment. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
Showing
7 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
@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 | ||
|
||
@description('The frequency in seconds at which the test runs') | ||
param frequency int = 120 // Default is every 2 minutes | ||
|
||
@description('The timeout in seconds for the test') | ||
param timeout int = 60 // Default is 1 minute | ||
|
||
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: frequency | ||
Timeout: timeout | ||
Kind: 'standard' | ||
RetryEnabled: true | ||
Locations: [ | ||
{ Id: 'emea-nl-ams-azr' } // Amsterdam | ||
{ Id: 'emea-se-sto-edge' } // Stockholm | ||
{ Id: 'emea-gb-db3-azr' } // Dublin | ||
] | ||
Request: { | ||
RequestUrl: url | ||
HttpVerb: 'GET' | ||
ParseDependentRequests: false | ||
} | ||
ValidationRules: { | ||
ExpectedHttpStatusCode: 200 | ||
SSLCheck: true | ||
SSLCertRemainingLifetimeCheck: 7 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters