@cryptotaxi247 / infra / commits / adb5d41a

terraform: add netlify as a provider

Since we have a shared account, use a shared token as well.

zimbatm committed Oct 4, 2021 at 12:13 UTC adb5d41af4526484fa38de01b2f469621c79a75a
4 files changed +21 -3
terraform/flake.lock
+3 -3
@@ -2,11 +2,11 @@
2 "nodes": {
3 "nixpkgs": {
4 "locked": {
5 - "lastModified": 1630322016,
6 - "narHash": "sha256-dqKKXpxpdZp1fmyvxlN9ihM1cRjpj3S2Yjw8CvRz/uY=",
5 + "lastModified": 1633342272,
6 + "narHash": "sha256-81nIPU3IKq432OxpsLu2t1SoUmdNIvBloi1yF2aGNLc=",
7 "owner": "NixOS",
8 "repo": "nixpkgs",
9 - "rev": "bc9e07ba1007b03d15427bac5275bea5b32f10ca",
9 + "rev": "03754a32a00fcf325e3735240bcd28d4b6e44abc",
10 "type": "github"
11 },
12 "original": {
terraform/flake.nix
+2
@@ -10,6 +10,8 @@
10 (terraform.withPlugins (p: with p; [
11 aws
12 fastly
13 + netlify
14 + secret
15 ]))
16 ];
17
terraform/providers.tf
+10
@@ -8,3 +8,13 @@ provider "aws" {
8 }
9
10 provider "fastly" {}
11 +
12 +# Create a token at https://app.netlify.com/user/applications/personal
13 +# And then import using `tf import secret_resource.netlify_token <TOKEN>`
14 +resource "secret_resource" "netlify_token" {
15 + lifecycle { prevent_destroy = true }
16 +}
17 +
18 +provider "netlify" {
19 + token = secret_resource.netlify_token.value
20 +}
terraform/terraform.tf
+6
@@ -13,5 +13,11 @@ terraform {
13 fastly = {
14 source = "fastly/fastly"
15 }
16 + netlify = {
17 + source = "AegirHealth/netlify"
18 + }
19 + secret = {
20 + source = "nixpkgs/secret"
21 + }
22 }
23 }