terraform-provider-sendgrid

command module
v0.0.0-...-d08c6b2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

README

terraform-provider-sendgrid

Sendgrid provider plugin for Terraform.

Installation

Requirements
  1. Terraform. Make sure you have it installed and it's accessible from your $PATH.
  2. Sendgrid
From Source (only method right now)
  • Install Go and configure your workspace.

  • Download this repo:

$ go get github.com/syoya/terraform-provider-sendgrid
  • Install the dependencies:
$ cd $GOPATH/src/github.com/syoya/terraform-provider-sendgrid
$ go get
  • Compile it:
$ go build -o terraform-provider-sendgrid
  • Copy it to a directory:
$ sudo cp terraform-provider-sendgrid ~/.terraform/providers/
  • Define new provider in terraform configuration:
~/.terraform/terraformrc
providers {
    sendgrid = "~/.terraform/providers/terraform-provider-sendgrid"
}

Usage

Here's a simple Terraform file to get you started:

provider "sendgrid" {
}

resource "sendgrid_template" "first_template" {
  name = "name"
  generation = "dynamic"
}

resource "sendgrid_template_version" "first_template_version" {
  name = "version name"
	template_id = "${sendgrid_template.first_template.id}"
	subject = "email subject"
	html_content_file = "./resources/test_template.html"
	plain_content_file = "./resources/test_template_plain.html"
  active = true
}

For either example, save it to a .tf file and run:

$ terraform plan
$ terraform apply
$ terraform show

Reference

Provider
Example
provider "sendgrid" {
  api_key = "sendgrid_key"
}
Parameters
  • api_key: Optional. Set the key for sendgrid account. You can set it through the ENV_VARS
sendgrid_template
Example
resource "sendgrid_template" "my_template" {
  name = "my_template"
  generation = "legacy"
}
Parameters
  • name: Required. The name of the template.
  • generation: Optional. Defines whether the template supports dynamic replacement. [dynamic|legacy]
Exported Parameters
  • id: The Id of the new template.
sendgrid_template_version
Example
resource "sendgrid_template_version" "my_template_version" {
  name = "version name"
	template_id = "${sendgrid_template.first_template.id}"
	subject = "email subject"
	html_content_file = "./resources/test_template.html"
	plain_content_file = "./resources/test_template_plain.html"
  active = true
}
Parameters
  • name: Required. The name of the template_version.
  • template_id: Required. The id of the template.
  • subject: Required. The subject for the email template.
  • html_content_file: Required. Html content file path.
  • plain_content_file: Required. Plain text file path.
  • active: Optional. Boolean option if template version is active. Default true.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL