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: Link API Gateway Methods to Integrations #5174

Merged
merged 25 commits into from
May 16, 2023

Conversation

mildaniel
Copy link
Contributor

Which issue(s) does this change fix?

N/A

Why is this change necessary?

To support sam local start-api for Terraform resources, we need to read in the Terraform API Gateway resources and convert them to their corresponding CFN resources.

How does it address the issue?

Adds support for linking API Gateway methods to their corresponding API Gateway integrations. Additional handling needed to be done for these resources since they don't map 1:1 between Terraform and CFN. In Terraform, integrations are their own resources whereas in CFN, they are a field under the AWS::ApiGateway::Method resource.

  1. Added support for mapping internal integration resources to the corresponding REST API and Gateway Resource resources on the RestApiId and ResourceId fields, respectively.
  2. Linked all internal integration resources to the Lambda functions they are proxied to on the Uri field of the integration.
  3. Added additional handling during the translation to iterate over all methods, find the corresponding integration and map the fields from the integration to the ApiGatewayMethod.Properties.Integration field.

What side effects does this change have?

N/A

Mandatory Checklist

PRs will only be reviewed after checklist is complete

  • Add input/output type hints to new functions/methods
  • Write design document if needed (Do I need to write a design document?)
  • Write/update unit tests
  • Write/update integration tests
  • Write/update functional tests if needed
  • make pr passes
  • make update-reproducible-reqs if dependencies were changed
  • Write documentation

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

@mildaniel mildaniel requested a review from a team as a code owner May 15, 2023 23:09
Copy link
Contributor

@sriram-mv sriram-mv left a comment

Choose a reason for hiding this comment

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

Overall looks good to me. Added one thing to be changed.

Copy link
Contributor

@moelasmar moelasmar left a comment

Choose a reason for hiding this comment

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

Thanks Daniel

@mildaniel mildaniel enabled auto-merge May 16, 2023 21:37
@mildaniel mildaniel added this pull request to the merge queue May 16, 2023
Merged via the queue into aws:develop with commit 8d777e1 May 16, 2023
65 checks passed
@mildaniel mildaniel deleted the link-integrations branch May 16, 2023 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants