

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# Infrastructure Composer でカードを切断する
<a name="reference-navigation-gestures-disconnect"></a>

Infrastructure Composer では、*拡張コンポーネントカード*と*標準コンポーネントカード*を使用して AWS リソースを接続および切断します。このセクションでは、両方のタイプのカードを切断する方法について説明します。

## 拡張コンポーネントカード
<a name="using-composer-connecting-enhanced-disconnect"></a>

拡張コンポーネントカードを切断するには、行を選択し、**切断**を選択します。

![\[Lambda 関数から切断されている API Gateway カード。\]](http://docs.aws.amazon.com/ja_jp/infrastructure-composer/latest/dg/images/aac_use_con_03.png)


Infrastructure Composer は、テンプレートを自動的に変更して、アプリケーションからイベント駆動型の関係を削除します。

## 標準コンポーネントカード
<a name="w2aac17c31b7"></a>

標準コンポーネントカードには、他のリソースとの接続を作成するためのポートは含まれていません。[カードの設定](using-composer-standard-cards.md)中に、アプリケーションのテンプレートでイベント駆動型の関係を指定すると、Infrastructure Composer はこれらの接続を自動的に検出し、カード間の点線で視覚化します。標準コンポーネントカードを切断するには、アプリケーションの テンプレートでイベント駆動型リレーションシップを削除します。

次の例は、Amazon API Gateway の rest API に接続されている Lambda 関数を示しています。

```
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
```

2 つのカード間の接続を削除するには、 `ApiGatewayMethod:`の に`MyLambdaFunction`リストされている への参照を削除します`Integration`。