resources
Creates, updates, deletes, gets or lists a resources resource.
Overview
| Name | resources |
| Type | Resource |
| Id | aws.cloudcontrol.resources |
Fields
The following fields are returned by SELECT queries:
- get_resource
| Name | Datatype | Description |
|---|---|---|
resource_description | object | Represents information about a provisioned resource. |
type_name | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_resource | select | region | 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. | |
create_resource | insert | region, TypeName, DesiredState | 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. | |
update_resource | update | region, TypeName, PatchDocument | 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. | |
delete_resource | delete | region | 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. | |
cancel_resource_request | exec | region, RequestToken | 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. | |
list_resources | exec | region, TypeName | Returns 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_resource
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
- create_resource
- Manifest
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
;
# Description fields are for documentation purposes
- name: resources
props:
- name: region
value: "{{ region }}"
description: Required parameter for the resources resource.
- name: TypeName
value: "{{ TypeName }}"
description: |
The name of the resource type.
- name: TypeVersionId
value: "{{ TypeVersionId }}"
description: |
For private resource types, the type version to use in this resource operation. If you do not specify a resource version, CloudFormation uses the default version.
- name: RoleArn
value: "{{ RoleArn }}"
description: |
The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role for Cloud Control API to use when performing this resource operation. The role specified must have the permissions required for this operation. The necessary permissions for each event handler are defined in the handlers section of the resource type definition schema. If you do not specify a role, Cloud Control API uses a temporary session created using your Amazon Web Services user credentials. For more information, see Specifying credentials in the Amazon Web Services Cloud Control API User Guide.
- name: ClientToken
value: "{{ ClientToken }}"
description: |
A unique identifier to ensure the idempotency of the resource request. As a best practice, specify this token to ensure idempotency, so that Amazon Web Services Cloud Control API can accurately distinguish between request retries and new resource requests. You might retry a resource request to ensure that it was successfully received. A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. For more information, see Ensuring resource operation requests are unique in the Amazon Web Services Cloud Control API User Guide.
- name: DesiredState
value: "{{ DesiredState }}"
description: |
Structured data format representing the desired state of the resource, consisting of that resource's properties and their desired values. Cloud Control API currently supports JSON as a structured data format. Specify the desired state as one of the following: A JSON blob A local path containing the desired state in JSON data format For more information, see Composing the desired state of the resource in the Amazon Web Services Cloud Control API User Guide. 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 examples
- update_resource
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
- delete_resource
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
- cancel_resource_request
- list_resources
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 }}"
}'
;
Returns 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.
EXEC aws.cloudcontrol.resources.list_resources
@region='{{ region }}' --required
@@json=
'{
"TypeName": "{{ TypeName }}",
"TypeVersionId": "{{ TypeVersionId }}",
"RoleArn": "{{ RoleArn }}",
"NextToken": "{{ NextToken }}",
"MaxResults": {{ MaxResults }},
"ResourceModel": "{{ ResourceModel }}"
}'
;