We announced the upcoming end-of-support for AWS SDK for JavaScript v2.
We recommend that you migrate to AWS SDK for JavaScript v3. For dates, additional details, and information on how to migrate, please refer to the linked announcement.

Class: AWS.GreengrassV2

Inherits:
AWS.Service show all
Identifier:
greengrassv2
API Version:
2020-11-30
Defined in:
(unknown)

Overview

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

Service Description

IoT Greengrass brings local compute, messaging, data management, sync, and ML inference capabilities to edge devices. This enables devices to collect and analyze data closer to the source of information, react autonomously to local events, and communicate securely with each other on local networks. Local devices can also communicate securely with Amazon Web Services IoT Core and export IoT data to the Amazon Web Services Cloud. IoT Greengrass developers can use Lambda functions and components to create and deploy applications to fleets of edge devices for local operation.

IoT Greengrass Version 2 provides a new major version of the IoT Greengrass Core software, new APIs, and a new console. Use this API reference to learn how to use the IoT Greengrass V2 API operations to manage components, manage deployments, and core devices.

For more information, see What is IoT Greengrass? in the IoT Greengrass V2 Developer Guide.

Sending a Request Using GreengrassV2

var greengrassv2 = new AWS.GreengrassV2();
greengrassv2.associateServiceRoleToAccount(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 GreengrassV2 object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var greengrassv2 = new AWS.GreengrassV2({apiVersion: '2020-11-30'});

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

AWS.config.apiVersions = {
  greengrassv2: '2020-11-30',
  // other service API versions
};

var greengrassv2 = new AWS.GreengrassV2();

Version:

  • 2020-11-30

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.GreengrassV2(options = {}) ⇒ Object

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

Examples:

Constructing a GreengrassV2 object

var greengrassv2 = new AWS.GreengrassV2({apiVersion: '2020-11-30'});

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|AWS.Endpoint)

    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' or an Endpoint object.

  • 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.GreengrassV2.region for more information.

  • maxRetries (Integer)

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

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.GreengrassV2.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.

  • s3UsEast1RegionalEndpoint ('legacy'|'regional')

    when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to legacy

  • s3UseArnRegion (Boolean)

    whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets 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 error and returns the amount of time to delay in milliseconds. If the result is a non-zero negative value, no further retry attempts will be made. The base option will be ignored if this option is supplied. The function is only called for retryable errors.
  • 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.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean|undefined)

    whether to call operations with endpoints given by service dynamically. Setting this

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to true.

  • stsRegionalEndpoints ('legacy'|'regional')

    whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.

  • useFipsEndpoint (Boolean)

    Enables FIPS compatible endpoints. Defaults to false.

  • useDualstackEndpoint (Boolean)

    Enables IPv6 dualstack endpoint. Defaults to false.

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

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

Associates a Greengrass service role with IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region. IoT Greengrass uses this role to verify the identity of client devices and manage core device connectivity information. The role must include the AWSGreengrassResourceAccessRolePolicy managed policy or a custom policy that defines equivalent permissions for the IoT Greengrass features that you use. For more information, see Greengrass service role in the IoT Greengrass Version 2 Developer Guide.

Service Reference:

Examples:

Calling the associateServiceRoleToAccount operation

var params = {
  roleArn: 'STRING_VALUE' /* required */
};
greengrassv2.associateServiceRoleToAccount(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: {})
    • roleArn — (String)

      The Amazon Resource Name (ARN) of the service role to associate with IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region.

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:

      • associatedAt — (String)

        The time when the service role was associated with IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region.

Returns:

  • (AWS.Request)

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

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

Associates a list of client devices with a core device. Use this API operation to specify which client devices can discover a core device through cloud discovery. With cloud discovery, client devices connect to IoT Greengrass to retrieve associated core devices' connectivity information and certificates. For more information, see Configure cloud discovery in the IoT Greengrass V2 Developer Guide.

Note: Client devices are local IoT devices that connect to and communicate with an IoT Greengrass core device over MQTT. You can connect client devices to a core device to sync MQTT messages and data to Amazon Web Services IoT Core and interact with client devices in Greengrass components. For more information, see Interact with local IoT devices in the IoT Greengrass V2 Developer Guide.

Examples:

Calling the batchAssociateClientDeviceWithCoreDevice operation

var params = {
  coreDeviceThingName: 'STRING_VALUE', /* required */
  entries: [
    {
      thingName: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
greengrassv2.batchAssociateClientDeviceWithCoreDevice(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: {})
    • entries — (Array<map>)

      The list of client devices to associate.

      • thingNamerequired — (String)

        The name of the IoT thing that represents the client device to associate.

    • coreDeviceThingName — (String)

      The name of the core device. This is also the name of the IoT 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:

      • errorEntries — (Array<map>)

        The list of any errors for the entries in the request. Each error entry contains the name of the IoT thing that failed to associate.

        • thingName — (String)

          The name of the IoT thing whose associate request failed.

        • code — (String)

          The error code for the request.

        • message — (String)

          A message that provides additional information about the error.

Returns:

  • (AWS.Request)

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

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

Disassociates a list of client devices from a core device. After you disassociate a client device from a core device, the client device won't be able to use cloud discovery to retrieve the core device's connectivity information and certificates.

Examples:

Calling the batchDisassociateClientDeviceFromCoreDevice operation

var params = {
  coreDeviceThingName: 'STRING_VALUE', /* required */
  entries: [
    {
      thingName: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
greengrassv2.batchDisassociateClientDeviceFromCoreDevice(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: {})
    • entries — (Array<map>)

      The list of client devices to disassociate.

      • thingNamerequired — (String)

        The name of the IoT thing that represents the client device to disassociate.

    • coreDeviceThingName — (String)

      The name of the core device. This is also the name of the IoT 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:

      • errorEntries — (Array<map>)

        The list of any errors for the entries in the request. Each error entry contains the name of the IoT thing that failed to disassociate.

        • thingName — (String)

          The name of the IoT thing whose disassociate request failed.

        • code — (String)

          The error code for the request.

        • message — (String)

          A message that provides additional information about the error.

Returns:

  • (AWS.Request)

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

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

Cancels a deployment. This operation cancels the deployment for devices that haven't yet received it. If a device already received the deployment, this operation doesn't change anything for that device.

Service Reference:

Examples:

Calling the cancelDeployment operation

var params = {
  deploymentId: 'STRING_VALUE' /* required */
};
greengrassv2.cancelDeployment(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: {})
    • deploymentId — (String)

      The ID of the deployment.

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:

      • message — (String)

        A message that communicates if the cancel was successful.

Returns:

  • (AWS.Request)

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

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

Creates a component. Components are software that run on Greengrass core devices. After you develop and test a component on your core device, you can use this operation to upload your component to IoT Greengrass. Then, you can deploy the component to other core devices.

You can use this operation to do the following:

  • Create components from recipes

    Create a component from a recipe, which is a file that defines the component's metadata, parameters, dependencies, lifecycle, artifacts, and platform capability. For more information, see IoT Greengrass component recipe reference in the IoT Greengrass V2 Developer Guide.

    To create a component from a recipe, specify inlineRecipe when you call this operation.

  • Create components from Lambda functions

    Create a component from an Lambda function that runs on IoT Greengrass. This creates a recipe and artifacts from the Lambda function's deployment package. You can use this operation to migrate Lambda functions from IoT Greengrass V1 to IoT Greengrass V2.

    This function accepts Lambda functions in all supported versions of Python, Node.js, and Java runtimes. IoT Greengrass doesn't apply any additional restrictions on deprecated Lambda runtime versions.

    To create a component from a Lambda function, specify lambdaFunction when you call this operation.

    Note: IoT Greengrass currently supports Lambda functions on only Linux core devices.

Service Reference:

Examples:

Calling the createComponentVersion operation

var params = {
  clientToken: 'STRING_VALUE',
  inlineRecipe: Buffer.from('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
  lambdaFunction: {
    lambdaArn: 'STRING_VALUE', /* required */
    componentDependencies: {
      '<NonEmptyString>': {
        dependencyType: HARD | SOFT,
        versionRequirement: 'STRING_VALUE'
      },
      /* '<NonEmptyString>': ... */
    },
    componentLambdaParameters: {
      environmentVariables: {
        '<NonEmptyString>': 'STRING_VALUE',
        /* '<NonEmptyString>': ... */
      },
      eventSources: [
        {
          topic: 'STRING_VALUE', /* required */
          type: PUB_SUB | IOT_CORE /* required */
        },
        /* more items */
      ],
      execArgs: [
        'STRING_VALUE',
        /* more items */
      ],
      inputPayloadEncodingType: json | binary,
      linuxProcessParams: {
        containerParams: {
          devices: [
            {
              path: 'STRING_VALUE', /* required */
              addGroupOwner: true || false,
              permission: ro | rw
            },
            /* more items */
          ],
          memorySizeInKB: 'NUMBER_VALUE',
          mountROSysfs: true || false,
          volumes: [
            {
              destinationPath: 'STRING_VALUE', /* required */
              sourcePath: 'STRING_VALUE', /* required */
              addGroupOwner: true || false,
              permission: ro | rw
            },
            /* more items */
          ]
        },
        isolationMode: GreengrassContainer | NoContainer
      },
      maxIdleTimeInSeconds: 'NUMBER_VALUE',
      maxInstancesCount: 'NUMBER_VALUE',
      maxQueueSize: 'NUMBER_VALUE',
      pinned: true || false,
      statusTimeoutInSeconds: 'NUMBER_VALUE',
      timeoutInSeconds: 'NUMBER_VALUE'
    },
    componentName: 'STRING_VALUE',
    componentPlatforms: [
      {
        attributes: {
          '<NonEmptyString>': 'STRING_VALUE',
          /* '<NonEmptyString>': ... */
        },
        name: 'STRING_VALUE'
      },
      /* more items */
    ],
    componentVersion: 'STRING_VALUE'
  },
  tags: {
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
greengrassv2.createComponentVersion(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: {})
    • inlineRecipe — (Buffer, Typed Array, Blob, String)

      The recipe to use to create the component. The recipe defines the component's metadata, parameters, dependencies, lifecycle, artifacts, and platform compatibility.

      You must specify either inlineRecipe or lambdaFunction.

    • lambdaFunction — (map)

      The parameters to create a component from a Lambda function.

      You must specify either inlineRecipe or lambdaFunction.

      • lambdaArnrequired — (String)

        The ARN of the Lambda function. The ARN must include the version of the function to import. You can't use version aliases like $LATEST.

      • componentName — (String)

        The name of the component.

        Defaults to the name of the Lambda function.

      • componentVersion — (String)

        The version of the component.

        Defaults to the version of the Lambda function as a semantic version. For example, if your function version is 3, the component version becomes 3.0.0.

      • componentPlatforms — (Array<map>)

        The platforms that the component version supports.

        • name — (String)

          The friendly name of the platform. This name helps you identify the platform.

          If you omit this parameter, IoT Greengrass creates a friendly name from the os and architecture of the platform.

        • attributes — (map<String>)

          A dictionary of attributes for the platform. The IoT Greengrass Core software defines the os and architecture by default. You can specify additional platform attributes for a core device when you deploy the Greengrass nucleus component. For more information, see the Greengrass nucleus component in the IoT Greengrass V2 Developer Guide.

      • componentDependencies — (map<map>)

        The component versions on which this Lambda function component depends.

        • versionRequirement — (String)

          The component version requirement for the component dependency.

          IoT Greengrass V2 uses semantic version constraints. For more information, see Semantic Versioning.

        • dependencyType — (String)

          The type of this dependency. Choose from the following options:

          • SOFT – The component doesn't restart if the dependency changes state.

          • HARD – The component restarts if the dependency changes state.

          Default: HARD

          Possible values include:
          • "HARD"
          • "SOFT"
      • componentLambdaParameters — (map)

        The system and runtime parameters for the Lambda function as it runs on the Greengrass core device.

        • eventSources — (Array<map>)

          The list of event sources to which to subscribe to receive work messages. The Lambda function runs when it receives a message from an event source. You can subscribe this function to local publish/subscribe messages and Amazon Web Services IoT Core MQTT messages.

          • topicrequired — (String)

            The topic to which to subscribe to receive event messages.

          • typerequired — (String)

            The type of event source. Choose from the following options:

            • PUB_SUB – Subscribe to local publish/subscribe messages. This event source type doesn't support MQTT wildcards (+ and #) in the event source topic.

            • IOT_CORE – Subscribe to Amazon Web Services IoT Core MQTT messages. This event source type supports MQTT wildcards (+ and #) in the event source topic.

            Possible values include:
            • "PUB_SUB"
            • "IOT_CORE"
        • maxQueueSize — (Integer)

          The maximum size of the message queue for the Lambda function component. The IoT Greengrass core stores messages in a FIFO (first-in-first-out) queue until it can run the Lambda function to consume each message.

        • maxInstancesCount — (Integer)

          The maximum number of instances that a non-pinned Lambda function can run at the same time.

        • maxIdleTimeInSeconds — (Integer)

          The maximum amount of time in seconds that a non-pinned Lambda function can idle before the IoT Greengrass Core software stops its process.

        • timeoutInSeconds — (Integer)

          The maximum amount of time in seconds that the Lambda function can process a work item.

        • statusTimeoutInSeconds — (Integer)

          The interval in seconds at which a pinned (also known as long-lived) Lambda function component sends status updates to the Lambda manager component.

        • pinned — (Boolean)

          Whether or not the Lambda function is pinned, or long-lived.

          • A pinned Lambda function starts when IoT Greengrass starts and keeps running in its own container.

          • A non-pinned Lambda function starts only when it receives a work item and exists after it idles for maxIdleTimeInSeconds. If the function has multiple work items, the IoT Greengrass Core software creates multiple instances of the function.

          Default: true

        • inputPayloadEncodingType — (String)

          The encoding type that the Lambda function supports.

          Default: json

          Possible values include:
          • "json"
          • "binary"
        • execArgs — (Array<String>)

          The list of arguments to pass to the Lambda function when it runs.

        • environmentVariables — (map<String>)

          The map of environment variables that are available to the Lambda function when it runs.

        • linuxProcessParams — (map)

          The parameters for the Linux process that contains the Lambda function.

          • isolationMode — (String)

            The isolation mode for the process that contains the Lambda function. The process can run in an isolated runtime environment inside the IoT Greengrass container, or as a regular process outside any container.

            Default: GreengrassContainer

            Possible values include:
            • "GreengrassContainer"
            • "NoContainer"
          • containerParams — (map)

            The parameters for the container in which the Lambda function runs.

            • memorySizeInKB — (Integer)

              The memory size of the container, expressed in kilobytes.

              Default: 16384 (16 MB)

            • mountROSysfs — (Boolean)

              Whether or not the container can read information from the device's /sys folder.

              Default: false

            • volumes — (Array<map>)

              The list of volumes that the container can access.

              • sourcePathrequired — (String)

                The path to the physical volume in the file system.

              • destinationPathrequired — (String)

                The path to the logical volume in the file system.

              • permission — (String)

                The permission to access the volume: read/only (ro) or read/write (rw).

                Default: ro

                Possible values include:
                • "ro"
                • "rw"
              • addGroupOwner — (Boolean)

                Whether or not to add the IoT Greengrass user group as an owner of the volume.

                Default: false

            • devices — (Array<map>)

              The list of system devices that the container can access.

              • pathrequired — (String)

                The mount path for the device in the file system.

              • permission — (String)

                The permission to access the device: read/only (ro) or read/write (rw).

                Default: ro

                Possible values include:
                • "ro"
                • "rw"
              • addGroupOwner — (Boolean)

                Whether or not to add the component's system user as an owner of the device.

                Default: false

    • tags — (map<String>)

      A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources in the IoT Greengrass V2 Developer Guide.

    • clientToken — (String)

      A unique, case-sensitive identifier that you can provide to ensure that the request is idempotent. Idempotency means that the request is successfully processed only once, even if you send the request multiple times. When a request succeeds, and you specify the same client token for subsequent successful requests, the IoT Greengrass V2 service returns the successful response that it caches from the previous request. IoT Greengrass V2 caches successful responses for idempotent requests for up to 8 hours.

      If a token is not provided, the SDK will use a version 4 UUID.

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:

      • arn — (String)

        The ARN of the component version.

      • componentName — (String)

        The name of the component.

      • componentVersion — (String)

        The version of the component.

      • creationTimestamp — (Date)

        The time at which the component was created, expressed in ISO 8601 format.

      • status — (map)

        The status of the component version in IoT Greengrass V2. This status is different from the status of the component on a core device.

        • componentState — (String)

          The state of the component version.

          Possible values include:
          • "REQUESTED"
          • "INITIATED"
          • "DEPLOYABLE"
          • "FAILED"
          • "DEPRECATED"
        • message — (String)

          A message that communicates details, such as errors, about the status of the component version.

        • errors — (map<String>)

          A dictionary of errors that communicate why the component version is in an error state. For example, if IoT Greengrass can't access an artifact for the component version, then errors contains the artifact's URI as a key, and the error message as the value for that key.

        • vendorGuidance — (String)

          The vendor guidance state for the component version. This state indicates whether the component version has any issues that you should consider before you deploy it. The vendor guidance state can be:

          • ACTIVE – This component version is available and recommended for use.

          • DISCONTINUED – This component version has been discontinued by its publisher. You can deploy this component version, but we recommend that you use a different version of this component.

          • DELETED – This component version has been deleted by its publisher, so you can't deploy it. If you have any existing deployments that specify this component version, those deployments will fail.

          Possible values include:
          • "ACTIVE"
          • "DISCONTINUED"
          • "DELETED"
        • vendorGuidanceMessage — (String)

          A message that communicates details about the vendor guidance state of the component version. This message communicates why a component version is discontinued or deleted.

Returns:

  • (AWS.Request)

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

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

Creates a continuous deployment for a target, which is a Greengrass core device or group of core devices. When you add a new core device to a group of core devices that has a deployment, IoT Greengrass deploys that group's deployment to the new device.

You can define one deployment for each target. When you create a new deployment for a target that has an existing deployment, you replace the previous deployment. IoT Greengrass applies the new deployment to the target devices.

Every deployment has a revision number that indicates how many deployment revisions you define for a target. Use this operation to create a new revision of an existing deployment.

For more information, see the Create deployments in the IoT Greengrass V2 Developer Guide.

Service Reference:

Examples:

Calling the createDeployment operation

var params = {
  targetArn: 'STRING_VALUE', /* required */
  clientToken: 'STRING_VALUE',
  components: {
    '<NonEmptyString>': {
      componentVersion: 'STRING_VALUE', /* required */
      configurationUpdate: {
        merge: 'STRING_VALUE',
        reset: [
          'STRING_VALUE',
          /* more items */
        ]
      },
      runWith: {
        posixUser: 'STRING_VALUE',
        systemResourceLimits: {
          cpus: 'NUMBER_VALUE',
          memory: 'NUMBER_VALUE'
        },
        windowsUser: 'STRING_VALUE'
      }
    },
    /* '<NonEmptyString>': ... */
  },
  deploymentName: 'STRING_VALUE',
  deploymentPolicies: {
    componentUpdatePolicy: {
      action: NOTIFY_COMPONENTS | SKIP_NOTIFY_COMPONENTS,
      timeoutInSeconds: 'NUMBER_VALUE'
    },
    configurationValidationPolicy: {
      timeoutInSeconds: 'NUMBER_VALUE'
    },
    failureHandlingPolicy: ROLLBACK | DO_NOTHING
  },
  iotJobConfiguration: {
    abortConfig: {
      criteriaList: [ /* required */
        {
          action: CANCEL, /* required */
          failureType: FAILED | REJECTED | TIMED_OUT | ALL, /* required */
          minNumberOfExecutedThings: 'NUMBER_VALUE', /* required */
          thresholdPercentage: 'NUMBER_VALUE' /* required */
        },
        /* more items */
      ]
    },
    jobExecutionsRolloutConfig: {
      exponentialRate: {
        baseRatePerMinute: 'NUMBER_VALUE', /* required */
        incrementFactor: 'NUMBER_VALUE', /* required */
        rateIncreaseCriteria: { /* required */
          numberOfNotifiedThings: 'NUMBER_VALUE',
          numberOfSucceededThings: 'NUMBER_VALUE'
        }
      },
      maximumPerMinute: 'NUMBER_VALUE'
    },
    timeoutConfig: {
      inProgressTimeoutInMinutes: 'NUMBER_VALUE'
    }
  },
  parentTargetArn: 'STRING_VALUE',
  tags: {
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
greengrassv2.createDeployment(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: {})
    • targetArn — (String)

      The ARN of the target IoT thing or thing group. When creating a subdeployment, the targetARN can only be a thing group.

    • deploymentName — (String)

      The name of the deployment.

    • components — (map<map>)

      The components to deploy. This is a dictionary, where each key is the name of a component, and each key's value is the version and configuration to deploy for that component.

      • componentVersionrequired — (String)

        The version of the component.

      • configurationUpdate — (map)

        The configuration updates to deploy for the component. You can define reset updates and merge updates. A reset updates the keys that you specify to the default configuration for the component. A merge updates the core device's component configuration with the keys and values that you specify. The IoT Greengrass Core software applies reset updates before it applies merge updates. For more information, see Update component configurations in the IoT Greengrass V2 Developer Guide.

        • merge — (String)

          A serialized JSON string that contains the configuration object to merge to target devices. The core device merges this configuration with the component's existing configuration. If this is the first time a component deploys on a device, the core device merges this configuration with the component's default configuration. This means that the core device keeps it's existing configuration for keys and values that you don't specify in this object. For more information, see Merge configuration updates in the IoT Greengrass V2 Developer Guide.

        • reset — (Array<String>)

          The list of configuration nodes to reset to default values on target devices. Use JSON pointers to specify each node to reset. JSON pointers start with a forward slash (/) and use forward slashes to separate the key for each level in the object. For more information, see the JSON pointer specification and Reset configuration updates in the IoT Greengrass V2 Developer Guide.

      • runWith — (map)

        The system user and group that the IoT Greengrass Core software uses to run component processes on the core device. If you omit this parameter, the IoT Greengrass Core software uses the system user and group that you configure for the core device. For more information, see Configure the user and group that run components in the IoT Greengrass V2 Developer Guide.

        • posixUser — (String)

          The POSIX system user and, optionally, group to use to run this component on Linux core devices. The user, and group if specified, must exist on each Linux core device. Specify the user and group separated by a colon (:) in the following format: user:group. The group is optional. If you don't specify a group, the IoT Greengrass Core software uses the primary user for the group.

          If you omit this parameter, the IoT Greengrass Core software uses the default system user and group that you configure on the Greengrass nucleus component. For more information, see Configure the user and group that run components.

        • systemResourceLimits — (map)

          The system resource limits to apply to this component's process on the core device. IoT Greengrass currently supports this feature on only Linux core devices.

          If you omit this parameter, the IoT Greengrass Core software uses the default system resource limits that you configure on the Greengrass nucleus component. For more information, see Configure system resource limits for components.

          • memory — (Integer)

            The maximum amount of RAM, expressed in kilobytes, that a component's processes can use on the core device.

          • cpus — (Float)

            The maximum amount of CPU time that a component's processes can use on the core device. A core device's total CPU time is equivalent to the device's number of CPU cores. For example, on a core device with 4 CPU cores, you can set this value to 2 to limit the component's processes to 50 percent usage of each CPU core. On a device with 1 CPU core, you can set this value to 0.25 to limit the component's processes to 25 percent usage of the CPU. If you set this value to a number greater than the number of CPU cores, the IoT Greengrass Core software doesn't limit the component's CPU usage.

        • windowsUser — (String)

          The Windows user to use to run this component on Windows core devices. The user must exist on each Windows core device, and its name and password must be in the LocalSystem account's Credentials Manager instance.

          If you omit this parameter, the IoT Greengrass Core software uses the default Windows user that you configure on the Greengrass nucleus component. For more information, see Configure the user and group that run components.

    • iotJobConfiguration — (map)

      The job configuration for the deployment configuration. The job configuration specifies the rollout, timeout, and stop configurations for the deployment configuration.

      • jobExecutionsRolloutConfig — (map)

        The rollout configuration for the job. This configuration defines the rate at which the job rolls out to the fleet of target devices.

        • exponentialRate — (map)

          The exponential rate to increase the job rollout rate.

          • baseRatePerMinuterequired — (Integer)

            The minimum number of devices that receive a pending job notification, per minute, when the job starts. This parameter defines the initial rollout rate of the job.

          • incrementFactorrequired — (Float)

            The exponential factor to increase the rollout rate for the job.

            This parameter supports up to one digit after the decimal (for example, you can specify 1.5, but not 1.55).

          • rateIncreaseCriteriarequired — (map)

            The criteria to increase the rollout rate for the job.

            • numberOfNotifiedThings — (Integer)

              The number of devices to receive the job notification before the rollout rate increases.

            • numberOfSucceededThings — (Integer)

              The number of devices to successfully run the configuration job before the rollout rate increases.

        • maximumPerMinute — (Integer)

          The maximum number of devices that receive a pending job notification, per minute.

      • abortConfig — (map)

        The stop configuration for the job. This configuration defines when and how to stop a job rollout.

        • criteriaListrequired — (Array<map>)

          The list of criteria that define when and how to cancel the configuration deployment.

          • failureTyperequired — (String)

            The type of job deployment failure that can cancel a job.

            Possible values include:
            • "FAILED"
            • "REJECTED"
            • "TIMED_OUT"
            • "ALL"
          • actionrequired — (String)

            The action to perform when the criteria are met.

            Possible values include:
            • "CANCEL"
          • thresholdPercentagerequired — (Float)

            The minimum percentage of failureType failures that occur before the job can cancel.

            This parameter supports up to two digits after the decimal (for example, you can specify 10.9 or 10.99, but not 10.999).

          • minNumberOfExecutedThingsrequired — (Integer)

            The minimum number of things that receive the configuration before the job can cancel.

      • timeoutConfig — (map)

        The timeout configuration for the job. This configuration defines the amount of time each device has to complete the job.

        • inProgressTimeoutInMinutes — (Integer)

          The amount of time, in minutes, that devices have to complete the job. The timer starts when the job status is set to IN_PROGRESS. If the job status doesn't change to a terminal state before the time expires, then the job status is set to TIMED_OUT.

          The timeout interval must be between 1 minute and 7 days (10080 minutes).

    • deploymentPolicies — (map)

      The deployment policies for the deployment. These policies define how the deployment updates components and handles failure.

      • failureHandlingPolicy — (String)

        The failure handling policy for the configuration deployment. This policy defines what to do if the deployment fails.

        Default: ROLLBACK

        Possible values include:
        • "ROLLBACK"
        • "DO_NOTHING"
      • componentUpdatePolicy — (map)

        The component update policy for the configuration deployment. This policy defines when it's safe to deploy the configuration to devices.

        • timeoutInSeconds — (Integer)

          The amount of time in seconds that each component on a device has to report that it's safe to update. If the component waits for longer than this timeout, then the deployment proceeds on the device.

          Default: 60

        • action — (String)

          Whether or not to notify components and wait for components to become safe to update. Choose from the following options:

          • NOTIFY_COMPONENTS – The deployment notifies each component before it stops and updates that component. Components can use the SubscribeToComponentUpdates IPC operation to receive these notifications. Then, components can respond with the DeferComponentUpdate IPC operation. For more information, see Create deployments in the IoT Greengrass V2 Developer Guide.

          • SKIP_NOTIFY_COMPONENTS – The deployment doesn't notify components or wait for them to be safe to update.

          Default: NOTIFY_COMPONENTS

          Possible values include:
          • "NOTIFY_COMPONENTS"
          • "SKIP_NOTIFY_COMPONENTS"
      • configurationValidationPolicy — (map)

        The configuration validation policy for the configuration deployment. This policy defines how long each component has to validate its configure updates.

        • timeoutInSeconds — (Integer)

          The amount of time in seconds that a component can validate its configuration updates. If the validation time exceeds this timeout, then the deployment proceeds for the device.

          Default: 30

    • parentTargetArn — (String)

      The parent deployment's target ARN within a subdeployment.

    • tags — (map<String>)

      A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources in the IoT Greengrass V2 Developer Guide.

    • clientToken — (String)

      A unique, case-sensitive identifier that you can provide to ensure that the request is idempotent. Idempotency means that the request is successfully processed only once, even if you send the request multiple times. When a request succeeds, and you specify the same client token for subsequent successful requests, the IoT Greengrass V2 service returns the successful response that it caches from the previous request. IoT Greengrass V2 caches successful responses for idempotent requests for up to 8 hours.

      If a token is not provided, the SDK will use a version 4 UUID.

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:

      • deploymentId — (String)

        The ID of the deployment.

      • iotJobId — (String)

        The ID of the IoT job that applies the deployment to target devices.

      • iotJobArn — (String)

        The ARN of the IoT job that applies the deployment to target devices.

Returns:

  • (AWS.Request)

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

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

Deletes a version of a component from IoT Greengrass.

Note: This operation deletes the component's recipe and artifacts. As a result, deployments that refer to this component version will fail. If you have deployments that use this component version, you can remove the component from the deployment or update the deployment to use a valid version.

Service Reference:

Examples:

Calling the deleteComponent operation

var params = {
  arn: 'STRING_VALUE' /* required */
};
greengrassv2.deleteComponent(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: {})
    • arn — (String)

      The ARN of the component version.

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.

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

Deletes a Greengrass core device, which is an IoT thing. This operation removes the core device from the list of core devices. This operation doesn't delete the IoT thing. For more information about how to delete the IoT thing, see DeleteThing in the IoT API Reference.

Service Reference:

Examples:

Calling the deleteCoreDevice operation

var params = {
  coreDeviceThingName: 'STRING_VALUE' /* required */
};
greengrassv2.deleteCoreDevice(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: {})
    • coreDeviceThingName — (String)

      The name of the core device. This is also the name of the IoT 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.

Returns:

  • (AWS.Request)

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

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

Deletes a deployment. To delete an active deployment, you must first cancel it. For more information, see CancelDeployment.

Deleting a deployment doesn't affect core devices that run that deployment, because core devices store the deployment's configuration on the device. Additionally, core devices can roll back to a previous deployment that has been deleted.

Service Reference:

Examples:

Calling the deleteDeployment operation

var params = {
  deploymentId: 'STRING_VALUE' /* required */
};
greengrassv2.deleteDeployment(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: {})
    • deploymentId — (String)

      The ID of the deployment.

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.

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

Retrieves metadata for a version of a component.

Service Reference:

Examples:

Calling the describeComponent operation

var params = {
  arn: 'STRING_VALUE' /* required */
};
greengrassv2.describeComponent(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: {})
    • arn — (String)

      The ARN of the component version.

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:

      • arn — (String)

        The ARN of the component version.

      • componentName — (String)

        The name of the component.

      • componentVersion — (String)

        The version of the component.

      • creationTimestamp — (Date)

        The time at which the component was created, expressed in ISO 8601 format.

      • publisher — (String)

        The publisher of the component version.

      • description — (String)

        The description of the component version.

      • status — (map)

        The status of the component version in IoT Greengrass V2. This status is different from the status of the component on a core device.

        • componentState — (String)

          The state of the component version.

          Possible values include:
          • "REQUESTED"
          • "INITIATED"
          • "DEPLOYABLE"
          • "FAILED"
          • "DEPRECATED"
        • message — (String)

          A message that communicates details, such as errors, about the status of the component version.

        • errors — (map<String>)

          A dictionary of errors that communicate why the component version is in an error state. For example, if IoT Greengrass can't access an artifact for the component version, then errors contains the artifact's URI as a key, and the error message as the value for that key.

        • vendorGuidance — (String)

          The vendor guidance state for the component version. This state indicates whether the component version has any issues that you should consider before you deploy it. The vendor guidance state can be:

          • ACTIVE – This component version is available and recommended for use.

          • DISCONTINUED – This component version has been discontinued by its publisher. You can deploy this component version, but we recommend that you use a different version of this component.

          • DELETED – This component version has been deleted by its publisher, so you can't deploy it. If you have any existing deployments that specify this component version, those deployments will fail.

          Possible values include:
          • "ACTIVE"
          • "DISCONTINUED"
          • "DELETED"
        • vendorGuidanceMessage — (String)

          A message that communicates details about the vendor guidance state of the component version. This message communicates why a component version is discontinued or deleted.

      • platforms — (Array<map>)

        The platforms that the component version supports.

        • name — (String)

          The friendly name of the platform. This name helps you identify the platform.

          If you omit this parameter, IoT Greengrass creates a friendly name from the os and architecture of the platform.

        • attributes — (map<String>)

          A dictionary of attributes for the platform. The IoT Greengrass Core software defines the os and architecture by default. You can specify additional platform attributes for a core device when you deploy the Greengrass nucleus component. For more information, see the Greengrass nucleus component in the IoT Greengrass V2 Developer Guide.

      • tags — (map<String>)

        A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources in the IoT Greengrass V2 Developer Guide.

Returns:

  • (AWS.Request)

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

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

Disassociates the Greengrass service role from IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region. Without a service role, IoT Greengrass can't verify the identity of client devices or manage core device connectivity information. For more information, see Greengrass service role in the IoT Greengrass Version 2 Developer Guide.

Examples:

Calling the disassociateServiceRoleFromAccount operation

var params = {
};
greengrassv2.disassociateServiceRoleFromAccount(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:

      • disassociatedAt — (String)

        The time when the service role was disassociated from IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region.

Returns:

  • (AWS.Request)

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

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

Gets the recipe for a version of a component.

Service Reference:

Examples:

Calling the getComponent operation

var params = {
  arn: 'STRING_VALUE', /* required */
  recipeOutputFormat: JSON | YAML
};
greengrassv2.getComponent(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: {})
    • recipeOutputFormat — (String)

      The format of the recipe.

      Possible values include:
      • "JSON"
      • "YAML"
    • arn — (String)

      The ARN of the component version.

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:

      • recipeOutputFormat — (String)

        The format of the recipe.

        Possible values include:
        • "JSON"
        • "YAML"
      • recipe — (Buffer(Node.js), Typed Array(Browser))

        The recipe of the component version.

      • tags — (map<String>)

        A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources in the IoT Greengrass V2 Developer Guide.

Returns:

  • (AWS.Request)

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

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

Gets the pre-signed URL to download a public or a Lambda component artifact. Core devices call this operation to identify the URL that they can use to download an artifact to install.

Service Reference:

Examples:

Calling the getComponentVersionArtifact operation

var params = {
  arn: 'STRING_VALUE', /* required */
  artifactName: 'STRING_VALUE', /* required */
  iotEndpointType: fips | standard,
  s3EndpointType: REGIONAL | GLOBAL
};
greengrassv2.getComponentVersionArtifact(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: {})
    • arn — (String)

      The ARN of the component version. Specify the ARN of a public or a Lambda component version.

    • artifactName — (String)

      The name of the artifact.

      You can use the GetComponent operation to download the component recipe, which includes the URI of the artifact. The artifact name is the section of the URI after the scheme. For example, in the artifact URI greengrass:SomeArtifact.zip, the artifact name is SomeArtifact.zip.

    • s3EndpointType — (String)

      Specifies the endpoint to use when getting Amazon S3 pre-signed URLs.

      All Amazon Web Services Regions except US East (N. Virginia) use REGIONAL in all cases. In the US East (N. Virginia) Region the default is GLOBAL, but you can change it to REGIONAL with this parameter.

      Possible values include:
      • "REGIONAL"
      • "GLOBAL"
    • iotEndpointType — (String)

      Determines if the Amazon S3 URL returned is a FIPS pre-signed URL endpoint. Specify fips if you want the returned Amazon S3 pre-signed URL to point to an Amazon S3 FIPS endpoint. If you don't specify a value, the default is standard.

      Possible values include:
      • "fips"
      • "standard"

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:

      • preSignedUrl — (String)

        The URL of the artifact.

Returns:

  • (AWS.Request)

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

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

Retrieves connectivity information for a Greengrass core device.

Connectivity information includes endpoints and ports where client devices can connect to an MQTT broker on the core device. When a client device calls the IoT Greengrass discovery API, IoT Greengrass returns connectivity information for all of the core devices where the client device can connect. For more information, see Connect client devices to core devices in the IoT Greengrass Version 2 Developer Guide.

Service Reference:

Examples:

Calling the getConnectivityInfo operation

var params = {
  thingName: 'STRING_VALUE' /* required */
};
greengrassv2.getConnectivityInfo(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 core device. This is also the name of the IoT 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:

      • connectivityInfo — (Array<map>)

        The connectivity information for the core device.

        • id — (String)

          An ID for the connectivity information.

        • hostAddress — (String)

          The IP address or DNS address where client devices can connect to an MQTT broker on the Greengrass core device.

        • portNumber — (Integer)

          The port where the MQTT broker operates on the core device. This port is typically 8883, which is the default port for the MQTT broker component that runs on core devices.

        • metadata — (String)

          Additional metadata to provide to client devices that connect to this core device.

      • message — (String)

        A message about the connectivity information request.

Returns:

  • (AWS.Request)

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

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

Retrieves metadata for a Greengrass core device.

Note: IoT Greengrass relies on individual devices to send status updates to the Amazon Web Services Cloud. If the IoT Greengrass Core software isn't running on the device, or if device isn't connected to the Amazon Web Services Cloud, then the reported status of that device might not reflect its current status. The status timestamp indicates when the device status was last updated. Core devices send status updates at the following times:
  • When the IoT Greengrass Core software starts
  • When the core device receives a deployment from the Amazon Web Services Cloud
  • When the status of any component on the core device becomes BROKEN
  • At a regular interval that you can configure, which defaults to 24 hours
  • For IoT Greengrass Core v2.7.0, the core device sends status updates upon local deployment and cloud deployment

Service Reference:

Examples:

Calling the getCoreDevice operation

var params = {
  coreDeviceThingName: 'STRING_VALUE' /* required */
};
greengrassv2.getCoreDevice(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: {})
    • coreDeviceThingName — (String)

      The name of the core device. This is also the name of the IoT 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:

      • coreDeviceThingName — (String)

        The name of the core device. This is also the name of the IoT thing.

      • coreVersion — (String)

        The version of the IoT Greengrass Core software that the core device runs. This version is equivalent to the version of the Greengrass nucleus component that runs on the core device. For more information, see the Greengrass nucleus component in the IoT Greengrass V2 Developer Guide.

      • platform — (String)

        The operating system platform that the core device runs.

      • architecture — (String)

        The computer architecture of the core device.

      • status — (String)

        The status of the core device. The core device status can be:

        • HEALTHY – The IoT Greengrass Core software and all components run on the core device without issue.

        • UNHEALTHY – The IoT Greengrass Core software or a component is in a failed state on the core device.

        Possible values include:
        • "HEALTHY"
        • "UNHEALTHY"
      • lastStatusUpdateTimestamp — (Date)

        The time at which the core device's status last updated, expressed in ISO 8601 format.

      • tags — (map<String>)

        A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources in the IoT Greengrass V2 Developer Guide.

Returns:

  • (AWS.Request)

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

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

Gets a deployment. Deployments define the components that run on Greengrass core devices.

Service Reference:

Examples:

Calling the getDeployment operation

var params = {
  deploymentId: 'STRING_VALUE' /* required */
};
greengrassv2.getDeployment(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: {})
    • deploymentId — (String)

      The ID of the deployment.

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:

      • targetArn — (String)

        The ARN of the target IoT thing or thing group.

      • revisionId — (String)

        The revision number of the deployment.

      • deploymentId — (String)

        The ID of the deployment.

      • deploymentName — (String)

        The name of the deployment.

      • deploymentStatus — (String)

        The status of the deployment.

        Possible values include:
        • "ACTIVE"
        • "COMPLETED"
        • "CANCELED"
        • "FAILED"
        • "INACTIVE"
      • iotJobId — (String)

        The ID of the IoT job that applies the deployment to target devices.

      • iotJobArn — (String)

        The ARN of the IoT job that applies the deployment to target devices.

      • components — (map<map>)

        The components to deploy. This is a dictionary, where each key is the name of a component, and each key's value is the version and configuration to deploy for that component.

        • componentVersionrequired — (String)

          The version of the component.

        • configurationUpdate — (map)

          The configuration updates to deploy for the component. You can define reset updates and merge updates. A reset updates the keys that you specify to the default configuration for the component. A merge updates the core device's component configuration with the keys and values that you specify. The IoT Greengrass Core software applies reset updates before it applies merge updates. For more information, see Update component configurations in the IoT Greengrass V2 Developer Guide.

          • merge — (String)

            A serialized JSON string that contains the configuration object to merge to target devices. The core device merges this configuration with the component's existing configuration. If this is the first time a component deploys on a device, the core device merges this configuration with the component's default configuration. This means that the core device keeps it's existing configuration for keys and values that you don't specify in this object. For more information, see Merge configuration updates in the IoT Greengrass V2 Developer Guide.

          • reset — (Array<String>)

            The list of configuration nodes to reset to default values on target devices. Use JSON pointers to specify each node to reset. JSON pointers start with a forward slash (/) and use forward slashes to separate the key for each level in the object. For more information, see the JSON pointer specification and Reset configuration updates in the IoT Greengrass V2 Developer Guide.

        • runWith — (map)

          The system user and group that the IoT Greengrass Core software uses to run component processes on the core device. If you omit this parameter, the IoT Greengrass Core software uses the system user and group that you configure for the core device. For more information, see Configure the user and group that run components in the IoT Greengrass V2 Developer Guide.

          • posixUser — (String)

            The POSIX system user and, optionally, group to use to run this component on Linux core devices. The user, and group if specified, must exist on each Linux core device. Specify the user and group separated by a colon (:) in the following format: user:group. The group is optional. If you don't specify a group, the IoT Greengrass Core software uses the primary user for the group.

            If you omit this parameter, the IoT Greengrass Core software uses the default system user and group that you configure on the Greengrass nucleus component. For more information, see Configure the user and group that run components.

          • systemResourceLimits — (map)

            The system resource limits to apply to this component's process on the core device. IoT Greengrass currently supports this feature on only Linux core devices.

            If you omit this parameter, the IoT Greengrass Core software uses the default system resource limits that you configure on the Greengrass nucleus component. For more information, see Configure system resource limits for components.

            • memory — (Integer)

              The maximum amount of RAM, expressed in kilobytes, that a component's processes can use on the core device.

            • cpus — (Float)

              The maximum amount of CPU time that a component's processes can use on the core device. A core device's total CPU time is equivalent to the device's number of CPU cores. For example, on a core device with 4 CPU cores, you can set this value to 2 to limit the component's processes to 50 percent usage of each CPU core. On a device with 1 CPU core, you can set this value to 0.25 to limit the component's processes to 25 percent usage of the CPU. If you set this value to a number greater than the number of CPU cores, the IoT Greengrass Core software doesn't limit the component's CPU usage.

          • windowsUser — (String)

            The Windows user to use to run this component on Windows core devices. The user must exist on each Windows core device, and its name and password must be in the LocalSystem account's Credentials Manager instance.

            If you omit this parameter, the IoT Greengrass Core software uses the default Windows user that you configure on the Greengrass nucleus component. For more information, see Configure the user and group that run components.

      • deploymentPolicies — (map)

        The deployment policies for the deployment. These policies define how the deployment updates components and handles failure.

        • failureHandlingPolicy — (String)

          The failure handling policy for the configuration deployment. This policy defines what to do if the deployment fails.

          Default: ROLLBACK

          Possible values include:
          • "ROLLBACK"
          • "DO_NOTHING"
        • componentUpdatePolicy — (map)

          The component update policy for the configuration deployment. This policy defines when it's safe to deploy the configuration to devices.

          • timeoutInSeconds — (Integer)

            The amount of time in seconds that each component on a device has to report that it's safe to update. If the component waits for longer than this timeout, then the deployment proceeds on the device.

            Default: 60

          • action — (String)

            Whether or not to notify components and wait for components to become safe to update. Choose from the following options:

            • NOTIFY_COMPONENTS – The deployment notifies each component before it stops and updates that component. Components can use the SubscribeToComponentUpdates IPC operation to receive these notifications. Then, components can respond with the DeferComponentUpdate IPC operation. For more information, see Create deployments in the IoT Greengrass V2 Developer Guide.

            • SKIP_NOTIFY_COMPONENTS – The deployment doesn't notify components or wait for them to be safe to update.

            Default: NOTIFY_COMPONENTS

            Possible values include:
            • "NOTIFY_COMPONENTS"
            • "SKIP_NOTIFY_COMPONENTS"
        • configurationValidationPolicy — (map)

          The configuration validation policy for the configuration deployment. This policy defines how long each component has to validate its configure updates.

          • timeoutInSeconds — (Integer)

            The amount of time in seconds that a component can validate its configuration updates. If the validation time exceeds this timeout, then the deployment proceeds for the device.

            Default: 30

      • iotJobConfiguration — (map)

        The job configuration for the deployment configuration. The job configuration specifies the rollout, timeout, and stop configurations for the deployment configuration.

        • jobExecutionsRolloutConfig — (map)

          The rollout configuration for the job. This configuration defines the rate at which the job rolls out to the fleet of target devices.

          • exponentialRate — (map)

            The exponential rate to increase the job rollout rate.

            • baseRatePerMinuterequired — (Integer)

              The minimum number of devices that receive a pending job notification, per minute, when the job starts. This parameter defines the initial rollout rate of the job.

            • incrementFactorrequired — (Float)

              The exponential factor to increase the rollout rate for the job.

              This parameter supports up to one digit after the decimal (for example, you can specify 1.5, but not 1.55).

            • rateIncreaseCriteriarequired — (map)

              The criteria to increase the rollout rate for the job.

              • numberOfNotifiedThings — (Integer)

                The number of devices to receive the job notification before the rollout rate increases.

              • numberOfSucceededThings — (Integer)

                The number of devices to successfully run the configuration job before the rollout rate increases.

          • maximumPerMinute — (Integer)

            The maximum number of devices that receive a pending job notification, per minute.

        • abortConfig — (map)

          The stop configuration for the job. This configuration defines when and how to stop a job rollout.

          • criteriaListrequired — (Array<map>)

            The list of criteria that define when and how to cancel the configuration deployment.

            • failureTyperequired — (String)

              The type of job deployment failure that can cancel a job.

              Possible values include:
              • "FAILED"
              • "REJECTED"
              • "TIMED_OUT"
              • "ALL"
            • actionrequired — (String)

              The action to perform when the criteria are met.

              Possible values include:
              • "CANCEL"
            • thresholdPercentagerequired — (Float)

              The minimum percentage of failureType failures that occur before the job can cancel.

              This parameter supports up to two digits after the decimal (for example, you can specify 10.9 or 10.99, but not 10.999).

            • minNumberOfExecutedThingsrequired — (Integer)

              The minimum number of things that receive the configuration before the job can cancel.

        • timeoutConfig — (map)

          The timeout configuration for the job. This configuration defines the amount of time each device has to complete the job.

          • inProgressTimeoutInMinutes — (Integer)

            The amount of time, in minutes, that devices have to complete the job. The timer starts when the job status is set to IN_PROGRESS. If the job status doesn't change to a terminal state before the time expires, then the job status is set to TIMED_OUT.

            The timeout interval must be between 1 minute and 7 days (10080 minutes).

      • creationTimestamp — (Date)

        The time at which the deployment was created, expressed in ISO 8601 format.

      • isLatestForTarget — (Boolean)

        Whether or not the deployment is the latest revision for its target.

      • parentTargetArn — (String)

        The parent deployment's target ARN within a subdeployment.

      • tags — (map<String>)

        A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources in the IoT Greengrass V2 Developer Guide.

Returns:

  • (AWS.Request)

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

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

Gets the service role associated with IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region. IoT Greengrass uses this role to verify the identity of client devices and manage core device connectivity information. For more information, see Greengrass service role in the IoT Greengrass Version 2 Developer Guide.

Service Reference:

Examples:

Calling the getServiceRoleForAccount operation

var params = {
};
greengrassv2.getServiceRoleForAccount(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:

      • associatedAt — (String)

        The time when the service role was associated with IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region.

      • roleArn — (String)

        The ARN of the service role that is associated with IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region.

Returns:

  • (AWS.Request)

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

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

Retrieves a paginated list of client devices that are associated with a core device.

Examples:

Calling the listClientDevicesAssociatedWithCoreDevice operation

var params = {
  coreDeviceThingName: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
greengrassv2.listClientDevicesAssociatedWithCoreDevice(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: {})
    • coreDeviceThingName — (String)

      The name of the core device. This is also the name of the IoT thing.

    • maxResults — (Integer)

      The maximum number of results to be returned per paginated request.

    • nextToken — (String)

      The token to be used for the next set of paginated 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:

      • associatedClientDevices — (Array<map>)

        A list that describes the client devices that are associated with the core device.

        • thingName — (String)

          The name of the IoT thing that represents the associated client device.

        • associationTimestamp — (Date)

          The time that the client device was associated, expressed in ISO 8601 format.

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

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

Retrieves a paginated list of component summaries. This list includes components that you have permission to view.

Service Reference:

Examples:

Calling the listComponents operation

var params = {
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE',
  scope: PRIVATE | PUBLIC
};
greengrassv2.listComponents(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: {})
    • scope — (String)

      The scope of the components to list.

      Default: PRIVATE

      Possible values include:
      • "PRIVATE"
      • "PUBLIC"
    • maxResults — (Integer)

      The maximum number of results to be returned per paginated request.

    • nextToken — (String)

      The token to be used for the next set of paginated 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:

      • components — (Array<map>)

        A list that summarizes each component.

        • arn — (String)

          The ARN of the component version.

        • componentName — (String)

          The name of the component.

        • latestVersion — (map)

          The latest version of the component and its details.

          • arn — (String)

            The ARN of the component version.

          • componentVersion — (String)

            The version of the component.

          • creationTimestamp — (Date)

            The time at which the component was created, expressed in ISO 8601 format.

          • description — (String)

            The description of the component version.

          • publisher — (String)

            The publisher of the component version.

          • platforms — (Array<map>)

            The platforms that the component version supports.

            • name — (String)

              The friendly name of the platform. This name helps you identify the platform.

              If you omit this parameter, IoT Greengrass creates a friendly name from the os and architecture of the platform.

            • attributes — (map<String>)

              A dictionary of attributes for the platform. The IoT Greengrass Core software defines the os and architecture by default. You can specify additional platform attributes for a core device when you deploy the Greengrass nucleus component. For more information, see the Greengrass nucleus component in the IoT Greengrass V2 Developer Guide.

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

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

Retrieves a paginated list of all versions for a component. Greater versions are listed first.

Service Reference:

Examples:

Calling the listComponentVersions operation

var params = {
  arn: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
greengrassv2.listComponentVersions(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: {})
    • arn — (String)

      The ARN of the component.

    • maxResults — (Integer)

      The maximum number of results to be returned per paginated request.

    • nextToken — (String)

      The token to be used for the next set of paginated 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:

      • componentVersions — (Array<map>)

        A list of versions that exist for the component.

        • componentName — (String)

          The name of the component.

        • componentVersion — (String)

          The version of the component.

        • arn — (String)

          The ARN of the component version.

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

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

Retrieves a paginated list of Greengrass core devices.

Note: IoT Greengrass relies on individual devices to send status updates to the Amazon Web Services Cloud. If the IoT Greengrass Core software isn't running on the device, or if device isn't connected to the Amazon Web Services Cloud, then the reported status of that device might not reflect its current status. The status timestamp indicates when the device status was last updated. Core devices send status updates at the following times:
  • When the IoT Greengrass Core software starts
  • When the core device receives a deployment from the Amazon Web Services Cloud
  • When the status of any component on the core device becomes BROKEN
  • At a regular interval that you can configure, which defaults to 24 hours
  • For IoT Greengrass Core v2.7.0, the core device sends status updates upon local deployment and cloud deployment

Service Reference:

Examples:

Calling the listCoreDevices operation

var params = {
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE',
  status: HEALTHY | UNHEALTHY,
  thingGroupArn: 'STRING_VALUE'
};
greengrassv2.listCoreDevices(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: {})
    • thingGroupArn — (String)

      The ARN of the IoT thing group by which to filter. If you specify this parameter, the list includes only core devices that have successfully deployed a deployment that targets the thing group. When you remove a core device from a thing group, the list continues to include that core device.

    • status — (String)

      The core device status by which to filter. If you specify this parameter, the list includes only core devices that have this status. Choose one of the following options:

      • HEALTHY – The IoT Greengrass Core software and all components run on the core device without issue.

      • UNHEALTHY – The IoT Greengrass Core software or a component is in a failed state on the core device.

      Possible values include:
      • "HEALTHY"
      • "UNHEALTHY"
    • maxResults — (Integer)

      The maximum number of results to be returned per paginated request.

    • nextToken — (String)

      The token to be used for the next set of paginated 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:

      • coreDevices — (Array<map>)

        A list that summarizes each core device.

        • coreDeviceThingName — (String)

          The name of the core device. This is also the name of the IoT thing.

        • status — (String)

          The status of the core device. Core devices can have the following statuses:

          • HEALTHY – The IoT Greengrass Core software and all components run on the core device without issue.

          • UNHEALTHY – The IoT Greengrass Core software or a component is in a failed state on the core device.

          Possible values include:
          • "HEALTHY"
          • "UNHEALTHY"
        • lastStatusUpdateTimestamp — (Date)

          The time at which the core device's status last updated, expressed in ISO 8601 format.

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

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

Retrieves a paginated list of deployments.

Service Reference:

Examples:

Calling the listDeployments operation

var params = {
  historyFilter: ALL | LATEST_ONLY,
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE',
  parentTargetArn: 'STRING_VALUE',
  targetArn: 'STRING_VALUE'
};
greengrassv2.listDeployments(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: {})
    • targetArn — (String)

      The ARN of the target IoT thing or thing group.

    • historyFilter — (String)

      The filter for the list of deployments. Choose one of the following options:

      • ALL – The list includes all deployments.

      • LATEST_ONLY – The list includes only the latest revision of each deployment.

      Default: LATEST_ONLY

      Possible values include:
      • "ALL"
      • "LATEST_ONLY"
    • parentTargetArn — (String)

      The parent deployment's target ARN within a subdeployment.

    • maxResults — (Integer)

      The maximum number of results to be returned per paginated request.

      Default: 50

    • nextToken — (String)

      The token to be used for the next set of paginated 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:

      • deployments — (Array<map>)

        A list that summarizes each deployment.

        • targetArn — (String)

          The ARN of the target IoT thing or thing group. When creating a subdeployment, the targetARN can only be a thing group.

        • revisionId — (String)

          The revision number of the deployment.

        • deploymentId — (String)

          The ID of the deployment.

        • deploymentName — (String)

          The name of the deployment.

        • creationTimestamp — (Date)

          The time at which the deployment was created, expressed in ISO 8601 format.

        • deploymentStatus — (String)

          The status of the deployment.

          Possible values include:
          • "ACTIVE"
          • "COMPLETED"
          • "CANCELED"
          • "FAILED"
          • "INACTIVE"
        • isLatestForTarget — (Boolean)

          Whether or not the deployment is the latest revision for its target.

        • parentTargetArn — (String)

          The parent deployment's target ARN within a subdeployment.

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

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

Retrieves a paginated list of deployment jobs that IoT Greengrass sends to Greengrass core devices.

Service Reference:

Examples:

Calling the listEffectiveDeployments operation

var params = {
  coreDeviceThingName: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
greengrassv2.listEffectiveDeployments(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: {})
    • coreDeviceThingName — (String)

      The name of the core device. This is also the name of the IoT thing.

    • maxResults — (Integer)

      The maximum number of results to be returned per paginated request.

    • nextToken — (String)

      The token to be used for the next set of paginated 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:

      • effectiveDeployments — (Array<map>)

        A list that summarizes each deployment on the core device.

        • deploymentIdrequired — (String)

          The ID of the deployment.

        • deploymentNamerequired — (String)

          The name of the deployment.

        • iotJobId — (String)

          The ID of the IoT job that applies the deployment to target devices.

        • iotJobArn — (String)

          The ARN of the IoT job that applies the deployment to target devices.

        • description — (String)

          The description of the deployment job.

        • targetArnrequired — (String)

          The ARN of the target IoT thing or thing group.

        • coreDeviceExecutionStatusrequired — (String)

          The status of the deployment job on the Greengrass core device.

          • IN_PROGRESS – The deployment job is running.

          • QUEUED – The deployment job is in the job queue and waiting to run.

          • FAILED – The deployment failed. For more information, see the statusDetails field.

          • COMPLETED – The deployment to an IoT thing was completed successfully.

          • TIMED_OUT – The deployment didn't complete in the allotted time.

          • CANCELED – The deployment was canceled by the user.

          • REJECTED – The deployment was rejected. For more information, see the statusDetails field.

          • SUCCEEDED – The deployment to an IoT thing group was completed successfully.

          Possible values include:
          • "IN_PROGRESS"
          • "QUEUED"
          • "FAILED"
          • "COMPLETED"
          • "TIMED_OUT"
          • "CANCELED"
          • "REJECTED"
          • "SUCCEEDED"
        • reason — (String)

          The reason code for the update, if the job was updated.

        • creationTimestamprequired — (Date)

          The time at which the deployment was created, expressed in ISO 8601 format.

        • modifiedTimestamprequired — (Date)

          The time at which the deployment job was last modified, expressed in ISO 8601 format.

        • statusDetails — (map)

          The status details that explain why a deployment has an error. This response will be null if the deployment is in a success state.

          • errorStack — (Array<String>)

            Contains an ordered list of short error codes that range from the most generic error to the most specific one. The error codes describe the reason for failure whenever the coreDeviceExecutionStatus is in a failed state. The response will be an empty list if there is no error.

          • errorTypes — (Array<String>)

            Contains tags which describe the error. You can use the error types to classify errors to assist with remediating the failure. The response will be an empty list if there is no error.

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

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

Retrieves a paginated list of the components that a Greengrass core device runs. By default, this list doesn't include components that are deployed as dependencies of other components. To include dependencies in the response, set the topologyFilter parameter to ALL.

Note: IoT Greengrass relies on individual devices to send status updates to the Amazon Web Services Cloud. If the IoT Greengrass Core software isn't running on the device, or if device isn't connected to the Amazon Web Services Cloud, then the reported status of that device might not reflect its current status. The status timestamp indicates when the device status was last updated. Core devices send status updates at the following times:
  • When the IoT Greengrass Core software starts
  • When the core device receives a deployment from the Amazon Web Services Cloud
  • When the status of any component on the core device becomes BROKEN
  • At a regular interval that you can configure, which defaults to 24 hours
  • For IoT Greengrass Core v2.7.0, the core device sends status updates upon local deployment and cloud deployment

Service Reference:

Examples:

Calling the listInstalledComponents operation

var params = {
  coreDeviceThingName: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE',
  topologyFilter: ALL | ROOT
};
greengrassv2.listInstalledComponents(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: {})
    • coreDeviceThingName — (String)

      The name of the core device. This is also the name of the IoT thing.

    • maxResults — (Integer)

      The maximum number of results to be returned per paginated request.

    • nextToken — (String)

      The token to be used for the next set of paginated results.

    • topologyFilter — (String)

      The filter for the list of components. Choose from the following options:

      • ALL – The list includes all components installed on the core device.

      • ROOT – The list includes only root components, which are components that you specify in a deployment. When you choose this option, the list doesn't include components that the core device installs as dependencies of other components.

      Default: ROOT

      Possible values include:
      • "ALL"
      • "ROOT"

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:

      • installedComponents — (Array<map>)

        A list that summarizes each component on the core device.

        Note: Greengrass nucleus v2.7.0 or later is required to get an accurate lastStatusChangeTimestamp response. This response can be inaccurate in earlier Greengrass nucleus versions.
        Note: Greengrass nucleus v2.8.0 or later is required to get an accurate lastInstallationSource and lastReportedTimestamp response. This response can be inaccurate or null in earlier Greengrass nucleus versions.
        • componentName — (String)

          The name of the component.

        • componentVersion — (String)

          The version of the component.

        • lifecycleState — (String)

          The lifecycle state of the component.

          Possible values include:
          • "NEW"
          • "INSTALLED"
          • "STARTING"
          • "RUNNING"
          • "STOPPING"
          • "ERRORED"
          • "BROKEN"
          • "FINISHED"
        • lifecycleStateDetails — (String)

          A detailed response about the lifecycle state of the component that explains the reason why a component has an error or is broken.

        • isRoot — (Boolean)

          Whether or not the component is a root component.

        • lastStatusChangeTimestamp — (Date)

          The status of how current the data is.

          This response is based off of component state changes. The status reflects component disruptions and deployments. If a component only sees a configuration update during a deployment, it might not undergo a state change and this status would not be updated.

        • lastReportedTimestamp — (Date)

          The last time the Greengrass core device sent a message containing a component's state to the Amazon Web Services Cloud.

          A component does not need to see a state change for this field to update.

        • lastInstallationSource — (String)

          The most recent deployment source that brought the component to the Greengrass core device. For a thing group deployment or thing deployment, the source will be the ID of the last deployment that contained the component. For local deployments it will be LOCAL.

          Note: Any deployment will attempt to reinstall currently broken components on the device, which will update the last installation source.
        • lifecycleStatusCodes — (Array<String>)

          The status codes that indicate the reason for failure whenever the lifecycleState has an error or is in a broken state.

          Note: Greengrass nucleus v2.8.0 or later is required to get an accurate lifecycleStatusCodes response. This response can be inaccurate in earlier Greengrass nucleus versions.
      • 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.

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

Retrieves the list of tags for an IoT Greengrass resource.

Service Reference:

Examples:

Calling the listTagsForResource operation

var params = {
  resourceArn: 'STRING_VALUE' /* required */
};
greengrassv2.listTagsForResource(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: {})
    • resourceArn — (String)

      The ARN of the resource.

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:

      • tags — (map<String>)

        A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources in the IoT Greengrass V2 Developer Guide.

Returns:

  • (AWS.Request)

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

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

Retrieves a list of components that meet the component, version, and platform requirements of a deployment. Greengrass core devices call this operation when they receive a deployment to identify the components to install.

This operation identifies components that meet all dependency requirements for a deployment. If the requirements conflict, then this operation returns an error and the deployment fails. For example, this occurs if component A requires version >2.0.0 and component B requires version <2.0.0 of a component dependency.

When you specify the component candidates to resolve, IoT Greengrass compares each component's digest from the core device with the component's digest in the Amazon Web Services Cloud. If the digests don't match, then IoT Greengrass specifies to use the version from the Amazon Web Services Cloud.

To use this operation, you must use the data plane API endpoint and authenticate with an IoT device certificate. For more information, see IoT Greengrass endpoints and quotas.

Service Reference:

Examples:

Calling the resolveComponentCandidates operation

var params = {
  componentCandidates: [
    {
      componentName: 'STRING_VALUE',
      componentVersion: 'STRING_VALUE',
      versionRequirements: {
        '<NonEmptyString>': 'STRING_VALUE',
        /* '<NonEmptyString>': ... */
      }
    },
    /* more items */
  ],
  platform: {
    attributes: {
      '<NonEmptyString>': 'STRING_VALUE',
      /* '<NonEmptyString>': ... */
    },
    name: 'STRING_VALUE'
  }
};
greengrassv2.resolveComponentCandidates(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: {})
    • platform — (map)

      The platform to use to resolve compatible components.

      • name — (String)

        The friendly name of the platform. This name helps you identify the platform.

        If you omit this parameter, IoT Greengrass creates a friendly name from the os and architecture of the platform.

      • attributes — (map<String>)

        A dictionary of attributes for the platform. The IoT Greengrass Core software defines the os and architecture by default. You can specify additional platform attributes for a core device when you deploy the Greengrass nucleus component. For more information, see the Greengrass nucleus component in the IoT Greengrass V2 Developer Guide.

    • componentCandidates — (Array<map>)

      The list of components to resolve.

      • componentName — (String)

        The name of the component.

      • componentVersion — (String)

        The version of the component.

      • versionRequirements — (map<String>)

        The version requirements for the component's dependencies. Greengrass core devices get the version requirements from component recipes.

        IoT Greengrass V2 uses semantic version constraints. For more information, see Semantic Versioning.

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:

      • resolvedComponentVersions — (Array<map>)

        A list of components that meet the requirements that you specify in the request. This list includes each component's recipe that you can use to install the component.

        • arn — (String)

          The ARN of the component version.

        • componentName — (String)

          The name of the component.

        • componentVersion — (String)

          The version of the component.

        • recipe — (Buffer, Typed Array, Blob, String)

          The recipe of the component version.

        • vendorGuidance — (String)

          The vendor guidance state for the component version. This state indicates whether the component version has any issues that you should consider before you deploy it. The vendor guidance state can be:

          • ACTIVE – This component version is available and recommended for use.

          • DISCONTINUED – This component version has been discontinued by its publisher. You can deploy this component version, but we recommend that you use a different version of this component.

          • DELETED – This component version has been deleted by its publisher, so you can't deploy it. If you have any existing deployments that specify this component version, those deployments will fail.

          Possible values include:
          • "ACTIVE"
          • "DISCONTINUED"
          • "DELETED"
        • message — (String)

          A message that communicates details about the vendor guidance state of the component version. This message communicates why a component version is discontinued or deleted.

Returns:

  • (AWS.Request)

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

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

Adds tags to an IoT Greengrass resource. If a tag already exists for the resource, this operation updates the tag's value.

Service Reference:

Examples:

Calling the tagResource operation

var params = {
  resourceArn: 'STRING_VALUE', /* required */
  tags: { /* required */
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
greengrassv2.tagResource(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: {})
    • resourceArn — (String)

      The ARN of the resource to tag.

    • tags — (map<String>)

      A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources in the IoT Greengrass V2 Developer Guide.

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.

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

Removes a tag from an IoT Greengrass resource.

Service Reference:

Examples:

Calling the untagResource operation

var params = {
  resourceArn: 'STRING_VALUE', /* required */
  tagKeys: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
greengrassv2.untagResource(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: {})
    • resourceArn — (String)

      The ARN of the resource to untag.

    • tagKeys — (Array<String>)

      A list of keys for tags to remove from the resource.

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.

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

Updates connectivity information for a Greengrass core device.

Connectivity information includes endpoints and ports where client devices can connect to an MQTT broker on the core device. When a client device calls the IoT Greengrass discovery API, IoT Greengrass returns connectivity information for all of the core devices where the client device can connect. For more information, see Connect client devices to core devices in the IoT Greengrass Version 2 Developer Guide.

Service Reference:

Examples:

Calling the updateConnectivityInfo operation

var params = {
  connectivityInfo: [ /* required */
    {
      hostAddress: 'STRING_VALUE',
      id: 'STRING_VALUE',
      metadata: 'STRING_VALUE',
      portNumber: 'NUMBER_VALUE'
    },
    /* more items */
  ],
  thingName: 'STRING_VALUE' /* required */
};
greengrassv2.updateConnectivityInfo(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 core device. This is also the name of the IoT thing.

    • connectivityInfo — (Array<map>)

      The connectivity information for the core device.

      • id — (String)

        An ID for the connectivity information.

      • hostAddress — (String)

        The IP address or DNS address where client devices can connect to an MQTT broker on the Greengrass core device.

      • portNumber — (Integer)

        The port where the MQTT broker operates on the core device. This port is typically 8883, which is the default port for the MQTT broker component that runs on core devices.

      • metadata — (String)

        Additional metadata to provide to client devices that connect to this core device.

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:

      • version — (String)

        The new version of the connectivity information for the core device.

      • message — (String)

        A message about the connectivity information update request.

Returns:

  • (AWS.Request)

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