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

Add APIs prop to GuLambdaFunction #28

Merged
merged 8 commits into from
Dec 7, 2020

Conversation

jamie-lynch
Copy link
Contributor

What does this change?

This PR adds a new apis prop to the GuLambdaFunction to which an array of config for LambdaRestApis can be passed. This means that lambdas with an API gateway can be instantiated in one go.

Does this change require changes to existing projects or CDK CLI?

This is a new, non-breaking feature so existing stacks won't require changes. Currently no migrated stacks make use of this feature but soon to be migrated stacks will.

How to test

A new snapshot has been added which includes the extra resources created when the apis prop is used. Further testing can be done by migrating a stack that already uses lambdas and API gateway and verifying that the output is the same.

How can we measure success?

Stacks which have api gateways along with lambda functions can specify them via the apis prop for simpler configuration.

Have we considered potential risks?

n/a

Images

n/a

@jamie-lynch jamie-lynch requested a review from a team December 3, 2020 16:19
Copy link
Contributor

@stephengeller stephengeller left a comment

Choose a reason for hiding this comment

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

Looks good! Won't approve as I contributed but nice work getting tests on it

@stephengeller stephengeller force-pushed the sg-jl/google-chat-bots-migration branch from e5a5c2d to 735e50d Compare December 4, 2020 14:01
@stephengeller stephengeller requested a review from a team December 4, 2020 16:46
it("should create a lambda function with an api gateway", () => {
const stack = new Stack();

new GuLambdaFunction(stack, "lambda", {
Copy link
Member

Choose a reason for hiding this comment

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

We probably want GuLambdaFunction to take in a GuStack as it's first argument, rather than a Construct as this will provide the stack and stage params and tags for free.

@jamie-lynch jamie-lynch requested a review from akash1810 December 7, 2020 11:12
@jamie-lynch jamie-lynch merged commit f725f42 into main Dec 7, 2020
@jamie-lynch jamie-lynch deleted the sg-jl/google-chat-bots-migration branch December 7, 2020 13:05
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.

3 participants