[ 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 | --cli-input-yaml]
[--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/#”).

(string)

Syntax:

"string" "string" ...

--tags (list)

Metadata that can be used to manage the dimension.

(structure)

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, AWS SDKs will automatically generate a unique client request.

--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those 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. This may not be specified along with --cli-input-yaml.

--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. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. 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 Amazon Resource Name (ARN) of the created dimension.