

# AWS CLI를 사용한 CloudWatch Synthetics 예제
<a name="cli_synthetics_code_examples"></a>

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

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

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

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

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

### `associate-resource`
<a name="synthetics_AssociateResource_cli_topic"></a>

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

**AWS CLI**  
**카나리를 그룹과 연결하려면**  
다음 `associate-resource` 예제에서는 카나리를 `demo_group`이라는 그룹과 연결합니다.  

```
aws synthetics associate-resource \
    --group-identifier demo_group \
    --resource-arn arn:aws:synthetics:us-east-1:123456789012:canary:demo_canary
```
이 명령은 출력을 생성하지 않습니다.  
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [AssociateResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/associate-resource.html)를 참조하세요.

### `create-canary`
<a name="synthetics_CreateCanary_cli_topic"></a>

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

**AWS CLI**  
**카나리를 생성하려면**  
다음 `create-canary` 예제에서는 `demo_canary`라는 카나리를 생성합니다.  

```
aws synthetics create-canary \
    --name demo_canary \
    --code '{"S3Bucket": "artifacts3bucket", "S3Key":"demo_canary.zip", "Handler": "index.lambda_handler"}' \
    --artifact-s3-location s3://amzn-s3-demo-bucket/demo_canary.zip \
    --execution-role-arn arn:aws:iam::123456789012:role/demo_canary_role \
    --schedule Expression="rate(10 minutes)" \
    --runtime-version syn-nodejs-puppeteer-9.1
```
출력:  

```
{
    "Canary": {
        "Id": "a1b2c3d4-5678-90ab-cdef-example11111",
        "Name": "demo_canary",
        "Code": {
            "Handler": "index.lambda_handler"
        },
        "ExecutionRoleArn": "arn:aws:iam::123456789012:role/demo_canary_role",
        "Schedule": {
            "Expression": "rate(10 minutes)",
            "DurationInSeconds": 0
        },
        "RunConfig": {
            "TimeoutInSeconds": 600,
            "MemoryInMB": 1000,
            "ActiveTracing": false
        },
        "SuccessRetentionPeriodInDays": 31,
        "FailureRetentionPeriodInDays": 31,
        "Status": {
            "State": "CREATING",
            "StateReasonCode": "CREATE_PENDING"
        },
        "Timeline": {
            "Created": "2024-10-15T19:03:08.826000+05:30",
            "LastModified": "2024-10-15T19:03:08.826000+05:30"
        },
        "ArtifactS3Location": "amzn-s3-demo-bucket/demo_canary.zip",
        "RuntimeVersion": "syn-nodejs-puppeteer-9.1",
        "Tags": {}
    }
}
```
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [CreateCanary](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/create-canary.html)를 참조하세요.

### `create-group`
<a name="synthetics_CreateGroup_cli_topic"></a>

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

**AWS CLI**  
**그룹 생성**  
다음 `create-group` 예시에서는 `demo_group`이라는 그룹을 생성합니다.  

```
aws synthetics create-group \
    --name demo_group
```
출력:  

```
{
    "Group": {
        "Id": "example123",
        "Name": "demo_group",
        "Arn": "arn:aws:synthetics:us-east-1:123456789012:group:example123",
        "Tags": {},
        "CreatedTime": "2024-10-15T14:47:23.811000+05:30",
        "LastModifiedTime": "2024-10-15T14:47:23.811000+05:30"
    }
}
```
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [CreateGroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/create-group.html)을 참조하세요.

### `delete-canary`
<a name="synthetics_DeleteCanary_cli_topic"></a>

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

**AWS CLI**  
**카나리를 영구적으로 삭제하려면**  
다음 `delete-canary` 예제에서는 `demo_canary`라는 카나리를 삭제합니다.  

```
aws synthetics delete-canary \
    --name demo_canary
```
이 명령은 출력을 생성하지 않습니다.  
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [DeleteCanary](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/delete-canary.html)를 참조하세요.

### `delete-group`
<a name="synthetics_DeleteGroup_cli_topic"></a>

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

**AWS CLI**  
**그룹 삭제**  
다음 `delete-group` 예제에서는 `demo_group`이라는 그룹을 삭제합니다.  

```
aws synthetics delete-group \
    --group-identifier demo_group
```
이 명령은 출력을 생성하지 않습니다.  
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [DeleteGroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/delete-group.html)을 참조하세요.

### `describe-canaries-last-run`
<a name="synthetics_DescribeCanariesLastRun_cli_topic"></a>

다음 코드 예시는 `describe-canaries-last-run`의 사용 방법을 보여줍니다.

**AWS CLI**  
**각 카나리의 최신 실행 정보를 보려면**  
다음 `describe-canaries-last-run` 예제에서는 생성한 각 카나리의 가장 최근 실행을 반환합니다.  

```
aws synthetics describe-canaries-last-run
```
출력:  

```
{
    "CanariesLastRun": [
        {
            "CanaryName": "demo_canary",
            "LastRun": {
                "Id": "a1b2c3d4-5678-90ab-cdef-example11111",
                "Name": "demo_canary",
                "Status": {
                    "State": "PASSED",
                    "StateReason": "",
                    "StateReasonCode": ""
                },
                "Timeline": {
                    "Started": "2024-10-15T19:20:39.691000+05:30",
                    "Completed": "2024-10-15T19:20:58.211000+05:30"
                },
                "ArtifactS3Location": "cw-syn-results-123456789012-us-east-1/canary/us-east-1/demo_canary-abc-example1234/2024/10/15/13/50-39-690"
            }
        }
    ]
}
```
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [DescribeCanariesLastRun](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/describe-canaries-last-run.html) 섹션을 참조하세요.

### `describe-canaries`
<a name="synthetics_DescribeCanaries_cli_topic"></a>

다음 코드 예시는 `describe-canaries`의 사용 방법을 보여줍니다.

**AWS CLI**  
**계정의 카나리를 나열하려면**  
다음 `describe-canaries` 예제에서는 계정의 카나리에 대한 세부 정보를 나열합니다.  

```
aws synthetics describe-canaries
```
출력:  

```
{
    "Canaries": [
        {
            "Id": "a1b2c3d4-5678-90ab-cdef-example11111",
            "Name": "demo_canary",
            "Code": {
                "SourceLocationArn": "arn:aws:lambda:us-east-1:123456789012:layer:cwsyn-demo_canary-a1b2c3d4-5678-90ab-cdef-example11111b8:1",
                "Handler": "pageLoadBlueprint.handler"
            },
            "ExecutionRoleArn": "arn:aws:iam::123456789012:role/service-role/CloudWatchSyntheticsRole-demo_canary-a12-a123bc456789",
            "Schedule": {
                "Expression": "rate(5 minutes)",
                "DurationInSeconds": 0
            },
            "RunConfig": {
                "TimeoutInSeconds": 300,
                "MemoryInMB": 1000,
                "ActiveTracing": false
            },
            "SuccessRetentionPeriodInDays": 31,
            "FailureRetentionPeriodInDays": 31,
            "Status": {
            "State": "RUNNING"
            },
            "Timeline": {
                "Created": "2024-10-15T18:55:15.168000+05:30",
                "LastModified": "2024-10-15T18:55:40.540000+05:30",
                "LastStarted": "2024-10-15T18:55:40.540000+05:30"
            },
            "ArtifactS3Location": "cw-syn-results-123456789012-us-east-1/canary/us-east-1/demo_canary-a12-a123bc456789",
            "EngineArn": "arn:aws:lambda:us-east-1:123456789012:function:cwsyn-demo_canary-a1b2c3d4-5678-90ab-cdef-example111118:1",
            "RuntimeVersion": "syn-nodejs-puppeteer-9.1",
            "Tags": {
                "blueprint": "heartbeat"
            }
        }
    ]
}
```
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [DescribeCanaries](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/describe-canaries.html)를 참조하세요.

### `describe-runtime-versions`
<a name="synthetics_DescribeRuntimeVersions_cli_topic"></a>

다음 코드 예시는 `describe-runtime-versions`의 사용 방법을 보여줍니다.

**AWS CLI**  
**합성 카나리 런타임 버전 목록을 반환하려면**  
다음 `describe-runtime-versions` 예제에서는 합성 카나리 런타임 버전 목록을 반환합니다.  

```
aws synthetics describe-runtime-versions
```
출력:  

```
{
    "RuntimeVersions": [
        {
            "VersionName": "syn-nodejs-puppeteer-9.1",
            "Description": "Security fixes and bug fix for date range error in har. Dependencies: Node JS 20.x, Puppeteer-core 22.12.1, Chromium 126.0.6478.126",
            "ReleaseDate": "2024-10-02T05:30:00+05:30"
        },
        {
            "VersionName": "syn-nodejs-puppeteer-9.0",
            "Description": "Upgraded Chromium and Puppeteer. Dependencies: Node JS 20.x, Puppeteer-core 22.12.1, Chromium 126.0.6478.126",
            "ReleaseDate": "2024-07-22T05:30:00+05:30"
        },
        {
            "VersionName": "syn-nodejs-puppeteer-8.0",
            "Description": "Upgraded Chromium and Puppeteer. Dependencies: Node JS 20.x, Puppeteer-core 22.10.0, Chromium 125.0.6422.112",
            "ReleaseDate": "2024-06-21T05:30:00+05:30"
        },
        {
            "VersionName": "syn-nodejs-puppeteer-7.0",
            "Description": "Upgraded Chromium and Puppeteer. Dependencies: Node JS 18.x, Puppeteer-core 21.9.0, Chromium 121.0.6167.139",
            "ReleaseDate": "2024-03-08T05:30:00+05:30"
            },
        {
            "VersionName": "syn-nodejs-puppeteer-6.2",
            "Description": "Updated shared libraries for Chromium and added ephemeral storage monitoring. Dependencies: Node JS 18.x, Puppeteer-core 19.7.0, Chromium 111.0.5563.146",
            "ReleaseDate": "2024-02-02T05:30:00+05:30"
        },
        {
            "VersionName": "syn-nodejs-puppeteer-6.1",
            "Description": "Added puppeteer launch retry. Dependencies: Node JS 18.x, Puppeteer-core 19.7.0, Chromium 111.0.5563.146",
            "ReleaseDate": "2023-11-13T05:30:00+05:30",
            "DeprecationDate": "2024-03-08T13:30:00+05:30"
        },
        {
            "VersionName": "syn-nodejs-puppeteer-6.0",
            "Description": "Reduced X-Ray traces of a canary run, improved duration metric and upgraded to NodeJS 18.x. Dependencies: Node JS 18.x, Puppeteer-core 19.7.0, Chromium 111.0.5563.146",
            "ReleaseDate": "2023-09-15T05:30:00+05:30",
            "DeprecationDate": "2024-03-08T13:30:00+05:30"
        },
        {
            "VersionName": "syn-nodejs-puppeteer-5.2",
            "Description": "Updated shared libraries for Chromium. Dependencies: Node JS 16.x, Puppeteer-core 19.7.0, Chromium 111.0.5563.146",
            "ReleaseDate": "2024-02-01T05:30:00+05:30"
        },
        {
            "VersionName": "syn-nodejs-puppeteer-5.1",
            "Description": "Fixes a bug about missing request headers in har. Dependencies: Node JS 16.x, Puppeteer-core 19.7.0, Chromium 111.0.5563.146",
            "ReleaseDate": "2023-08-09T05:30:00+05:30",
            "DeprecationDate": "2024-03-08T13:30:00+05:30"
        },
        {
            "VersionName": "syn-nodejs-puppeteer-5.0",
            "Description": "Upgraded Puppeteer and Chromium. Dependencies: Node JS 16.x, Puppeteer-core 19.7.0, Chromium 111.0.5563.146",
            "ReleaseDate": "2023-07-21T05:30:00+05:30",
            "DeprecationDate": "2024-03-08T13:30:00+05:30"
        },
        {
            "VersionName": "syn-nodejs-puppeteer-4.0",
            "Description": "Upgraded to NodeJS 16.x. Dependencies: Node JS 16.x, Puppeteer-core 5.5.0, Chromium 92.0.4512.0",
            "ReleaseDate": "2023-05-01T05:30:00+05:30",
            "DeprecationDate": "2024-03-08T13:30:00+05:30"
        }
    ]
}
```
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [DescribeRuntimeVersions](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/describe-runtime-versions.html) 섹션을 참조하세요.

### `disassociate-resource`
<a name="synthetics_DisassociateResource_cli_topic"></a>

다음 코드 예시는 `disassociate-resource`의 사용 방법을 보여줍니다.

**AWS CLI**  
**그룹에서 카나리를 제거하려면**  
다음 `disassociate-resource` 예제에서는 `demo_group`이라는 그룹에서 카나리를 제거합니다.  

```
aws synthetics disassociate-resource \
    --group-identifier demo_group \
    --resource-arn arn:aws:synthetics:us-east-1:123456789012:canary:demo_canary
```
이 명령은 출력을 생성하지 않습니다.  
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [DisassociateResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/disassociate-resource.html)를 참조하세요.

### `get-canary-runs`
<a name="synthetics_GetCanaryRuns_cli_topic"></a>

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

**AWS CLI**  
**지정된 카나리에 대한 실행 목록을 검색하려면**  
다음 `get-canary-runs` 예제에서는 `demo_canary`라는 카나리의 실행 목록을 검색합니다.  

```
aws synthetics get-canary-runs \
    --name demo_canary
```
출력:  

```
{
    "CanaryRuns": [
        {
            "Id": "a1b2c3d4-5678-90ab-cdef-example11111",
            "Name": "demo_canary",
            "Status": {
                "State": "PASSED",
                "StateReason": "",
                "StateReasonCode": ""
            },
            "Timeline": {
                "Started": "2024-10-16T10:38:57.013000+05:30",
                "Completed": "2024-10-16T10:39:25.793000+05:30"
            },
            "ArtifactS3Location": "cw-syn-results-123456789012-us-east-1/canary/us-east-1/demo_canary-abc-example1234/2024/10/15/13/50-39-690"
        }
    ]
}
```
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [GetCanaryRuns](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/get-canary-runs.html)를 참조하세요.

### `get-canary`
<a name="synthetics_GetCanary_cli_topic"></a>

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

**AWS CLI**  
**하나의 카나리에 대한 전체 정보를 검색하려면**  
다음 `get-canary` 예제에서는 `demo_canary`라는 카나리에 대한 전체 정보를 검색합니다.  

```
aws synthetics get-canary \
    --name demo_canary
```
출력:  

```
{
    "Canary": {
        "Id": "a1b2c3d4-5678-90ab-cdef-example11111",
        "Name": "demo_canary",
        "Code": {
            "SourceLocationArn": "arn:aws:lambda:us-east-1:123456789012:layer:cwsyn-demo_canary-a1b2c3d4-5678-90ab-cdef-example111118:1",
            "Handler": "pageLoadBlueprint.handler"
        },
        "ExecutionRoleArn": "arn:aws:iam::123456789012:role/demo_canary_role",
        "Schedule": {
            "Expression": "rate(10 minutes)",
            "DurationInSeconds": 0
        },
        "RunConfig": {
            "TimeoutInSeconds": 300,
            "MemoryInMB": 1000,
            "ActiveTracing": false
        },
        "SuccessRetentionPeriodInDays": 31,
        "FailureRetentionPeriodInDays": 31,
        "Status": {
            "State": "RUNNING"
        },
        "Timeline": {
            "Created": "2024-10-15T18:55:15.168000+05:30",
            "LastModified": "2024-10-15T18:55:40.540000+05:30",
            "LastStarted": "2024-10-15T18:55:40.540000+05:30"
        },
        "ArtifactS3Location": "cw-syn-results-123456789012-us-east-1/canary/us-east-1/demo_canary-a12-a123bc456789",
        "EngineArn": "arn:aws:lambda:us-east-1:123456789012:function:cwsyn-demo_canary-a1b2c3d4-5678-90ab-cdef-example111118:1",
        "RuntimeVersion": "syn-nodejs-puppeteer-9.1",
        "Tags": {
            "blueprint": "heartbeat"
        }
    }
}
```
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [GetCanary](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/get-canary.html)를 참조하세요.

### `get-group`
<a name="synthetics_GetGroup_cli_topic"></a>

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

**AWS CLI**  
**하나의 그룹에 대한 정보를 반환하려면**  
다음 `get-group` 예제에서는 `demo_group`이라는 그룹에 대한 정보를 반환합니다.  

```
aws synthetics get-group \
    --group-identifier demo_group
```
출력:  

```
{
    "Group": {
        "Id": "example123",
        "Name": "demo_group",
        "Arn": "arn:aws:synthetics:us-east-1:123456789012:group:example123",
        "Tags": {},
        "CreatedTime": "2024-10-15T14:47:23.811000+05:30",
        "LastModifiedTime": "2024-10-15T14:47:23.811000+05:30"
    }
}
```
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [GetGroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/get-group.html)을 참조하세요.

### `list-associated-groups`
<a name="synthetics_ListAssociatedGroups_cli_topic"></a>

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

**AWS CLI**  
**그룹 목록을 반환하려면**  
다음 `list-associated-groups` 예제에서는 `demo_canary`라는 카나리와 연결된 그룹의 목록을 반환합니다.  

```
aws synthetics list-associated-groups \
    --resource-arn arn:aws:synthetics:us-east-1:123456789012:canary:demo_canary
```
출력:  

```
{
    "Groups": [
        {
            "Id": "example123",
            "Name": "demo_group",
            "Arn": "arn:aws:synthetics:us-east-1:123456789012:group:example123"
        }
    ]
}
```
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [ListAssociatedGroups](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/list-associated-groups.html) 섹션을 참조하세요.

### `list-group-resources`
<a name="synthetics_ListGroupResources_cli_topic"></a>

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

**AWS CLI**  
**지정된 그룹과 연결된 카나리의 ARN 목록을 반환하려면**  
다음 `list-group-resources` 예제에서는 `demo_group`이라는 그룹과 연결된 카나리의 ARN 목록을 반환합니다.  

```
aws synthetics list-group-resources \
    --group-identifier demo_group
```
출력:  

```
{
    "Resources": [
        "arn:aws:synthetics:us-east-1:123456789012:canary:demo_canary"
    ]
}
```
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [ListGroupResources](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/list-group-resources.html)를 참조하세요.

### `list-groups`
<a name="synthetics_ListGroups_cli_topic"></a>

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

**AWS CLI**  
**계정의 모든 그룹 목록을 반환하려면**  
다음 `list-groups` 예제에서는 계정의 모든 그룹 목록을 반환합니다.  

```
aws synthetics list-groups
```
출력:  

```
{
    "Groups": [
        {
            "Id": "example123",
            "Name": "demo_group",
            "Arn": "arn:aws:synthetics:us-east-1:123456789012:group:example123"
        }
    ]
}
```
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [ListGroups](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/list-groups.html)를 참조하세요.

### `list-tags-for-resource`
<a name="synthetics_ListTagsForResource_cli_topic"></a>

다음 코드 예시는 `list-tags-for-resource`의 사용 방법을 보여줍니다.

**AWS CLI**  
**예제 1: 카나리와 연결된 태그 표시**  
다음 `list-tags-for-resource` 예제에서는 `demo_canary`라는 카나리와 연결된 태그를 반환합니다.  

```
aws synthetics list-tags-for-resource \
    --resource-arn arn:aws:synthetics:us-east-1:123456789012:canary:demo_canary
```
출력:  

```
{
    "Tags": {
        "blueprint": "heartbeat"
    }
}
```
**예제 2: 그룹과 연결된 태그 표시**  
다음 `list-tags-for-resource` 예제에서는 `demo_group`이라는 그룹과 연결된 태그를 반환합니다.  

```
aws  synthetics list-tags-for-resource \
    --resource-arn arn:aws:synthetics:us-east-1:123456789012:group:example123
```
출력:  

```
{
    "Tags": {
        "team": "Devops"
    }
}
```
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [ListTagsForResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/list-tags-for-resource.html)를 참조하세요.

### `start-canary`
<a name="synthetics_StartCanary_cli_topic"></a>

다음 코드 예시는 `start-canary`의 사용 방법을 보여줍니다.

**AWS CLI**  
**카나리를 실행하려면**  
다음 `start-canary` 예제에서는 `demo_canary`라는 카나리를 실행합니다.  

```
aws synthetics start-canary \
    --name demo_canary
```
이 명령은 출력을 생성하지 않습니다.  
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [StartCanary](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/start-canary.html) 섹션을 참조하세요.

### `stop-canary`
<a name="synthetics_StopCanary_cli_topic"></a>

다음 코드 예시는 `stop-canary`의 사용 방법을 보여줍니다.

**AWS CLI**  
**카나리를 중지하려면**  
다음 `stop-canary` 예제에서는 `demo_canary`라는 카나리를 중지합니다.  

```
aws synthetics stop-canary \
    --name demo_canary
```
이 명령은 출력을 생성하지 않습니다.  
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [StopCanary](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/stop-canary.html) 섹션을 참조하세요.

### `tag-resource`
<a name="synthetics_TagResource_cli_topic"></a>

다음 코드 예시는 `tag-resource`의 사용 방법을 보여줍니다.

**AWS CLI**  
**예제 1: 카나리에 태그 할당**  
다음 `tag-resource` 예제에서는 `demo_canary`라는 카나리에 태그를 할당합니다.  

```
aws synthetics tag-resource \
    --resource-arn arn:aws:synthetics:us-east-1:123456789012:canary:demo_canary \
    --tags blueprint=heartbeat
```
이 명령은 출력을 생성하지 않습니다.  
**예제 2: 그룹에 태그를 할당**  
다음 `tag-resource` 예제에서는 `demo_group`이라는 그룹에 태그를 할당합니다.  

```
aws synthetics tag-resource \
    --resource-arn arn:aws:synthetics:us-east-1:123456789012:group:example123 \
    --tags team=Devops
```
이 명령은 출력을 생성하지 않습니다.  
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [TagResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/tag-resource.html)를 참조하세요.

### `untag-resource`
<a name="synthetics_UntagResource_cli_topic"></a>

다음 코드 예시는 `untag-resource`의 사용 방법을 보여줍니다.

**AWS CLI**  
**예제 1: 카나리에서 태그 제거**  
다음 `untag-resource` 예제에서는 `demo_canary`라는 카나리에서 태그를 제거합니다.  

```
aws synthetics untag-resource \
    --resource-arn arn:aws:synthetics:us-east-1:123456789012:canary:demo_canary \
    --tag-keys blueprint
```
이 명령은 출력을 생성하지 않습니다.  
**예제 2: 그룹에서 태그 제거**  
다음 `untag-resource` 예제에서는 `demo_group`이라는 그룹에서 태그를 제거합니다.  

```
aws synthetics untag-resource \
    --resource-arn arn:aws:synthetics:us-east-1:123456789012:group:example123 \
    --tag-keys team
```
이 명령은 출력을 생성하지 않습니다.  
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [UntagResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/untag-resource.html)를 참조하세요.

### `update-canary`
<a name="synthetics_UpdateCanary_cli_topic"></a>

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

**AWS CLI**  
**카나리를 업데이트하려면**  
다음 `update-canary` 예제에서는 `demo_canary`라는 카나리의 구성을 업데이트합니다.  

```
aws synthetics update-canary \
    --name demo_canary \
    --schedule Expression="rate(15 minutes)"
```
이 명령은 출력을 생성하지 않습니다.  
자세한 내용은 *Amazon CloudWatch 사용 설명서*의 [Synthetic 모니터링(카나리)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [UpdateCanary](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/synthetics/update-canary.html)를 참조하세요.