diff --git a/deploy/infra/lib/constructs/access-handler.ts b/deploy/infra/lib/constructs/access-handler.ts index 9ce6daf79..7da660291 100644 --- a/deploy/infra/lib/constructs/access-handler.ts +++ b/deploy/infra/lib/constructs/access-handler.ts @@ -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(), diff --git a/deploy/infra/lib/constructs/app-backend.ts b/deploy/infra/lib/constructs/app-backend.ts index 5869bc23a..7f213f18f 100644 --- a/deploy/infra/lib/constructs/app-backend.ts +++ b/deploy/infra/lib/constructs/app-backend.ts @@ -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"; @@ -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( @@ -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, @@ -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({ @@ -323,6 +324,6 @@ export class AppBackend extends Construct { } getKmsKeyArn(): string { - return this._KMSkey.keyArn + return this._KMSkey.keyArn; } }