쿠키 기본 설정 선택

당사는 사이트와 서비스를 제공하는 데 필요한 필수 쿠키 및 유사한 도구를 사용합니다. 고객이 사이트를 어떻게 사용하는지 파악하고 개선할 수 있도록 성능 쿠키를 사용해 익명의 통계를 수집합니다. 필수 쿠키는 비활성화할 수 없지만 '사용자 지정' 또는 ‘거부’를 클릭하여 성능 쿠키를 거부할 수 있습니다.

사용자가 동의하는 경우 AWS와 승인된 제3자도 쿠키를 사용하여 유용한 사이트 기능을 제공하고, 사용자의 기본 설정을 기억하고, 관련 광고를 비롯한 관련 콘텐츠를 표시합니다. 필수가 아닌 모든 쿠키를 수락하거나 거부하려면 ‘수락’ 또는 ‘거부’를 클릭하세요. 더 자세한 내용을 선택하려면 ‘사용자 정의’를 클릭하세요.

AWS CLI를 사용한 Cloud Control API 예제

포커스 모드
AWS CLI를 사용한 Cloud Control API 예제 - AWS Command Line Interface

이 문서는 AWS CLI의 버전 1에만 해당합니다. AWS CLI의 버전 2와 관련된 문서는 버전 2 사용 설명서를 참조하세요.

이 문서는 AWS CLI의 버전 1에만 해당합니다. AWS CLI의 버전 2와 관련된 문서는 버전 2 사용 설명서를 참조하세요.

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

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

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

주제

작업

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

AWS CLI

리소스를 생성하려면

다음 create-resource 예제에서는 보존 기간이 168시간이고 샤드 수가 3인 ResourceExample라는 이름의 AWS::Kinesis::Stream 리소스를 생성합니다.

aws cloudcontrol create-resource \ --type-name AWS::Kinesis::Stream \ --desired-state "{\"Name\": \"ResourceExample\",\"RetentionPeriodHours\":168, \"ShardCount\":3}"

출력:

{ "ProgressEvent": { "EventTime": 1632506656.706, "TypeName": "AWS::Kinesis::Stream", "OperationStatus": "IN_PROGRESS", "Operation": "CREATE", "Identifier": "ResourceExample", "RequestToken": "20999d87-e304-4725-ad84-832dcbfd7fc5" } }

자세한 내용은 Cloud Control API 사용 설명서Creating a resource를 참조하세요.

  • API 세부 정보는 AWS CLI 명령 참조의 CreateResource를 참조하세요.

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

AWS CLI

리소스를 생성하려면

다음 create-resource 예제에서는 보존 기간이 168시간이고 샤드 수가 3인 ResourceExample라는 이름의 AWS::Kinesis::Stream 리소스를 생성합니다.

aws cloudcontrol create-resource \ --type-name AWS::Kinesis::Stream \ --desired-state "{\"Name\": \"ResourceExample\",\"RetentionPeriodHours\":168, \"ShardCount\":3}"

출력:

{ "ProgressEvent": { "EventTime": 1632506656.706, "TypeName": "AWS::Kinesis::Stream", "OperationStatus": "IN_PROGRESS", "Operation": "CREATE", "Identifier": "ResourceExample", "RequestToken": "20999d87-e304-4725-ad84-832dcbfd7fc5" } }

자세한 내용은 Cloud Control API 사용 설명서Creating a resource를 참조하세요.

  • API 세부 정보는 AWS CLI 명령 참조의 CreateResource를 참조하세요.

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

AWS CLI

리소스를 삭제하는 방법

다음 delete-resource 예제에서는 AWS 계정에서 식별자 ResourceExample이 있는 AWS::Kinesis::Stream 리소스를 삭제합니다.

aws cloudcontrol delete-resource \ --type-name AWS::Kinesis::Stream \ --identifier ResourceExample

출력:

{ "ProgressEvent": { "TypeName": "AWS::Kinesis::Stream", "Identifier": "ResourceExample", "RequestToken": "e48f26ff-d0f9-4ab8-a878-120db1edf111", "Operation": "DELETE", "OperationStatus": "IN_PROGRESS", "EventTime": 1632950300.14 } }

자세한 내용은 Cloud Control API 사용 설명서Deleting a resource를 참조하세요.

  • API 세부 정보는 AWS CLI 명령 참조DeleteResource를 참조하세요.

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

AWS CLI

리소스를 삭제하는 방법

다음 delete-resource 예제에서는 AWS 계정에서 식별자 ResourceExample이 있는 AWS::Kinesis::Stream 리소스를 삭제합니다.

aws cloudcontrol delete-resource \ --type-name AWS::Kinesis::Stream \ --identifier ResourceExample

출력:

{ "ProgressEvent": { "TypeName": "AWS::Kinesis::Stream", "Identifier": "ResourceExample", "RequestToken": "e48f26ff-d0f9-4ab8-a878-120db1edf111", "Operation": "DELETE", "OperationStatus": "IN_PROGRESS", "EventTime": 1632950300.14 } }

자세한 내용은 Cloud Control API 사용 설명서Deleting a resource를 참조하세요.

  • API 세부 정보는 AWS CLI 명령 참조DeleteResource를 참조하세요.

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

AWS CLI

리소스 요청의 상태 정보를 가져오려면

다음 get-resource-request-status 예제는 지정된 리소스 요청에 대한 상태 정보를 반환합니다.

aws cloudcontrol get-resource-request-status \ --request-token "e1a6b86e-46bd-41ac-bfba-001234567890"

출력:

{ "ProgressEvent": { "TypeName": "AWS::Kinesis::Stream", "Identifier": "Demo", "RequestToken": "e1a6b86e-46bd-41ac-bfba-001234567890", "Operation": "CREATE", "OperationStatus": "FAILED", "EventTime": 1632950268.481, "StatusMessage": "Resource of type 'AWS::Kinesis::Stream' with identifier 'Demo' already exists.", "ErrorCode": "AlreadyExists" } }

자세한 내용은 Cloud Control API 사용 설명서Managing resource operation requests를 참조하세요.

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

AWS CLI

리소스 요청의 상태 정보를 가져오려면

다음 get-resource-request-status 예제는 지정된 리소스 요청에 대한 상태 정보를 반환합니다.

aws cloudcontrol get-resource-request-status \ --request-token "e1a6b86e-46bd-41ac-bfba-001234567890"

출력:

{ "ProgressEvent": { "TypeName": "AWS::Kinesis::Stream", "Identifier": "Demo", "RequestToken": "e1a6b86e-46bd-41ac-bfba-001234567890", "Operation": "CREATE", "OperationStatus": "FAILED", "EventTime": 1632950268.481, "StatusMessage": "Resource of type 'AWS::Kinesis::Stream' with identifier 'Demo' already exists.", "ErrorCode": "AlreadyExists" } }

자세한 내용은 Cloud Control API 사용 설명서Managing resource operation requests를 참조하세요.

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

AWS CLI

리소스의 현재 상태를 가져오려면

다음 get-resource 예제는 이름이 ResourceExample인 AWS::Kinesis::Stream 리소스의 현재 상태를 반환합니다.

aws cloudcontrol get-resource \ --type-name AWS::Kinesis::Stream \ --identifier ResourceExample

출력:

{ "TypeName": "AWS::Kinesis::Stream", "ResourceDescription": { "Identifier": "ResourceExample", "Properties": "{\"Arn\":\"arn:aws:kinesis:us-west-2:099908667365:stream/ResourceExample\",\"RetentionPeriodHours\":168,\"Name\":\"ResourceExample\",\"ShardCount\":3}" } }

자세한 내용은 Cloud Control API 사용 설명서Reading a resource's current state를 참조하세요.

  • API 세부 정보는 AWS CLI 명령 참조GetResources를 참조하세요.

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

AWS CLI

리소스의 현재 상태를 가져오려면

다음 get-resource 예제는 이름이 ResourceExample인 AWS::Kinesis::Stream 리소스의 현재 상태를 반환합니다.

aws cloudcontrol get-resource \ --type-name AWS::Kinesis::Stream \ --identifier ResourceExample

출력:

{ "TypeName": "AWS::Kinesis::Stream", "ResourceDescription": { "Identifier": "ResourceExample", "Properties": "{\"Arn\":\"arn:aws:kinesis:us-west-2:099908667365:stream/ResourceExample\",\"RetentionPeriodHours\":168,\"Name\":\"ResourceExample\",\"ShardCount\":3}" } }

자세한 내용은 Cloud Control API 사용 설명서Reading a resource's current state를 참조하세요.

  • API 세부 정보는 AWS CLI 명령 참조GetResources를 참조하세요.

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

AWS CLI

활성 리소스 작업 요청을 나열하려면

다음 list-resource-requests 예제에서는 AWS 계정에서 실패한 CREATE 및 UPDATE 작업에 대한 리소스 요청을 나열합니다.

aws cloudcontrol list-resource-requests \ --resource-request-status-filter Operations=CREATE,OperationStatuses=FAILED

출력:

{ "ResourceRequestStatusSummaries": [ { "TypeName": "AWS::Kinesis::Stream", "Identifier": "Demo", "RequestToken": "e1a6b86e-46bd-41ac-bfba-633abcdfdbd7", "Operation": "CREATE", "OperationStatus": "FAILED", "EventTime": 1632950268.481, "StatusMessage": "Resource of type 'AWS::Kinesis::Stream' with identifier 'Demo' already exists.", "ErrorCode": "AlreadyExists" } ] }

자세한 내용은 Cloud Control API 사용 설명서Managing resource operation requests를 참조하세요.

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

AWS CLI

활성 리소스 작업 요청을 나열하려면

다음 list-resource-requests 예제에서는 AWS 계정에서 실패한 CREATE 및 UPDATE 작업에 대한 리소스 요청을 나열합니다.

aws cloudcontrol list-resource-requests \ --resource-request-status-filter Operations=CREATE,OperationStatuses=FAILED

출력:

{ "ResourceRequestStatusSummaries": [ { "TypeName": "AWS::Kinesis::Stream", "Identifier": "Demo", "RequestToken": "e1a6b86e-46bd-41ac-bfba-633abcdfdbd7", "Operation": "CREATE", "OperationStatus": "FAILED", "EventTime": 1632950268.481, "StatusMessage": "Resource of type 'AWS::Kinesis::Stream' with identifier 'Demo' already exists.", "ErrorCode": "AlreadyExists" } ] }

자세한 내용은 Cloud Control API 사용 설명서Managing resource operation requests를 참조하세요.

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

AWS CLI

지정된 유형의 리소스를 나열하려면

다음 list-resources 예제에서는 AWS 계정에 프로비저닝된 AWS::Kinesis::Stream 리소스를 나열합니다.

aws cloudcontrol list-resources \ --type-name AWS::Kinesis::Stream

출력:

{ "TypeName": "AWS::Kinesis::Stream", "ResourceDescriptions": [ { "Identifier": "MyKinesisStream", "Properties": "{\"Name\":\"MyKinesisStream\"}" }, { "Identifier": "AnotherStream", "Properties": "{\"Name\":\"AnotherStream\"}" } ] }

자세한 내용은 Cloud Control API 사용 설명서Discovering resources를 참조하세요.

  • API 세부 정보는 AWS CLI 명령 참조ListResources를 참조하세요.

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

AWS CLI

지정된 유형의 리소스를 나열하려면

다음 list-resources 예제에서는 AWS 계정에 프로비저닝된 AWS::Kinesis::Stream 리소스를 나열합니다.

aws cloudcontrol list-resources \ --type-name AWS::Kinesis::Stream

출력:

{ "TypeName": "AWS::Kinesis::Stream", "ResourceDescriptions": [ { "Identifier": "MyKinesisStream", "Properties": "{\"Name\":\"MyKinesisStream\"}" }, { "Identifier": "AnotherStream", "Properties": "{\"Name\":\"AnotherStream\"}" } ] }

자세한 내용은 Cloud Control API 사용 설명서Discovering resources를 참조하세요.

  • API 세부 정보는 AWS CLI 명령 참조ListResources를 참조하세요.

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

AWS CLI

기존 리소스의 속성을 업데이트하려면

다음 update-resource 예제에서는 이름이 ExampleLogGroup인 AWS::Logs::LogGroup 리소스의 보존 정책을 90일로 업데이트합니다.

aws cloudcontrol update-resource \ --type-name AWS::Logs::LogGroup \ --identifier ExampleLogGroup \ --patch-document "[{\"op\":\"replace\",\"path\":\"/RetentionInDays\",\"value\":90}]"

출력:

{ "ProgressEvent": { "EventTime": "2021-08-09T18:17:15.219Z", "TypeName": "AWS::Logs::LogGroup", "OperationStatus": "IN_PROGRESS", "Operation": "UPDATE", "Identifier": "ExampleLogGroup", "RequestToken": "5f40c577-3534-4b20-9599-0b0123456789" } }

자세한 내용은 Cloud Control API 사용 설명서Updating a resource를 참조하세요.

  • API 세부 정보는 AWS CLI 명령 참조UpdateResource를 참조하세요.

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

AWS CLI

기존 리소스의 속성을 업데이트하려면

다음 update-resource 예제에서는 이름이 ExampleLogGroup인 AWS::Logs::LogGroup 리소스의 보존 정책을 90일로 업데이트합니다.

aws cloudcontrol update-resource \ --type-name AWS::Logs::LogGroup \ --identifier ExampleLogGroup \ --patch-document "[{\"op\":\"replace\",\"path\":\"/RetentionInDays\",\"value\":90}]"

출력:

{ "ProgressEvent": { "EventTime": "2021-08-09T18:17:15.219Z", "TypeName": "AWS::Logs::LogGroup", "OperationStatus": "IN_PROGRESS", "Operation": "UPDATE", "Identifier": "ExampleLogGroup", "RequestToken": "5f40c577-3534-4b20-9599-0b0123456789" } }

자세한 내용은 Cloud Control API 사용 설명서Updating a resource를 참조하세요.

  • API 세부 정보는 AWS CLI 명령 참조UpdateResource를 참조하세요.

이 페이지에서

프라이버시사이트 이용 약관쿠키 기본 설정
© 2025, Amazon Web Services, Inc. 또는 계열사. All rights reserved.