Table Of Contents


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 ]



Creates a job.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.


--job-id <value>
--targets <value>
[--document-source <value>]
[--document <value>]
[--description <value>]
[--presigned-url-config <value>]
[--target-selection <value>]
[--job-executions-rollout-config <value>]
[--abort-config <value>]
[--timeout-config <value>]
[--tags <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]


--job-id (string)

A job identifier which must be unique for your AWS account. We recommend using a UUID. Alpha-numeric characters, "-" and "_" are valid for use here.

--targets (list)

A list of things and thing groups to which the job should be sent.


"string" "string" ...

--document-source (string)

An S3 link to the job document.

--document (string)

The job document.


If the job document resides in an S3 bucket, you must use a placeholder link when specifying the document.

The placeholder link is of the following form:

${aws:iot:s3-presigned-url:*bucket* /*key* }

where bucket is your bucket name and key is the object in the bucket to which you are linking.

--description (string)

A short text description of the job.

--presigned-url-config (structure)

Configuration information for pre-signed S3 URLs.

Shorthand Syntax:


JSON Syntax:

  "roleArn": "string",
  "expiresInSec": long

--target-selection (string)

Specifies whether the job will continue to run (CONTINUOUS), or will be complete after all those things specified as targets have completed the job (SNAPSHOT). If continuous, the job may also be run on a thing when a change is detected in a target. For example, a job will run on a thing when the thing is added to a target group, even after the job was completed by all things originally in the group.

Possible values:


--job-executions-rollout-config (structure)

Allows you to create a staged rollout of the job.

Shorthand Syntax:


JSON Syntax:

  "maximumPerMinute": integer,
  "exponentialRate": {
    "baseRatePerMinute": integer,
    "incrementFactor": double,
    "rateIncreaseCriteria": {
      "numberOfNotifiedThings": integer,
      "numberOfSucceededThings": integer

--abort-config (structure)

Allows you to create criteria to abort a job.

Shorthand Syntax:


JSON Syntax:

  "criteriaList": [
      "failureType": "FAILED"|"REJECTED"|"TIMED_OUT"|"ALL",
      "action": "CANCEL",
      "thresholdPercentage": double,
      "minNumberOfExecutedThings": integer

--timeout-config (structure)

Specifies the amount of time each device has to finish its execution of the job. The timer is started when the job execution status is set to IN_PROGRESS . If the job execution status is not set to another terminal state before the time expires, it will be automatically set to TIMED_OUT .

Shorthand Syntax:


JSON Syntax:

  "inProgressTimeoutInMinutes": long

--tags (list)

Metadata which can be used to manage the job.

Shorthand Syntax:

Key=string,Value=string ...

JSON Syntax:

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

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


Example 1: To create a job

The following create-job example creates a simple AWS IoT job that sends a JSON document to the MyRaspberryPi device.

aws iot create-job \
    --job-id "example-job-01" \
    --targets "arn:aws:iot:us-west-2:123456789012:thing/MyRaspberryPi" \
    --document file://example-job.json \
    --description "example job test" \
    --target-selection SNAPSHOT


    "jobArn": "arn:aws:iot:us-west-2:123456789012:job/example-job-01",
    "jobId": "example-job-01",
    "description": "example job test"

Example 2: To create a continuous job

The following create-job example creates a job that continues to run after the things specified as targets have completed the job. In this example, the target is a thing group, so when new devices are added to the group, the continuous job runs on those new things.

aws iot create-job
--job-id "example-job-04" --targets "arn:aws:iot:us-west-2:123456789012:thinggroup/DeadBulbs" --document file://example-job.json --description "example continuous job" --target-selection CONTINUOUS


    "jobArn": "arn:aws:iot:us-west-2:123456789012:job/example-job-04",
    "jobId": "example-job-04",
    "description": "example continuous job"

For more information, see Creating and Managing Jobs (CLI) in the AWS IoT Developer Guide.


jobArn -> (string)

The job ARN.

jobId -> (string)

The unique identifier you assigned to this job.

description -> (string)

The job description.