From 9f6ce121439ac4badff89380b1e11f3b9b614273 Mon Sep 17 00:00:00 2001 From: Marja Kari Date: Thu, 14 Nov 2024 14:42:54 +0200 Subject: [PATCH] OK-652 fiksattu domain --- cdk/lib/sovellus-stack.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cdk/lib/sovellus-stack.ts b/cdk/lib/sovellus-stack.ts index 13ccb5c7..c5186f21 100644 --- a/cdk/lib/sovellus-stack.ts +++ b/cdk/lib/sovellus-stack.ts @@ -27,6 +27,7 @@ import {NagSuppressions} from "cdk-nag"; import path = require("path"); import {Nextjs} from "cdk-nextjs-standalone"; import {PriceClass} from "aws-cdk-lib/aws-cloudfront"; +import * as domain from "node:domain"; interface ViestinValitysStackProps extends cdk.StackProps { environmentName: string; @@ -412,11 +413,12 @@ export class SovellusStack extends cdk.Stack { } ); + const domainName = `viestinvalitys.${publicHostedZones[props.environmentName]}`; const certificate = new acm.DnsValidatedCertificate( this, "SiteCertificate", { - domainName: `viestinvalitys.${publicHostedZones[props.environmentName]}`, + domainName: domainName, hostedZone: zone, region: "us-east-1", // Cloudfront only checks this region for certificates. } @@ -424,15 +426,14 @@ export class SovellusStack extends cdk.Stack { /** * Uusi raportointikäyttöliittymä */ - const domainName = `https://viestinvalitys.${publicHostedZones[props.environmentName]};` - const nextjs = new Nextjs(this, 'Viestinvalitys-nextjs', { + const nextjs = new Nextjs(this, 'ViestinvalitysRaportointi', { nextjsPath: '../viestinvalitys-raportointi', // relative path from your project root to NextJS buildCommand: 'pwd && npx --yes open-next@^2 build -- --build-command "npm run noop"', basePath: '/raportointi', environment: { VIRKAILIJA_URL: `https://virkailija.${publicHostedZones[props.environmentName]}`, VIESTINTAPALVELU_URL: domainName, - LOGIN_URL: `https://viestinvalitys.${publicHostedZones[props.environmentName]}/raportointi/login`, + LOGIN_URL: `https://${domainName}/raportointi/login`, PORT: '8080', }, domainProps: {