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

Context::default() function or associated item not found in Context #776

Closed
1oglop1 opened this issue Jan 15, 2024 · 3 comments · Fixed by #778
Closed

Context::default() function or associated item not found in Context #776

1oglop1 opened this issue Jan 15, 2024 · 3 comments · Fixed by #778

Comments

@1oglop1
Copy link

1oglop1 commented Jan 15, 2024

Hi, I've been using 0.8.1 and after updating to 0.9.0 I can no longer run tests.

src/main.rs:86:36
   |
86 |         let mut context = Context::default();
   |                                    ^^^^^^^ function or associated item not found in `Context`

Although readme and examples still show Context::default(). Has that been removed on purpose?

I replicated the issue on this project as well https://github.com/awslabs/aws-lambda-rust-runtime/tree/main/examples/basic-sdk/src

Tried it on the

  • current master - did not work
  • on tag lambda-runtime-0.8.1 - worked as expected, can confirm this still works in 0.8.3

This seems to be a root issue:

53637e7#diff-ea9f9e8a3273dae249b71b478e9026be91d1ee33c280edec3d1aa25077f7bd11L100

#732

@calavera
Copy link
Contributor

What do you use a default context with no data for?

Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for the maintainers of this repository to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@1oglop1
Copy link
Author

1oglop1 commented Jan 16, 2024

@calavera
Thanks for fixing it!

  1. I did not study what even the Context is and I just followed the readme -> https://github.com/awslabs/aws-lambda-rust-runtime?tab=readme-ov-file#testing-your-code-with-unit-and-integration-tests
  2. I use it in integration tests where I have a local instance (docker) of Dynamo DB and I provide it with a custom SdkConfig
    use aws_credential_types::provider::SharedCredentialsProvider;
    use aws_credential_types::Credentials;
    let c = Credentials::new("x", "x", None, None, "my_provider_name");

    aws_config::SdkConfig::builder()
        .credentials_provider(SharedCredentialsProvider::new(c))
        .region(Region::new("local-env"))
        .endpoint_url("http://localhost:5001")
        .build()

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 a pull request may close this issue.

2 participants