Skip to main content

dimensions

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

Overview

Namedimensions
TypeResource
Idaws.iot.dimensions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe unique identifier for the dimension. (pattern: <code>[a-zA-Z0-9:_-]+</code>)
arnstringThe Amazon Resource Name (ARN) for the dimension.
creation_datestring (date-time)The date the dimension was created.
last_modified_datestring (date-time)The date the dimension was last modified.
string_valuesarrayThe value or list of values used to scope the dimension. For example, for topic filters, this is the pattern used to match the MQTT topic name.
type_stringThe type of the dimension. (TOPIC_FILTER)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_dimensionselectname, regionProvides details about a dimension that is defined in your Amazon Web Services accounts. Requires permission to access the DescribeDimension action.
list_dimensionsselectregionnextToken, maxResultsList the set of dimensions that are defined for your Amazon Web Services accounts. Requires permission to access the ListDimensions action.
create_dimensioninsertname, region, type, stringValues, clientRequestTokenCreate a dimension that you can use to limit the scope of a metric used in a security profile for IoT Device Defender. For example, using a TOPIC_FILTER dimension, you can narrow down the scope of the metric only to MQTT topics whose name match the pattern specified in the dimension. Requires permission to access the CreateDimension action.
update_dimensionupdatename, region, stringValuesUpdates the definition for a dimension. You cannot change the type of a dimension after it is created (you can delete it and recreate it). Requires permission to access the UpdateDimension action.
delete_dimensiondeletename, regionRemoves the specified dimension from your Amazon Web Services accounts. Requires permission to access the DeleteDimension 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
namestringThe unique identifier for the dimension that you want to delete.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of results to retrieve at one time.
nextTokenstringThe token for the next set of results.

SELECT examples

Provides details about a dimension that is defined in your Amazon Web Services accounts. Requires permission to access the DescribeDimension action.

SELECT
name,
arn,
creation_date,
last_modified_date,
string_values,
type_
FROM aws.iot.dimensions
WHERE name = '{{ name }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Create a dimension that you can use to limit the scope of a metric used in a security profile for IoT Device Defender. For example, using a TOPIC_FILTER dimension, you can narrow down the scope of the metric only to MQTT topics whose name match the pattern specified in the dimension. Requires permission to access the CreateDimension action.

INSERT INTO aws.iot.dimensions (
type,
stringValues,
tags,
clientRequestToken,
name,
region
)
SELECT
'{{ type }}' /* required */,
'{{ stringValues }}' /* required */,
'{{ tags }}',
'{{ clientRequestToken }}' /* required */,
'{{ name }}',
'{{ region }}'
RETURNING
name,
arn
;

UPDATE examples

Updates the definition for a dimension. You cannot change the type of a dimension after it is created (you can delete it and recreate it). Requires permission to access the UpdateDimension action.

UPDATE aws.iot.dimensions
SET
stringValues = '{{ stringValues }}'
WHERE
name = '{{ name }}' --required
AND region = '{{ region }}' --required
AND stringValues = '{{ stringValues }}' --required
RETURNING
name,
arn,
creation_date,
last_modified_date,
string_values,
type_;

DELETE examples

Removes the specified dimension from your Amazon Web Services accounts. Requires permission to access the DeleteDimension action.

DELETE FROM aws.iot.dimensions
WHERE name = '{{ name }}' --required
AND region = '{{ region }}' --required
;