@cryptotaxi247 / infra / commits / d36f4bb8

terraform: add the fastly provider

zimbatm committed Nov 19, 2018 at 15:23 UTC d36f4bb842278fc37317c8a1defd98773a427beb
3 files changed +26 -6
terraform/README.md
+20 -5
@@ -2,21 +2,36 @@
2
3 For now this manages only resources in the main AWS account.
4
5 -## Usage
5 +## Setup
6 +
7 +Set the following environment variables:
8 +
9 +AWS access key pair:
10
7 -Make sure to have the AWS key-pair in the environment, in
8 -`~/.aws/credentials` or as the EC2 metadata service.
11 +```sh
12 +export AWS_ACCESS_KEY_ID=...
13 +export AWS_SECRET_ACCESS_KEY=...
14 +```
15 +
16 +Fastly token from https://manage.fastly.com/account/personal/tokens with
17 +global scope.
18 +
19 +```sh
20 +export FASTLY_API_KEY=...
21 +```
22 +
23 +## Usage
24
25 The first time the following command has to be run to initialize the state
26 file and plugins:
27
13 -```
28 +```sh
29 nix-shell --run "terraform init"
30 ```
31
32 Then run the following command to diff the changes and then apply if approved:
33
19 -```
34 +```sh
35 nix-shell --run "terraform apply"
36 ```
37
terraform/providers.tf
+2
@@ -6,3 +6,5 @@ provider "aws" {
6 alias = "us"
7 region = "us-east-1"
8 }
9 +
10 +provider "fastly" {}
terraform/shell.nix
+4 -1
@@ -1,6 +1,9 @@
1 with import <nixpkgs> {};
2 let
3 - my-terraform = terraform.withPlugins (p: with p; [ aws ]);
3 + my-terraform = terraform.withPlugins (p: with p; [
4 + aws
5 + fastly
6 + ]);
7 in
8 mkShell {
9 buildInputs = [ my-terraform ];