diff --git a/.gitignore b/.gitignore index a1eb6b8..9ab2214 100644 --- a/.gitignore +++ b/.gitignore @@ -113,3 +113,40 @@ dmypy.json # End of https://www.gitignore.io/api/python,ansible env/ ansible/.vault_pass + +# Created by https://www.gitignore.io/api/terraform +# Edit at https://www.gitignore.io/?templates=terraform + +### Terraform ### +# Local .terraform directories +**/.terraform/* + +# .tfstate files +*.tfstate +*.tfstate.* + +# Crash log files +crash.log + +# Ignore any .tfvars files that are generated automatically for each Terraform run. Most +# .tfvars files are managed as part of configuration and so should be included in +# version control. +# +# example.tfvars + +# Ignore override files as they are usually used to override resources locally and so +# are not checked in +override.tf +override.tf.json +*_override.tf +*_override.tf.json + +# Include override files you do wish to add to version control using negated pattern +# !example_override.tf + +# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan +# example: *tfplan* + +# End of https://www.gitignore.io/api/terraform + +terraform/secrets.auto.tfvars diff --git a/scripts/terraform-apply.sh b/scripts/terraform-apply.sh new file mode 100755 index 0000000..0023776 --- /dev/null +++ b/scripts/terraform-apply.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -ex + +cd terraform/ + +terraform apply diff --git a/scripts/terraform-lint.sh b/scripts/terraform-lint.sh new file mode 100755 index 0000000..80088c1 --- /dev/null +++ b/scripts/terraform-lint.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e + +cd terraform/ + +terraform fmt -check -recursive diff --git a/scripts/terraform-plan.sh b/scripts/terraform-plan.sh new file mode 100755 index 0000000..a1ec465 --- /dev/null +++ b/scripts/terraform-plan.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -ex + +cd terraform/ + +terraform plan diff --git a/terraform/casey_vps.tf b/terraform/casey_vps.tf new file mode 100644 index 0000000..3ef215b --- /dev/null +++ b/terraform/casey_vps.tf @@ -0,0 +1,6 @@ +resource "vultr_server" "casey" { + plan_id = 200 + region_id = 8 + os_id = 159 + hostname = "casey" +} diff --git a/terraform/providers.tf b/terraform/providers.tf new file mode 100644 index 0000000..2ffc58c --- /dev/null +++ b/terraform/providers.tf @@ -0,0 +1,5 @@ +provider "vultr" { + api_key = var.vultr_api_key + rate_limit = 700 + retry_limit = 3 +} diff --git a/terraform/variables.tf b/terraform/variables.tf new file mode 100644 index 0000000..273d694 --- /dev/null +++ b/terraform/variables.tf @@ -0,0 +1 @@ +variable "vultr_api_key" {}