Class: AWS.Iot

Inherits:
AWS.Service show all
Identifier:
iot
API Version:
2015-05-28
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Sending a Request Using Iot

var iot = new AWS.Iot();
iot.acceptCertificateTransfer(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the Iot object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var iot = new AWS.Iot({apiVersion: '2015-05-28'});

You can also set the API version globally in AWS.config.apiVersions using the iot service identifier:

AWS.config.apiVersions = {
  iot: '2015-05-28',
  // other service API versions
};

var iot = new AWS.Iot();

Version:

  • 2015-05-28

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.Iot(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a Iot object

var iot = new AWS.Iot({apiVersion: '2015-05-28'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com'.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.Iot.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.Iot.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.Iot.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and returns the amount of time to delay in milliseconds. The base option will be ignored if this option is supplied.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

acceptCertificateTransfer(params = {}, callback) ⇒ AWS.Request

Accepts a pending certificate transfer. The default state of the certificate is INACTIVE.

To check for pending certificate transfers, call ListCertificates to enumerate your certificates.

Service Reference:

Examples:

Calling the acceptCertificateTransfer operation

var params = {
  certificateId: 'STRING_VALUE', /* required */
  setAsActive: true || false
};
iot.acceptCertificateTransfer(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • certificateId — (String)

      The ID of the certificate.

    • setAsActive — (Boolean)

      Specifies whether the certificate is active.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

attachPrincipalPolicy(params = {}, callback) ⇒ AWS.Request

Attaches the specified policy to the specified principal (certificate or other credential).

Service Reference:

Examples:

Calling the attachPrincipalPolicy operation

var params = {
  policyName: 'STRING_VALUE', /* required */
  principal: 'STRING_VALUE' /* required */
};
iot.attachPrincipalPolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyName — (String)

      The policy name.

    • principal — (String)

      The principal, which can be a certificate ARN (as returned from the CreateCertificate operation) or an Amazon Cognito ID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

attachThingPrincipal(params = {}, callback) ⇒ AWS.Request

Attaches the specified principal to the specified thing.

Service Reference:

Examples:

Calling the attachThingPrincipal operation

var params = {
  principal: 'STRING_VALUE', /* required */
  thingName: 'STRING_VALUE' /* required */
};
iot.attachThingPrincipal(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • thingName — (String)

      The name of the thing.

    • principal — (String)

      The principal, such as a certificate or other credential.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

cancelCertificateTransfer(params = {}, callback) ⇒ AWS.Request

Cancels a pending transfer for the specified certificate.

Note Only the transfer source account can use this operation to cancel a transfer. (Transfer destinations can use RejectCertificateTransfer instead.) After transfer, AWS IoT returns the certificate to the source account in the INACTIVE state. After the destination account has accepted the transfer, the transfer cannot be cancelled.

After a certificate transfer is cancelled, the status of the certificate changes from PENDING_TRANSFER to INACTIVE.

Service Reference:

Examples:

Calling the cancelCertificateTransfer operation

var params = {
  certificateId: 'STRING_VALUE' /* required */
};
iot.cancelCertificateTransfer(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • certificateId — (String)

      The ID of the certificate.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createCertificateFromCsr(params = {}, callback) ⇒ AWS.Request

Creates an X.509 certificate using the specified certificate signing request.

Note: The CSR must include a public key that is either an RSA key with a length of at least 2048 bits or an ECC key from NIST P-256 or NIST P-384 curves.

Note: Reusing the same certificate signing request (CSR) results in a distinct certificate.

You can create multiple certificates in a batch by creating a directory, copying multiple .csr files into that directory, and then specifying that directory on the command line. The following commands show how to create a batch of certificates given a batch of CSRs.

Assuming a set of CSRs are located inside of the directory my-csr-directory:

On Linux and OS X, the command is:

$ ls my-csr-directory/ | xargs -I {} aws iot create-certificate-from-csr --certificate-signing-request file://my-csr-directory/{}

This command lists all of the CSRs in my-csr-directory and pipes each CSR file name to the aws iot create-certificate-from-csr AWS CLI command to create a certificate for the corresponding CSR.

The aws iot create-certificate-from-csr part of the command can also be run in parallel to speed up the certificate creation process:

$ ls my-csr-directory/ | xargs -P 10 -I {} aws iot create-certificate-from-csr --certificate-signing-request file://my-csr-directory/{}

On Windows PowerShell, the command to create certificates for all CSRs in my-csr-directory is:

> ls -Name my-csr-directory | %iot create-certificate-from-csr --certificate-signing-request file://my-csr-directory/$_

On a Windows command prompt, the command to create certificates for all CSRs in my-csr-directory is:

> forfiles /p my-csr-directory /c "cmd /c aws iot create-certificate-from-csr --certificate-signing-request file://@path"

Service Reference:

Examples:

Calling the createCertificateFromCsr operation

var params = {
  certificateSigningRequest: 'STRING_VALUE', /* required */
  setAsActive: true || false
};
iot.createCertificateFromCsr(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • certificateSigningRequest — (String)

      The certificate signing request (CSR).

    • setAsActive — (Boolean)

      Specifies whether the certificate is active.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • certificateArn — (String)

        The Amazon Resource Name (ARN) of the certificate. You can use the ARN as a principal for policy operations.

      • certificateId — (String)

        The ID of the certificate. Certificate management operations only take a certificateId.

      • certificatePem — (String)

        The certificate data, in PEM format.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createKeysAndCertificate(params = {}, callback) ⇒ AWS.Request

Creates a 2048-bit RSA key pair and issues an X.509 certificate using the issued public key.

Note This is the only time AWS IoT issues the private key for this certificate, so it is important to keep it in a secure location.

Service Reference:

Examples:

Calling the createKeysAndCertificate operation

var params = {
  setAsActive: true || false
};
iot.createKeysAndCertificate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • setAsActive — (Boolean)

      Specifies whether the certificate is active.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • certificateArn — (String)

        The ARN of the certificate.

      • certificateId — (String)

        The ID of the certificate. AWS IoT issues a default subject name for the certificate (for example, AWS IoT Certificate).

      • certificatePem — (String)

        The certificate data, in PEM format.

      • keyPair — (map)

        The generated key pair.

        • PublicKey — (String)

          The public key.

        • PrivateKey — (String)

          The private key.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createPolicy(params = {}, callback) ⇒ AWS.Request

Creates an AWS IoT policy.

The created policy is the default version for the policy. This operation creates a policy version with a version identifier of 1 and sets 1 as the policy's default version.

Service Reference:

Examples:

Calling the createPolicy operation

var params = {
  policyDocument: 'STRING_VALUE', /* required */
  policyName: 'STRING_VALUE' /* required */
};
iot.createPolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyName — (String)

      The policy name.

    • policyDocument — (String)

      The JSON document that describes the policy. policyDocument must have a minimum length of 1, with a maximum length of 2048, excluding whitespace.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • policyName — (String)

        The policy name.

      • policyArn — (String)

        The policy ARN.

      • policyDocument — (String)

        The JSON document that describes the policy.

      • policyVersionId — (String)

        The policy version ID.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createPolicyVersion(params = {}, callback) ⇒ AWS.Request

Creates a new version of the specified AWS IoT policy. To update a policy, create a new policy version. A managed policy can have up to five versions. If the policy has five versions, you must use DeletePolicyVersion to delete an existing version before you create a new one.

Optionally, you can set the new version as the policy's default version. The default version is the operative version (that is, the version that is in effect for the certificates to which the policy is attached).

Service Reference:

Examples:

Calling the createPolicyVersion operation

var params = {
  policyDocument: 'STRING_VALUE', /* required */
  policyName: 'STRING_VALUE', /* required */
  setAsDefault: true || false
};
iot.createPolicyVersion(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyName — (String)

      The policy name.

    • policyDocument — (String)

      The JSON document that describes the policy. Minimum length of 1. Maximum length of 2048, excluding whitespaces

    • setAsDefault — (Boolean)

      Specifies whether the policy version is set as the default. When this parameter is true, the new policy version becomes the operative version (that is, the version that is in effect for the certificates to which the policy is attached).

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • policyArn — (String)

        The policy ARN.

      • policyDocument — (String)

        The JSON document that describes the policy.

      • policyVersionId — (String)

        The policy version ID.

      • isDefaultVersion — (Boolean)

        Specifies whether the policy version is the default.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createThing(params = {}, callback) ⇒ AWS.Request

Creates a thing record in the thing registry.

Service Reference:

Examples:

Calling the createThing operation

var params = {
  thingName: 'STRING_VALUE', /* required */
  attributePayload: {
    attributes: {
      '<AttributeName>': 'STRING_VALUE',
      /* '<AttributeName>': ... */
    },
    merge: true || false
  },
  thingTypeName: 'STRING_VALUE'
};
iot.createThing(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • thingName — (String)

      The name of the thing to create.

    • thingTypeName — (String)

      The name of the thing type associated with the new thing.

    • attributePayload — (map)

      The attribute payload, which consists of up to three name/value pairs in a JSON document. For example:

      {\"attributes\":{\"string1\":\"string2\"}}

      • attributes — (map<String>)

        A JSON string containing up to three key-value pair in JSON format. For example:

        {\"attributes\":{\"string1\":\"string2\"}}

      • merge — (Boolean)

        Specifies whether the list of attributes provided in the AttributePayload is merged with the attributes stored in the registry, instead of overwriting them.

        To remove an attribute, call UpdateThing with an empty attribute value.

        Note: The merge attribute is only valid when calling UpdateThing.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • thingName — (String)

        The name of the new thing.

      • thingArn — (String)

        The ARN of the new thing.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createThingType(params = {}, callback) ⇒ AWS.Request

Creates a new thing type.

Service Reference:

Examples:

Calling the createThingType operation

var params = {
  thingTypeName: 'STRING_VALUE', /* required */
  thingTypeProperties: {
    searchableAttributes: [
      'STRING_VALUE',
      /* more items */
    ],
    thingTypeDescription: 'STRING_VALUE'
  }
};
iot.createThingType(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • thingTypeName — (String)

      The name of the thing type.

    • thingTypeProperties — (map)

      The ThingTypeProperties for the thing type to create. It contains information about the new thing type including a description, and a list of searchable thing attribute names.

      • thingTypeDescription — (String)

        The description of the thing type.

      • searchableAttributes — (Array<String>)

        A list of searchable thing attribute names.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • thingTypeName — (String)

        The name of the thing type.

      • thingTypeArn — (String)

        The Amazon Resource Name (ARN) of the thing type.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createTopicRule(params = {}, callback) ⇒ AWS.Request

Creates a rule. Creating rules is an administrator-level action. Any user who has permission to create rules will be able to access data processed by the rule.

Service Reference:

Examples:

Calling the createTopicRule operation

var params = {
  ruleName: 'STRING_VALUE', /* required */
  topicRulePayload: { /* required */
    actions: [ /* required */
      {
        cloudwatchAlarm: {
          alarmName: 'STRING_VALUE', /* required */
          roleArn: 'STRING_VALUE', /* required */
          stateReason: 'STRING_VALUE', /* required */
          stateValue: 'STRING_VALUE' /* required */
        },
        cloudwatchMetric: {
          metricName: 'STRING_VALUE', /* required */
          metricNamespace: 'STRING_VALUE', /* required */
          metricUnit: 'STRING_VALUE', /* required */
          metricValue: 'STRING_VALUE', /* required */
          roleArn: 'STRING_VALUE', /* required */
          metricTimestamp: 'STRING_VALUE'
        },
        dynamoDB: {
          hashKeyField: 'STRING_VALUE', /* required */
          hashKeyValue: 'STRING_VALUE', /* required */
          roleArn: 'STRING_VALUE', /* required */
          tableName: 'STRING_VALUE', /* required */
          hashKeyType: STRING | NUMBER,
          operation: 'STRING_VALUE',
          payloadField: 'STRING_VALUE',
          rangeKeyField: 'STRING_VALUE',
          rangeKeyType: STRING | NUMBER,
          rangeKeyValue: 'STRING_VALUE'
        },
        dynamoDBv2: {
          putItem: {
            tableName: 'STRING_VALUE' /* required */
          },
          roleArn: 'STRING_VALUE'
        },
        elasticsearch: {
          endpoint: 'STRING_VALUE', /* required */
          id: 'STRING_VALUE', /* required */
          index: 'STRING_VALUE', /* required */
          roleArn: 'STRING_VALUE', /* required */
          type: 'STRING_VALUE' /* required */
        },
        firehose: {
          deliveryStreamName: 'STRING_VALUE', /* required */
          roleArn: 'STRING_VALUE', /* required */
          separator: 'STRING_VALUE'
        },
        kinesis: {
          roleArn: 'STRING_VALUE', /* required */
          streamName: 'STRING_VALUE', /* required */
          partitionKey: 'STRING_VALUE'
        },
        lambda: {
          functionArn: 'STRING_VALUE' /* required */
        },
        republish: {
          roleArn: 'STRING_VALUE', /* required */
          topic: 'STRING_VALUE' /* required */
        },
        s3: {
          bucketName: 'STRING_VALUE', /* required */
          key: 'STRING_VALUE', /* required */
          roleArn: 'STRING_VALUE', /* required */
          cannedAcl: private | public-read | public-read-write | aws-exec-read | authenticated-read | bucket-owner-read | bucket-owner-full-control | log-delivery-write
        },
        salesforce: {
          token: 'STRING_VALUE', /* required */
          url: 'STRING_VALUE' /* required */
        },
        sns: {
          roleArn: 'STRING_VALUE', /* required */
          targetArn: 'STRING_VALUE', /* required */
          messageFormat: RAW | JSON
        },
        sqs: {
          queueUrl: 'STRING_VALUE', /* required */
          roleArn: 'STRING_VALUE', /* required */
          useBase64: true || false
        }
      },
      /* more items */
    ],
    sql: 'STRING_VALUE', /* required */
    awsIotSqlVersion: 'STRING_VALUE',
    description: 'STRING_VALUE',
    ruleDisabled: true || false
  }
};
iot.createTopicRule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ruleName — (String)

      The name of the rule.

    • topicRulePayload — (map)

      The rule payload.

      • sqlrequired — (String)

        The SQL statement used to query the topic. For more information, see AWS IoT SQL Reference in the AWS IoT Developer Guide.

      • description — (String)

        The description of the rule.

      • actionsrequired — (Array<map>)

        The actions associated with the rule.

        • dynamoDB — (map)

          Write to a DynamoDB table.

          • tableNamerequired — (String)

            The name of the DynamoDB table.

          • roleArnrequired — (String)

            The ARN of the IAM role that grants access to the DynamoDB table.

          • operation — (String)

            The type of operation to be performed. This follows the substitution template, so it can be ${operation}, but the substitution must result in one of the following: INSERT, UPDATE, or DELETE.

          • hashKeyFieldrequired — (String)

            The hash key name.

          • hashKeyValuerequired — (String)

            The hash key value.

          • hashKeyType — (String)

            The hash key type. Valid values are "STRING" or "NUMBER"

            Possible values include:
            • "STRING"
            • "NUMBER"
          • rangeKeyField — (String)

            The range key name.

          • rangeKeyValue — (String)

            The range key value.

          • rangeKeyType — (String)

            The range key type. Valid values are "STRING" or "NUMBER"

            Possible values include:
            • "STRING"
            • "NUMBER"
          • payloadField — (String)

            The action payload. This name can be customized.

        • dynamoDBv2 — (map)

          Write to a DynamoDB table. This is a new version of the DynamoDB action. It allows you to write each attribute in an MQTT message payload into a separate DynamoDB column.

          • roleArn — (String)

            The ARN of the IAM role that grants access to the DynamoDB table.

          • putItem — (map)

            Specifies the DynamoDB table to which the message data will be written. For example:

            { "dynamoDBv2": { "roleArn": "aws:iam:12341251:my-role" "putItem": { "tableName": "my-table" } } }

            Each attribute in the message payload will be written to a separate column in the DynamoDB database.

            • tableNamerequired — (String)

              The table where the message data will be written

        • lambda — (map)

          Invoke a Lambda function.

          • functionArnrequired — (String)

            The ARN of the Lambda function.

        • sns — (map)

          Publish to an Amazon SNS topic.

          • targetArnrequired — (String)

            The ARN of the SNS topic.

          • roleArnrequired — (String)

            The ARN of the IAM role that grants access.

          • messageFormat — (String)

            The message format of the message to publish. Optional. Accepted values are "JSON" and "RAW". The default value of the attribute is "RAW". SNS uses this setting to determine if the payload should be parsed and relevant platform-specific bits of the payload should be extracted. To read more about SNS message formats, see http://docs.aws.amazon.com/sns/latest/dg/json-formats.html refer to their official documentation.

            Possible values include:
            • "RAW"
            • "JSON"
        • sqs — (map)

          Publish to an Amazon SQS queue.

          • roleArnrequired — (String)

            The ARN of the IAM role that grants access.

          • queueUrlrequired — (String)

            The URL of the Amazon SQS queue.

          • useBase64 — (Boolean)

            Specifies whether to use Base64 encoding.

        • kinesis — (map)

          Write data to an Amazon Kinesis stream.

          • roleArnrequired — (String)

            The ARN of the IAM role that grants access to the Amazon Kinesis stream.

          • streamNamerequired — (String)

            The name of the Amazon Kinesis stream.

          • partitionKey — (String)

            The partition key.

        • republish — (map)

          Publish to another MQTT topic.

          • roleArnrequired — (String)

            The ARN of the IAM role that grants access.

          • topicrequired — (String)

            The name of the MQTT topic.

        • s3 — (map)

          Write to an Amazon S3 bucket.

          • roleArnrequired — (String)

            The ARN of the IAM role that grants access.

          • bucketNamerequired — (String)

            The Amazon S3 bucket.

          • keyrequired — (String)

            The object key.

          • cannedAcl — (String)

            The Amazon S3 canned ACL that controls access to the object identified by the object key. For more information, see S3 canned ACLs.

            Possible values include:
            • "private"
            • "public-read"
            • "public-read-write"
            • "aws-exec-read"
            • "authenticated-read"
            • "bucket-owner-read"
            • "bucket-owner-full-control"
            • "log-delivery-write"
        • firehose — (map)

          Write to an Amazon Kinesis Firehose stream.

          • roleArnrequired — (String)

            The IAM role that grants access to the Amazon Kinesis Firehost stream.

          • deliveryStreamNamerequired — (String)

            The delivery stream name.

          • separator — (String)

            A character separator that will be used to separate records written to the Firehose stream. Valid values are: '\n' (newline), '\t' (tab), '\r\n' (Windows newline), ',' (comma).

        • cloudwatchMetric — (map)

          Capture a CloudWatch metric.

          • roleArnrequired — (String)

            The IAM role that allows access to the CloudWatch metric.

          • metricNamespacerequired — (String)

            The CloudWatch metric namespace name.

          • metricNamerequired — (String)

            The CloudWatch metric name.

          • metricValuerequired — (String)

            The CloudWatch metric value.

          • metricUnitrequired — (String)

            The metric unit supported by CloudWatch.

          • metricTimestamp — (String)

            An optional Unix timestamp.

        • cloudwatchAlarm — (map)

          Change the state of a CloudWatch alarm.

          • roleArnrequired — (String)

            The IAM role that allows access to the CloudWatch alarm.

          • alarmNamerequired — (String)

            The CloudWatch alarm name.

          • stateReasonrequired — (String)

            The reason for the alarm change.

          • stateValuerequired — (String)

            The value of the alarm state. Acceptable values are: OK, ALARM, INSUFFICIENT_DATA.

        • elasticsearch — (map)

          Write data to an Amazon Elasticsearch Service domain.

          • roleArnrequired — (String)

            The IAM role ARN that has access to Elasticsearch.

          • endpointrequired — (String)

            The endpoint of your Elasticsearch domain.

          • indexrequired — (String)

            The Elasticsearch index where you want to store your data.

          • typerequired — (String)

            The type of document you are storing.

          • idrequired — (String)

            The unique identifier for the document you are storing.

        • salesforce — (map)

          Send a message to a Salesforce IoT Cloud Input Stream.

          • tokenrequired — (String)

            The token used to authenticate access to the Salesforce IoT Cloud Input Stream. The token is available from the Salesforce IoT Cloud platform after creation of the Input Stream.

          • urlrequired — (String)

            The URL exposed by the Salesforce IoT Cloud Input Stream. The URL is available from the Salesforce IoT Cloud platform after creation of the Input Stream.

      • ruleDisabled — (Boolean)

        Specifies whether the rule is disabled.

      • awsIotSqlVersion — (String)

        The version of the SQL rules engine to use when evaluating the rule.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteCACertificate(params = {}, callback) ⇒ AWS.Request

Deletes a registered CA certificate.

Service Reference:

Examples:

Calling the deleteCACertificate operation

var params = {
  certificateId: 'STRING_VALUE' /* required */
};
iot.deleteCACertificate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • certificateId — (String)

      The ID of the certificate to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteCertificate(params = {}, callback) ⇒ AWS.Request

Deletes the specified certificate.

A certificate cannot be deleted if it has a policy attached to it or if its status is set to ACTIVE. To delete a certificate, first use the DetachPrincipalPolicy API to detach all policies. Next, use the UpdateCertificate API to set the certificate to the INACTIVE status.

Service Reference:

Examples:

Calling the deleteCertificate operation

var params = {
  certificateId: 'STRING_VALUE' /* required */
};
iot.deleteCertificate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • certificateId — (String)

      The ID of the certificate.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deletePolicy(params = {}, callback) ⇒ AWS.Request

Deletes the specified policy.

A policy cannot be deleted if it has non-default versions or it is attached to any certificate.

To delete a policy, use the DeletePolicyVersion API to delete all non-default versions of the policy; use the DetachPrincipalPolicy API to detach the policy from any certificate; and then use the DeletePolicy API to delete the policy.

When a policy is deleted using DeletePolicy, its default version is deleted with it.

Service Reference:

Examples:

Calling the deletePolicy operation

var params = {
  policyName: 'STRING_VALUE' /* required */
};
iot.deletePolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyName — (String)

      The name of the policy to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deletePolicyVersion(params = {}, callback) ⇒ AWS.Request

Deletes the specified version of the specified policy. You cannot delete the default version of a policy using this API. To delete the default version of a policy, use DeletePolicy. To find out which version of a policy is marked as the default version, use ListPolicyVersions.

Service Reference:

Examples:

Calling the deletePolicyVersion operation

var params = {
  policyName: 'STRING_VALUE', /* required */
  policyVersionId: 'STRING_VALUE' /* required */
};
iot.deletePolicyVersion(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyName — (String)

      The name of the policy.

    • policyVersionId — (String)

      The policy version ID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteRegistrationCode(params = {}, callback) ⇒ AWS.Request

Deletes a CA certificate registration code.

Service Reference:

Examples:

Calling the deleteRegistrationCode operation

var params = {
};
iot.deleteRegistrationCode(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteThing(params = {}, callback) ⇒ AWS.Request

Deletes the specified thing.

Service Reference:

Examples:

Calling the deleteThing operation

var params = {
  thingName: 'STRING_VALUE', /* required */
  expectedVersion: 0
};
iot.deleteThing(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • thingName — (String)

      The name of the thing to delete.

    • expectedVersion — (Integer)

      The expected version of the thing record in the registry. If the version of the record in the registry does not match the expected version specified in the request, the DeleteThing request is rejected with a VersionConflictException.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteThingType(params = {}, callback) ⇒ AWS.Request

Deletes the specified thing type . You cannot delete a thing type if it has things associated with it. To delete a thing type, first mark it as deprecated by calling DeprecateThingType, then remove any associated things by calling UpdateThing to change the thing type on any associated thing, and finally use DeleteThingType to delete the thing type.

Service Reference:

Examples:

Calling the deleteThingType operation

var params = {
  thingTypeName: 'STRING_VALUE' /* required */
};
iot.deleteThingType(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • thingTypeName — (String)

      The name of the thing type.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteTopicRule(params = {}, callback) ⇒ AWS.Request

Deletes the specified rule.

Service Reference:

Examples:

Calling the deleteTopicRule operation

var params = {
  ruleName: 'STRING_VALUE' /* required */
};
iot.deleteTopicRule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ruleName — (String)

      The name of the rule.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deprecateThingType(params = {}, callback) ⇒ AWS.Request

Deprecates a thing type. You can not associate new things with deprecated thing type.

Service Reference:

Examples:

Calling the deprecateThingType operation

var params = {
  thingTypeName: 'STRING_VALUE', /* required */
  undoDeprecate: true || false
};
iot.deprecateThingType(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • thingTypeName — (String)

      The name of the thing type to deprecate.

    • undoDeprecate — (Boolean)

      Whether to undeprecate a deprecated thing type. If true, the thing type will not be deprecated anymore and you can associate it with things.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeCACertificate(params = {}, callback) ⇒ AWS.Request

Describes a registered CA certificate.

Service Reference:

Examples:

Calling the describeCACertificate operation

var params = {
  certificateId: 'STRING_VALUE' /* required */
};
iot.describeCACertificate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • certificateId — (String)

      The CA certificate identifier.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • certificateDescription — (map)

        The CA certificate description.

        • certificateArn — (String)

          The CA certificate ARN.

        • certificateId — (String)

          The CA certificate ID.

        • status — (String)

          The status of a CA certificate.

          Possible values include:
          • "ACTIVE"
          • "INACTIVE"
        • certificatePem — (String)

          The CA certificate data, in PEM format.

        • ownedBy — (String)

          The owner of the CA certificate.

        • creationDate — (Date)

          The date the CA certificate was created.

        • autoRegistrationStatus — (String)

          Whether the CA certificate configured for auto registration of device certificates. Valid values are "ENABLE" and "DISABLE"

          Possible values include:
          • "ENABLE"
          • "DISABLE"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeCertificate(params = {}, callback) ⇒ AWS.Request

Gets information about the specified certificate.

Service Reference:

Examples:

Calling the describeCertificate operation

var params = {
  certificateId: 'STRING_VALUE' /* required */
};
iot.describeCertificate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • certificateId — (String)

      The ID of the certificate.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • certificateDescription — (map)

        The description of the certificate.

        • certificateArn — (String)

          The ARN of the certificate.

        • certificateId — (String)

          The ID of the certificate.

        • caCertificateId — (String)

          The certificate ID of the CA certificate used to sign this certificate.

        • status — (String)

          The status of the certificate.

          Possible values include:
          • "ACTIVE"
          • "INACTIVE"
          • "REVOKED"
          • "PENDING_TRANSFER"
          • "REGISTER_INACTIVE"
          • "PENDING_ACTIVATION"
        • certificatePem — (String)

          The certificate data, in PEM format.

        • ownedBy — (String)

          The ID of the AWS account that owns the certificate.

        • previousOwnedBy — (String)

          The ID of the AWS account of the previous owner of the certificate.

        • creationDate — (Date)

          The date and time the certificate was created.

        • lastModifiedDate — (Date)

          The date and time the certificate was last modified.

        • transferData — (map)

          The transfer data.

          • transferMessage — (String)

            The transfer message.

          • rejectReason — (String)

            The reason why the transfer was rejected.

          • transferDate — (Date)

            The date the transfer took place.

          • acceptDate — (Date)

            The date the transfer was accepted.

          • rejectDate — (Date)

            The date the transfer was rejected.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeEndpoint(params = {}, callback) ⇒ AWS.Request

Returns a unique endpoint specific to the AWS account making the call.

Service Reference:

Examples:

Calling the describeEndpoint operation

var params = {
};
iot.describeEndpoint(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • endpointAddress — (String)

        The endpoint. The format of the endpoint is as follows: identifier.iot.region.amazonaws.com.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeThing(params = {}, callback) ⇒ AWS.Request

Gets information about the specified thing.

Service Reference:

Examples:

Calling the describeThing operation

var params = {
  thingName: 'STRING_VALUE' /* required */
};
iot.describeThing(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • thingName — (String)

      The name of the thing.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • defaultClientId — (String)

        The default client ID.

      • thingName — (String)

        The name of the thing.

      • thingTypeName — (String)

        The thing type name.

      • attributes — (map<String>)

        The thing attributes.

      • version — (Integer)

        The current version of the thing record in the registry.

        Note: To avoid unintentional changes to the information in the registry, you can pass the version information in the expectedVersion parameter of the UpdateThing and DeleteThing calls.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeThingType(params = {}, callback) ⇒ AWS.Request

Gets information about the specified thing type.

Service Reference:

Examples:

Calling the describeThingType operation

var params = {
  thingTypeName: 'STRING_VALUE' /* required */
};
iot.describeThingType(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • thingTypeName — (String)

      The name of the thing type.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • thingTypeName — (String)

        The name of the thing type.

      • thingTypeProperties — (map)

        The ThingTypeProperties contains information about the thing type including description, and a list of searchable thing attribute names.

        • thingTypeDescription — (String)

          The description of the thing type.

        • searchableAttributes — (Array<String>)

          A list of searchable thing attribute names.

      • thingTypeMetadata — (map)

        The ThingTypeMetadata contains additional information about the thing type including: creation date and time, a value indicating whether the thing type is deprecated, and a date and time when it was deprecated.

        • deprecated — (Boolean)

          Whether the thing type is deprecated. If true, no new things could be associated with this type.

        • deprecationDate — (Date)

          The date and time when the thing type was deprecated.

        • creationDate — (Date)

          The date and time when the thing type was created.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

detachPrincipalPolicy(params = {}, callback) ⇒ AWS.Request

Removes the specified policy from the specified certificate.

Service Reference:

Examples:

Calling the detachPrincipalPolicy operation

var params = {
  policyName: 'STRING_VALUE', /* required */
  principal: 'STRING_VALUE' /* required */
};
iot.detachPrincipalPolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyName — (String)

      The name of the policy to detach.

    • principal — (String)

      The principal.

      If the principal is a certificate, specify the certificate ARN. If the principal is an Amazon Cognito identity, specify the identity ID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

detachThingPrincipal(params = {}, callback) ⇒ AWS.Request

Detaches the specified principal from the specified thing.

Service Reference:

Examples:

Calling the detachThingPrincipal operation

var params = {
  principal: 'STRING_VALUE', /* required */
  thingName: 'STRING_VALUE' /* required */
};
iot.detachThingPrincipal(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • thingName — (String)

      The name of the thing.

    • principal — (String)

      If the principal is a certificate, this value must be ARN of the certificate. If the principal is an Amazon Cognito identity, this value must be the ID of the Amazon Cognito identity.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

disableTopicRule(params = {}, callback) ⇒ AWS.Request

Disables the specified rule.

Service Reference:

Examples:

Calling the disableTopicRule operation

var params = {
  ruleName: 'STRING_VALUE' /* required */
};
iot.disableTopicRule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ruleName — (String)

      The name of the rule to disable.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

enableTopicRule(params = {}, callback) ⇒ AWS.Request

Enables the specified rule.

Service Reference:

Examples:

Calling the enableTopicRule operation

var params = {
  ruleName: 'STRING_VALUE' /* required */
};
iot.enableTopicRule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ruleName — (String)

      The name of the topic rule to enable.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getLoggingOptions(params = {}, callback) ⇒ AWS.Request

Gets the logging options.

Service Reference:

Examples:

Calling the getLoggingOptions operation

var params = {
};
iot.getLoggingOptions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • roleArn — (String)

        The ARN of the IAM role that grants access.

      • logLevel — (String)

        The logging level.

        Possible values include:
        • "DEBUG"
        • "INFO"
        • "ERROR"
        • "WARN"
        • "DISABLED"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getPolicy(params = {}, callback) ⇒ AWS.Request

Gets information about the specified policy with the policy document of the default version.

Service Reference:

Examples:

Calling the getPolicy operation

var params = {
  policyName: 'STRING_VALUE' /* required */
};
iot.getPolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyName — (String)

      The name of the policy.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • policyName — (String)

        The policy name.

      • policyArn — (String)

        The policy ARN.

      • policyDocument — (String)

        The JSON document that describes the policy.

      • defaultVersionId — (String)

        The default policy version ID.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getPolicyVersion(params = {}, callback) ⇒ AWS.Request

Gets information about the specified policy version.

Service Reference:

Examples:

Calling the getPolicyVersion operation

var params = {
  policyName: 'STRING_VALUE', /* required */
  policyVersionId: 'STRING_VALUE' /* required */
};
iot.getPolicyVersion(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyName — (String)

      The name of the policy.

    • policyVersionId — (String)

      The policy version ID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • policyArn — (String)

        The policy ARN.

      • policyName — (String)

        The policy name.

      • policyDocument — (String)

        The JSON document that describes the policy.

      • policyVersionId — (String)

        The policy version ID.

      • isDefaultVersion — (Boolean)

        Specifies whether the policy version is the default.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getRegistrationCode(params = {}, callback) ⇒ AWS.Request

Gets a registration code used to register a CA certificate with AWS IoT.

Service Reference:

Examples:

Calling the getRegistrationCode operation

var params = {
};
iot.getRegistrationCode(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • registrationCode — (String)

        The CA certificate registration code.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getTopicRule(params = {}, callback) ⇒ AWS.Request

Gets information about the specified rule.

Service Reference:

Examples:

Calling the getTopicRule operation

var params = {
  ruleName: 'STRING_VALUE' /* required */
};
iot.getTopicRule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ruleName — (String)

      The name of the rule.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ruleArn — (String)

        The rule ARN.

      • rule — (map)

        The rule.

        • ruleName — (String)

          The name of the rule.

        • sql — (String)

          The SQL statement used to query the topic. When using a SQL query with multiple lines, be sure to escape the newline characters.

        • description — (String)

          The description of the rule.

        • createdAt — (Date)

          The date and time the rule was created.

        • actions — (Array<map>)

          The actions associated with the rule.

          • dynamoDB — (map)

            Write to a DynamoDB table.

            • tableNamerequired — (String)

              The name of the DynamoDB table.

            • roleArnrequired — (String)

              The ARN of the IAM role that grants access to the DynamoDB table.

            • operation — (String)

              The type of operation to be performed. This follows the substitution template, so it can be ${operation}, but the substitution must result in one of the following: INSERT, UPDATE, or DELETE.

            • hashKeyFieldrequired — (String)

              The hash key name.

            • hashKeyValuerequired — (String)

              The hash key value.

            • hashKeyType — (String)

              The hash key type. Valid values are "STRING" or "NUMBER"

              Possible values include:
              • "STRING"
              • "NUMBER"
            • rangeKeyField — (String)

              The range key name.

            • rangeKeyValue — (String)

              The range key value.

            • rangeKeyType — (String)

              The range key type. Valid values are "STRING" or "NUMBER"

              Possible values include:
              • "STRING"
              • "NUMBER"
            • payloadField — (String)

              The action payload. This name can be customized.

          • dynamoDBv2 — (map)

            Write to a DynamoDB table. This is a new version of the DynamoDB action. It allows you to write each attribute in an MQTT message payload into a separate DynamoDB column.

            • roleArn — (String)

              The ARN of the IAM role that grants access to the DynamoDB table.

            • putItem — (map)

              Specifies the DynamoDB table to which the message data will be written. For example:

              { "dynamoDBv2": { "roleArn": "aws:iam:12341251:my-role" "putItem": { "tableName": "my-table" } } }

              Each attribute in the message payload will be written to a separate column in the DynamoDB database.

              • tableNamerequired — (String)

                The table where the message data will be written

          • lambda — (map)

            Invoke a Lambda function.

            • functionArnrequired — (String)

              The ARN of the Lambda function.

          • sns — (map)

            Publish to an Amazon SNS topic.

            • targetArnrequired — (String)

              The ARN of the SNS topic.

            • roleArnrequired — (String)

              The ARN of the IAM role that grants access.

            • messageFormat — (String)

              The message format of the message to publish. Optional. Accepted values are "JSON" and "RAW". The default value of the attribute is "RAW". SNS uses this setting to determine if the payload should be parsed and relevant platform-specific bits of the payload should be extracted. To read more about SNS message formats, see http://docs.aws.amazon.com/sns/latest/dg/json-formats.html refer to their official documentation.

              Possible values include:
              • "RAW"
              • "JSON"
          • sqs — (map)

            Publish to an Amazon SQS queue.

            • roleArnrequired — (String)

              The ARN of the IAM role that grants access.

            • queueUrlrequired — (String)

              The URL of the Amazon SQS queue.

            • useBase64 — (Boolean)

              Specifies whether to use Base64 encoding.

          • kinesis — (map)

            Write data to an Amazon Kinesis stream.

            • roleArnrequired — (String)

              The ARN of the IAM role that grants access to the Amazon Kinesis stream.

            • streamNamerequired — (String)

              The name of the Amazon Kinesis stream.

            • partitionKey — (String)

              The partition key.

          • republish — (map)

            Publish to another MQTT topic.

            • roleArnrequired — (String)

              The ARN of the IAM role that grants access.

            • topicrequired — (String)

              The name of the MQTT topic.

          • s3 — (map)

            Write to an Amazon S3 bucket.

            • roleArnrequired — (String)

              The ARN of the IAM role that grants access.

            • bucketNamerequired — (String)

              The Amazon S3 bucket.

            • keyrequired — (String)

              The object key.

            • cannedAcl — (String)

              The Amazon S3 canned ACL that controls access to the object identified by the object key. For more information, see S3 canned ACLs.

              Possible values include:
              • "private"
              • "public-read"
              • "public-read-write"
              • "aws-exec-read"
              • "authenticated-read"
              • "bucket-owner-read"
              • "bucket-owner-full-control"
              • "log-delivery-write"
          • firehose — (map)

            Write to an Amazon Kinesis Firehose stream.

            • roleArnrequired — (String)

              The IAM role that grants access to the Amazon Kinesis Firehost stream.

            • deliveryStreamNamerequired — (String)

              The delivery stream name.

            • separator — (String)

              A character separator that will be used to separate records written to the Firehose stream. Valid values are: '\n' (newline), '\t' (tab), '\r\n' (Windows newline), ',' (comma).

          • cloudwatchMetric — (map)

            Capture a CloudWatch metric.

            • roleArnrequired — (String)

              The IAM role that allows access to the CloudWatch metric.

            • metricNamespacerequired — (String)

              The CloudWatch metric namespace name.

            • metricNamerequired — (String)

              The CloudWatch metric name.

            • metricValuerequired — (String)

              The CloudWatch metric value.

            • metricUnitrequired — (String)

              The metric unit supported by CloudWatch.

            • metricTimestamp — (String)

              An optional Unix timestamp.

          • cloudwatchAlarm — (map)

            Change the state of a CloudWatch alarm.

            • roleArnrequired — (String)

              The IAM role that allows access to the CloudWatch alarm.

            • alarmNamerequired — (String)

              The CloudWatch alarm name.

            • stateReasonrequired — (String)

              The reason for the alarm change.

            • stateValuerequired — (String)

              The value of the alarm state. Acceptable values are: OK, ALARM, INSUFFICIENT_DATA.

          • elasticsearch — (map)

            Write data to an Amazon Elasticsearch Service domain.

            • roleArnrequired — (String)

              The IAM role ARN that has access to Elasticsearch.

            • endpointrequired — (String)

              The endpoint of your Elasticsearch domain.

            • indexrequired — (String)

              The Elasticsearch index where you want to store your data.

            • typerequired — (String)

              The type of document you are storing.

            • idrequired — (String)

              The unique identifier for the document you are storing.

          • salesforce — (map)

            Send a message to a Salesforce IoT Cloud Input Stream.

            • tokenrequired — (String)

              The token used to authenticate access to the Salesforce IoT Cloud Input Stream. The token is available from the Salesforce IoT Cloud platform after creation of the Input Stream.

            • urlrequired — (String)

              The URL exposed by the Salesforce IoT Cloud Input Stream. The URL is available from the Salesforce IoT Cloud platform after creation of the Input Stream.

        • ruleDisabled — (Boolean)

          Specifies whether the rule is disabled.

        • awsIotSqlVersion — (String)

          The version of the SQL rules engine to use when evaluating the rule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listCACertificates(params = {}, callback) ⇒ AWS.Request

Lists the CA certificates registered for your AWS account.

The results are paginated with a default page size of 25. You can use the returned marker to retrieve additional results.

Service Reference:

Examples:

Calling the listCACertificates operation

var params = {
  ascendingOrder: true || false,
  marker: 'STRING_VALUE',
  pageSize: 0
};
iot.listCACertificates(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pageSize — (Integer)

      The result page size.

    • marker — (String)

      The marker for the next set of results.

    • ascendingOrder — (Boolean)

      Determines the order of the results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • certificates — (Array<map>)

        The CA certificates registered in your AWS account.

        • certificateArn — (String)

          The ARN of the CA certificate.

        • certificateId — (String)

          The ID of the CA certificate.

        • status — (String)

          The status of the CA certificate.

          The status value REGISTER_INACTIVE is deprecated and should not be used.

          Possible values include:
          • "ACTIVE"
          • "INACTIVE"
        • creationDate — (Date)

          The date the CA certificate was created.

      • nextMarker — (String)

        The current position within the list of CA certificates.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listCertificates(params = {}, callback) ⇒ AWS.Request

Lists the certificates registered in your AWS account.

The results are paginated with a default page size of 25. You can use the returned marker to retrieve additional results.

Service Reference:

Examples:

Calling the listCertificates operation

var params = {
  ascendingOrder: true || false,
  marker: 'STRING_VALUE',
  pageSize: 0
};
iot.listCertificates(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pageSize — (Integer)

      The result page size.

    • marker — (String)

      The marker for the next set of results.

    • ascendingOrder — (Boolean)

      Specifies the order for results. If True, the results are returned in ascending order, based on the creation date.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • certificates — (Array<map>)

        The descriptions of the certificates.

        • certificateArn — (String)

          The ARN of the certificate.

        • certificateId — (String)

          The ID of the certificate.

        • status — (String)

          The status of the certificate.

          The status value REGISTER_INACTIVE is deprecated and should not be used.

          Possible values include:
          • "ACTIVE"
          • "INACTIVE"
          • "REVOKED"
          • "PENDING_TRANSFER"
          • "REGISTER_INACTIVE"
          • "PENDING_ACTIVATION"
        • creationDate — (Date)

          The date and time the certificate was created.

      • nextMarker — (String)

        The marker for the next set of results, or null if there are no additional results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listCertificatesByCA(params = {}, callback) ⇒ AWS.Request

List the device certificates signed by the specified CA certificate.

Service Reference:

Examples:

Calling the listCertificatesByCA operation

var params = {
  caCertificateId: 'STRING_VALUE', /* required */
  ascendingOrder: true || false,
  marker: 'STRING_VALUE',
  pageSize: 0
};
iot.listCertificatesByCA(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • caCertificateId — (String)

      The ID of the CA certificate. This operation will list all registered device certificate that were signed by this CA certificate.

    • pageSize — (Integer)

      The result page size.

    • marker — (String)

      The marker for the next set of results.

    • ascendingOrder — (Boolean)

      Specifies the order for results. If True, the results are returned in ascending order, based on the creation date.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • certificates — (Array<map>)

        The device certificates signed by the specified CA certificate.

        • certificateArn — (String)

          The ARN of the certificate.

        • certificateId — (String)

          The ID of the certificate.

        • status — (String)

          The status of the certificate.

          The status value REGISTER_INACTIVE is deprecated and should not be used.

          Possible values include:
          • "ACTIVE"
          • "INACTIVE"
          • "REVOKED"
          • "PENDING_TRANSFER"
          • "REGISTER_INACTIVE"
          • "PENDING_ACTIVATION"
        • creationDate — (Date)

          The date and time the certificate was created.

      • nextMarker — (String)

        The marker for the next set of results, or null if there are no additional results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listOutgoingCertificates(params = {}, callback) ⇒ AWS.Request

Lists certificates that are being transfered but not yet accepted.

Service Reference:

Examples:

Calling the listOutgoingCertificates operation

var params = {
  ascendingOrder: true || false,
  marker: 'STRING_VALUE',
  pageSize: 0
};
iot.listOutgoingCertificates(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pageSize — (Integer)

      The result page size.

    • marker — (String)

      The marker for the next set of results.

    • ascendingOrder — (Boolean)

      Specifies the order for results. If True, the results are returned in ascending order, based on the creation date.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • outgoingCertificates — (Array<map>)

        The certificates that are being transfered but not yet accepted.

        • certificateArn — (String)

          The certificate ARN.

        • certificateId — (String)

          The certificate ID.

        • transferredTo — (String)

          The AWS account to which the transfer was made.

        • transferDate — (Date)

          The date the transfer was initiated.

        • transferMessage — (String)

          The transfer message.

        • creationDate — (Date)

          The certificate creation date.

      • nextMarker — (String)

        The marker for the next set of results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listPolicies(params = {}, callback) ⇒ AWS.Request

Lists your policies.

Service Reference:

Examples:

Calling the listPolicies operation

var params = {
  ascendingOrder: true || false,
  marker: 'STRING_VALUE',
  pageSize: 0
};
iot.listPolicies(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • marker — (String)

      The marker for the next set of results.

    • pageSize — (Integer)

      The result page size.

    • ascendingOrder — (Boolean)

      Specifies the order for results. If true, the results are returned in ascending creation order.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • policies — (Array<map>)

        The descriptions of the policies.

        • policyName — (String)

          The policy name.

        • policyArn — (String)

          The policy ARN.

      • nextMarker — (String)

        The marker for the next set of results, or null if there are no additional results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listPolicyPrincipals(params = {}, callback) ⇒ AWS.Request

Lists the principals associated with the specified policy.

Service Reference:

Examples:

Calling the listPolicyPrincipals operation

var params = {
  policyName: 'STRING_VALUE', /* required */
  ascendingOrder: true || false,
  marker: 'STRING_VALUE',
  pageSize: 0
};
iot.listPolicyPrincipals(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyName — (String)

      The policy name.

    • marker — (String)

      The marker for the next set of results.

    • pageSize — (Integer)

      The result page size.

    • ascendingOrder — (Boolean)

      Specifies the order for results. If true, the results are returned in ascending creation order.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • principals — (Array<String>)

        The descriptions of the principals.

      • nextMarker — (String)

        The marker for the next set of results, or null if there are no additional results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listPolicyVersions(params = {}, callback) ⇒ AWS.Request

Lists the versions of the specified policy and identifies the default version.

Service Reference:

Examples:

Calling the listPolicyVersions operation

var params = {
  policyName: 'STRING_VALUE' /* required */
};
iot.listPolicyVersions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyName — (String)

      The policy name.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • policyVersions — (Array<map>)

        The policy versions.

        • versionId — (String)

          The policy version ID.

        • isDefaultVersion — (Boolean)

          Specifies whether the policy version is the default.

        • createDate — (Date)

          The date and time the policy was created.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listPrincipalPolicies(params = {}, callback) ⇒ AWS.Request

Lists the policies attached to the specified principal. If you use an Cognito identity, the ID must be in AmazonCognito Identity format.

Service Reference:

Examples:

Calling the listPrincipalPolicies operation

var params = {
  principal: 'STRING_VALUE', /* required */
  ascendingOrder: true || false,
  marker: 'STRING_VALUE',
  pageSize: 0
};
iot.listPrincipalPolicies(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • principal — (String)

      The principal.

    • marker — (String)

      The marker for the next set of results.

    • pageSize — (Integer)

      The result page size.

    • ascendingOrder — (Boolean)

      Specifies the order for results. If true, results are returned in ascending creation order.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • policies — (Array<map>)

        The policies.

        • policyName — (String)

          The policy name.

        • policyArn — (String)

          The policy ARN.

      • nextMarker — (String)

        The marker for the next set of results, or null if there are no additional results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listPrincipalThings(params = {}, callback) ⇒ AWS.Request

Lists the things associated with the specified principal.

Service Reference:

Examples:

Calling the listPrincipalThings operation

var params = {
  principal: 'STRING_VALUE', /* required */
  maxResults: 0,
  nextToken: 'STRING_VALUE'
};
iot.listPrincipalThings(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • nextToken — (String)

      The token for the next set of results, or null if there are no additional results.

    • maxResults — (Integer)

      The maximum number of results to return in this operation.

    • principal — (String)

      The principal.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • things — (Array<String>)

        The things.

      • nextToken — (String)

        The token for the next set of results, or null if there are no additional results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listThingPrincipals(params = {}, callback) ⇒ AWS.Request

Lists the principals associated with the specified thing.

Service Reference:

Examples:

Calling the listThingPrincipals operation

var params = {
  thingName: 'STRING_VALUE' /* required */
};
iot.listThingPrincipals(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • thingName — (String)

      The name of the thing.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • principals — (Array<String>)

        The principals associated with the thing.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listThings(params = {}, callback) ⇒ AWS.Request

Lists your things. Use the attributeName and attributeValue parameters to filter your things. For example, calling ListThings with attributeName=Color and attributeValue=Red retrieves all things in the registry that contain an attribute Color with the value Red.

Service Reference:

Examples:

Calling the listThings operation

var params = {
  attributeName: 'STRING_VALUE',
  attributeValue: 'STRING_VALUE',
  maxResults: 0,
  nextToken: 'STRING_VALUE',
  thingTypeName: 'STRING_VALUE'
};
iot.listThings(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • nextToken — (String)

      The token for the next set of results, or null if there are no additional results.

    • maxResults — (Integer)

      The maximum number of results to return in this operation.

    • attributeName — (String)

      The attribute name used to search for things.

    • attributeValue — (String)

      The attribute value used to search for things.

    • thingTypeName — (String)

      The name of the thing type used to search for things.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • things — (Array<map>)

        The things.

        • thingName — (String)

          The name of the thing.

        • thingTypeName — (String)

          The name of the thing type, if the thing has been associated with a type.

        • attributes — (map<String>)

          A list of thing attributes which are name-value pairs.

        • version — (Integer)

          The version of the thing record in the registry.

      • nextToken — (String)

        The token for the next set of results, or null if there are no additional results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listThingTypes(params = {}, callback) ⇒ AWS.Request

Lists the existing thing types.

Service Reference:

Examples:

Calling the listThingTypes operation

var params = {
  maxResults: 0,
  nextToken: 'STRING_VALUE',
  thingTypeName: 'STRING_VALUE'
};
iot.listThingTypes(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • nextToken — (String)

      The token for the next set of results, or null if there are no additional results.

    • maxResults — (Integer)

      The maximum number of results to return in this operation.

    • thingTypeName — (String)

      The name of the thing type.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • thingTypes — (Array<map>)

        The thing types.

        • thingTypeName — (String)

          The name of the thing type.

        • thingTypeProperties — (map)

          The ThingTypeProperties for the thing type.

          • thingTypeDescription — (String)

            The description of the thing type.

          • searchableAttributes — (Array<String>)

            A list of searchable thing attribute names.

        • thingTypeMetadata — (map)

          The ThingTypeMetadata contains additional information about the thing type including: creation date and time, a value indicating whether the thing type is deprecated, and a date and time when it was deprecated.

          • deprecated — (Boolean)

            Whether the thing type is deprecated. If true, no new things could be associated with this type.

          • deprecationDate — (Date)

            The date and time when the thing type was deprecated.

          • creationDate — (Date)

            The date and time when the thing type was created.

      • nextToken — (String)

        The token for the next set of results, or null if there are no additional results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listTopicRules(params = {}, callback) ⇒ AWS.Request

Lists the rules for the specific topic.

Service Reference:

Examples:

Calling the listTopicRules operation

var params = {
  maxResults: 0,
  nextToken: 'STRING_VALUE',
  ruleDisabled: true || false,
  topic: 'STRING_VALUE'
};
iot.listTopicRules(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • topic — (String)

      The topic.

    • maxResults — (Integer)

      The maximum number of results to return.

    • nextToken — (String)

      A token used to retrieve the next value.

    • ruleDisabled — (Boolean)

      Specifies whether the rule is disabled.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • rules — (Array<map>)

        The rules.

        • ruleArn — (String)

          The rule ARN.

        • ruleName — (String)

          The name of the rule.

        • topicPattern — (String)

          The pattern for the topic names that apply.

        • createdAt — (Date)

          The date and time the rule was created.

        • ruleDisabled — (Boolean)

          Specifies whether the rule is disabled.

      • nextToken — (String)

        A token used to retrieve the next value.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

registerCACertificate(params = {}, callback) ⇒ AWS.Request

Registers a CA certificate with AWS IoT. This CA certificate can then be used to sign device certificates, which can be then registered with AWS IoT. You can register up to 10 CA certificates per AWS account that have the same subject field. This enables you to have up to 10 certificate authorities sign your device certificates. If you have more than one CA certificate registered, make sure you pass the CA certificate when you register your device certificates with the RegisterCertificate API.

Service Reference:

Examples:

Calling the registerCACertificate operation

var params = {
  caCertificate: 'STRING_VALUE', /* required */
  verificationCertificate: 'STRING_VALUE', /* required */
  allowAutoRegistration: true || false,
  setAsActive: true || false
};
iot.registerCACertificate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • caCertificate — (String)

      The CA certificate.

    • verificationCertificate — (String)

      The private key verification certificate.

    • setAsActive — (Boolean)

      A boolean value that specifies if the CA certificate is set to active.

    • allowAutoRegistration — (Boolean)

      Allows this CA certificate to be used for auto registration of device certificates.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • certificateArn — (String)

        The CA certificate ARN.

      • certificateId — (String)

        The CA certificate identifier.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

registerCertificate(params = {}, callback) ⇒ AWS.Request

Registers a device certificate with AWS IoT. If you have more than one CA certificate that has the same subject field, you must specify the CA certificate that was used to sign the device certificate being registered.

Service Reference:

Examples:

Calling the registerCertificate operation

var params = {
  certificatePem: 'STRING_VALUE', /* required */
  caCertificatePem: 'STRING_VALUE',
  setAsActive: true || false,
  status: ACTIVE | INACTIVE | REVOKED | PENDING_TRANSFER | REGISTER_INACTIVE | PENDING_ACTIVATION
};
iot.registerCertificate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • certificatePem — (String)

      The certificate data, in PEM format.

    • caCertificatePem — (String)

      The CA certificate used to sign the device certificate being registered.

    • setAsActive — (Boolean)

      A boolean value that specifies if the CA certificate is set to active.

    • status — (String)

      The status of the register certificate request.

      Possible values include:
      • "ACTIVE"
      • "INACTIVE"
      • "REVOKED"
      • "PENDING_TRANSFER"
      • "REGISTER_INACTIVE"
      • "PENDING_ACTIVATION"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • certificateArn — (String)

        The certificate ARN.

      • certificateId — (String)

        The certificate identifier.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

rejectCertificateTransfer(params = {}, callback) ⇒ AWS.Request

Rejects a pending certificate transfer. After AWS IoT rejects a certificate transfer, the certificate status changes from PENDING_TRANSFER to INACTIVE.

To check for pending certificate transfers, call ListCertificates to enumerate your certificates.

This operation can only be called by the transfer destination. After it is called, the certificate will be returned to the source's account in the INACTIVE state.

Service Reference:

Examples:

Calling the rejectCertificateTransfer operation

var params = {
  certificateId: 'STRING_VALUE', /* required */
  rejectReason: 'STRING_VALUE'
};
iot.rejectCertificateTransfer(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • certificateId — (String)

      The ID of the certificate.

    • rejectReason — (String)

      The reason the certificate transfer was rejected.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

replaceTopicRule(params = {}, callback) ⇒ AWS.Request

Replaces the specified rule. You must specify all parameters for the new rule. Creating rules is an administrator-level action. Any user who has permission to create rules will be able to access data processed by the rule.

Service Reference:

Examples:

Calling the replaceTopicRule operation

var params = {
  ruleName: 'STRING_VALUE', /* required */
  topicRulePayload: { /* required */
    actions: [ /* required */
      {
        cloudwatchAlarm: {
          alarmName: 'STRING_VALUE', /* required */
          roleArn: 'STRING_VALUE', /* required */
          stateReason: 'STRING_VALUE', /* required */
          stateValue: 'STRING_VALUE' /* required */
        },
        cloudwatchMetric: {
          metricName: 'STRING_VALUE', /* required */
          metricNamespace: 'STRING_VALUE', /* required */
          metricUnit: 'STRING_VALUE', /* required */
          metricValue: 'STRING_VALUE', /* required */
          roleArn: 'STRING_VALUE', /* required */
          metricTimestamp: 'STRING_VALUE'
        },
        dynamoDB: {
          hashKeyField: 'STRING_VALUE', /* required */
          hashKeyValue: 'STRING_VALUE', /* required */
          roleArn: 'STRING_VALUE', /* required */
          tableName: 'STRING_VALUE', /* required */
          hashKeyType: STRING | NUMBER,
          operation: 'STRING_VALUE',
          payloadField: 'STRING_VALUE',
          rangeKeyField: 'STRING_VALUE',
          rangeKeyType: STRING | NUMBER,
          rangeKeyValue: 'STRING_VALUE'
        },
        dynamoDBv2: {
          putItem: {
            tableName: 'STRING_VALUE' /* required */
          },
          roleArn: 'STRING_VALUE'
        },
        elasticsearch: {
          endpoint: 'STRING_VALUE', /* required */
          id: 'STRING_VALUE', /* required */
          index: 'STRING_VALUE', /* required */
          roleArn: 'STRING_VALUE', /* required */
          type: 'STRING_VALUE' /* required */
        },
        firehose: {
          deliveryStreamName: 'STRING_VALUE', /* required */
          roleArn: 'STRING_VALUE', /* required */
          separator: 'STRING_VALUE'
        },
        kinesis: {
          roleArn: 'STRING_VALUE', /* required */
          streamName: 'STRING_VALUE', /* required */
          partitionKey: 'STRING_VALUE'
        },
        lambda: {
          functionArn: 'STRING_VALUE' /* required */
        },
        republish: {
          roleArn: 'STRING_VALUE', /* required */
          topic: 'STRING_VALUE' /* required */
        },
        s3: {
          bucketName: 'STRING_VALUE', /* required */
          key: 'STRING_VALUE', /* required */
          roleArn: 'STRING_VALUE', /* required */
          cannedAcl: private | public-read | public-read-write | aws-exec-read | authenticated-read | bucket-owner-read | bucket-owner-full-control | log-delivery-write
        },
        salesforce: {
          token: 'STRING_VALUE', /* required */
          url: 'STRING_VALUE' /* required */
        },
        sns: {
          roleArn: 'STRING_VALUE', /* required */
          targetArn: 'STRING_VALUE', /* required */
          messageFormat: RAW | JSON
        },
        sqs: {
          queueUrl: 'STRING_VALUE', /* required */
          roleArn: 'STRING_VALUE', /* required */
          useBase64: true || false
        }
      },
      /* more items */
    ],
    sql: 'STRING_VALUE', /* required */
    awsIotSqlVersion: 'STRING_VALUE',
    description: 'STRING_VALUE',
    ruleDisabled: true || false
  }
};
iot.replaceTopicRule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ruleName — (String)

      The name of the rule.

    • topicRulePayload — (map)

      The rule payload.

      • sqlrequired — (String)

        The SQL statement used to query the topic. For more information, see AWS IoT SQL Reference in the AWS IoT Developer Guide.

      • description — (String)

        The description of the rule.

      • actionsrequired — (Array<map>)

        The actions associated with the rule.

        • dynamoDB — (map)

          Write to a DynamoDB table.

          • tableNamerequired — (String)

            The name of the DynamoDB table.

          • roleArnrequired — (String)

            The ARN of the IAM role that grants access to the DynamoDB table.

          • operation — (String)

            The type of operation to be performed. This follows the substitution template, so it can be ${operation}, but the substitution must result in one of the following: INSERT, UPDATE, or DELETE.

          • hashKeyFieldrequired — (String)

            The hash key name.

          • hashKeyValuerequired — (String)

            The hash key value.

          • hashKeyType — (String)

            The hash key type. Valid values are "STRING" or "NUMBER"

            Possible values include:
            • "STRING"
            • "NUMBER"
          • rangeKeyField — (String)

            The range key name.

          • rangeKeyValue — (String)

            The range key value.

          • rangeKeyType — (String)

            The range key type. Valid values are "STRING" or "NUMBER"

            Possible values include:
            • "STRING"
            • "NUMBER"
          • payloadField — (String)

            The action payload. This name can be customized.

        • dynamoDBv2 — (map)

          Write to a DynamoDB table. This is a new version of the DynamoDB action. It allows you to write each attribute in an MQTT message payload into a separate DynamoDB column.

          • roleArn — (String)

            The ARN of the IAM role that grants access to the DynamoDB table.

          • putItem — (map)

            Specifies the DynamoDB table to which the message data will be written. For example:

            { "dynamoDBv2": { "roleArn": "aws:iam:12341251:my-role" "putItem": { "tableName": "my-table" } } }

            Each attribute in the message payload will be written to a separate column in the DynamoDB database.

            • tableNamerequired — (String)

              The table where the message data will be written

        • lambda — (map)

          Invoke a Lambda function.

          • functionArnrequired — (String)

            The ARN of the Lambda function.

        • sns — (map)

          Publish to an Amazon SNS topic.

          • targetArnrequired — (String)

            The ARN of the SNS topic.

          • roleArnrequired — (String)

            The ARN of the IAM role that grants access.

          • messageFormat — (String)

            The message format of the message to publish. Optional. Accepted values are "JSON" and "RAW". The default value of the attribute is "RAW". SNS uses this setting to determine if the payload should be parsed and relevant platform-specific bits of the payload should be extracted. To read more about SNS message formats, see http://docs.aws.amazon.com/sns/latest/dg/json-formats.html refer to their official documentation.

            Possible values include:
            • "RAW"
            • "JSON"
        • sqs — (map)

          Publish to an Amazon SQS queue.

          • roleArnrequired — (String)

            The ARN of the IAM role that grants access.

          • queueUrlrequired — (String)

            The URL of the Amazon SQS queue.

          • useBase64 — (Boolean)

            Specifies whether to use Base64 encoding.

        • kinesis — (map)

          Write data to an Amazon Kinesis stream.

          • roleArnrequired — (String)

            The ARN of the IAM role that grants access to the Amazon Kinesis stream.

          • streamNamerequired — (String)

            The name of the Amazon Kinesis stream.

          • partitionKey — (String)

            The partition key.

        • republish — (map)

          Publish to another MQTT topic.

          • roleArnrequired — (String)

            The ARN of the IAM role that grants access.

          • topicrequired — (String)

            The name of the MQTT topic.

        • s3 — (map)

          Write to an Amazon S3 bucket.

          • roleArnrequired — (String)

            The ARN of the IAM role that grants access.

          • bucketNamerequired — (String)

            The Amazon S3 bucket.

          • keyrequired — (String)

            The object key.

          • cannedAcl — (String)

            The Amazon S3 canned ACL that controls access to the object identified by the object key. For more information, see S3 canned ACLs.

            Possible values include:
            • "private"
            • "public-read"
            • "public-read-write"
            • "aws-exec-read"
            • "authenticated-read"
            • "bucket-owner-read"
            • "bucket-owner-full-control"
            • "log-delivery-write"
        • firehose — (map)

          Write to an Amazon Kinesis Firehose stream.

          • roleArnrequired — (String)

            The IAM role that grants access to the Amazon Kinesis Firehost stream.

          • deliveryStreamNamerequired — (String)

            The delivery stream name.

          • separator — (String)

            A character separator that will be used to separate records written to the Firehose stream. Valid values are: '\n' (newline), '\t' (tab), '\r\n' (Windows newline), ',' (comma).

        • cloudwatchMetric — (map)

          Capture a CloudWatch metric.

          • roleArnrequired — (String)

            The IAM role that allows access to the CloudWatch metric.

          • metricNamespacerequired — (String)

            The CloudWatch metric namespace name.

          • metricNamerequired — (String)

            The CloudWatch metric name.

          • metricValuerequired — (String)

            The CloudWatch metric value.

          • metricUnitrequired — (String)

            The metric unit supported by CloudWatch.

          • metricTimestamp — (String)

            An optional Unix timestamp.

        • cloudwatchAlarm — (map)

          Change the state of a CloudWatch alarm.

          • roleArnrequired — (String)

            The IAM role that allows access to the CloudWatch alarm.

          • alarmNamerequired — (String)

            The CloudWatch alarm name.

          • stateReasonrequired — (String)

            The reason for the alarm change.

          • stateValuerequired — (String)

            The value of the alarm state. Acceptable values are: OK, ALARM, INSUFFICIENT_DATA.

        • elasticsearch — (map)

          Write data to an Amazon Elasticsearch Service domain.

          • roleArnrequired — (String)

            The IAM role ARN that has access to Elasticsearch.

          • endpointrequired — (String)

            The endpoint of your Elasticsearch domain.

          • indexrequired — (String)

            The Elasticsearch index where you want to store your data.

          • typerequired — (String)

            The type of document you are storing.

          • idrequired — (String)

            The unique identifier for the document you are storing.

        • salesforce — (map)

          Send a message to a Salesforce IoT Cloud Input Stream.

          • tokenrequired — (String)

            The token used to authenticate access to the Salesforce IoT Cloud Input Stream. The token is available from the Salesforce IoT Cloud platform after creation of the Input Stream.

          • urlrequired — (String)

            The URL exposed by the Salesforce IoT Cloud Input Stream. The URL is available from the Salesforce IoT Cloud platform after creation of the Input Stream.

      • ruleDisabled — (Boolean)

        Specifies whether the rule is disabled.

      • awsIotSqlVersion — (String)

        The version of the SQL rules engine to use when evaluating the rule.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

setDefaultPolicyVersion(params = {}, callback) ⇒ AWS.Request

Sets the specified version of the specified policy as the policy's default (operative) version. This action affects all certificates to which the policy is attached. To list the principals the policy is attached to, use the ListPrincipalPolicy API.

Service Reference:

Examples:

Calling the setDefaultPolicyVersion operation

var params = {
  policyName: 'STRING_VALUE', /* required */
  policyVersionId: 'STRING_VALUE' /* required */
};
iot.setDefaultPolicyVersion(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyName — (String)

      The policy name.

    • policyVersionId — (String)

      The policy version ID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

setLoggingOptions(params = {}, callback) ⇒ AWS.Request

Sets the logging options.

Service Reference:

Examples:

Calling the setLoggingOptions operation

var params = {
  loggingOptionsPayload: { /* required */
    roleArn: 'STRING_VALUE', /* required */
    logLevel: DEBUG | INFO | ERROR | WARN | DISABLED
  }
};
iot.setLoggingOptions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • loggingOptionsPayload — (map)

      The logging options payload.

      • roleArnrequired — (String)

        The ARN of the IAM role that grants access.

      • logLevel — (String)

        The logging level.

        Possible values include:
        • "DEBUG"
        • "INFO"
        • "ERROR"
        • "WARN"
        • "DISABLED"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

transferCertificate(params = {}, callback) ⇒ AWS.Request

Transfers the specified certificate to the specified AWS account.

You can cancel the transfer until it is acknowledged by the recipient.

No notification is sent to the transfer destination's account. It is up to the caller to notify the transfer target.

The certificate being transferred must not be in the ACTIVE state. You can use the UpdateCertificate API to deactivate it.

The certificate must not have any policies attached to it. You can use the DetachPrincipalPolicy API to detach them.

Service Reference:

Examples:

Calling the transferCertificate operation

var params = {
  certificateId: 'STRING_VALUE', /* required */
  targetAwsAccount: 'STRING_VALUE', /* required */
  transferMessage: 'STRING_VALUE'
};
iot.transferCertificate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • certificateId — (String)

      The ID of the certificate.

    • targetAwsAccount — (String)

      The AWS account.

    • transferMessage — (String)

      The transfer message.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • transferredCertificateArn — (String)

        The ARN of the certificate.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateCACertificate(params = {}, callback) ⇒ AWS.Request

Updates a registered CA certificate.

Service Reference:

Examples:

Calling the updateCACertificate operation

var params = {
  certificateId: 'STRING_VALUE', /* required */
  newAutoRegistrationStatus: ENABLE | DISABLE,
  newStatus: ACTIVE | INACTIVE
};
iot.updateCACertificate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • certificateId — (String)

      The CA certificate identifier.

    • newStatus — (String)

      The updated status of the CA certificate.

      Note: The status value REGISTER_INACTIVE is deprecated and should not be used.

      Possible values include:
      • "ACTIVE"
      • "INACTIVE"
    • newAutoRegistrationStatus — (String)

      The new value for the auto registration status. Valid values are: "ENABLE" or "DISABLE".

      Possible values include:
      • "ENABLE"
      • "DISABLE"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateCertificate(params = {}, callback) ⇒ AWS.Request

Updates the status of the specified certificate. This operation is idempotent.

Moving a certificate from the ACTIVE state (including REVOKED) will not disconnect currently connected devices, but these devices will be unable to reconnect.

The ACTIVE state is required to authenticate devices connecting to AWS IoT using a certificate.

Service Reference:

Examples:

Calling the updateCertificate operation

var params = {
  certificateId: 'STRING_VALUE', /* required */
  newStatus: ACTIVE | INACTIVE | REVOKED | PENDING_TRANSFER | REGISTER_INACTIVE | PENDING_ACTIVATION /* required */
};
iot.updateCertificate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • certificateId — (String)

      The ID of the certificate.

    • newStatus — (String)

      The new status.

      Note: Setting the status to PENDING_TRANSFER will result in an exception being thrown. PENDING_TRANSFER is a status used internally by AWS IoT. It is not intended for developer use.

      Note: The status value REGISTER_INACTIVE is deprecated and should not be used.

      Possible values include:
      • "ACTIVE"
      • "INACTIVE"
      • "REVOKED"
      • "PENDING_TRANSFER"
      • "REGISTER_INACTIVE"
      • "PENDING_ACTIVATION"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateThing(params = {}, callback) ⇒ AWS.Request

Updates the data for a thing.

Service Reference:

Examples:

Calling the updateThing operation

var params = {
  thingName: 'STRING_VALUE', /* required */
  attributePayload: {
    attributes: {
      '<AttributeName>': 'STRING_VALUE',
      /* '<AttributeName>': ... */
    },
    merge: true || false
  },
  expectedVersion: 0,
  removeThingType: true || false,
  thingTypeName: 'STRING_VALUE'
};
iot.updateThing(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • thingName — (String)

      The name of the thing to update.

    • thingTypeName — (String)

      The name of the thing type.

    • attributePayload — (map)

      A list of thing attributes, a JSON string containing name-value pairs. For example:

      {\"attributes\":{\"name1\":\"value2\"}}

      This data is used to add new attributes or update existing attributes.

      • attributes — (map<String>)

        A JSON string containing up to three key-value pair in JSON format. For example:

        {\"attributes\":{\"string1\":\"string2\"}}

      • merge — (Boolean)

        Specifies whether the list of attributes provided in the AttributePayload is merged with the attributes stored in the registry, instead of overwriting them.

        To remove an attribute, call UpdateThing with an empty attribute value.

        Note: The merge attribute is only valid when calling UpdateThing.
    • expectedVersion — (Integer)

      The expected version of the thing record in the registry. If the version of the record in the registry does not match the expected version specified in the request, the UpdateThing request is rejected with a VersionConflictException.

    • removeThingType — (Boolean)

      Remove a thing type association. If true, the assocation is removed.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.