Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

boto3.resource vs boto3.client #4412

Closed
plushcare-chau opened this issue Jan 29, 2025 · 1 comment
Closed

boto3.resource vs boto3.client #4412

plushcare-chau opened this issue Jan 29, 2025 · 1 comment
Assignees
Labels
documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged.

Comments

@plushcare-chau
Copy link

Describe the issue

in this example, boto3.resource() is used as a client

in later examples, we use boto3.client().

Which method is preferred?

Links

https://boto3.amazonaws.com/v1/documentation/api/latest/guide/sqs.html#creating-a-queue
https://boto3.amazonaws.com/v1/documentation/api/latest/guide/sqs-example-sending-receiving-msgs.html#receive-and-delete-messages-from-a-queue

@plushcare-chau plushcare-chau added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Jan 29, 2025
@RyanFitzSimmonsAK RyanFitzSimmonsAK self-assigned this Jan 29, 2025
@RyanFitzSimmonsAK
Copy link
Contributor

Hi @plushcare-chau, thanks for reaching out. I'll be turning this into a discussion, as it is a guidance question.

Using the client is recommended. Using resources might work depending on what you're trying to do, but resources have been feature frozen (not deprecated) for some time now, and might be missing recent service features. If what you're trying to do is fully supported by resources, then you can use either. You can check SQS resource operations here. Let me know if you have any follow-up questions.

@boto boto locked and limited conversation to collaborators Jan 29, 2025
@RyanFitzSimmonsAK RyanFitzSimmonsAK converted this issue into discussion #4414 Jan 29, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants