

# AWS CLI를 사용한 AppRegistry 예시
<a name="cli_service-catalog-appregistry_code_examples"></a>

다음 코드 예시는 AppRegistry와 함께 AWS Command Line Interface를 사용하여 작업을 수행하고 일반적인 시나리오를 구현하는 방법을 보여줍니다.

*작업*은 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 작업은 개별 서비스 함수를 직접적으로 호출하는 방법을 보여주며 관련 시나리오의 컨텍스트에 맞는 작업을 볼 수 있습니다.

각 예시에는 전체 소스 코드에 대한 링크가 포함되어 있으며, 여기에서 컨텍스트에 맞춰 코드를 설정하고 실행하는 방법에 대한 지침을 찾을 수 있습니다.

**Topics**
+ [작업](#actions)

## 작업
<a name="actions"></a>

### `associate-attribute-group`
<a name="service-catalog-appregistry_AssociateAttributeGroup_cli_topic"></a>

다음 코드 예시에서는 `associate-attribute-group`의 사용 방법을 보여줍니다.

**AWS CLI**  
**속성 그룹 연결**  
다음 `associate-attribute-group` 예시에서는 AWS 계정의 특정 속성 그룹을 AWS 계정의 특정 애플리케이션에 연결합니다.  

```
aws servicecatalog-appregistry associate-attribute-group \
    --application "ExampleApplication" \
    --attribute-group "ExampleAttributeGroup"
```
출력:  

```
{
    "applicationArn": "arn:aws:servicecatalog:us-west-2:813737243517:/applications/0ars38r6btoohvpvd9gqrptt9l",
    "attributeGroupArn": "arn:aws:servicecatalog:us-west-2:813737243517:/attribute-groups/01sj5xdwhbw54kejwnt09fnpcl"
}
```
자세한 내용은 *AWS Service Catalog AppRegistry 관리자 안내서*의 [속성 그룹 연결 및 연결 해제](https://docs.aws.amazon.com/servicecatalog/latest/arguide/associate-attr-groups.html)를 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [AssociateAttributeGroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/servicecatalog-appregistry/associate-attribute-group.html)을 참조하세요.

### `create-application`
<a name="service-catalog-appregistry_CreateApplication_cli_topic"></a>

다음 코드 예시에서는 `create-application`의 사용 방법을 보여줍니다.

**AWS CLI**  
**애플리케이션 생성**  
다음 `create-application` 예시에서는 AWS 계정에 새 애플리케이션을 생성합니다.  

```
aws servicecatalog-appregistry create-application \
    --name "ExampleApplication"
```
출력:  

```
{
    "application": {
        "id": "0ars38r6btoohvpvd9gqrptt9l",
        "arn": "arn:aws:servicecatalog:us-west-2:813737243517:/applications/0ars38r6btoohvpvd9gqrptt9l",
        "name": "ExampleApplication",
        "creationTime": "2023-02-28T21:10:10.820000+00:00",
        "lastUpdateTime": "2023-02-28T21:10:10.820000+00:00",
        "tags": {}
    }
}
```
자세한 내용은 *AWS Service Catalog AppRegistry 관리자 안내서*의 [애플리케이션 생성](https://docs.aws.amazon.com/servicecatalog/latest/arguide/create-apps.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [CreateApplication](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/servicecatalog-appregistry/create-application.html)을 참조하세요.

### `create-attribute-group`
<a name="service-catalog-appregistry_CreateAttributeGroup_cli_topic"></a>

다음 코드 예시에서는 `create-attribute-group`의 사용 방법을 보여줍니다.

**AWS CLI**  
**속성 그룹 생성**  
다음 `create-attribute-group` 예시에서는 AWS 계정에 새 속성 그룹을 생성합니다.  

```
aws servicecatalog-appregistry create-attribute-group \
    --name "ExampleAttributeGroup" \
    --attributes '{"SomeKey1":"SomeValue1","SomeKey2":"SomeValue2"}'
```
출력:  

```
{
    "attributeGroup": {
        "id": "01sj5xdwhbw54kejwnt09fnpcl",
        "arn": "arn:aws:servicecatalog:us-west-2:813737243517:/attribute-groups/01sj5xdwhbw54kejwnt09fnpcl",
        "name": "ExampleAttributeGroup",
        "creationTime": "2023-02-28T20:38:01.389000+00:00",
        "lastUpdateTime": "2023-02-28T20:38:01.389000+00:00",
        "tags": {}
    }
}
```
자세한 내용은 *AWS Service Catalog AppRegistry 관리자 안내서*의 [속성 그룹 생성](https://docs.aws.amazon.com/servicecatalog/latest/arguide/create-attr-groups.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [CreateAttributeGroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/servicecatalog-appregistry/create-attribute-group.html)을 참조하세요.

### `delete-application`
<a name="service-catalog-appregistry_DeleteApplication_cli_topic"></a>

다음 코드 예시에서는 `delete-application`의 사용 방법을 보여줍니다.

**AWS CLI**  
**애플리케이션을 삭제하려면**  
다음 `delete-application` 예시에서는 AWS 계정의 특정 애플리케이션을 삭제합니다.  

```
aws servicecatalog-appregistry delete-application \
    --application "ExampleApplication3"
```
출력:  

```
{
    "application": {
        "id": "055gw7aynr1i5mbv7kjwzx5945",
        "arn": "arn:aws:servicecatalog:us-west-2:813737243517:/applications/055gw7aynr1i5mbv7kjwzx5945",
        "name": "ExampleApplication3",
        "creationTime": "2023-02-28T22:06:28.228000+00:00",
        "lastUpdateTime": "2023-02-28T22:06:28.228000+00:00"
    }
}
```
자세한 내용은 *AWS Service Catalog AppRegistry 관리자 안내서*의 [애플리케이션 관리](https://docs.aws.amazon.com/servicecatalog/latest/arguide/delete-app-details.html)를 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [DeleteApplication](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/servicecatalog-appregistry/delete-application.html)을 참조하세요.

### `delete-attribute-group`
<a name="service-catalog-appregistry_DeleteAttributeGroup_cli_topic"></a>

다음 코드 예시에서는 `delete-attribute-group`의 사용 방법을 보여줍니다.

**AWS CLI**  
**예시 8: 속성 그룹 삭제**  
다음 `delete-attribute-group` 예시에서는 AWS 계정의 특정 속성 그룹을 삭제합니다.  

```
aws servicecatalog-appregistry delete-attribute-group \
    --attribute-group "ExampleAttributeGroup3"
```
출력:  

```
{
    "attributeGroup": {
        "id": "011ge6y3emyjijt8dw8jn6r0hv",
        "arn": "arn:aws:servicecatalog:us-west-2:813737243517:/attribute-groups/011ge6y3emyjijt8dw8jn6r0hv",
        "name": "ExampleAttributeGroup3",
        "creationTime": "2023-02-28T22:05:35.224000+00:00",
        "lastUpdateTime": "2023-02-28T22:05:35.224000+00:00"
    }
}
```
자세한 내용은 *AWS Service Catalog AppRegistry 관리자 안내서*의 [속성 그룹 삭제](https://docs.aws.amazon.com/servicecatalog/latest/arguide/delete-attr-group.html)를 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [DeleteAttributeGroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/servicecatalog-appregistry/delete-attribute-group.html)을 참조하세요.

### `get-application`
<a name="service-catalog-appregistry_GetApplication_cli_topic"></a>

다음 코드 예시에서는 `get-application`의 사용 방법을 보여줍니다.

**AWS CLI**  
**애플리케이션 가져오기**  
다음 `get-application` 예시에서는 AWS 계정의 특정 애플리케이션에 대한 메타데이터 정보를 가져옵니다.  

```
aws servicecatalog-appregistry get-application \
    --application "ExampleApplication"
```
출력:  

```
{
    "id": "0ars38r6btoohvpvd9gqrptt9l",
    "arn": "arn:aws:servicecatalog:us-west-2:813737243517:/applications/0ars38r6btoohvpvd9gqrptt9l",
    "name": "ExampleApplication",
    "creationTime": "2023-02-28T21:10:10.820000+00:00",
    "lastUpdateTime": "2023-02-28T21:10:10.820000+00:00",
    "associatedResourceCount": 0,
    "tags": {
        "aws:servicecatalog:applicationName": "ExampleApplication"
    },
    "integrations": {
        "resourceGroup": {
            "state": "CREATE_COMPLETE",
            "arn": "arn:aws:resource-groups:us-west-2:813737243517:group/AWS_AppRegistry_Application-ExampleApplication"
        }
    }
}
```
자세한 내용은 *AWS Service Catalog AppRegistry 관리자 안내서*의 [애플리케이션 세부 정보 사용](https://docs.aws.amazon.com/servicecatalog/latest/arguide/access-app-details.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [GetApplication](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/servicecatalog-appregistry/get-application.html)을 참조하세요.

### `get-attribute-group`
<a name="service-catalog-appregistry_GetAttributeGroup_cli_topic"></a>

다음 코드 예시에서는 `get-attribute-group`의 사용 방법을 보여줍니다.

**AWS CLI**  
**속성 그룹 가져오기**  
다음 `get-attribute-group` 예시에서는 AWS 계정의 특정 속성 그룹을 가져옵니다.  

```
aws servicecatalog-appregistry get-attribute-group \
    --attribute-group "ExampleAttributeGroup"
```
출력:  

```
{
    "id": "01sj5xdwhbw54kejwnt09fnpcl",
    "arn": "arn:aws:servicecatalog:us-west-2:813737243517:/attribute-groups/01sj5xdwhbw54kejwnt09fnpcl",
    "name": "ExampleAttributeGroup",
    "attributes": "{\"SomeKey1\":\"SomeValue1\",\"SomeKey2\":\"SomeValue2\"}",
    "creationTime": "2023-02-28T20:38:01.389000+00:00",
    "lastUpdateTime": "2023-02-28T20:38:01.389000+00:00",
    "tags": {
        "aws:servicecatalog:attributeGroupName": "ExampleAttributeGroup"
    }
}
```
자세한 내용은 *AWS Service Catalog AppRegistry 관리자 안내서*의 [속성 그룹의 메타데이터 관리](https://docs.aws.amazon.com/servicecatalog/latest/arguide/manage-metatdata.html)를 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [GetAttributeGroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/servicecatalog-appregistry/get-attribute-group.html)을 참조하세요.

### `list-applications`
<a name="service-catalog-appregistry_ListApplications_cli_topic"></a>

다음 코드 예시에서는 `list-applications`의 사용 방법을 보여줍니다.

**AWS CLI**  
**애플리케이션 나열**  
다음 `list-applications` 예시에서는 AWS 계정의 모든 애플리케이션 목록을 가져옵니다.  

```
aws servicecatalog-appregistry list-applications
```
출력:  

```
{
    "applications": [
        {
            "id": "03axw94pjfj3uan00tcgbrxnkw",
            "arn": "arn:aws:servicecatalog:us-west-2:813737243517:/applications/03axw94pjfj3uan00tcgbrxnkw",
            "name": "ExampleApplication2",
            "creationTime": "2023-02-28T21:59:34.094000+00:00",
            "lastUpdateTime": "2023-02-28T21:59:34.094000+00:00"
        },
        {
            "id": "055gw7aynr1i5mbv7kjwzx5945",
            "arn": "arn:aws:servicecatalog:us-west-2:813737243517:/applications/055gw7aynr1i5mbv7kjwzx5945",
            "name": "ExampleApplication3",
            "creationTime": "2023-02-28T22:06:28.228000+00:00",
            "lastUpdateTime": "2023-02-28T22:06:28.228000+00:00"
        },
        {
            "id": "0ars38r6btoohvpvd9gqrptt9l",
            "arn": "arn:aws:servicecatalog:us-west-2:813737243517:/applications/0ars38r6btoohvpvd9gqrptt9l",
            "name": "ExampleApplication",
            "description": "This is an example application",
            "creationTime": "2023-02-28T21:10:10.820000+00:00",
            "lastUpdateTime": "2023-02-28T21:24:19.729000+00:00"
        }
    ]
}
```
자세한 내용은 *AWS Service Catalog AppRegistry 관리자 안내서*의 [애플리케이션 세부 정보 보기](https://docs.aws.amazon.com/servicecatalog/latest/arguide/view-app-details.html)를 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [ListApplications](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/servicecatalog-appregistry/list-applications.html)를 참조하세요.

### `list-associated-attribute-groups`
<a name="service-catalog-appregistry_ListAssociatedAttributeGroups_cli_topic"></a>

다음 코드 예시에서는 `list-associated-attribute-groups`의 사용 방법을 보여줍니다.

**AWS CLI**  
**연결된 속성 그룹 나열**  
다음 `list-associated-attribute-groups` 예시에서는 AWS 계정의 특정 애플리케이션과 연결된 AWS 계정의 모든 속성 그룹 목록을 가져옵니다.  

```
aws servicecatalog-appregistry list-associated-attribute-groups \
    --application "ExampleApplication"
```
출력:  

```
{
    "attributeGroups": [
        "01sj5xdwhbw54kejwnt09fnpcl"
    ]
}
```
자세한 내용은 *AWS Service Catalog AppRegistry 관리자 안내서*의 [속성 그룹 연결 및 연결 해제](https://https://docs.aws.amazon.com/servicecatalog/latest/arguide/associate-attr-groups.html)를 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [ListAssociatedAttributeGroups](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/servicecatalog-appregistry/list-associated-attribute-groups.html)를 참조하세요.

### `list-attribute-groups-for-application`
<a name="service-catalog-appregistry_ListAttributeGroupsForApplication_cli_topic"></a>

다음 코드 예시에서는 `list-attribute-groups-for-application`의 사용 방법을 보여줍니다.

**AWS CLI**  
**애플리케이션의 속성 그룹 나열**  
다음 `list-attribute-groups-for-application` 예시에서는 AWS 계정의 특정 애플리케이션에 연결된 AWS 계정의 모든 속성 그룹에 대한 세부 정보를 나열합니다.  

```
aws servicecatalog-appregistry list-attribute-groups-for-application \
    --application "ExampleApplication"
```
출력:  

```
{
    "attributeGroupsDetails": [
        {
            "id": "01sj5xdwhbw54kejwnt09fnpcl",
            "arn": "arn:aws:servicecatalog:us-west-2:813737243517:/attribute-groups/01sj5xdwhbw54kejwnt09fnpcl",
            "name": "ExampleAttributeGroup"
        }
    ]
}
```
자세한 내용은 *AWS Service Catalog AppRegistry 관리자 안내서*의 [속성 그룹 세부 정보 보기](https://servicecatalog/latest/arguide/view-attr-group.html)를 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [ListAttributeGroupsForApplication](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/servicecatalog-appregistry/list-attribute-groups-for-application.html)을 참조하세요.

### `list-attribute-groups`
<a name="service-catalog-appregistry_ListAttributeGroups_cli_topic"></a>

다음 코드 예시에서는 `list-attribute-groups`의 사용 방법을 보여줍니다.

**AWS CLI**  
**속성 그룹 나열**  
다음 `list-attribute-groups` 예시에서는 AWS 계정의 모든 속성 그룹 목록을 가져옵니다.  

```
aws servicecatalog-appregistry list-attribute-groups
```
출력:  

```
{
    "attributeGroups": [
        {
            "id": "011ge6y3emyjijt8dw8jn6r0hv",
            "arn": "arn:aws:servicecatalog:us-west-2:813737243517:/attribute-groups/011ge6y3emyjijt8dw8jn6r0hv",
            "name": "ExampleAttributeGroup3",
            "creationTime": "2023-02-28T22:05:35.224000+00:00",
            "lastUpdateTime": "2023-02-28T22:05:35.224000+00:00"
        },
        {
            "id": "01sj5xdwhbw54kejwnt09fnpcl",
            "arn": "arn:aws:servicecatalog:us-west-2:813737243517:/attribute-groups/01sj5xdwhbw54kejwnt09fnpcl",
            "name": "ExampleAttributeGroup",
            "description": "This is an example attribute group",
            "creationTime": "2023-02-28T20:38:01.389000+00:00",
            "lastUpdateTime": "2023-02-28T21:02:04.559000+00:00"
        },
        {
            "id": "03n1yffgq6d18vwrzxf0c70nm3",
            "arn": "arn:aws:servicecatalog:us-west-2:813737243517:/attribute-groups/03n1yffgq6d18vwrzxf0c70nm3",
            "name": "ExampleAttributeGroup2",
            "creationTime": "2023-02-28T21:57:30.687000+00:00",
            "lastUpdateTime": "2023-02-28T21:57:30.687000+00:00"
        }
    ]
}
```
자세한 내용은 *AWS Service Catalog AppRegistry 관리자 안내서*의 [속성 그룹 세부 정보 보기](https://docs.aws.amazon.com/servicecatalog/latest/arguide/view-attr-group.html)를 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [ListAttributeGroups](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/servicecatalog-appregistry/list-attribute-groups.html)를 참조하세요.

### `update-application`
<a name="service-catalog-appregistry_UpdateApplication_cli_topic"></a>

다음 코드 예시에서는 `update-application`의 사용 방법을 보여줍니다.

**AWS CLI**  
**애플리케이션 업데이트**  
다음 `update-application` 예시에서는 AWS 계정의 특정 애플리케이션을 업데이트하여 설명을 포함합니다.  

```
aws servicecatalog-appregistry update-application \
    --application "ExampleApplication" \
    --description "This is an example application"
```
출력:  

```
{
    "application": {
        "id": "0ars38r6btoohvpvd9gqrptt9l",
        "arn": "arn:aws:servicecatalog:us-west-2:813737243517:/applications/0ars38r6btoohvpvd9gqrptt9l",
        "name": "ExampleApplication",
        "description": "This is an example application",
        "creationTime": "2023-02-28T21:10:10.820000+00:00",
        "lastUpdateTime": "2023-02-28T21:24:19.729000+00:00",
        "tags": {
            "aws:servicecatalog:applicationName": "ExampleApplication"
        }
    }
}
```
자세한 내용은 *AWS Service Catalog AppRegistry 관리자 안내서*의 [애플리케이션 편집](https://docs.aws.amazon.com/servicecatalog/latest/arguide/edit-apps.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [UpdateApplication](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/servicecatalog-appregistry/update-application.html)을 참조하세요.

### `update-attribute-group`
<a name="service-catalog-appregistry_UpdateAttributeGroup_cli_topic"></a>

다음 코드 예시에서는 `update-attribute-group`의 사용 방법을 보여줍니다.

**AWS CLI**  
**속성 그룹 업데이트**  
다음 `update-attribute-group` 예제에서는 AWS 계정의 특정 속성 그룹을 업데이트하여 설명을 포함합니다.  

```
aws servicecatalog-appregistry update-attribute-group \
    --attribute-group "ExampleAttributeGroup" \
    --description "This is an example attribute group"
```
출력:  

```
{
    "attributeGroup": {
        "id": "01sj5xdwhbw54kejwnt09fnpcl",
        "arn": "arn:aws:servicecatalog:us-west-2:813737243517:/attribute-groups/01sj5xdwhbw54kejwnt09fnpcl",
        "name": "ExampleAttributeGroup",
        "description": "This is an example attribute group",
        "creationTime": "2023-02-28T20:38:01.389000+00:00",
        "lastUpdateTime": "2023-02-28T21:02:04.559000+00:00",
        "tags": {
            "aws:servicecatalog:attributeGroupName": "ExampleAttributeGroup"
        }
    }
}
```
자세한 내용은 *AWS Service Catalog AppRegistry 관리자 안내서*의 [속성 그룹 편집](https://docs.aws.amazon.com/servicecatalog/latest/arguide/edit-attr-group.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [UpdateAttributeGroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/servicecatalog-appregistry/update-attribute-group.html)을 참조하세요.