diff --git a/template.yaml b/template.yaml index 7d2354f..a6307b5 100644 --- a/template.yaml +++ b/template.yaml @@ -21,8 +21,22 @@ Globals: MemorySize: 1024 Architectures: - arm64 + # Access logging + default throttling on the implicit HTTP API (audit M-18). + HttpApi: + AccessLogSettings: + DestinationArn: !GetAtt ApiAccessLogGroup.Arn + Format: '{"requestId":"$context.requestId","ip":"$context.identity.sourceIp","requestTime":"$context.requestTime","method":"$context.httpMethod","routeKey":"$context.routeKey","status":"$context.status","protocol":"$context.protocol","responseLength":"$context.responseLength","integrationError":"$context.integrationErrorMessage"}' + DefaultRouteSettings: + ThrottlingBurstLimit: 50 + ThrottlingRateLimit: 100 Resources: + ApiAccessLogGroup: + Type: AWS::Logs::LogGroup + Properties: + LogGroupName: /aws/apigateway/afterhours-shift-manager + RetentionInDays: 90 + # --- Shared Lambda Layer --- SharedLayer: Type: AWS::Serverless::LayerVersion