Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
boost timeout to 60s
Browse files Browse the repository at this point in the history
  • Loading branch information
chrnorm committed Aug 23, 2022
1 parent 86a25e6 commit 71ae829
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion deploy/infra/lib/constructs/access-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class AccessHandler extends Construct {

this._lambda = new lambda.Function(this, "RestAPIHandlerFunction", {
code,
timeout: Duration.seconds(20),
timeout: Duration.seconds(60),
environment: {
GRANTED_RUNTIME: "lambda",
STATE_MACHINE_ARN: this._granter.getStateMachineARN(),
Expand Down
15 changes: 8 additions & 7 deletions deploy/infra/lib/constructs/app-backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as cdk from "aws-cdk-lib";
import { Duration, Stack } from "aws-cdk-lib";
import * as apigateway from "aws-cdk-lib/aws-apigateway";
import * as dynamodb from "aws-cdk-lib/aws-dynamodb";
import * as kms from 'aws-cdk-lib/aws-kms';
import * as kms from "aws-cdk-lib/aws-kms";
import { EventBus } from "aws-cdk-lib/aws-events";
import * as iam from "aws-cdk-lib/aws-iam";
import { PolicyStatement } from "aws-cdk-lib/aws-iam";
Expand Down Expand Up @@ -43,10 +43,11 @@ export class AppBackend extends Construct {

this.createDynamoTables();

this._KMSkey = new kms.Key(this, 'PaginationKMSKey', {
this._KMSkey = new kms.Key(this, "PaginationKMSKey", {
removalPolicy: cdk.RemovalPolicy.DESTROY,
pendingWindow: cdk.Duration.days(7),
description: 'used for encrypting and decrypting pagination tokens for granted approvals',
description:
"used for encrypting and decrypting pagination tokens for granted approvals",
});

const code = lambda.Code.fromAsset(
Expand All @@ -55,7 +56,7 @@ export class AppBackend extends Construct {

this._lambda = new lambda.Function(this, "RestAPIHandlerFunction", {
code,
timeout: Duration.seconds(20),
timeout: Duration.seconds(60),
environment: {
APPROVALS_TABLE_NAME: this._dynamoTable.tableName,
APPROVALS_FRONTEND_URL: props.frontendUrl,
Expand All @@ -68,13 +69,13 @@ export class AppBackend extends Construct {
EVENT_BUS_ARN: props.eventBus.eventBusArn,
EVENT_BUS_SOURCE: props.eventBusSourceName,
IDENTITY_SETTINGS: props.identityProviderSyncConfiguration,
PAGINATION_KMS_KEY_ARN: this._KMSkey.keyArn
PAGINATION_KMS_KEY_ARN: this._KMSkey.keyArn,
},
runtime: lambda.Runtime.GO_1_X,
handler: "approvals",
});

this._KMSkey.grantEncryptDecrypt(this._lambda)
this._KMSkey.grantEncryptDecrypt(this._lambda);

this._lambda.addToRolePolicy(
new PolicyStatement({
Expand Down Expand Up @@ -323,6 +324,6 @@ export class AppBackend extends Construct {
}

getKmsKeyArn(): string {
return this._KMSkey.keyArn
return this._KMSkey.keyArn;
}
}

0 comments on commit 71ae829

Please sign in to comment.