v0.5.8 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2019 License: BSD-3-Clause Imports: 8 Imported by: 0


title: AWS IoT weight: 4605


This activity allows you to update a device shadow on AWS.


Flogo Web

This activity comes out of the box with the Flogo Web UI

Flogo CLI

flogo add activity


Inputs and Outputs:

      "name": "thingName",
      "type": "string",
      "required": true
      "name": "awsEndpoint",
      "type": "string",
      "required": true
      "name": "desired",
      "type": "params"
      "name": "reported",
      "type": "params"


Setting Required Description
thingName True The name of the "thing" in Aws IoT
awsEndpoint True The Aws Iot Endpoint for the account
desired False The desired state to update
reported False The reported state to update


Certificate Installation

The activity looks for the AWS device certificates in a "things" directory relative to where the engine was started. Download the root CA certificate file and save it as "things/root-CA.pem.crt". Now place the cert and private key generated by Aws IoT for your thing under "things/[thingName]" as device.pem.crt and device.pem.key respectively.

Flow Configuration

Configure a task in flow to update the device shadow of 'raspberry-pi' with a reported temp of "50".

  "id": "awsiot_1",
  "name": "Update AWS Device Shadow",
  "description": "Simple AWS IoT",
  "activity": {
    "ref": "",
    "input": {
      "thingName": "raspberry-pi",
      "awsEndpoint": "",
      "reported": { "temp":"50" }




This section is empty.


This section is empty.


func NewActivity

func NewActivity(metadata *activity.Metadata) activity.Activity

NewActivity creates a new AwsIoT activity

func NewTLSConfig

func NewTLSConfig(thingName string) *tls.Config

NewTLSConfig creates a TLS configuration for the specified 'thing'

func Publish

func Publish(client MQTT.Client, topic string, qos int, input string) error

Publish publishes a client message


type AwsIoT

type AwsIoT struct {
	// contains filtered or unexported fields

AwsIoT is an Activity that is used to update an Aws IoT device shadow inputs : {method,uri,params} outputs: {result}

func (*AwsIoT) Eval

func (a *AwsIoT) Eval(context activity.Context) (done bool, err error)

Eval implements api.Activity.Eval - Invokes a Aws Iot Shadow Update

func (*AwsIoT) Metadata

func (a *AwsIoT) Metadata() *activity.Metadata

Metadata returns the activity's metadata

type ShadowRequest

type ShadowRequest struct {
	State *ShadowState `json:"state"`

ShadowRequest is a simple structure representing a Aws Shadow Update Request

type ShadowState

type ShadowState struct {
	Desired  map[string]string `json:"desired,omitempty"`
	Reported map[string]string `json:"reported,omitempty"`

ShadowState is the state to be updated

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL