Skip to content

Commit

Permalink
looks like it was trying to validate the wrong hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
fredex42 committed Mar 15, 2024
1 parent 8153ade commit ca818e2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion cdk/lib/concierge-graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export class ConciergeGraphql extends GuStack {

const hostedZoneId = aws_ssm.StringParameter.valueForStringParameter(this, `/account/services/capi.gutools/${this.stage}/hostedzoneid`);

const lbDomainName = getHostName(this, ".internal");
const {loadBalancer, listener} = new GuPlayApp(this, {
access: {
//You should put a gateway in front of this
Expand All @@ -50,7 +51,7 @@ export class ConciergeGraphql extends GuStack {
app: "concierge-graphql",
certificateProps: {
hostedZoneId,
domainName: getHostName(this),
domainName: lbDomainName,
},
instanceType: InstanceType.of(InstanceClass.T4G, InstanceSize.LARGE),
monitoringConfiguration: {
Expand Down Expand Up @@ -85,6 +86,7 @@ export class ConciergeGraphql extends GuStack {
new HttpGateway(this, "GW", {
stage: props.stage as "CODE"|"PROD",
backendLoadbalancer: loadBalancer,
lbDomainName,
previewMode,
backendListener: listener,
backendLbIncomingSg: linkageSG,
Expand Down
3 changes: 2 additions & 1 deletion cdk/lib/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface HttpGatewayProps {
backendLoadbalancer: IApplicationLoadBalancer;
backendListener: IApplicationListener;
backendLbIncomingSg: ISecurityGroup;
lbDomainName: string;
subnets: SubnetSelection;
vpc: IVpc;
}
Expand Down Expand Up @@ -47,7 +48,7 @@ export class HttpGateway extends Construct {
description: `Gateway for the ${props.stage} concierge-graphql${maybePreview} instance`,
defaultIntegration: new HttpAlbIntegration('DefaultIntegration', props.backendListener, {
vpcLink,
secureServerName: props.backendLoadbalancer.loadBalancerDnsName,
secureServerName: props.lbDomainName,
}),
createDefaultStage: true,
});
Expand Down
12 changes: 6 additions & 6 deletions cdk/lib/hostname.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import {GuStack} from "@guardian/cdk/lib/constructs/core";

export function getHostName(scope:GuStack):string {
export function getHostName(scope:GuStack, insert?:string):string {
if(scope.stage.startsWith("CODE")) {
if(scope.stack.endsWith("preview")) {
return "concierge-graphql-preview.content.code.dev-guardianapis.com";
return `graphql-preview${insert ?? ""}.content.code.dev-guardianapis.com`;
} else {
return "concierge-graphql.content.code.dev-guardianapis.com";
return `graphql${insert ?? ""}.content.code.dev-guardianapis.com`;
}
} else if(scope.stage.startsWith("PROD")) {
if (scope.stack.endsWith("preview")) {
return "concierge-graphql-preview.content.guardianapis.com";
return `graphql-preview${insert ?? ""}.content.guardianapis.com`;
} else {
return "concierge-graphql.content.guardianapis.com";
return `graphql${insert ?? ""}.content.guardianapis.com`;
}
} else if(scope.stage=="TEST") { //CI testing
return "concierge-graphql-preview.content.code.dev-guardianapis.com";
return `graphql-preview${insert ?? ""}.content.code.dev-guardianapis.com`;
} else {
throw "stage must be either CODE or PROD";
}
Expand Down

0 comments on commit ca818e2

Please sign in to comment.