Skip to content

Commit

Permalink
Merge pull request #5363 from dfe-analytical-services/dev
Browse files Browse the repository at this point in the history
Merge Dev into Master
  • Loading branch information
N-moh authored Oct 30, 2024
2 parents 2e96be5 + e9ec168 commit 8cc159f
Show file tree
Hide file tree
Showing 91 changed files with 5,164 additions and 680 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/validate-snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ on:
# Actions are scheduled in UTC
# Until Actions supports timezones, we need to update this cron
# twice a year (at the start and end of daylight saving time)
# to account for daylight saving time in the UK
# to account for daylight saving time in the UK.
# Set a new reminder in the slack channel for next time to
# change this
# This action is intended to run at 9:35AM, 12:35PM & 4:35PM
- cron: '35 8,11,15 * * 1-5'
# March to October - cron: '35 8,11,15 * * 1-5'
- cron: '35 9,12,16 * * 1-5'
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand Down
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.3.5
3 changes: 2 additions & 1 deletion infrastructure/templates/public-api/abbreviations.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
var abbreviations = {
appContainerApps: 'ca'
appManagedEnvironments: 'cae'
// TODO - remove the "-flexibleserver" suffix and change the suffix of our PSQL instance to "-01"
// TODO - remove the "-flexibleserver" suffix and change the suffix of our PSQL instance to "-01"
dBforPostgreSQLServers: 'psql-flexibleserver'
// 'ai' is non-standard - it should be 'appi'
insightsComponents: 'ai'
managedIdentityUserAssignedIdentities: 'id'
networkApplicationGateways: 'agw'
operationalInsightsWorkspaces: 'log'
staticWebApps: 'stapp'
// 'sa' is non-standard - it should be 'st'
storageStorageAccounts: 'sa'
// 'fa' is non-standard - it shoule be 'func'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { resourceNamesType, staticWebAppSkuType } from '../../types.bicep'

@description('Common resource naming variables.')
param resourceNames resourceNamesType

@description('Static Web App SKU to use.')
param appSku staticWebAppSkuType = 'Free'

@description('A set of tags for the resource.')
param tagValues object

module publicApiDocsApp '../../components/staticWebApp.bicep' = {
name: 'publicApiDocsAppDeploy'
params: {
name: resourceNames.publicApi.docsApp
tagValues: tagValues
sku: appSku
}
}
25 changes: 25 additions & 0 deletions infrastructure/templates/public-api/components/staticWebApp.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { staticWebAppSkuType } from '../types.bicep'

@description('Name of the resource.')
param name string

@description('Location for an optional Azure Functions API backend (only certain regions allowed).')
@allowed(['centralus', 'eastus2', 'eastasia', 'westeurope', 'westus2'])
param location string = 'westeurope'

@description('Static Web App SKU to use.')
param sku staticWebAppSkuType = 'Free'

@description('A set of tags for the resource.')
param tagValues object

resource staticWebApp 'Microsoft.Web/staticSites@2023-12-01' = {
name: name
location: location
tags: tagValues
sku: {
name: sku
size: sku
}
properties: {}
}
16 changes: 15 additions & 1 deletion infrastructure/templates/public-api/main.bicep
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { abbreviations } from 'abbreviations.bicep'
import { firewallRuleType, principalNameAndIdType } from 'types.bicep'
import { firewallRuleType, principalNameAndIdType, staticWebAppSkuType } from 'types.bicep'

@description('Environment : Subscription name e.g. s101d01. Used as a prefix for created resources.')
param subscription string = ''
Expand Down Expand Up @@ -45,6 +45,9 @@ param postgreSqlEntraIdAdminPrincipals principalNameAndIdType[] = []
@description('ACR : Specifies the resource group in which the shared Container Registry lives.')
param acrResourceGroupName string = ''

@description('Public API docs app : SKU to use.')
param docsAppSku staticWebAppSkuType = 'Free'

@description('Tagging : Environment name e.g. Development. Used for tagging resources created by this infrastructure pipeline.')
param environmentName string

Expand Down Expand Up @@ -142,6 +145,7 @@ var resourceNames = {
dataProcessorIdentity: '${publicApiResourcePrefix}-${abbreviations.managedIdentityUserAssignedIdentities}-${abbreviations.webSitesFunctions}-processor'
dataProcessorPlan: '${publicApiResourcePrefix}-${abbreviations.webServerFarms}-${abbreviations.webSitesFunctions}-processor'
dataProcessorStorageAccountsPrefix: '${subscription}eessaprocessor'
docsApp: '${publicApiResourcePrefix}-${abbreviations.staticWebApps}-docs'
publicApiFileshare: '${publicApiResourcePrefix}-fs-data'
publicApiStorageAccount: '${replace(publicApiResourcePrefix, '-', '')}${abbreviations.storageStorageAccounts}'
}
Expand Down Expand Up @@ -262,6 +266,16 @@ module apiAppModule 'application/public-api/publicApiApp.bicep' = if (deployCont
]
}

// Deploy Public API docs.
module docsModule 'application/public-api/publicApiDocs.bicep' = {
name: 'publicApiDocsModuleDeploy'
params: {
appSku: docsAppSku
resourceNames: resourceNames
tagValues: tagValues
}
}

// Create an Application Gateway to serve public traffic for the Public API Container App.
module appGatewayModule 'application/shared/appGateway.bicep' = if (deployContainerApp) {
name: 'appGatewayApplicationModuleDeploy'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ param publicUrls = {
param postgreSqlSkuName = 'Standard_B1ms'
param postgreSqlStorageSizeGB = 32
param postgreSqlAutoGrowStatus = 'Disabled'

param docsAppSku = 'Standard'
4 changes: 4 additions & 0 deletions infrastructure/templates/public-api/types.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type resourceNamesType = {
dataProcessorIdentity: string
dataProcessorPlan: string
dataProcessorStorageAccountsPrefix: string
docsApp: string
publicApiStorageAccount: string
publicApiFileshare: string
}
Expand Down Expand Up @@ -87,3 +88,6 @@ type containerRegistryRoleType = 'AcrPull'

@export()
type keyVaultRoleType = 'Secrets User' | 'Certificate User'

@export()
type staticWebAppSkuType = 'Free' | 'Standard'
Loading

0 comments on commit 8cc159f

Please sign in to comment.