aws-samples / serverless-patterns

Serverless patterns. Learn more at the website: https://serverlessland.com/patterns.
https://serverlessland.com
Other
1.48k stars 863 forks source link

Benpyle api gateway ddb rust #1934

Closed benbpyle closed 5 months ago

benbpyle commented 5 months ago

Issue #1933

Description of changes:

New Pattern for querying DyanamoDB via Lambda coded in Rust and executed by API Gateway

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

benbpyle commented 5 months ago

Updated the PR for the fixes to the example-pattern.json in the social fields

julianwood commented 5 months ago

I'm getting the following size message when deploying using SAM CLI, version 1.103.0: Resource handler returned message: "Unzipped size must be smaller than 262144000 bytes (Service: Lambda, Status Code: 400, Request ID: 2e50a6ab-3446-4e67-8359-7f09438a76e2)" (RequestToken: 0ada374f-1555-a591-6372-c5056a9304a9, HandlerErrorCode: InvalidRequest)

benbpyle commented 5 months ago

@julianwood Let me take a look. I've deployed multiple times so i must have checked something in wrong. Let me get back to you

benbpyle commented 5 months ago

@julianwood

Here are the steps I just ran locally. I started from a clean environment. Then I deleted and ran it again and both times it worked great. Can you give more details about what you are seeing and running?

sam build --beta-features
sam deploy --guided
julianwood commented 5 months ago

Hi, I'm still struggling to deploy this. The original README says to just deploy with experimental features. Your recent comment includes a build as well.

If I just deploy, the deploy works.

I curl the endpoint curl https://xxxxxxxx.execute-api.us-east-1.amazonaws.com/Prod/one which results in {"message": "Internal server error"} CloudWatch shows

INIT_START Runtime Version: provided:al2.v28    Runtime Version ARN: arn:aws:lambda:us-east-1::runtime:c2f9d23694707c1161c0d3fbc0673f4ee14150265f4f3081161948aa71fad0a0
INIT_REPORT Init Duration: 0.24 ms  Phase: init Status: error   Error Type: Runtime.InvalidEntrypoint
INIT_REPORT Init Duration: 0.24 ms  Phase: invoke   Status: error   Error Type: Runtime.InvalidEntrypoint
START RequestId: 8df691f9-6db4-43c3-a4e5-8e689183f526 Version: $LATEST
RequestId: 8df691f9-6db4-43c3-a4e5-8e689183f526 Error: Couldn't find valid bootstrap(s): [/var/task/bootstrap /opt/bootstrap]Runtime.InvalidEntrypoint
END RequestId: 8df691f9-6db4-43c3-a4e5-8e689183f526
REPORT RequestId: 8df691f9-6db4-43c3-a4e5-8e689183f526  Duration: 19.37 ms  Billed Duration: 20 ms  Memory Size: 128 MB Max Memory Used: 2 MB

When I also try a build step

# sam --version
SAM CLI, version 1.105.0
# sam build --beta-features

Experimental features are enabled for this session.
Visit the docs page to learn more about the AWS Beta terms https://aws.amazon.com/service-terms/.

Building codeuri: /git/serverless-patterns/apigw-ddb-rust runtime: provided.al2 metadata: {'BuildMethod':
'rust-cargolambda'} architecture: arm64 functions: GetByIdFunction
Workflow RustCargoLambdaBuilder does not support value "False" for building in source. Using default value "True".

Build Failed
Error: RustCargoLambdaBuilder:Resolver - Path resolution for runtime: provided of binary: cargo was not successful
FAIL

Any ideas!

benbpyle commented 5 months ago

Something seems off. Let me double check and get back to you.

On Thursday, December 21, 2023, Julian Wood @.***> wrote:

Hi, I'm still struggling to deploy this. The original README says to just deploy with experimental features. Your recent comment includes a build as well.

If I just deploy, the deploy works.

I curl the endpoint curl https://xxxxxxxx.execute-api. us-east-1.amazonaws.com/Prod/one which results in {"message": "Internal server error"} CloudWatch shows

INIT_START Runtime Version: provided:al2.v28 Runtime Version ARN: arn:aws:lambda:us-east-1::runtime:c2f9d23694707c1161c0d3fbc0673f4ee14150265f4f3081161948aa71fad0a0 INIT_REPORT Init Duration: 0.24 ms Phase: init Status: error Error Type: Runtime.InvalidEntrypoint INIT_REPORT Init Duration: 0.24 ms Phase: invoke Status: error Error Type: Runtime.InvalidEntrypoint START RequestId: 8df691f9-6db4-43c3-a4e5-8e689183f526 Version: $LATEST RequestId: 8df691f9-6db4-43c3-a4e5-8e689183f526 Error: Couldn't find valid bootstrap(s): [/var/task/bootstrap /opt/bootstrap]Runtime.InvalidEntrypoint END RequestId: 8df691f9-6db4-43c3-a4e5-8e689183f526 REPORT RequestId: 8df691f9-6db4-43c3-a4e5-8e689183f526 Duration: 19.37 ms Billed Duration: 20 ms Memory Size: 128 MB Max Memory Used: 2 MB

When I also try a build step

sam --version

SAM CLI, version 1.105.0

sam build --beta-features

Experimental features are enabled for this session. Visit the docs page to learn more about the AWS Beta terms https://aws.amazon.com/service-terms/.

Building codeuri: /git/serverless-patterns/apigw-ddb-rust runtime: provided.al2 metadata: {'BuildMethod': 'rust-cargolambda'} architecture: arm64 functions: GetByIdFunction Workflow RustCargoLambdaBuilder does not support value "False" for building in source. Using default value "True".

Build Failed Error: RustCargoLambdaBuilder:Resolver - Path resolution for runtime: provided of binary: cargo was not successful FAIL

Any ideas!

— Reply to this email directly, view it on GitHub https://github.com/aws-samples/serverless-patterns/pull/1934#issuecomment-1866619874, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG6HZYFZIF3VWXG4ZZPEKDYKRQZNAVCNFSM6AAAAABAIU5XEOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRWGYYTSOBXGQ . You are receiving this because you authored the thread.Message ID: @.***>

-- [image: This is Benjamen Pyle's card. Their email is @.*** Their phone number is +1 817 557 7109.] https://hihello.me/p/62d18782-7e53-468d-bd27-cdb3a57cda76