Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/bedrock_agentcore/gateway/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ def create_gateway_target_and_wait(self, wait_config: Optional[WaitConfig] = Non
TimeoutError: If the target doesn't become READY within max_wait.
"""
response = self.cp_client.create_gateway_target(**convert_kwargs(kwargs))
gw_arn = response["gatewayArn"]
gw_id = response["gatewayArn"].rsplit("/", 1)[-1]
target_id = response["targetId"]
return wait_until(
lambda: self.cp_client.get_gateway_target(
gatewayIdentifier=gw_arn,
gatewayIdentifier=gw_id,
targetId=target_id,
),
"READY",
Expand All @@ -184,11 +184,11 @@ def update_gateway_target_and_wait(self, wait_config: Optional[WaitConfig] = Non
TimeoutError: If the target doesn't become READY within max_wait.
"""
response = self.cp_client.update_gateway_target(**convert_kwargs(kwargs))
gw_arn = response["gatewayArn"]
gw_id = response["gatewayArn"].rsplit("/", 1)[-1]
target_id = response["targetId"]
return wait_until(
lambda: self.cp_client.get_gateway_target(
gatewayIdentifier=gw_arn,
gatewayIdentifier=gw_id,
targetId=target_id,
),
"READY",
Expand Down Expand Up @@ -232,11 +232,11 @@ def delete_gateway_target_and_wait(
TimeoutError: If the target isn't deleted within max_wait.
"""
response = self.cp_client.delete_gateway_target(**convert_kwargs(kwargs))
gw_arn = response["gatewayArn"]
gw_id = response["gatewayArn"].rsplit("/", 1)[-1]
target_id = response["targetId"]
wait_until_deleted(
lambda: self.cp_client.get_gateway_target(
gatewayIdentifier=gw_arn,
gatewayIdentifier=gw_id,
targetId=target_id,
),
wait_config=wait_config,
Expand Down
3 changes: 3 additions & 0 deletions tests_integ/gateway/test_gateway_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ def test_update_gateway_target_and_wait(self):
}
},
},
credentialProviderConfigurations=[
{"credentialProviderType": "GATEWAY_IAM_ROLE"},
],
description="updated by integ test",
)
assert updated["status"] == "READY"
Expand Down