diff --git a/template.yml b/template.yml index 1328fc0..4d2b6b8 100644 --- a/template.yml +++ b/template.yml @@ -97,11 +97,6 @@ Resources: RouteTableId: !Ref VpcPrivateRouteTable SubnetId: !Ref PrivateSubnet - MyApi: - Type: AWS::Serverless::Api - Properties: - StageName: Dev - SNDIFunction: Type: AWS::Serverless::Function Metadata: @@ -119,18 +114,22 @@ Resources: Handler: sndi Runtime: go1.x Events: - ProxyApiRoot: - Type: Api - Properties: - RestApiId: !Ref MyApi - Method: Get - Path: / - ProxyApiGreedy: - Type: Api + CatchAll: + Type: HttpApi Properties: - RestApiId: !Ref MyApi + ApiId: !Ref HttpApi Path: /{proxy+} + TimeoutInMillis: 10000 + PayloadFormatVersion: "2.0" Method: ANY + HttpApi: + Type: AWS::Serverless::HttpApi + Properties: + DefaultRouteSettings: + ThrottlingBurstLimit: 200 + FailOnWarnings: True + + StaticIpLambdaRole: Type: AWS::IAM::Role @@ -152,8 +151,8 @@ Outputs: SNDIFunction: Value: !GetAtt SNDIFunction.Arn API: - Description: "API Gateway endpoint URL for Dev stage" - Value: !Sub "https://${MyApi}.execute-api.${AWS::Region}.amazonaws.com/Dev/" + Description: "API Gateway endpoint URL" + Value: !Sub "https://${HttpApi}.execute-api.${AWS::Region}.amazonaws.com" StaticIpAddress: Description: Address of the generated static ip Value: !Ref ElasticIp