-
Notifications
You must be signed in to change notification settings - Fork 74
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
defineFunction
initial implementation
#742
Conversation
🦋 Changeset detectedLatest commit: 3cdb1a3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
packages/backend-function/src/test-assets/default-lambda/handler.ts
Outdated
Show resolved
Hide resolved
...ration-tests/test-projects/data-storage-auth-with-triggers-cjs/amplify/data/echo/handler.cjs
Outdated
Show resolved
Hide resolved
...ntegration-tests/test-projects/data-storage-auth-with-triggers-cjs/update-1/data/resource.ts
Show resolved
Hide resolved
// if entry is not set, default to handler.ts | ||
if (!this.props.entry) { | ||
return path.join(getCallerDirectory(this.callerStack), 'handler.ts'); | ||
} | ||
|
||
// if entry is absolute use that | ||
if (path.isAbsolute(this.props.entry)) { | ||
return this.props.entry; | ||
} | ||
return constructContainer.getOrCompute( | ||
this.generator | ||
) as AmplifyLambdaFunction; | ||
|
||
// if entry is relative, compute with respect to the caller directory | ||
return path.join(getCallerDirectory(this.callerStack), this.props.entry); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have req for these fallbacks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does req mean requirements? I'm not sure the PMs have explicitly stated it anywhere, but they have written examples where they seem to expect this behavior.
Issue #, if available:
Description of changes:
Initial implementation of
defineFunction
. This PR includes:function-construct-alpha
packagebackend-function
to removeFunc.fromDir
andFunc.build
in favor ofdefineFunction
which acts as a wrapper around CDK's NodejsFunctionWhat's not included:
defineFunction
is not implemented. Things like lambda memory size, timeout, and environment variables are easy additions in follow up PRsBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.