GithubHelp home page GithubHelp logo

terraform-provider-dmsnitch's Introduction

Terraform Dead Man's Snitch Provider

Now available via the Terraform Registry!

Note on Compatability

This branch is meant to work against the latest version of Terraform. For previous versions, see below

  • 0.0.x: Terraform 0.11 and earlier
  • 0.1.x: Terraform 0.12+

Requirements

  • Terraform 0.12.x or higher
  • Go 1.18 or higher
  • Go module support

Please note the following details if you have built this plugin prior to Terraform 0.12.

Setting up the provider

$ go get -u github.com/plukevdh/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"
  tags = ["one", "two"]
  alert_email = ["[email protected]", "[email protected]"]
}

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
tags no an array of values
alert_email no an array of email addresses

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

joepurdy avatar omnibs avatar plukevdh avatar sydorovdmytro avatar yurrriq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

terraform-provider-dmsnitch's Issues

Licence

Hello,

Could you please clarify under which licence this provider has been published?
If possible, it would be very great if licence would be added to the repo as well.

Thank you.

Build and release the package with the addition of darwin_arm64

Thanks for this provider! I am working on a team with a mix of new M1 apple laptops and old intel ones. Having an official package built and released for darwin_arm64, would really help the workflow.

We can use something like https://github.com/kreuzwerker/m1-terraform-provider-helper to build for darwin_arm64 but it isn't great for collaboration as this removes any other platforms from the generated terraform.lock file meaning you have to munge it yourself to collaborate across platforms.

OpenTofu Support

Hey, thank your work for this provider.

Since the license change of Terraform, it would be nice to switch to OpenTofu. Would be great to get this ;)

type `heartbeat` always switched to `basic`

We have the type set to heartbeat, and each time we apply terraform, the snitch has to be updated.
The readme say type value is basic, smart, but heartbeat seems accepted too.
Could you please add proper support for the heartbeat type? so it won't update for nothing anymore
Thanks a lot ๐Ÿ™

resource "dmsnitch_snitch" "xsnitch" {
  name  = "devxxxxx"

  interval = "10_minute"
  type     = "heartbeat"
  tags     = [var.environment, "xxx"]
}
  # module.xxx.dmsnitch_snitch.xsnitch[0] will be updated in-place
  ~ resource "dmsnitch_snitch" "xsnitch" {
        id       = "1axxxxxxxe"
        name     = "devxxxxx"
        tags     = [
            "xxx",
            "dev",
        ]
      ~ type     = "basic" -> "heartbeat"
        # (5 unchanged attributes hidden)
    }

image

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.