Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

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-dimension

Description

Create a dimension that you can use to limit the scope of a metric used in a security profile for AWS 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.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

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

Options

--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:

  • TOPIC_FILTER

--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/#").

Syntax:

"string" "string" ...

--tags (list)

Metadata that can be used to manage the dimension.

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, AWS 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.

Examples

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

Output:

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

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

Output

name -> (string)

A unique identifier for the dimension.

arn -> (string)

The ARN (Amazon resource name) of the created dimension.