Skip to content

Commit

Permalink
fix: bug of terraform with s3/do space, now can run terraform plan & …
Browse files Browse the repository at this point in the history
…apply successfully
  • Loading branch information
dadiorchen committed Oct 30, 2023
1 parent 597010f commit 3b45c5f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
38 changes: 38 additions & 0 deletions database-grants/terraform/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# How to set up terraform

Find your digitalocean spaces access key and secret key here: https://cloud.digitalocean.com/account/api/spaces?i=d79377

Save it to your local `~/.netrc` file:

```bash
echo "machine sfo2.digitaloceanspaces.com login $SPACES_KEY password $SPACES_SECRET" >> ~/.netrc
```

Go the env folder, load key

```bash
cd dev
source setup_keys.sh
```

# How to run terraform

Init:

```bash
terraform init -backend-config=backend-config.tfvars
```

Plan, in the prompt input the database password:

```bash
terraform plan -var-file=dev.env.tfvars
```

Apply:

```bash
terraform apply -var-file=dev.env.tfvars
```


Empty file modified database-grants/terraform/dev/setup_keys.sh
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion database-grants/terraform/prod/backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ terraform {
# Deactivate a few checks as TF will attempt these against AWS
skip_credentials_validation = true
# skip_get_ec2_platforms = true
# skip_requesting_account_id = true
skip_requesting_account_id = true
skip_metadata_api_check = true
}
}

0 comments on commit 3b45c5f

Please sign in to comment.