Skip to main content

resources

Creates, updates, deletes, gets or lists a resources resource.

Overview

Nameresources
TypeResource
Idaws.cloudcontrol.resources

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
resource_descriptionobjectRepresents information about a provisioned resource.
type_namestringThe name of the resource type. (pattern: <code>[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_resourceselectregionReturns information about the current state of the specified resource. For details, see Reading a resource's current state. You can use this action to return information about an existing resource in your account and Amazon Web Services Region, whether those resources were provisioned using Cloud Control API.
create_resourceinsertregion, TypeName, DesiredStateCreates the specified resource. For more information, see Creating a resource in the Amazon Web Services Cloud Control API User Guide. After you have initiated a resource creation request, you can monitor the progress of your request by calling GetResourceRequestStatus using the RequestToken of the ProgressEvent type returned by CreateResource.
update_resourceupdateregion, TypeName, PatchDocumentUpdates the specified property values in the resource. You specify your resource property updates as a list of patch operations contained in a JSON patch document that adheres to the RFC 6902 - JavaScript Object Notation (JSON) Patch standard. For details on how Cloud Control API performs resource update operations, see Updating a resource in the Amazon Web Services Cloud Control API User Guide. After you have initiated a resource update request, you can monitor the progress of your request by calling GetResourceRequestStatus using the RequestToken of the ProgressEvent returned by UpdateResource. For more information about the properties of a specific resource, refer to the related topic for the resource in the Resource and property types reference in the CloudFormation Users Guide.
delete_resourcedeleteregionDeletes the specified resource. For details, see Deleting a resource in the Amazon Web Services Cloud Control API User Guide. After you have initiated a resource deletion request, you can monitor the progress of your request by calling GetResourceRequestStatus using the RequestToken of the ProgressEvent returned by DeleteResource.
cancel_resource_requestexecregion, RequestTokenCancels the specified resource operation request. For more information, see Canceling resource operation requests in the Amazon Web Services Cloud Control API User Guide. Only resource operations requests with a status of PENDING or IN_PROGRESS can be canceled.
list_resourcesexecregion, TypeNameReturns information about the specified resources. For more information, see Discovering resources in the Amazon Web Services Cloud Control API User Guide. You can use this action to return information about existing resources in your account and Amazon Web Services Region, whether those resources were provisioned using Cloud Control API.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Returns information about the current state of the specified resource. For details, see Reading a resource's current state. You can use this action to return information about an existing resource in your account and Amazon Web Services Region, whether those resources were provisioned using Cloud Control API.

SELECT
resource_description,
type_name
FROM aws.cloudcontrol.resources
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates the specified resource. For more information, see Creating a resource in the Amazon Web Services Cloud Control API User Guide. After you have initiated a resource creation request, you can monitor the progress of your request by calling GetResourceRequestStatus using the RequestToken of the ProgressEvent type returned by CreateResource.

INSERT INTO aws.cloudcontrol.resources (
TypeName,
TypeVersionId,
RoleArn,
ClientToken,
DesiredState,
region
)
SELECT
'{{ TypeName }}' /* required */,
'{{ TypeVersionId }}',
'{{ RoleArn }}',
'{{ ClientToken }}',
'{{ DesiredState }}' /* required */,
'{{ region }}'
RETURNING
progress_event
;

UPDATE examples

Updates the specified property values in the resource. You specify your resource property updates as a list of patch operations contained in a JSON patch document that adheres to the RFC 6902 - JavaScript Object Notation (JSON) Patch standard. For details on how Cloud Control API performs resource update operations, see Updating a resource in the Amazon Web Services Cloud Control API User Guide. After you have initiated a resource update request, you can monitor the progress of your request by calling GetResourceRequestStatus using the RequestToken of the ProgressEvent returned by UpdateResource. For more information about the properties of a specific resource, refer to the related topic for the resource in the Resource and property types reference in the CloudFormation Users Guide.

UPDATE aws.cloudcontrol.resources
SET
TypeName = '{{ TypeName }}',
TypeVersionId = '{{ TypeVersionId }}',
RoleArn = '{{ RoleArn }}',
ClientToken = '{{ ClientToken }}',
Identifier = '{{ Identifier }}',
PatchDocument = '{{ PatchDocument }}'
WHERE
region = '{{ region }}' --required
AND TypeName = '{{ TypeName }}' --required
AND PatchDocument = '{{ PatchDocument }}' --required
RETURNING
progress_event;

DELETE examples

Deletes the specified resource. For details, see Deleting a resource in the Amazon Web Services Cloud Control API User Guide. After you have initiated a resource deletion request, you can monitor the progress of your request by calling GetResourceRequestStatus using the RequestToken of the ProgressEvent returned by DeleteResource.

DELETE FROM aws.cloudcontrol.resources
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Cancels the specified resource operation request. For more information, see Canceling resource operation requests in the Amazon Web Services Cloud Control API User Guide. Only resource operations requests with a status of PENDING or IN_PROGRESS can be canceled.

EXEC aws.cloudcontrol.resources.cancel_resource_request
@region='{{ region }}' --required
@@json=
'{
"RequestToken": "{{ RequestToken }}"
}'
;