Discovering resources with Amazon Cloud Control API
Use the list-resources command to discover the resources currently provisioned in your
Amazon Web Services account and Amazon Web Services Region. This includes all resources of the specified resource type, regardless of whether
they were provisioned through Cloud Control API, directly through the underlying service, or other mechanism (such as being
part of an Amazon CloudFormation stack).
The information returned for each resource includes:
-
The resource's primary identifier.
-
Optionally, it may include the part or all resource's properties, detailing the current state of the resource. For more information, see Viewing resource type schemas.
The follow example returns a list of AWS::Logs::LogGroup resources.
$aws cloudcontrol list-resources --type-name AWS::Logs::LogGroup
Cloud Control API returns a list of the resources in your account of the specified resource type. For the example ,
list-resources returns the primary identifier and resource properties of all
AWS::Logs::LogGroup resources in your account, regardless of whether they were provisioned by Cloud Control API.
The returned information resembles the following, depending on the resources in your account.
{ "TypeName": "AWS::Logs::LogGroup", "ResourceDescriptions": [ { "Identifier": "CloudControlExample", "Properties": '{"RetentionInDays":180, "LogGroupName": "CloudControlExample", "Arn": "arn:aws-cn:logs:us-west-2:123456789012:log-group:CloudControlExample:*"}' }, { "Identifier": "AnotherLogGroupResourceExample", "Properties": '{"RetentionInDays":90, "LogGroupName": "AnotherLogGroupResourceExample", "Arn": "arn:aws-cn:logs:us-west-2:123456789012:log-group:AnotherLogGroupResourceExample:*"}' } ] }
The follow example requests a list of AWS::Kinesis::Stream resources.
$aws cloudcontrol list-resources --type-name AWS::Kinesis::Stream
For Kinesis streams, Cloud Control API returns the primary identifier of each stream, along with a
subset of the resource properties. In this case, just a single property, Name. You
could then use a stream's primary identifier with get-resource to request the resource's full current
state.
{ "TypeName": "AWS::Kinesis::Stream", "ResourceDescriptions": [ { "Identifier": "MyKinesisStream", "Properties": '{"Name": "MyKinesisStream"}' }, { "Identifier": "AnotherStream", "Properties": '{"Name": "AnotherStream"}' } ] }
Resources that require additional information
Certain resources require that you provide additional information about the resources that you want to list as
part of your request. In these cases, you must use the ResourceModel parameter to specify these
properties.
The table below lists these resources, and the properties you to specify in the ResourceModel
parameter during list requests.
| Resources | Required properties |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|