File tree Expand file tree Collapse file tree 6 files changed +46
-4
lines changed
book-search/gateway_setup Expand file tree Collapse file tree 6 files changed +46
-4
lines changed Original file line number Diff line number Diff line change 33import json
44import os
55import boto3
6+ from botocore .config import Config
67from bedrock_agentcore_starter_toolkit .operations .gateway .client import GatewayClient
78
89
@@ -53,6 +54,16 @@ def main():
5354
5455 # Create Gateway client for us-west-2
5556 gateway_client = GatewayClient (region_name = "us-west-2" )
57+ retry_config = Config (
58+ retries = {
59+ "max_attempts" : 10 ,
60+ "mode" : "standard" ,
61+ }
62+ )
63+ boto_client = boto3 .client (
64+ "bedrock-agentcore-control" , region_name = "us-west-2" , config = retry_config
65+ )
66+ gateway_client .client = boto_client
5667
5768 # Create Gateway
5869 role_arn = f"arn:aws:iam::{ account_id } :role/mcp-lambda-example-agentcore-gateways"
Original file line number Diff line number Diff line change 33import json
44import os
55import boto3
6+ from botocore .config import Config
67
78
89def main ():
@@ -23,8 +24,14 @@ def main():
2324 return
2425
2526 # Delete all gateway targets
27+ retry_config = Config (
28+ retries = {
29+ "max_attempts" : 10 ,
30+ "mode" : "standard" ,
31+ }
32+ )
2633 agentcore_client = boto3 .client (
27- "bedrock-agentcore-control" , region_name = "us-west-2"
34+ "bedrock-agentcore-control" , region_name = "us-west-2" , config = retry_config
2835 )
2936
3037 targets = agentcore_client .list_gateway_targets (gatewayIdentifier = gateway_id )
Original file line number Diff line number Diff line change @@ -72,7 +72,10 @@ async function main() {
7272 } ;
7373
7474 // Create Gateway
75- const agentCoreClient = new BedrockAgentCoreControlClient ( { region } ) ;
75+ const agentCoreClient = new BedrockAgentCoreControlClient ( {
76+ region,
77+ maxAttempts : 10 ,
78+ } ) ;
7679 const roleArn = `arn:aws:iam::${ accountId } :role/mcp-lambda-example-agentcore-gateways` ;
7780
7881 const gateway = await agentCoreClient . send (
Original file line number Diff line number Diff line change @@ -38,7 +38,10 @@ async function main() {
3838 throw error ;
3939 }
4040
41- const agentCoreClient = new BedrockAgentCoreControlClient ( { region } ) ;
41+ const agentCoreClient = new BedrockAgentCoreControlClient ( {
42+ region,
43+ maxAttempts : 10 ,
44+ } ) ;
4245
4346 // Delete all gateway targets
4447 const targets = await agentCoreClient . send (
Original file line number Diff line number Diff line change 33import json
44import os
55import boto3
6+ from botocore .config import Config
67from bedrock_agentcore_starter_toolkit .operations .gateway .client import GatewayClient
78
89
@@ -39,6 +40,16 @@ def main():
3940
4041 # Create Gateway client for us-west-2
4142 gateway_client = GatewayClient (region_name = "us-west-2" )
43+ retry_config = Config (
44+ retries = {
45+ "max_attempts" : 10 ,
46+ "mode" : "standard" ,
47+ }
48+ )
49+ boto_client = boto3 .client (
50+ "bedrock-agentcore-control" , region_name = "us-west-2" , config = retry_config
51+ )
52+ gateway_client .client = boto_client
4253
4354 # Create Gateway
4455 role_arn = f"arn:aws:iam::{ account_id } :role/mcp-lambda-example-agentcore-gateways"
Original file line number Diff line number Diff line change 33import json
44import os
55import boto3
6+ from botocore .config import Config
67
78
89def main ():
@@ -23,8 +24,14 @@ def main():
2324 return
2425
2526 # Delete all gateway targets
27+ retry_config = Config (
28+ retries = {
29+ "max_attempts" : 10 ,
30+ "mode" : "standard" ,
31+ }
32+ )
2633 agentcore_client = boto3 .client (
27- "bedrock-agentcore-control" , region_name = "us-west-2"
34+ "bedrock-agentcore-control" , region_name = "us-west-2" , config = retry_config
2835 )
2936
3037 targets = agentcore_client .list_gateway_targets (gatewayIdentifier = gateway_id )
You can’t perform that action at this time.
0 commit comments