

지원 종료 공지: 2025년 9월 15 AWS 일에는 Amazon Lex V1에 대한 지원을 중단할 예정입니다. 2025년 9월 15일 이후에는 Amazon Lex V1 콘솔 또는 Amazon Lex V1 리소스에 더 이상 액세스할 수 없습니다. Amazon Lex V2를 사용하는 경우 대신 [Amazon Lex V2 가이드를](https://docs.aws.amazon.com/lexv2/latest/dg/what-is.html) 참조하세요.

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# 4단계: 버전 게시(AWS CLI)
<a name="gs-cli-publish"></a>

이제 연습 1에서 생성한 봇의 버전을 생성합니다. *버전*은 봇의 스냅샷입니다. 버전을 생성한 후에는 변경할 수 없습니다. 업데이트할 수 있는 유일한 봇 버전은 `$LATEST` 버전입니다. 버전에 대한 자세한 내용은 [버전 관리 및 별칭](versioning-aliases.md)을 참조하십시오.

봇의 버전을 게시하려면 먼저 봇에서 사용하는 의도를 게시해야 합니다. 마찬가지로 해당 의도에서 참조하는 슬롯 유형을 게시해야 합니다. 일반적으로 버전을 게시하려면 다음을 수행합니다.

1. [CreateSlotTypeVersion](API_CreateSlotTypeVersion.md) 작업을 사용하여 슬롯 유형의 버전을 게시합니다.

1. [CreateIntentVersion](API_CreateIntentVersion.md) 작업을 사용하여 의도의 버전을 게시합니다.

1. [CreateBotVersion](API_CreateBotVersion.md) 작업을 사용하여 봇의 버전을 게시합니다.

이 연습에서 명령을 실행하려면 명령이 실행될 리전을 알아야 합니다. 리전 목록은 [모델 구축 할당량](gl-limits.md#gl-limits-model-building)을 참조하십시오.

**Topics**
+ [1단계: 슬롯 유형 게시(AWS CLI)](gs-cli-publish-slot-type.md)
+ [2단계: 의도 게시(AWS CLI)](gs-cli-publish-intent.md)
+ [3단계: 봇 게시(AWS CLI)](gs-cli-publish-bot.md)

# 1단계: 슬롯 유형 게시(AWS CLI)
<a name="gs-cli-publish-slot-type"></a>

슬롯 유형을 사용하는 의도의 버전을 게시하려면 먼저 해당 슬롯 유형의 버전을 게시해야 합니다. 이 경우 `FlowerTypes` 슬롯 유형을 게시합니다.

**참고**  
다음 AWS CLI 예제는 Unix, Linux 및 macOS용으로 포맷되어 있습니다. Windows의 경우 `"\$LATEST"`를 `$LATEST`로 바꾸고, 각 줄의 끝에 있는 백슬래시(\$1) 연속 문자를 캐럿(^)으로 변경합니다.

**슬롯 유형을 게시하려면(AWS CLI)**

1. 에서 슬롯 유형의 최신 버전을 AWS CLI가져옵니다.

   ```
   aws lex-models get-slot-type \
       --region region \
       --name FlowerTypes \
       --slot-type-version "\$LATEST"
   ```

   Amazon Lex에서 다음과 같이 응답합니다. `$LATEST` 버전의 현재 개정에 대한 체크섬을 기록합니다.

   ```
   {
       "enumerationValues": [
           {
               "value": "tulips"
           }, 
           {
               "value": "lilies"
           }, 
           {
               "value": "roses"
           }
       ], 
       "name": "FlowerTypes", 
       "checksum": "checksum", 
       "version": "$LATEST", 
       "lastUpdatedDate": timestamp, 
       "createdDate": timestamp, 
       "description": "Types of flowers to pick up"
   }
   ```

1. 슬롯 유형의 버전을 게시합니다. 이전 단계에서 기록한 체크섬을 사용합니다.

   ```
   aws lex-models create-slot-type-version \
       --region region \
       --name FlowerTypes \
       --checksum "checksum"
   ```

   Amazon Lex에서 다음과 같이 응답합니다. 다음 단계를 위해 버전 번호를 기록합니다.

   ```
   {
       "version": "1", 
       "enumerationValues": [
           {
               "value": "tulips"
           }, 
           {
               "value": "lilies"
           }, 
           {
               "value": "roses"
           }
       ], 
       "name": "FlowerTypes", 
       "createdDate": timestamp, 
       "lastUpdatedDate": timestamp, 
       "description": "Types of flowers to pick up"
   }
   ```

## 다음 단계
<a name="gs-cli-publish-2"></a>

[2단계: 의도 게시(AWS CLI)](gs-cli-publish-intent.md)

# 2단계: 의도 게시(AWS CLI)
<a name="gs-cli-publish-intent"></a>

의도를 게시하려면 먼저 의도에서 참조하는 모든 슬롯 유형을 게시해야 합니다. 슬롯 유형은 `$LATEST` 버전이 아니라 번호가 지정된 버전이어야 합니다.

먼저 이전 단계에서 게시한 `FlowerTypes` 슬롯 유형의 버전을 사용하도록 `OrderFlowers` 의도를 업데이트합니다. 그런 다음 `OrderFlowers` 의도의 새 버전을 게시합니다.

**참고**  
다음 AWS CLI 예제는 Unix, Linux 및 macOS용으로 포맷되어 있습니다. Windows의 경우 `"\$LATEST"`를 `$LATEST`로 바꾸고, 각 줄의 끝에 있는 백슬래시(\$1) 연속 문자를 캐럿(^)으로 변경합니다.

**의도의 버전을 게시하려면(AWS CLI)**

1. 에서 `OrderFlowers` 의도의 `$LATEST` 버전을 AWS CLI가져와 파일에 저장합니다.

   ```
   aws lex-models get-intent \
       --region region \
       --name OrderFlowers \
       --intent-version "\$LATEST" > OrderFlowers_V4.json
   ```

1. 텍스트 편집기에서 **OrderFlowers\$1V4.json** 파일을 엽니다. `createdDate`, `lastUpdatedDate` 및 `version` 필드를 삭제합니다. `FlowerTypes` 슬롯 유형을 찾아 이전 단계에서 기록한 버전 번호로 버전을 변경합니다. **OrderFlowers\$1V4.json** 파일의 다음 조각은 변경 위치를 보여 줍니다.

   ```
           {
               "slotType": "FlowerTypes", 
               "name": "FlowerType", 
               "slotConstraint": "Required", 
               "valueElicitationPrompt": {
                   "maxAttempts": 2, 
                   "messages": [
                       {
                           "content": "What type of flowers?", 
                           "contentType": "PlainText"
                       }
                   ]
               }, 
               "priority": 1, 
               "slotTypeVersion": "version", 
               "sampleUtterances": []
           },
   ```

1. 에서 의도의 개정을 AWS CLI저장합니다.

   ```
   aws lex-models put-intent \
       --name OrderFlowers \
       --cli-input-json file://OrderFlowers_V4.json
   ```

1. 의도의 최신 개정에 대한 체크섬을 가져옵니다.

   ```
   aws lex-models get-intent \
       --region region \
       --name OrderFlowers \
       --intent-version "\$LATEST" > OrderFlowers_V4a.json
   ```

   응답의 다음 조각은 의도의 체크섬을 보여 줍니다. 다음 단계를 위해 이 체크섬을 기록합니다.

   ```
       "name": "OrderFlowers", 
       "checksum": "checksum", 
       "version": "$LATEST",
   ```

1. 의도의 새 버전을 게시합니다.

   ```
   aws lex-models create-intent-version \
       --region region \
       --name OrderFlowers \
       --checksum "checksum"
   ```

   응답의 다음 조각은 의도의 새 버전을 보여 줍니다. 다음 단계를 위해 버전 번호를 기록합니다.

   ```
       "name": "OrderFlowers", 
       "checksum": "checksum", 
       "version": "version",
   ```

## 다음 단계
<a name="gs-cli-publish-3"></a>

[3단계: 봇 게시(AWS CLI)](gs-cli-publish-bot.md)

# 3단계: 봇 게시(AWS CLI)
<a name="gs-cli-publish-bot"></a>

봇에서 사용하는 모든 슬롯 유형 및 의도를 게시한 후 봇을 게시할 수 있습니다.

이전 단계에서 업데이트한 `OrderFlowers` 의도를 사용하도록 `OrderFlowersBot` 봇을 업데이트합니다. 그런 다음 새 버전의 `OrderFlowersBot` 봇을 게시합니다.

**참고**  
다음 AWS CLI 예제는 Unix, Linux 및 macOS용으로 포맷되어 있습니다. Windows의 경우 `"\$LATEST"`를 `$LATEST`로 바꾸고, 각 줄의 끝에 있는 백슬래시(\$1) 연속 문자를 캐럿(^)으로 변경합니다.

**봇의 버전을 게시하려면(AWS CLI)**

1. 에서 `OrderFlowersBot` 봇의 `$LATEST` 버전을 AWS CLI가져와 파일에 저장합니다.

   ```
   aws lex-models get-bot \
       --region region \
       --name OrderFlowersBot \
       --version-or-alias "\$LATEST" > OrderFlowersBot_V4.json
   ```

1. 텍스트 편집기에서 **OrderFlowersBot\$1V4.json** 파일을 엽니다. `createdDate`, `lastUpdatedDate`, `status` 및 `version` 필드를 삭제합니다. `OrderFlowers` 의도를 찾아 이전 단계에서 기록한 버전 번호로 버전을 변경합니다. **OrderFlowersBot\$1V4.json**의 다음 조각은 변경 위치를 보여 줍니다.

   ```
       "intents": [
           {
               "intentVersion": "version", 
               "intentName": "OrderFlowers"
           }
   ```

1. 에서 봇의 새 개정을 AWS CLI저장합니다. `put-bot`을 호출하면 반환되는 버전 번호를 기록해 둡니다.

   ```
   aws lex-models put-bot \
       --name OrderFlowersBot \
       --cli-input-json file://OrderFlowersBot_V4.json
   ```

1. 봇의 최신 개정에 대한 체크섬을 가져옵니다. 3단계에서 반환된 버전 번호를 사용합니다.

   ```
   aws lex-models get-bot \
       --region region \
       --version-or-alias version \
       --name OrderFlowersBot > OrderFlowersBot_V4a.json
   ```

   응답의 다음 조각은 봇의 체크섬을 보여 줍니다. 다음 단계를 위해 이 체크섬을 기록합니다.

   ```
       "name": "OrderFlowersBot", 
       "locale": "en-US", 
       "checksum": "checksum",
   ```

1. 새 버전의 봇을 게시합니다.

   ```
   aws lex-models create-bot-version \
       --region region \
       --name OrderFlowersBot \
       --checksum "checksum"
   ```

   응답의 다음 조각은 봇의 새 버전을 보여 줍니다.

   ```
       "checksum": "checksum", 
       "abortStatement": {
           ...
       }, 
       "version": "1",
       "lastUpdatedDate": timestamp,
   ```

## 다음 단계
<a name="gs-cli-next-exercise-5"></a>

[연습 5: 별칭 만들기(AWS CLI)](gs-cli-create-alias.md)