feat: update runtime client with passthrough#434
Conversation
|
| max_wait. | ||
| """ | ||
| response = self.cp_client.create_agent_runtime_endpoint( | ||
| **convert_kwargs(kwargs), |
There was a problem hiding this comment.
nit: should we call convert_kwargs once and re-use?
There was a problem hiding this comment.
yep I'll make this change
| response = self.cp_client.create_agent_runtime_endpoint( | ||
| **convert_kwargs(kwargs), | ||
| ) | ||
| rid = kwargs.get( |
There was a problem hiding this comment.
would the behavior here be the same if we checked the field on the converted kwargs once?
My current understanding of the flow is we check for agentRuntimeId, then fallback to the converted ones. However, I thought converting it handled it for us here?
There was a problem hiding this comment.
You're correct, we can check the converted kwargs once with the same end behavior. I will update
| validate_region(region) | ||
| self.region = region | ||
| session = session if session else boto3.Session() | ||
| self.region = region or session.region_name or "us-west-2" |
There was a problem hiding this comment.
do we still need to validate the region or does boto3 handle this for us? Wondering if this opens us up to poisoning the endpoint? Context: #417
There was a problem hiding this comment.
boto3 validates the region for its client creation (raises botocore.exceptions.InvalidRegionError for malicious inputs). Self.region is used to construct the websocket URLs, but that method calls validate_region() internally, so technically we are still fine with this region construction
However, we can validate_region on the __init__ construction for safety. I'll make this change
Issue #, if available: Issue #391
Description of changes:
__getattr__passthrough with accept_snake_case_kwargs to AgentCoreRuntimeClient__init__to create cp_client and dp_client boto3 clients*_and_waitpolling methods using shared wait_until/wait_until_deleted utilities:*_and_waitmethods accept WaitConfig for configurable polling behavior and apply convert_kwargs for snake_case supportTest plan
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.