Skip to content

Commit 1a4e73f

Browse files
committed
fix: Truncate gateway names in integ tests
1 parent 0b8d517 commit 1a4e73f

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

examples/servers/book-search/gateway_setup/setup_gateway.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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,

examples/servers/dictionary/gateway_setup/setup-gateway.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff 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",

examples/servers/inspiration/setup_gateway.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)