本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
在基础架构编辑器中断开卡的连接
在 Infrastructure Composer 中,您可以使用增强的组件卡和标准组件卡来连接和断开 AWS 资源。本节介绍如何断开两种类型的卡的连接。
增强的组件卡
要断开增强型组件卡的连接,请选择该线路并选择 “断开连接”。

Infrastructure Composer 将自动修改您的模板,从您的应用程序中删除事件驱动的关系。
标准组件卡
标准组件卡不包括用于与其他资源建立连接的端口。在配置卡片期间,您可以在应用程序的模板中指定事件驱动的关系,Infrastructure Composer 将自动检测这些连接,并在卡片之间用虚线将它们可视化。要断开标准组件卡的连接,请删除应用程序模板中的事件驱动关系。
以下示例显示了与 Amazon Gate API way rest 关联的 Lambda 函数:API
AWSTemplateFormatVersion: '2010-09-09' Resources: MyApi: Type: 'AWS::ApiGateway::RestApi' Properties: Name: MyApi ApiGatewayMethod: Type: 'AWS::ApiGateway::Method' Properties: HttpMethod: POST # Specify the HTTP method you want to use (e.g., GET, POST, PUT, DELETE) ResourceId: !GetAtt MyApi.RootResourceId RestApiId: !Ref MyApi AuthorizationType: NONE Integration: Type: AWS_PROXY IntegrationHttpMethod: POST Uri: !Sub - arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${LambdaFunctionArn}/invocations - { LambdaFunctionArn: !GetAtt MyLambdaFunction.Arn } MethodResponses: - StatusCode: 200 MyLambdaFunction: Type: 'AWS::Lambda::Function' Properties: Handler: index.handler Role: !GetAtt LambdaExecutionRole.Arn Runtime: nodejs14.x Code: S3Bucket: your-bucket-name S3Key: your-lambda-zip-file.zip LambdaExecutionRole: Type: 'AWS::IAM::Role' Properties: AssumeRolePolicyDocument: Version: '2012-10-17' Statement: - Effect: Allow Principal: Service: lambda.amazonaws.com Action: 'sts:AssumeRole' Policies: - PolicyName: LambdaExecutionPolicy PolicyDocument: Version: '2012-10-17' Statement: - Effect: Allow Action: - 'logs:CreateLogGroup' - 'logs:CreateLogStream' - 'logs:PutLogEvents' Resource: 'arn:aws:logs:*:*:*' - Effect: Allow Action: - 'lambda:InvokeFunction' Resource: !GetAtt MyLambdaFunction.Arn
要移除两张卡片之间的连接,请移除MyLambdaFunction
下面列出的ApiGatewayMethod:
内容。Integration