Skip to content

arminaaki/terraform-provider-pastebin

Repository files navigation

Terraform provider for Pastebin

Go Report Card

Table of Content

Purpose

The provider will allow you to manage your pastes in Pastebin.

Requirements

Quickstart

The binary artifacts are available in release page. These builds are generated from the master branch. This project uses go modules to manage its dependecies.

make build

Once the binary is successfully built, it will be placed at $HOME/.terraform.d/plugins directory.

Example

Before using the provider, ensure you have a pastebin account. As a member of pastebin, you will be given a unique developer API key.

Here is an example that will create a private paste for your provided account.

provider "pastebin" {
  api_dev_key       = var.api_dev_key
  api_user_name     = var.api_user_name
  api_user_password = var.api_user_password
}

resource "pastebin_api_user_key" "api_key" {
  name = "my_key"
}

resource "pastebin_create_paste" "pasteA" {
  name                  = "pasteA"
  api_user_key          = pastebin_api_user_key.api_key.api_user_key
  api_dev_key           = var.api_dev_key
  api_paste_code        = "puts 'Hello World'"
  api_paste_name        = "main.rb"
  api_paste_expire_date = "10M"
  api_paste_format      = "ruby"
  api_paste_private     = "2"
}

Demo