Skip to main content

resource_definitions

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

Overview

Nameresource_definitions
TypeResource
Idaws.greengrass.resource_definitions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe ARN of the definition.
creation_timestampstringThe time, in milliseconds since the epoch, when the definition was created.
idstringThe ID of the definition.
last_updated_timestampstringThe time, in milliseconds since the epoch, when the definition was last updated.
latest_versionstringThe ID of the latest version associated with the definition.
latest_version_arnstringThe ARN of the latest version associated with the definition.
namestringThe name of the definition.
tagsobjectTag(s) attached to the resource arn.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_resource_definitionselectresource_definition_id, regionRetrieves information about a resource definition, including its creation time and latest version.
list_resource_definitionsselectregionMaxResults, NextTokenRetrieves a list of resource definitions.
create_resource_definitioninsertregionX-Amzn-Client-TokenCreates a resource definition which contains a list of resources to be used in a group. You can create an initial version of the definition by providing a list of resources now, or use ''CreateResourceDefinitionVersion'' later.
update_resource_definitionupdateresource_definition_id, regionUpdates a resource definition.
delete_resource_definitiondeleteresource_definition_id, regionDeletes a resource definition.

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)
resource_definition_idstringThe ID of the resource definition.
MaxResultsstringThe maximum number of results to be returned per request.
NextTokenstringThe token for the next set of results, or ''null'' if there are no additional results.
X-Amzn-Client-TokenstringA client token used to correlate requests and responses.

SELECT examples

Retrieves information about a resource definition, including its creation time and latest version.

SELECT
arn,
creation_timestamp,
id,
last_updated_timestamp,
latest_version,
latest_version_arn,
name,
tags
FROM aws.greengrass.resource_definitions
WHERE resource_definition_id = '{{ resource_definition_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a resource definition which contains a list of resources to be used in a group. You can create an initial version of the definition by providing a list of resources now, or use ''CreateResourceDefinitionVersion'' later.

INSERT INTO aws.greengrass.resource_definitions (
InitialVersion,
Name,
tags,
region,
`X-Amzn-Client-Token`
)
SELECT
'{{ InitialVersion }}',
'{{ Name }}',
'{{ tags }}',
'{{ region }}',
'{{ X-Amzn-Client-Token }}'
RETURNING
arn,
creation_timestamp,
id,
last_updated_timestamp,
latest_version,
latest_version_arn,
name
;

UPDATE examples

Updates a resource definition.

UPDATE aws.greengrass.resource_definitions
SET
Name = '{{ Name }}'
WHERE
resource_definition_id = '{{ resource_definition_id }}' --required
AND region = '{{ region }}' --required;

DELETE examples

Deletes a resource definition.

DELETE FROM aws.greengrass.resource_definitions
WHERE resource_definition_id = '{{ resource_definition_id }}' --required
AND region = '{{ region }}' --required
;