Code Monkey home page Code Monkey logo

terraform-provider-meltwater's Introduction

Meltwater Terraform Provider

A Terraform provider for Meltwater based on the persistent/infrastructure parts of the Meltwater API. Such as setting up webhooks and recurring exports.

Terraform registry documentation

Requirements

  • Terraform 0.11.x to 0.13.x
  • Go 1.14 to 1.17 (to build the provider plugin)

Build

Clone repository anywhere:

$ git clone https://github.com/meltwater/terraform-provider-meltwater.git

Enter the provider directory and build the provider

$ cd terraform-provider-meltwater
$ make compile

Or alternatively, to install it as a plugin, run

$ cd terraform-provider-meltwater
$ make install

Using the provider

If you're building the provider, follow the instructions to install it as a plugin. After placing it into your plugins directory, run terraform init to initialize it.

Basic Usage

Set an environment variable, TF_VAR_meltwater_api_key to store your Meltwater API key. This is the recommended way to not commit an access token into your version control system.

export TF_VAR_meltwater_api_key=<your meltwater api key>

Your token is now accessible in your Terraform configuration as var.meltwater_api_key, and can be used to configure the provider.

The example below demonstrates the following operations:

  • Create a search
    • Keyword search
    • Combined search
    • Boolean search
  • Create a recurring export
terraform {
  required_providers {
    meltwater = {
      source = "meltwater/meltwater"
      version = "<VERSION_HERE>"
    }
  }
}

variable "meltwater_api_key" {
    type = string
}

provider "meltwater" {
  # NOTE: This is populated from the `TF_VAR_meltwater_api_key` environment variable.
  api_key = var.meltwater_api_key
}

resource "meltwater_search" "my_awesome_search" {
  type = "social"
  category = "explore"
  name = "Golang - terraform"
  query {

    // One of keyword, combined or boolean

    keyword {
      case_sensitivity = "yes"
      all_keywords = ["golang"]
      any_keywords = []
      not_keywords = ["foobar"]
    }

    combined {
      all_searches = [16058498]
      not_searches = [7912335]
    }

    boolean {
      case_sensitivity = "hybrid"
      boolean = "(SourceName: /r/ProgrammingHumour OR SourceName: /r/Golang) AND metaData.discussionType:\"og\" AND language:\"fr\""
    }
  }
}

resource "meltwater_recurring_export" "my_awesome_recurring_export" {
  search_id = meltwater_search.my_awesome_search.id
  timezone = "Europe/London"
  window_time_unit = "week"
  window_time = "00:00:00"
  window_size = 1
}

terraform-provider-meltwater's People

Contributors

ollieparsley avatar

Watchers

 avatar  avatar  avatar  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.