Skip to content

Commit aa70d27

Browse files
committed
Use apis map and rename function key to slackBot
1 parent 2d17bfd commit aa70d27

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

packages/cdk/resources/Apis.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export interface ApisProps {
1212
}
1313

1414
export class Apis extends Construct {
15-
public readonly apiGateway: RestApiGateway
15+
public apis: {[key: string]: RestApiGateway}
1616

1717
public constructor(scope: Construct, id: string, props: ApisProps) {
1818
super(scope, id)
@@ -32,8 +32,10 @@ export class Apis extends Construct {
3232
resourceName: "ask-eps",
3333
method: HttpMethod.POST,
3434
restApiGatewayRole: apiGateway.role,
35-
lambdaFunction: props.functions.status
35+
lambdaFunction: props.functions.slackBot
3636
})
37-
this.apiGateway = apiGateway
37+
this.apis = {
38+
api: apiGateway
39+
}
3840
}
3941
}

packages/cdk/stacks/EpsAssistMeStack.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -480,16 +480,16 @@ export class EpsAssistMeStack extends Stack {
480480
logRetentionInDays,
481481
enableMutalTls: false,
482482
functions: {
483-
status: slackBotLambda
483+
slackBot: slackBotLambda
484484
}
485485
})
486486

487-
// ==== Output: SlackBot Endpoint ====
487+
// Output: SlackBot Endpoint
488488
new CfnOutput(this, "SlackBotEndpoint", {
489-
value: `https://${apis.apiGateway.api.domainName?.domainName}/slack/ask-eps`
489+
value: `https://${apis.apis["api"].api.domainName?.domainName}/slack/ask-eps`
490490
})
491491

492-
// ==== Final CDK Nag Suppressions ====
492+
// Final CDK Nag Suppressions
493493
nagSuppressions(this)
494494
}
495495
}

0 commit comments

Comments
 (0)