Ce générateur est utilisé pour connecter des projets entre eux, comme des sites web appelant des API. Sélectionnez simplement le projet source (par exemple le projet qui appellera votre API) et le projet cible (par exemple votre projet API), et ce générateur se chargera d’intégrer les deux.
Esquissez-le visuellement
Vous préférez concevoir votre espace de travail d’abord ? Le Graph Builder vous permet de faire glisser des projets et de tracer les connexions entre eux, puis vous donne les commandes pour échafauder le tout.
pnpm nx g @aws/nx-plugin:connection
yarn nx g @aws/nx-plugin:connection
npx nx g @aws/nx-plugin:connection
bunx nx g @aws/nx-plugin:connection
Vous pouvez également effectuer une simulation pour voir quels fichiers seraient modifiés pnpm nx g @aws/nx-plugin:connection --dry-run
yarn nx g @aws/nx-plugin:connection --dry-run
npx nx g @aws/nx-plugin:connection --dry-run
bunx nx g @aws/nx-plugin:connection --dry-run
Installez le Nx Console VSCode Plugin si ce n'est pas déjà fait Ouvrez la console Nx dans VSCode Cliquez sur Generate (UI) dans la section "Common Nx Commands" Recherchez @aws/nx-plugin - connection Remplissez les paramètres requis Cliquez sur Generate
Paramètre Type Par défaut Description sourceProject Requis string - Le projet source targetProject Requis string - Le projet cible auquel se connecter sourceComponent string - Le composant source depuis lequel se connecter (nom du composant, chemin relatif à la racine du projet source, ou identifiant du générateur). Utilisez '.' pour sélectionner explicitement le projet comme source. targetComponent string - Le composant cible auquel se connecter (nom du composant, chemin relatif à la racine du projet cible, ou identifiant du générateur). Utilisez '.' pour sélectionner explicitement le projet comme cible. preferInstallDependencies boolean true Indique s'il faut privilégier l'installation des dépendances après l'exécution du générateur. Définir à false pour différer l'installation lors de l'exécution de plusieurs générateurs en lot (une installation s'exécute quand même si nécessaire pour que les générateurs suivants puissent calculer le graphe de projet Nx) ; installer une seule fois à la fin.
Le générateur Connection prend en charge les connexions suivantes :
React to tRPC Call a tRPC API from a React website React to FastAPI Call a Python FastAPI from a React website React to Smithy API Call a Smithy API from a React website React to Python Agent Call a Python Agent from a React website React to TypeScript Agent Call a TypeScript Agent from a React website React to AG-UI Agent Call an Agent exposing the AG-UI protocol from a React website via CopilotKit Python Agent to MCP Connect a Python Agent to an MCP server TypeScript Agent to MCP Connect a TypeScript Agent to an MCP server Python Agent to A2A Agent Connect a Python Agent to a remote A2A agent TypeScript Agent to A2A Agent Connect a TypeScript Agent to a remote A2A agent tRPC API to Relational Database Connect a tRPC API to an Aurora relational database Smithy API to Relational Database Connect a Smithy API to an Aurora relational database TypeScript Agent to Relational Database Connect a TypeScript Agent to an Aurora relational database TypeScript MCP Server to Relational Database Connect a TypeScript MCP Server to an Aurora relational database FastAPI to Python Relational Database Connect a FastAPI to a Python Aurora relational database Python Agent to Python Relational Database Connect a Python Agent to a Python Aurora relational database Python MCP Server to Python Relational Database Connect a Python MCP Server to a Python Aurora relational database tRPC API to TypeScript DynamoDB Connect a tRPC API to a DynamoDB table Smithy API to TypeScript DynamoDB Connect a Smithy API to a DynamoDB table TypeScript Agent to TypeScript DynamoDB Connect a TypeScript Agent to a DynamoDB table MCP Server to TypeScript DynamoDB Connect a TypeScript MCP Server to a DynamoDB table FastAPI to Python DynamoDB Connect a FastAPI to a DynamoDB table Python Agent to Python DynamoDB Connect a Python Agent to a DynamoDB table Python MCP Server to Python DynamoDB Connect a Python MCP Server to a DynamoDB table AgentCore Gateway to MCP Server Aggregate an MCP server behind an AgentCore Gateway AgentCore Gateway to AgentCore Gateway Aggregate an AgentCore Gateway behind another AgentCore Gateway TypeScript Agent to AgentCore Gateway Connect a TypeScript Agent to an AgentCore Gateway Python Agent to AgentCore Gateway Connect a Python Agent to an AgentCore Gateway AgentCore Gateway to Agent Front an agent with an AgentCore Gateway as a runtime target React Website to AgentCore Gateway Connect a React website to agents through an AgentCore Gateway
Configuration d’exécution
Le générateur de connexion utilise la Configuration d’exécution pour transmettre des valeurs de déploiement (telles que les URL d’API, les paramètres Cognito et les ARN d’exécution d’agent) entre les projets et composants générés au moment de l’exécution afin qu’ils puissent se découvrir et se connecter les uns aux autres.