-
Notifications
You must be signed in to change notification settings - Fork 64
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 lamda data client support #2224
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 6e3ba61 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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/function_data_config_generator.ts
Outdated
Show resolved
Hide resolved
packages/backend-function/src/runtime/get_amplify_clients_configuration.ts
Outdated
Show resolved
Hide resolved
517f304
to
eb41f64
Compare
packages/backend-function/src/runtime/get_amplify_clients_configuration.ts
Show resolved
Hide resolved
packages/backend-function/src/function_data_config_generator.ts
Outdated
Show resolved
Hide resolved
packages/backend-function/src/runtime/get_amplify_clients_configuration.ts
Outdated
Show resolved
Hide resolved
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
import * as __export__runtime from './runtime/index.js'; | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
import * as __export__get_amplify_clients_configuration from './runtime/get_amplify_clients_configuration.js'; | ||
|
||
/* | ||
Api-extractor does not ([yet](https://github.com/microsoft/rushstack/issues/1596)) support multiple package entry points | ||
Because this package has a submodule export, we are working around this issue by including that export here and directing api-extract to this entry point instead | ||
This allows api-extractor to pick up the submodule exports in its analysis | ||
*/ | ||
export { __export__runtime, __export__get_amplify_clients_configuration }; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
The changes look good to me. The only missing part is an e2e test where we assert that lambda function can access the data client at runtime. E.g.
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.
lgtm
packages/backend-function/src/runtime/get_amplify_clients_configuration.ts
Show resolved
Hide resolved
1ebc7f0
to
bf16475
Compare
bf16475
to
d1dec7f
Compare
This comment was marked as resolved.
This comment was marked as resolved.
packages/integration-tests/src/test-projects/data-and-function/amplify/backend.ts
Fixed
Show fixed
Hide fixed
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.
LGTM
Co-authored-by: Kamil Sobol <sobkamil@amazon.com>
packages/integration-tests/src/test-project-setup/data_and_function_project.ts
Outdated
Show resolved
Hide resolved
...tegration-tests/src/test-projects/data-and-function/amplify/functions/noop-import/handler.ts
Outdated
Show resolved
Hide resolved
…a/function-runtime-config
packages/integration-tests/src/test-projects/data_access_from_function/amplify/backend.ts
Dismissed
Show dismissed
Hide dismissed
…a/function-runtime-config
Problem
Users would like to use the Gen2 data client interface to access their APIs from application functions (lambda's).
Our docs offer instructions on this experience, which stop short of indicating how the customer should provide the model introspection schema needed to make the whole experience work.
Changes
resource
permissions to the data schemaimport { getAmplifyClientsConfiguration } from "@aws-amplify/backend/function/runtime";
Example:
amplify/functions/todo-count/handler.ts
Corresponding docs PR, if applicable:
aws-amplify/docs#8096
Validation
S3Client
Checklist
run-e2e
label set.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.