diff --git a/README.md b/README.md index 2c3fc9b..edad5f9 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ We are using AWS SAM(Serverless Application Model) with [golang](https://go.dev/ ``` /profile /verify -/healthCheck +/health ``` ## State Machine Diagram diff --git a/template.yaml b/template.yaml index 54e86f4..dcc85b7 100644 --- a/template.yaml +++ b/template.yaml @@ -8,7 +8,8 @@ Description: > # More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst Globals: Function: - Timeout: 900 + Timeout: 5 + MemorySize: 128 Environment: Variables: firestoreCred: YourFirestoreCredentials @@ -18,35 +19,34 @@ Globals: Resources: HealthCheckFunction: Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction + Metadata: + BuildMethod: go1.x Properties: CodeUri: health-check/ - Handler: health-check - Runtime: go1.x + Handler: bootstrap + Runtime: provided.al2023 Architectures: - x86_64 - Tracing: Active # https://docs.aws.amazon.com/lambda/latest/dg/lambda-x-ray.html + Tracing: Active Events: CatchAll: Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api Properties: - Path: /healthCheck + Path: /health Method: GET ProfileFunction: Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction + Metadata: + BuildMethod: go1.x Properties: CodeUri: profile/ - Handler: profile - Runtime: go1.x + Handler: bootstrap + Runtime: provided.al2023 Architectures: - x86_64 - Tracing: Active # https://docs.aws.amazon.com/lambda/latest/dg/lambda-x-ray.html + Tracing: Active Events: - ScheduledEvent: - Type: Schedule - Properties: - Schedule: cron(0 18 ? * WED *) - Enabled: True CatchAll: Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api Properties: @@ -55,13 +55,15 @@ Resources: VerifyFunction: Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction + Metadata: + BuildMethod: go1.x Properties: CodeUri: verify/ - Handler: verify - Runtime: go1.x + Handler: bootstrap + Runtime: provided.al2023 Architectures: - x86_64 - Tracing: Active # https://docs.aws.amazon.com/lambda/latest/dg/lambda-x-ray.html + Tracing: Active Events: CatchAll: Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api @@ -69,34 +71,43 @@ Resources: Path: /verify Method: POST - CallProfileFunction: + CallProfilesFunction: Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction + Metadata: + BuildMethod: go1.x Properties: - CodeUri: call-profile/ - Handler: call-profile - Runtime: go1.x + CodeUri: call-profiles/ + Handler: bootstrap + Runtime: provided.al2023 Architectures: - x86_64 - Tracing: Active # https://docs.aws.amazon.com/lambda/latest/dg/lambda-x-ray.html + Tracing: Active Events: + ScheduledEvent: + Type: Schedule + Properties: + Schedule: cron(0 18 ? * WED *) + Enabled: True CatchAll: Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api Properties: - Path: /call-profile - Method: POST + Path: /profiles + Method: GET - CallProfilesFunction: + CallProfileFunction: Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction + Metadata: + BuildMethod: go1.x Properties: - CodeUri: call-profiles/ - Handler: call-profiles - Runtime: go1.x + CodeUri: call-profile/ + Handler: bootstrap + Runtime: provided.al2023 Architectures: - x86_64 - Tracing: Active # https://docs.aws.amazon.com/lambda/latest/dg/lambda-x-ray.html + Tracing: Active Events: CatchAll: Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api Properties: - Path: /profiles - Method: GET + Path: /call-profile + Method: POST \ No newline at end of file