All Projects → hashicorp → Terraform Provider Netlify

hashicorp / Terraform Provider Netlify

Licence: mpl-2.0
Terraform Netlify provider. Please note: This Terraform provider is archived per our provider archiving process: https://terraform.io/docs/internals/archiving.html

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Terraform Provider Netlify

Terraform Provider Github
Terraform GitHub provider
Stars: ✭ 305 (+498.04%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Aws
Terraform AWS provider
Stars: ✭ 6,624 (+12888.24%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Alicloud
Terraform AliCloud provider
Stars: ✭ 340 (+566.67%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Kafka
Terraform provider for managing Apache Kafka Topics + ACLs
Stars: ✭ 256 (+401.96%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Kubernetes
Terraform Kubernetes provider
Stars: ✭ 898 (+1660.78%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Ansible
"Logical" provider for integrating with an Ansible Dynamic Inventory script.
Stars: ✭ 262 (+413.73%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Oci
Terraform Oracle Cloud Infrastructure provider
Stars: ✭ 400 (+684.31%)
Mutual labels:  terraform, terraform-provider
terraform-provider-nutanix
Terraform Nutanix Provider
Stars: ✭ 53 (+3.92%)
Mutual labels:  terraform, terraform-provider
Namecheap
Go library for Namecheap API
Stars: ✭ 18 (-64.71%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Libvirt
Terraform provider to provision infrastructure with Linux's KVM using libvirt
Stars: ✭ 894 (+1652.94%)
Mutual labels:  terraform, terraform-provider
terraform-provider-terraform
Terraform terraform provider
Stars: ✭ 24 (-52.94%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Packet
Terraform provider for Equinix Metal (formerly Packet)
Stars: ✭ 33 (-35.29%)
Mutual labels:  terraform, terraform-provider
terraform-provider-bigip
Terraform resources that can configure F5 BIG-IP products
Stars: ✭ 74 (+45.1%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Digitalocean
Terraform DigitalOcean provider
Stars: ✭ 296 (+480.39%)
Mutual labels:  terraform, terraform-provider
terraform-provider-vercel
Terraform Provider for Vercel (former ZEIT)
Stars: ✭ 36 (-29.41%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Vsphere
Terraform VMware vSphere provider
Stars: ✭ 380 (+645.1%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Vault
Terraform Vault provider
Stars: ✭ 244 (+378.43%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Auth0
Auth0 Terraform Provider
Stars: ✭ 252 (+394.12%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Helm
Terraform Helm provider
Stars: ✭ 704 (+1280.39%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Dome9
Terraform Provider for Dome9
Stars: ✭ 33 (-35.29%)
Mutual labels:  terraform, terraform-provider

Please note: This Terraform provider is archived, per our provider archiving process. What does this mean?

  1. The code repository and all commit history will still be available.
  2. Existing released binaries will remain available on the releases site.
  3. Issues and pull requests are not being monitored.
  4. New releases will not be published.

If anyone from the community or an interested third party is willing to maintain it, they can fork the repository and publish it to the Terraform Registry. If you are interested in maintaining this provider, please reach out to the Terraform Provider Development Program at [email protected].


Terraform Provider

Requirements

  • Terraform 0.10.x
  • Go 1.8 (to build the provider plugin)

Building The Provider

Clone repository to: $GOPATH/src/github.com/terraform-providers/terraform-provider-netlify

$ mkdir -p $GOPATH/src/github.com/terraform-providers; cd $GOPATH/src/github.com/terraform-providers
$ git clone [email protected]:terraform-providers/terraform-provider-netlify.git

Enter the provider directory and build the provider

$ cd $GOPATH/src/github.com/terraform-providers/terraform-provider-netlify
$ make build
# or if you're on a mac:
$ gnumake build

Using the provider

NOTE: This provider is best used when paired with a VCS system provider such as the Github provider, which will be used for reference in these examples, since Netlify integrates directly with your VCS system in order to continuously deploy your website.

Using this provider requires an auth token from Netlify. You can generate a token here: https://app.netlify.com/account/applications. You will also likely need an auth token for your VCS system. In this example, we'll use Github, so you'll want to get a Github token as well. We'll start by configuring Github. In this example, we'll assume that we're using a repo at github.com/username/repo.

// configure the github provider
provider "github" {
  organization = "<username>"
}

// Configure the repository with the dynamically created Netlify key.
resource "github_repository_deploy_key" "key" {
  title      = "Netlify"
  repository = "<repo>"
  key        = "${netlify_deploy_key.key.public_key}"
  read_only  = false
}

// Create a webhook that triggers Netlify builds on push.
resource "github_repository_webhook" "main" {
  repository = "<repo>"
  name       = "web"
  events     = ["delete", "push", "pull_request"]

  configuration {
    content_type = "json"
    url          = "https://api.netlify.com/hooks/github"
  }

  depends_on = ["netlify_site.main"]
}

This pairs closely with the Netlify provider instructions as you can see, example shown below:

// A new, unique deploy key for this specific website
resource "netlify_deploy_key" "key" {}

resource "netlify_site" "main" {
  name = "<name of netlify site>"

  repo {
    repo_branch = "<github branch to deploy>"
    command = "<command used to build your website>"
    deploy_key_id = "${netlify_deploy_key.key.id}"
    dir = "<directory your website is built into, relative to root>"
    provider = "github"
    repo_path = "<username/repo>"
  }
}

With all the details filled in here, you should be able to run the script and have your site deploy. Of course, it's likely that you will want to configure some of these values as variables, and you can use GITHUB_TOKEN and NETLIFY_TOKEN environment variables as well to represent these API keys.

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.8+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin to your $PATH.

To compile the provider, run make build. This will build the provider and put the provider binary in the $GOPATH/bin directory.

$ make build
...
$ $GOPATH/bin/terraform-provider-netlify
...

In order to test the provider, you can simply run make test.

$ make test

In order to run the full suite of Acceptance tests, run make testacc.

Note: Acceptance tests create real resources, and often cost money to run.

$ make testacc
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].