Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add TimeoutInMillis Property to API Event Source #3310

Merged
merged 9 commits into from
Aug 18, 2023

Conversation

gracelu0
Copy link
Contributor

@gracelu0 gracelu0 commented Aug 17, 2023

Issue #, if available

Feature request discussion: #3287

  • Both Global level and Function level support are requested, but only Function level support is implemented in this pull request.

Description of changes

Add TimeoutInMillis Property to API Event Source (currently only supported for HTTP API Event Source).

Example:

MyFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: src/handlers/code.handler
      Events:
        MyApiEvent:
          Type: Api  # API Event Source
          Properties:
            Path: /hello
            Method: GET
            TimeoutInMillis: 5000 # Now supported

Description of how you validated changes

Validated with transform tests and integration tests. Transformed template with added TimeoutInMillis property, then deployed it successfully. Added integration test also verifies that the TimeoutInMillis property is set to the expected value from the template.

Checklist

Examples?

Please reach out in the comments if you want to add an example. Examples will be
added to sam init through aws/aws-sam-cli-app-templates.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@gracelu0 gracelu0 changed the title Add TimeoutInMillis Property to API Event Source feat: Add TimeoutInMillis Property to API Event Source Aug 17, 2023
@gracelu0 gracelu0 marked this pull request as ready for review August 17, 2023 22:06
@gracelu0 gracelu0 requested a review from a team as a code owner August 17, 2023 22:06
Copy link
Contributor

@aaythapa aaythapa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think globals can be implemented in this PR too, just to have everything roll out at once. Unless we have a good reason not to?

@gracelu0
Copy link
Contributor Author

I think globals can be implemented in this PR too, just to have everything roll out at once. Unless we have a good reason not to?

TimeoutInMillis is not a supported global property for HTTP APIs currently (https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification-template-anatomy-globals.html), so for consistency I first implemented the function level support.

@xazhao
Copy link
Contributor

xazhao commented Aug 18, 2023

LGTM!

@gracelu0 gracelu0 merged commit 14ef743 into aws:develop Aug 18, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants