本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
探索資源
使用list-resources
命令以探索您目前佈建的資源AWS 帳戶和AWS 區域。這包括指定資源類型的所有資源,無論這些資源是透過 Cloud Control API 佈建、直接透過基礎服務或其他機制 (例如屬於AWS CloudFormation堆棧)。
針對每個資源傳回的資訊包括:
-
資源的主要識別碼。
-
或者,它可能包括部分或全部資源的屬性,詳細說明資源的目前狀態。如需詳細資訊,請參閱「」檢視資源類型結構描述。
下列範例會傳回清單AWS::Logs::LogGroup
的費用。
aws cloudcontrol list-resources --type-name AWS::Logs::LogGroup
Cloud Control API 會傳回您帳戶中指定資源類型的資源清單。在上述範例中,list-resources
返回所有的主標識符和資源屬性AWS::Logs::LogGroup
您帳戶中的資源,無論這些資源是否由雲端控制 API 佈建。根據您帳戶中的資源,傳回的資訊類似下列。
{ "TypeName": "AWS::Logs::LogGroup", "ResourceDescriptions": [ { "Identifier": "CloudControlExample", "Properties": "{"RetentionInDays":180, "LogGroupName": "CloudControlExample", "Arn": "arn:aws:logs:us-west-2:090123456789:log-group:CloudControlExample:*"}" }, { "Identifier": "AnotherLogGroupResourceExample", "Properties": "{"RetentionInDays":90, "LogGroupName": "AnotherLogGroupResourceExample", "Arn": "arn:aws:logs:us-west-2:011111111111:log-group:AnotherLogGroupResourceExample:*"}" }, ] }
下列範例請求清單AWS::Kinesis::Stream
的費用。
aws cloudcontrol list-resources --type-name AWS::Kinesis::Stream
針對 Kinesis 串流,雲端控制 API 會傳回每個串流的主要識別碼,以及子集的資源屬性。在這種情況下,只需要一個屬性,Name
。然後,您可以使用流的主標識符get-resource
請求資源的完整當前狀態。
{ "TypeName": "AWS::Kinesis::Stream", "ResourceDescriptions": [ { "Identifier": "MyKinesisStream", "Properties": "{"Name": "MyKinesisStream"}" }, { "Identifier": "AnotherStream", "Properties": "{"Name": "AnotherStream"}" } ] }
需要其他資訊的資源
某些資源會要求您提供有關要在請求中列出的資源的其他資訊。在這些情況下,您必須使用ResourceModel
用於指定這些屬性的參數。
下表列出了這些資源,以及您需要在ResourceModel
列表請求期間的參數。
資源 | 必要的屬性 |
---|---|
RestApiId | |
RestApiId | |
TypeArn 或者 TypeName | |
DomainName |
|
DomainName |
|
TransitGatewayMulticastDomainId |
|
TransitGatewayMulticastDomainId |
|
叢集、服務及識別碼 |
|
ClusterName |
|
ClusterName |
|
LoadBalancerArn |
|
ListenerArn |
|
|
|
SchemaVersionId |
|
|
|
ProjectId |
|
PortalId |
|
IndexId |
|
IndexId |
|
FlowArn |
|
FlowArn |
|
FlowArn |
|
FlowArn |
|
PackagingGroupId |
|
PackagingGroupId |
|
|
|
AwsAccountId |
|
AwsAccountId |
|
AwsAccountId |
|
AwsAccountId |
|
AwsAccountId |
|
AwsAccountId |
|
DBProxyName |
|
儲存貯體 |
|
OutpostId |
|
InstanceArn、 PermissionSetArn、 PrincipalId、 PrincipalType、 TargetId,以及 TargetType |
|
InstanceArn |
|
InstanceArn 和 PermissionSetArn |