[ aws . greengrass ]

create-subscription-definition-version

Description

Creates a version of a subscription definition which has already been defined.

See also: AWS API Documentation

See ‘aws help’ for descriptions of global parameters.

Synopsis

  create-subscription-definition-version
[--amzn-client-token <value>]
--subscription-definition-id <value>
[--subscriptions <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]

Options

--amzn-client-token (string) A client token used to correlate requests and responses.

--subscription-definition-id (string) The ID of the subscription definition.

--subscriptions (list) A list of subscriptions.(structure)

Information about a subscription.

Id -> (string)

A descriptive or arbitrary ID for the subscription. This value must be unique within the subscription definition version. Max length is 128 characters with pattern ‘’[a-zA-Z0-9:_-]+’’.

Source -> (string)

The source of the subscription. Can be a thing ARN, a Lambda function ARN, a connector ARN, ‘cloud’ (which represents the AWS IoT cloud), or ‘GGShadowService’.

Subject -> (string)

The MQTT topic used to route the message.

Target -> (string)

Where the message is sent to. Can be a thing ARN, a Lambda function ARN, a connector ARN, ‘cloud’ (which represents the AWS IoT cloud), or ‘GGShadowService’.

Shorthand Syntax:

Id=string,Source=string,Subject=string,Target=string ...

JSON Syntax:

[
  {
    "Id": "string",
    "Source": "string",
    "Subject": "string",
    "Target": "string"
  }
  ...
]

--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See ‘aws help’ for descriptions of global parameters.

Examples

Note

To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.

Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal’s quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .

To create a new version of a subscription definition

The following create-subscription-definition-version example creates a new version of a subscription definition that contains three subscriptions: a trigger notification, a temperature input, and an output status.

aws greengrass create-subscription-definition-version \
    --subscription-definition-id "9d611d57-5d5d-44bd-a3b4-feccbdd69112" \
    --subscriptions "[{\"Id\": \"TriggerNotification\", \"Source\": \"arn:aws:lambda:us-west-2:123456789012:function:TempMonitor:GG_TempMonitor\", \"Subject\": \"twilio/txt\", \"Target\": \"arn:aws:greengrass:us-west-2::/connectors/TwilioNotifications/versions/1\"},{\"Id\": \"TemperatureInput\", \"Source\": \"cloud\", \"Subject\": \"temperature/input\", \"Target\": \"arn:aws:lambda:us-west-2:123456789012:function:TempMonitor:GG_TempMonitor\"},{\"Id\": \"OutputStatus\", \"Source\": \"arn:aws:greengrass:us-west-2::/connectors/TwilioNotifications/versions/1\", \"Subject\": \"twilio/message/status\", \"Target\": \"cloud\"}]"

Output:

{
    "Arn": "arn:aws:greengrass:us-west-2:123456789012:/greengrass/definition/subscriptions/9d611d57-5d5d-44bd-a3b4-feccbdd69112/versions/7b65dfae-50b6-4d0f-b3e0-27728bfb0620",
    "CreationTimestamp": "2019-06-24T21:21:33.837Z",
    "Id": "9d611d57-5d5d-44bd-a3b4-feccbdd69112",
    "Version": "7b65dfae-50b6-4d0f-b3e0-27728bfb0620"
}

Output

Arn -> (string)

The ARN of the version.

CreationTimestamp -> (string)

The time, in milliseconds since the epoch, when the version was created.

Id -> (string)

The ID of the parent definition that the version is associated with.

Version -> (string)

The ID of the version.