Skip to content

Commit

Permalink
Use HTTP GET Method for availability monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
DrizzlyOwl authored and FrostyApeOne committed Jan 28, 2025
1 parent db0b1a3 commit cb40c0b
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 9 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build-and-push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,21 @@ jobs:
} catch (error) {
core.setFailed(error.message);
}
- name: Trigger Build and Push NuGet Package workflow
uses: "actions/github-script@v7"
if: needs.set-env.outputs.environment == 'production'
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
const tagName = "${{ needs.set-env.outputs.release }}"
console.log("Triggering Build and Push NuGet Package workflow with tag:", tagName);
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: "build-and-push-package.yml",
ref: "main",
inputs: {
tag_name: tagName
}
});
19 changes: 12 additions & 7 deletions .github/workflows/build-and-push-package.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Build and Push NuGet Package

on:
push:
tags:
- 'production-*'
workflow_dispatch:
inputs:
tag_name:
description: "The production tag name to process"
required: true

env:
DOTNET_VERSION: '8.0.x'
Expand All @@ -14,11 +16,14 @@ jobs:
permissions:
packages: write
contents: write
if: startsWith(github.event.inputs.tag_name, 'production-')

steps:
- uses: actions/checkout@v4
- name: Check Out Tag
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0 # Shallow clones disabled for a better relevancy of SC analysis
ref: ${{ github.event.inputs.tag_name }}
fetch-depth: 0 # Ensure full history and tags are available

- name: Setup .NET
uses: actions/setup-dotnet@v4
Expand Down Expand Up @@ -81,7 +86,7 @@ jobs:
shell: /usr/bin/bash -e {0}

- name: Build, pack and publish
working-directory: Dfe.PersonsApi.Client
working-directory: src/Dfe.PersonsApi.Client
run: |
dotnet build -c Release
dotnet pack -c Release -p:PackageVersion=${{ env.NEW_VERSION }} --output .
Expand Down
3 changes: 2 additions & 1 deletion terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_azure_container_apps_hosting"></a> [azure\_container\_apps\_hosting](#module\_azure\_container\_apps\_hosting) | github.com/DFE-Digital/terraform-azurerm-container-apps-hosting | v1.16.4 |
| <a name="module_azure_container_apps_hosting"></a> [azure\_container\_apps\_hosting](#module\_azure\_container\_apps\_hosting) | github.com/DFE-Digital/terraform-azurerm-container-apps-hosting | v1.16.6 |
| <a name="module_azurerm_key_vault"></a> [azurerm\_key\_vault](#module\_azurerm\_key\_vault) | github.com/DFE-Digital/terraform-azurerm-key-vault-tfvars | v0.5.1 |
| <a name="module_statuscake-tls-monitor"></a> [statuscake-tls-monitor](#module\_statuscake-tls-monitor) | github.com/dfe-digital/terraform-statuscake-tls-monitor | v0.1.5 |

Expand Down Expand Up @@ -198,6 +198,7 @@ No resources.
| <a name="input_key_vault_access_ipv4"></a> [key\_vault\_access\_ipv4](#input\_key\_vault\_access\_ipv4) | List of IPv4 Addresses that are permitted to access the Key Vault | `list(string)` | n/a | yes |
| <a name="input_monitor_email_receivers"></a> [monitor\_email\_receivers](#input\_monitor\_email\_receivers) | A list of email addresses that should be notified by monitoring alerts | `list(string)` | n/a | yes |
| <a name="input_monitor_endpoint_healthcheck"></a> [monitor\_endpoint\_healthcheck](#input\_monitor\_endpoint\_healthcheck) | Specify a route that should be monitored for a 200 OK status | `string` | n/a | yes |
| <a name="input_monitor_http_availability_verb"></a> [monitor\_http\_availability\_verb](#input\_monitor\_http\_availability\_verb) | Which HTTP verb to use for the HTTP Availability check | `string` | `"GET"` | no |
| <a name="input_project_name"></a> [project\_name](#input\_project\_name) | Project name. Will be used along with `environment` as a prefix for all resources. | `string` | n/a | yes |
| <a name="input_registry_admin_enabled"></a> [registry\_admin\_enabled](#input\_registry\_admin\_enabled) | Do you want to enable access key based authentication for your Container Registry? | `bool` | `true` | no |
| <a name="input_registry_managed_identity_assign_role"></a> [registry\_managed\_identity\_assign\_role](#input\_registry\_managed\_identity\_assign\_role) | Assign the 'AcrPull' Role to the Container App User-Assigned Managed Identity. Note: If you do not have 'Microsoft.Authorization/roleAssignments/write' permission, you will need to manually assign the 'AcrPull' Role to the identity | `bool` | `false` | no |
Expand Down
3 changes: 2 additions & 1 deletion terraform/container-apps-hosting.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "azure_container_apps_hosting" {
source = "github.com/DFE-Digital/terraform-azurerm-container-apps-hosting?ref=v1.16.4"
source = "github.com/DFE-Digital/terraform-azurerm-container-apps-hosting?ref=v1.16.6"

environment = local.environment
project_name = local.project_name
Expand Down Expand Up @@ -60,4 +60,5 @@ module "azure_container_apps_hosting" {
cdn_frontdoor_health_probe_path = local.cdn_frontdoor_health_probe_path
monitor_endpoint_healthcheck = local.monitor_endpoint_healthcheck
existing_logic_app_workflow = local.existing_logic_app_workflow
monitor_http_availability_verb = local.monitor_http_availability_verb
}
1 change: 1 addition & 0 deletions terraform/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ locals {
health_insights_api_ipv4_allow_list = var.health_insights_api_ipv4_allow_list
enable_cdn_frontdoor_vdp_redirects = var.enable_cdn_frontdoor_vdp_redirects
cdn_frontdoor_vdp_destination_hostname = var.cdn_frontdoor_vdp_destination_hostname
monitor_http_availability_verb = var.monitor_http_availability_verb
}
6 changes: 6 additions & 0 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -375,3 +375,9 @@ variable "existing_resource_group" {
description = "Conditionally launch resources into an existing resource group. Specifying this will NOT create a resource group."
type = string
}

variable "monitor_http_availability_verb" {
description = "Which HTTP verb to use for the HTTP Availability check"
type = string
default = "GET"
}

0 comments on commit cb40c0b

Please sign in to comment.