File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
book-search/gateway_setup Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -68,8 +68,12 @@ def main():
6868 # Create Gateway
6969 role_arn = f"arn:aws:iam::{ account_id } :role/mcp-lambda-example-agentcore-gateways"
7070
71+ gateway_name = f"LambdaMcpServer-BookSearch-Gateway{ suffix } "
72+ if len (gateway_name ) > 50 :
73+ gateway_name = gateway_name [:50 ]
74+
7175 gateway = gateway_client .create_mcp_gateway (
72- name = f"LambdaMcpServer-BookSearch-Gateway { suffix } " ,
76+ name = gateway_name ,
7377 role_arn = role_arn ,
7478 authorizer_config = authorizer_config ,
7579 enable_semantic_search = False ,
Original file line number Diff line number Diff line change @@ -78,9 +78,14 @@ async function main() {
7878 } ) ;
7979 const roleArn = `arn:aws:iam::${ accountId } :role/mcp-lambda-example-agentcore-gateways` ;
8080
81+ let gatewayName = `LambdaMcpServer-Dictionary-Gateway${ suffix } ` ;
82+ if ( gatewayName . length > 50 ) {
83+ gatewayName = gatewayName . substring ( 0 , 50 ) ;
84+ }
85+
8186 const gateway = await agentCoreClient . send (
8287 new CreateGatewayCommand ( {
83- name : `LambdaMcpServer-Dictionary-Gateway ${ suffix } ` ,
88+ name : gatewayName ,
8489 roleArn,
8590 protocolType : "MCP" ,
8691 authorizerType : "CUSTOM_JWT" ,
Original file line number Diff line number Diff line change @@ -54,8 +54,12 @@ def main():
5454 # Create Gateway
5555 role_arn = f"arn:aws:iam::{ account_id } :role/mcp-lambda-example-agentcore-gateways"
5656
57+ gateway_name = f"LambdaMcpServer-Inspiration-Gateway{ suffix } "
58+ if len (gateway_name ) > 50 :
59+ gateway_name = gateway_name [:50 ]
60+
5761 gateway = gateway_client .create_mcp_gateway (
58- name = f"LambdaMcpServer-Inspiration-Gateway { suffix } " ,
62+ name = gateway_name ,
5963 role_arn = role_arn ,
6064 authorizer_config = authorizer_config ,
6165 enable_semantic_search = False ,
You can’t perform that action at this time.
0 commit comments