diff --git a/src/responder-teams.ts b/src/responder-teams.ts new file mode 100644 index 0000000..3d88f26 --- /dev/null +++ b/src/responder-teams.ts @@ -0,0 +1,16 @@ +export type ResponderTeam= 'LANDONLINE - Common Services' | + 'LANDONLINE - Datacom' | + 'LANDONLINE - Dealings' | + 'LANDONLINE - Enablement' | + 'LANDONLINE - L2 Technical Support' | + 'LANDONLINE - Legacy Landonline' | + 'LANDONLINE - Notice of Change' | + 'LANDONLINE - Search' | + 'LANDONLINE - Survey External' | + 'LANDONLINE - Survey Internal' | + 'LANDONLINE - Titles Internal' | + 'LINZ - Enterprise Platforms' | + 'LINZ-BASEMAPS' | + 'LINZ-BASEMAPS-dev' | + 'TESTING L2 Escalation' | + 'TESTING L2 Support' ; diff --git a/src/tags.ts b/src/tags.ts index ec85667..8a94ba0 100644 --- a/src/tags.ts +++ b/src/tags.ts @@ -4,6 +4,7 @@ import { IConstruct } from 'constructs'; import { getGitBuildInfo } from './build.js'; import { TagsData } from './data.js'; import { SecurityClassification } from './security.js'; +import {ResponderTeam} from "./responder-teams"; export interface TagsBase { /** @@ -55,13 +56,13 @@ export interface TagsBase { * Operational impact of the resources on runtime overall system * @see https://toitutewhenua.atlassian.net/wiki/spaces/STEP/pages/524059414/OpsGenie+Incident+Priority+Matrix */ - impact: 'high' | 'medium' | 'low'; + impact: 'high' | 'moderate' | 'low'; /** * THe responder team listed in OpsGenie. * @see https://toitutewhenua.app.opsgenie.com/teams/list */ - responderTeam?: string; + responderTeam?: ResponderTeam; /** * skip collection of git info, commit, version etc * @default false @@ -85,6 +86,9 @@ export function applyTags(construct: IConstruct, ctx: TagsBase): void { if (ctx.data?.isPublic && ctx.classification !== SecurityClassification.Unclassified) { throw new Error('Only unclassified constructs can be made public'); } + if (!ctx.application.match(RegExp(/^[a-zA-Z0-9 -]+$/))) { + throw new Error('linz.app.name has to match /^[a-zA-Z0-9 -]+$/'); + } const buildInfo = ctx.skipGitInfo ? undefined : getGitBuildInfo();