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

python function is not accessible via the amplify v2 data/resource.ts file (or it is not clear how) #3099

Open
cookiejest opened this issue Dec 29, 2024 · 1 comment
Labels

Comments

@cookiejest
Copy link

Environment information

i am following the instructions here but it is not clear how to reference a python function from the data/resource.ts 

It deploys the lambda function correctly (although I imagine most cases will also want to specify a custom docker image as well.

Can you provide an example of how to do that?

https://medium.com/@misha.slyusarev/amplify-gen-2-custom-python-function-with-cdk-5e5b79b91b10

Describe the bug

no way to surface python function in the UI

Reproduction steps

follow instructions as specified here. https://medium.com/@misha.slyusarev/amplify-gen-2-custom-python-function-with-cdk-5e5b79b91b10

How to use the python function in the data/resource.ts file?

@ykethan
Copy link
Member

ykethan commented Dec 30, 2024

Hey @cookiejest, thank you for reaching out. Support for python function is currently being tracked on aws-amplify/amplify-backend#1602 and refer to the comments providing some additional information.

Transferring the issue to the API repository for further assistance on the lambda as data source.
On the backend.ts you should be able to use backend.data.addLambdaDataSource to add the custom function as a data source.
Then use create a custom query with a custom handler resolver to use the datasource.
https://docs.amplify.aws/react/build-a-backend/data/custom-business-logic/#step-2---configure-custom-business-logic-handler-code

@ykethan ykethan transferred this issue from aws-amplify/amplify-backend Dec 30, 2024
@AnilMaktala AnilMaktala added pending-response pending-community-response Issue is pending a response from the author or community. labels Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants