Git Product home page Git Product logo

terraform-aws-iot-topic-rule's Introduction

terraform-aws-iot-topic-rule

This module is used to create a aws iot rule with actions. It dynamically creates IAM permissions required by the action

Note: Not all actions/errors are supported by [Terraform] (https://www.terraform.io/docs/providers/aws/r/iot_topic_rule.html) when this was written.

Supported Actions

  • cloudwatch_alarm
  • cloudwatch_metric
  • dynamodb
  • elasticsearch
  • firehose
  • kinesis
  • lambda
  • republish
  • s3
  • sns
  • cloudwatch_logs (Only IAM and Log groups are created, Action is not yet supported)

Usage

  • Notifying SNSInvoking Lambda, CW alarm actions
module "iot_rule" {
  name        = "iotTestRule"
  description = "Rule created by TF module"
  sql_query   = "select * from \"mytopic/test\""
  source      = "Quinovas/terraform-aws-iot-topic-rule/aws"

  sns = [
    {
      message_format = "RAW"
      target_arn     = "arn:aws:sns:us-east-1:111222333444:sns-topic"
    }
  ]

  lambda = ["my-function-1", "my-function-2"]

  cloudwatch_alarm = [
    {
      alarm_name   = "iot-alarm"
      state_reason = "iotRule1"
      state_value  = "OK"
    }
   ]
}
  • Inserting message data to Dynamodb table, Cloudwatch and writing Errors to Cloudwatch
module "iot_rule" {
  name        = "iotTestRule"
  description = "Rule created by TF module"
  sql_query   = "select * from \"mytopic/test\""
  source      = "Quinovas/terraform-aws-iot-topic-rule/aws"

  message_data_logs = true
  error_logs        = true

  dynamodb = [{
    hash_key_field  = "message"
    hash_key_type   = null
    hash_key_value  = "$message"
    payload_field   = "Payload"
    range_key_field = null
    range_key_type  = null
    range_key_value = null
    table_name      = "test-iot"
  }]
}

Authors

Module is maintained by QuiNovas

License

Apache License, Version 2.0, January 2004 (http://www.apache.org/licenses/). See LICENSE for full details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.