Compare commits

..

No commits in common. "1126049762e90e7e2ebf9c23cc6b530ef761ca46" and "08f640cc644e57030187bb1f067e139f2e9f4ae4" have entirely different histories.

6 changed files with 0 additions and 71 deletions

6
.gitignore vendored
View File

@ -1,9 +1,3 @@
.idea/ .idea/
*.iml *.iml
terraform/.secrets terraform/.secrets
/terraform/.terraform/
/terraform/.terraform.lock.hcl
/terraform/destroy.tfplan
/terraform/exercise.tfplan
/terraform/terraform.tfstate
/terraform/terraform.tfstate.backup

View File

@ -16,7 +16,6 @@ Secrets required for Terraform can be stored in a file:
ex. terraform/.secrets which is already ignored by Git ex. terraform/.secrets which is already ignored by Git
Required variables: Required variables:
```shell ```shell
export TF_VAR_cloudflare_token=<cloudflare_token> export TF_VAR_cloudflare_token=<cloudflare_token>
export TF_VAR_zone_id=<cloudflare_zone_id> export TF_VAR_zone_id=<cloudflare_zone_id>

View File

@ -1,5 +0,0 @@
#!/usr/bin/env sh
terraform plan -destroy -out destroy.tfplan
terraform apply destroy.tfplan

View File

@ -1,26 +0,0 @@
terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = "~>4.0"
}
}
}
provider "cloudflare" {
api_token = var.cloudflare_token
}
resource "cloudflare_tunnel" "tunnel" {
account_id = var.account_id
name = "exercise"
secret = var.tunnel_secret
}
resource "cloudflare_record" "notfound" {
name = "notfound"
type = "CNAME"
zone_id = var.zone_id
value = cloudflare_tunnel.tunnel.cname
proxied = true
}

View File

@ -1,14 +0,0 @@
#!/usr/bin/env sh
export TF_IN_AUTOMATION=true
terraform init -upgrade
terraform fmt -recursive
terraform validate || exit
terraform plan -out exercise.tfplan
terraform apply exercise.tfplan

View File

@ -1,19 +0,0 @@
variable "cloudflare_token" {
type = string
description = "The token used to authenticate with Cloudflare (must have DNS:edit Account/Cloudflare Tunnel: edit privs)"
}
variable "account_id" {
type = string
description = "The ID for the Cloudflare account to make the tunnel under"
}
variable "zone_id" {
type = string
description = "The ID for the Cloudflare zone (the domain the tunnel will be running on)"
}
variable "tunnel_secret" {
type = string
default = "The secret for the tunnel"
}