Class: AWSCDK::Greengrass::CfnSubscriptionDefinition::SubscriptionProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Greengrass::CfnSubscriptionDefinition::SubscriptionProperty
- 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
-
#id ⇒ String
readonly
A descriptive or arbitrary ID for the subscription.
-
#source ⇒ String
readonly
The originator of the message.
-
#subject ⇒ String
readonly
The MQTT topic used to route the message.
-
#target ⇒ String
readonly
The destination of the message.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, source:, subject:, target:) ⇒ SubscriptionProperty
constructor
A new instance of SubscriptionProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(id:, source:, subject:, target:) ⇒ SubscriptionProperty
Returns a new instance of SubscriptionProperty.
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
#id ⇒ String (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 |
#source ⇒ String (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 |
#subject ⇒ String (readonly)
The MQTT topic used to route the message.
674 675 676 |
# File 'greengrass/cfn_subscription_definition.rb', line 674 def subject @subject end |
#target ⇒ String (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_properties ⇒ Object
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_jsii ⇒ Object
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 |