Capture netlify site in terraform

This commit is contained in:
Jeremy Dormitzer 2020-12-20 23:41:31 -05:00
parent a6ad8aec39
commit 5388db88ce
4 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,10 @@
# This file is maintained automatically by "terraform init".
# Manual edits may be lost in future updates.
provider "terraform.localhost/jdormit/netlify" {
version = "1.0.0"
constraints = "1.0.0"
hashes = [
"h1:MRtVAqOh0Av8FPpFYR7GLu/9W/K/oZI5eepf34/MQ9A=",
]
}

View File

@ -0,0 +1,15 @@
provider "netlify" {
token = var.netlify_token
}
resource "netlify_site" "jdormit_website" {
name = "jdormit-website"
custom_domain = "www.jeremydormitzer.com"
repo {
repo_branch = "deploy"
dir = "out"
provider = "github"
repo_path = "jdormit/jeremy-website"
}
}

View File

@ -0,0 +1,18 @@
terraform {
required_providers {
netlify = {
source = "terraform.localhost/jdormit/netlify"
version = "1.0.0"
}
}
backend "s3" {
skip_credentials_validation = true
skip_metadata_api_check = true
# Need to specify an AWS region to stop Terraform complaining
region = "us-east-1"
endpoint = "nyc3.digitaloceanspaces.com"
bucket = "jdormit-tf-state"
key = "prod/jdormit-website-netlify.tfstate"
}
}

View File

@ -0,0 +1,7 @@
variable netlify_token {
type = string
}
# variable netlify_base_url {
# type = string
# }