Giter Site home page Giter Site logo

terraform-provider-dmsnitch's Introduction

Requirements

  • Terraform 0.13.x or higher
  • Go 1.11 or higher
  • Go module support

Setting up the provider

$ go get -u github.com/repaygithub/terraform-provider-dmsnitch
$ mkdir -p ~/.terraform.d/plugins
$ mv ${GOPATH}/bin/terraform-provider-dmsnitch ~/.terraform.d/plugins

Usage

First create an API token in the Dead Man's Snitch dashboard. Note: Use of the DMS API requires a paid plan.

Copy this key and configure the DMS provider:

provider "dmsnitch" {
  api_key = "${var.dms_key}"
}

Optionally, this can be configured using the envvar DMS_TOKEN to avoid storing the token in plaintext config.

Then you can create and manage your DMS snitches like so:

resource "dmsnitch_snitch" "mysnitch" {
  name = "My Important Service"
  notes = "Description or other notes about this snitch."
  
  interval = "daily" 
  type = "basic"
  alert_email = ["[email protected]", "[email protected]"]
  tags = ["one", "two"]
}

You then might use this resource to perform database backup event check-ins with another provider, such as AWS RDS events.

resource "aws_sns_topic" "backup_event" {
  name = "db-backup-events"
}

resource "aws_db_event_subscription" "backup_event" {
  name      = "db-backup-events"
  sns_topic = "${aws_sns_topic.sbackup_event.arn}"

  source_type = "db-instance"
  source_ids  = ["${aws_db_instance.db.id}"]

  event_categories = [
    "backup",
  ]
}

resource "aws_sns_topic_subscription" "backup_event" {
  endpoint               = "${dmsnitch_snitch.mysnitch.url}"
  protocol               = "https"
  endpoint_auto_confirms = true
  topic_arn              = "${aws_sns_topic.backup_event.arn}"
}

You can also import existing snitches using their token found in the snitch's page URL:

terraform import dmsnitch_snitch.mysnitch 5b025eecf3

Fields

Field Required Values Defaults
name yes
notes no Managed by Terraform
interval yes 15_minute, 30_minute, hourly, daily, weekly, monthly daily
type yes; smart is only valid for weekly or monthly intervals basic, smart basic
alert_email no an array of values
tags no an array of values

Attributes

Attribute Description
token, id The unique snitch ID.
url The snitch checkin URL (for performing the check-in ping).
status Health status for the snitch.

For additional details about these fields and their purposes, see the API documentation.

Acknowledgements

This codebase is based heavily off of the Bitbucket Provider codebase.

terraform-provider-dmsnitch's People

Contributors

omnibs avatar plukevdh avatar richarddouglasfrye avatar

Watchers

 avatar

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.