From 5b8cb24bd72baaa7ab1126c815a1ad39f4f1d0a1 Mon Sep 17 00:00:00 2001 From: ayuki_j <19406594+ayuki-joto@users.noreply.github.com> Date: Fri, 17 May 2024 14:34:18 +0900 Subject: [PATCH] refactor: add api timeout --- lib/footprint-stack.ts | 5 +++-- lib/profile-stack.ts | 5 +++-- lib/share-stack.ts | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/footprint-stack.ts b/lib/footprint-stack.ts index e52be0a..13b2a10 100644 --- a/lib/footprint-stack.ts +++ b/lib/footprint-stack.ts @@ -1,4 +1,4 @@ -import { aws_dynamodb, aws_lambda_nodejs, Stack } from 'aws-cdk-lib' +import { aws_dynamodb, aws_lambda_nodejs, Duration, Stack } from 'aws-cdk-lib' import { Construct } from 'constructs' import { BaseStackProps } from './props' import { IFunction, Runtime, Tracing } from 'aws-cdk-lib/aws-lambda' @@ -25,7 +25,8 @@ export class FootprintStack extends Stack { environment: { TABLE_NAME: props.dynamoTable.tableName }, - tracing: Tracing.ACTIVE + tracing: Tracing.ACTIVE, + timeout: Duration.seconds(10) } ) props.dynamoTable.grantReadData(this.lambda) diff --git a/lib/profile-stack.ts b/lib/profile-stack.ts index 68be944..8853584 100644 --- a/lib/profile-stack.ts +++ b/lib/profile-stack.ts @@ -1,4 +1,4 @@ -import { aws_dynamodb, aws_lambda_nodejs, Stack } from 'aws-cdk-lib' +import { aws_dynamodb, aws_lambda_nodejs, Duration, Stack } from 'aws-cdk-lib' import { Construct } from 'constructs' import { BaseStackProps } from './props' import { IFunction, Runtime, Tracing } from 'aws-cdk-lib/aws-lambda' @@ -31,7 +31,8 @@ export class ProfileStack extends Stack { PROFILE_TABLE_NAME: props.profileTable.tableName, OPTION_TABLE_NAME: props.optionTable.tableName }, - tracing: Tracing.ACTIVE + tracing: Tracing.ACTIVE, + timeout: Duration.seconds(10) } ) props.footprintTable.grantReadData(this.lambda) diff --git a/lib/share-stack.ts b/lib/share-stack.ts index 8225179..c0df2d4 100644 --- a/lib/share-stack.ts +++ b/lib/share-stack.ts @@ -1,4 +1,4 @@ -import { aws_dynamodb, aws_lambda_nodejs, Stack } from 'aws-cdk-lib' +import { aws_dynamodb, aws_lambda_nodejs, Duration, Stack } from 'aws-cdk-lib' import { Construct } from 'constructs' import { BaseStackProps } from './props' import { IFunction, Runtime, Tracing } from 'aws-cdk-lib/aws-lambda' @@ -22,7 +22,8 @@ export class ShareStack extends Stack { environment: { TABLE_NAME: props.dynamoTable.tableName }, - tracing: Tracing.ACTIVE + tracing: Tracing.ACTIVE, + timeout: Duration.seconds(10) }) props.dynamoTable.grantReadData(this.lambda) }