Note: You are viewing the documentation for an older major version of the AWS CLI (version 1).

AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.

[ aws . iot ]



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.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.


--name <value>
--type <value>
--string-values <value>
[--tags <value>]
[--client-request-token <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]


--name (string)

A unique identifier for the dimension. Choose something that describes the type and value to make it easy to remember what it does.

--type (string)

Specifies the type of dimension. Supported types: TOPIC_FILTER.

Possible values:


--string-values (list)

Specifies the value or list of values for the dimension. For TOPIC_FILTER dimensions, this is a pattern used to match the MQTT topic (for example, "admin/#").



"string" "string" ...

--tags (list)

Metadata that can be used to manage the dimension.


A set of key/value pairs that are used to manage the resource.

Key -> (string)

The tag's key.

Value -> (string)

The tag's value.

Shorthand Syntax:

Key=string,Value=string ...

JSON Syntax:

    "Key": "string",
    "Value": "string"

--client-request-token (string)

Each dimension must have a unique client request token. If you try to create a new dimension with the same token as a dimension that already exists, an exception occurs. If you omit this value, Amazon Web Services SDKs will automatically generate a unique client request.

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.


To create a dimension

The following create-dimension creates a dimension with a single topic filter called TopicFilterForAuthMessages.

aws iot create-dimension \
    --name TopicFilterForAuthMessages \
    --type TOPIC_FILTER \
    --string-values device/+/auth


    "name": "TopicFilterForAuthMessages",
    "arn": "arn:aws:iot:eu-west-2:123456789012:dimension/TopicFilterForAuthMessages"

For more information, see Detect Commands in the AWS IoT Developer Guide.


name -> (string)

A unique identifier for the dimension.

arn -> (string)

The Amazon Resource Name (ARN) of the created dimension.