

# IVS 채팅룸 생성을 위한 CLI 지침

이 문서에서는 AWS CLI를 사용하여 Amazon IVS Chat 채팅방을 생성하는 데 관련된 단계를 안내합니다.

## 채팅룸 생성
<a name="create-room-cli-chat-room"></a>

AWS CLI를 사용하여 채팅룸을 생성하는 방법은 고급 옵션이며, 먼저 시스템에 CLI를 다운로드하고 구성해야 합니다. 자세한 내용은 [AWS 명령줄 인터페이스 사용 설명서](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html)를 참조하세요.

1. 채팅 `create-room` 명령을 실행하고 선택적 이름을 전달합니다.

   ```
   aws ivschat create-room --name test-room
   ```

1. 그러면 새 채팅룸이 반환됩니다.

   ```
   {  
      "arn": "arn:aws:ivschat:us-west-2:123456789012:room/g1H2I3j4k5L6",
      "id": "string",
      "createTime": "2021-06-07T14:26:05-07:00",
      "maximumMessageLength": 200, 
      "maximumMessageRatePerSecond": 10,
      "name": "test-room",
      "tags": {},
      "updateTime": "2021-06-07T14:26:05-07:00"
   }
   ```

1. `arn` 필드를 기록해 둡니다. 이는 클라이언트 토큰을 생성하고 채팅룸에 연결하는 데 필요합니다.

## 로깅 구성 설정(선택 사항)
<a name="create-room-cli-logging"></a>

채팅룸 생성과 마찬가지로 AWS CLI를 사용하여 로깅 구성을 설정하는 것은 고급 옵션이며, 먼저 컴퓨터에 CLI를 다운로드하고 구성해야 합니다. 자세한 내용은 [AWS 명령줄 인터페이스 사용 설명서](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html)를 참조하세요.

1. 채팅 `create-logging-configuration` 명령을 실행하고 선택적 이름과 Amazon S3 버킷을 가리키는 대상 구성을 이름별로 전달합니다. 이 Amazon S3 버킷은 로깅 구성을 생성하기 전에 존재해야 합니다. (Amazon S3 버킷 생성에 대한 자세한 내용은 [Amazon S3 설명서](https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html)를 참조하세요.)

   ```
   aws ivschat create-logging-configuration \
      --destination-configuration s3={bucketName=demo-logging-bucket} \
      --name "test-logging-config"
   ```

1. 그러면 새 로깅 구성이 반환됩니다.

   ```
   {
      "Arn": "arn:aws:ivschat:us-west-2:123456789012:logging-configuration/ABcdef34ghIJ",
      "createTime": "2022-09-14T17:48:00.653000+00:00",
      "destinationConfiguration": { 
         "s3": {"bucketName": "demo-logging-bucket"}
      },
      "id": "ABcdef34ghIJ",
      "name": "test-logging-config",
      "state": "ACTIVE",
      "tags": {},
      "updateTime": "2022-09-14T17:48:01.104000+00:00"
   }
   ```

1. `arn` 필드를 기록해 둡니다. 채팅룸에 로깅 구성을 연결하려면 이 정보가 필요합니다.

   1. 새 채팅룸을 생성하는 경우`create-room` 명령을 실행하고 로깅 구성 `arn`을 전달합니다.

      ```
      aws ivschat create-room --name test-room \ 
      --logging-configuration-identifiers \
      "arn:aws:ivschat:us-west-2:123456789012:logging-configuration/ABcdef34ghIJ"
      ```

   1. 기존 채팅룸을 업데이트하는 경우`update-room` 명령을 실행하고 로깅 구성 `arn`을 전달합니다.

      ```
      aws ivschat update-room --identifier \
      "arn:aws:ivschat:us-west-2:12345689012:room/g1H2I3j4k5L6" \
      --logging-configuration-identifiers \
      "arn:aws:ivschat:us-west-2:123456789012:logging-configuration/ABcdef34ghIJ"
      ```