Class: AWSCDK::Greengrass::CfnSubscriptionDefinition::SubscriptionProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
greengrass/cfn_subscription_definition.rb

Overview

Subscriptions define how MQTT messages can be exchanged between devices, functions, and connectors in the group, and with AWS IoT or the local shadow service.

A subscription defines a message source, message target, and a topic (or subject) that's used to route messages from the source to the target. A subscription defines the message flow in one direction, from the source to the target. For two-way communication, you must set up two subscriptions, one for each direction.

In an CloudFormation template, the Subscriptions property of the SubscriptionDefinitionVersion property type contains a list of Subscription property types.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, source:, subject:, target:) ⇒ SubscriptionProperty

Returns a new instance of SubscriptionProperty.

Parameters:

  • id (String)

    A descriptive or arbitrary ID for the subscription.

  • source (String)

    The originator of the message.

  • subject (String)

    The MQTT topic used to route the message.

  • target (String)

    The destination of the message.



645
646
647
648
649
650
651
652
653
654
# File 'greengrass/cfn_subscription_definition.rb', line 645

def initialize(id:, source:, subject:, target:)
  @id = id
  Jsii::Type.check_type(@id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  @source = source
  Jsii::Type.check_type(@source, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "source")
  @subject = subject
  Jsii::Type.check_type(@subject, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "subject")
  @target = target
  Jsii::Type.check_type(@target, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "target")
end

Instance Attribute Details

#idString (readonly)

A descriptive or arbitrary ID for the subscription.

This value must be unique within the subscription definition version. Maximum length is 128 characters with pattern [a-zA-Z0-9:_-]+ .



662
663
664
# File 'greengrass/cfn_subscription_definition.rb', line 662

def id
  @id
end

#sourceString (readonly)

The originator of the message.

The value can be a thing ARN, the ARN of a Lambda function alias (recommended) or version, a connector ARN, cloud (which represents the AWS IoT cloud), or GGShadowService .



669
670
671
# File 'greengrass/cfn_subscription_definition.rb', line 669

def source
  @source
end

#subjectString (readonly)

The MQTT topic used to route the message.



674
675
676
# File 'greengrass/cfn_subscription_definition.rb', line 674

def subject
  @subject
end

#targetString (readonly)

The destination of the message.

The value can be a thing ARN, the ARN of a Lambda function alias (recommended) or version, a connector ARN, cloud (which represents the AWS IoT cloud), or GGShadowService .



681
682
683
# File 'greengrass/cfn_subscription_definition.rb', line 681

def target
  @target
end

Class Method Details

.jsii_propertiesObject



683
684
685
686
687
688
689
690
# File 'greengrass/cfn_subscription_definition.rb', line 683

def self.jsii_properties
  {
    :id => "id",
    :source => "source",
    :subject => "subject",
    :target => "target",
  }
end

Instance Method Details

#to_jsiiObject



692
693
694
695
696
697
698
699
700
701
# File 'greengrass/cfn_subscription_definition.rb', line 692

def to_jsii
  result = {}
  result.merge!({
    "id" => @id,
    "source" => @source,
    "subject" => @subject,
    "target" => @target,
  })
  result.compact
end