Skip to content

Commit

Permalink
Pass reserved concurrent executions in as a prop
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwinch committed Jun 8, 2022
1 parent eaaa10d commit 1fa8958
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cdk/bin/cdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const codeProps: MobileSaveForLaterProps = {
hostedZoneName: "mobile-aws.code.dev-guardianapis.com",
hostedZoneId: "Z6PRU8YR6TQDK",
identityApiHost: "https://id.code.dev-guardianapis.com",
reservedConcurrentExecutions: 1,
};

export const prodProps: MobileSaveForLaterProps = {
Expand All @@ -23,6 +24,7 @@ export const prodProps: MobileSaveForLaterProps = {
hostedZoneName: "mobile-aws.guardianapis.com",
hostedZoneId: "Z1EYB4AREPXE3B",
identityApiHost: "https://id.guardianapis.com",
reservedConcurrentExecutions: 50,
};

new MobileSaveForLater(app, "MobileSaveForLater-CODE", codeProps);
Expand Down
3 changes: 2 additions & 1 deletion cdk/lib/mobile-save-for-later.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface MobileSaveForLaterProps extends GuStackProps {
hostedZoneName: string;
hostedZoneId: string;
identityApiHost: string;
reservedConcurrentExecutions: number;
}

export class MobileSaveForLater extends GuStack {
Expand Down Expand Up @@ -67,7 +68,7 @@ export class MobileSaveForLater extends GuStack {
handler: "com.gu.sfl.lambda.FetchArticlesLambda::handleRequest",
functionName: `mobile-save-for-later-FETCH-cdk-${this.stage}`,
timeout: Duration.seconds(20),
reservedConcurrentExecutions: this.stage === "PROD" ? 50 : 1,
reservedConcurrentExecutions: props.reservedConcurrentExecutions,
environment: commonEnvironmentVariables,
...commonLambdaProps,
}
Expand Down

0 comments on commit 1fa8958

Please sign in to comment.