Skip to main content

thing_types

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

Overview

Namething_types
TypeResource
Idaws.iot.thing_types

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
thing_type_arnstringThe thing type ARN.
thing_type_idstringThe thing type ID.
thing_type_metadataobjectThe ThingTypeMetadata contains additional information about the thing type including: creation date and time, a value indicating whether the thing type is deprecated, and a date and time when it was deprecated.
thing_type_namestringThe name of the thing type. (pattern: <code>[a-zA-Z0-9:_-]+</code>)
thing_type_propertiesobjectThe ThingTypeProperties contains information about the thing type including: a thing type description, and a list of searchable thing attribute names.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_thing_typeselectthing_type_name, regionGets information about the specified thing type. Requires permission to access the DescribeThingType action.
list_thing_typesselectregionnextToken, maxResults, thingTypeNameLists the existing thing types. Requires permission to access the ListThingTypes action.
create_thing_typeinsertthing_type_name, regionCreates a new thing type. If this call is made multiple times using the same thing type name and configuration, the call will succeed. If this call is made with the same thing type name but different configuration a ResourceAlreadyExistsException is thrown. Requires permission to access the CreateThingType action.
update_thing_typeupdatething_type_name, regionUpdates a thing type.
delete_thing_typedeletething_type_name, regionDeletes the specified thing type. You cannot delete a thing type if it has things associated with it. To delete a thing type, first mark it as deprecated by calling DeprecateThingType, then remove any associated things by calling UpdateThing to change the thing type on any associated thing, and finally use DeleteThingType to delete the thing type. Requires permission to access the DeleteThingType action.
deprecate_thing_typeexecthing_type_name, regionDeprecates a thing type. You can not associate new things with deprecated thing type. Requires permission to access the DeprecateThingType action.

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)
thing_type_namestringThe name of the thing type to deprecate.
maxResultsintegerThe maximum number of results to return in this operation.
nextTokenstringTo retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results.
thingTypeNamestringThe name of the thing type.

SELECT examples

Gets information about the specified thing type. Requires permission to access the DescribeThingType action.

SELECT
thing_type_arn,
thing_type_id,
thing_type_metadata,
thing_type_name,
thing_type_properties
FROM aws.iot.thing_types
WHERE thing_type_name = '{{ thing_type_name }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a new thing type. If this call is made multiple times using the same thing type name and configuration, the call will succeed. If this call is made with the same thing type name but different configuration a ResourceAlreadyExistsException is thrown. Requires permission to access the CreateThingType action.

INSERT INTO aws.iot.thing_types (
thingTypeProperties,
tags,
thing_type_name,
region
)
SELECT
'{{ thingTypeProperties }}',
'{{ tags }}',
'{{ thing_type_name }}',
'{{ region }}'
RETURNING
thing_type_arn,
thing_type_id,
thing_type_name
;

UPDATE examples

Updates a thing type.

UPDATE aws.iot.thing_types
SET
thingTypeProperties = '{{ thingTypeProperties }}'
WHERE
thing_type_name = '{{ thing_type_name }}' --required
AND region = '{{ region }}' --required;

DELETE examples

Deletes the specified thing type. You cannot delete a thing type if it has things associated with it. To delete a thing type, first mark it as deprecated by calling DeprecateThingType, then remove any associated things by calling UpdateThing to change the thing type on any associated thing, and finally use DeleteThingType to delete the thing type. Requires permission to access the DeleteThingType action.

DELETE FROM aws.iot.thing_types
WHERE thing_type_name = '{{ thing_type_name }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Deprecates a thing type. You can not associate new things with deprecated thing type. Requires permission to access the DeprecateThingType action.

EXEC aws.iot.thing_types.deprecate_thing_type
@thing_type_name='{{ thing_type_name }}' --required,
@region='{{ region }}' --required
@@json=
'{
"undoDeprecate": {{ undoDeprecate }}
}'
;