-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Used for a new blog post and the hosted Derek service. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
- Loading branch information
Showing
6 changed files
with
152 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/main.tfvars | ||
/.terraform | ||
/*.tfstate |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
auth_token = "" // your Equinix Personal API Key | ||
project = "" // your Equinix Project name | ||
name = "derek" | ||
#domain = "derek.example.com" | ||
#email = "" | ||
metro = "am" | ||
plan = "c3.small.x86" | ||
ufw_enabled = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
terraform { | ||
required_providers { | ||
metal = { | ||
source = "equinix/metal" | ||
} | ||
} | ||
} | ||
|
||
# Configure the Equinix Metal Provider. | ||
provider "metal" { | ||
auth_token = var.auth_token | ||
} | ||
|
||
data "metal_project" "project" { | ||
name = var.project | ||
} | ||
|
||
module "faasd" { | ||
source = "github.com/jsiebens/terraform-equinix-faasd" | ||
|
||
project_id = data.metal_project.project.id | ||
name = var.name | ||
domain = var.domain | ||
email = var.email | ||
|
||
plan = var.plan | ||
metro = var.metro | ||
ufw_enabled = var.ufw_enabled | ||
project_ssh_key_ids = [] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
output "summary" { | ||
value = <<CONFIGURATION | ||
Your faasd instance "${var.name} is ready. | ||
IP Address: ${module.faasd.ipv4_address} | ||
To continue, use the IP address above create a DNS A record for your domain "${var.domain}" | ||
Give Caddy a moment to get a certificate and when ready, the faasd gateway is available at: | ||
${module.faasd.gateway_url} | ||
Authenticate with faas-cli: | ||
export PWD=$(terraform output -raw basic_auth_password) | ||
export OPENFAAS_URL=${module.faasd.gateway_url} | ||
echo $PWD | faas-cli login -u admin --password-stdin | ||
CONFIGURATION | ||
} | ||
|
||
output "basic_auth_password" { | ||
description = "The basic auth password." | ||
value = module.faasd.basic_auth_password | ||
sensitive = true | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
variable "auth_token" { | ||
type = string | ||
} | ||
|
||
variable "project" { | ||
type = string | ||
} | ||
|
||
variable "name" { | ||
description = "The faasd device name." | ||
type = string | ||
} | ||
|
||
variable "domain" { | ||
description = "A public domain for the faasd instance. This will the use of Caddy and a Let's Encrypt certificate" | ||
type = string | ||
} | ||
|
||
variable "email" { | ||
description = "Email used to order a certificate from Let's Encrypt" | ||
type = string | ||
} | ||
|
||
variable "metro" { | ||
description = "Metro area for the new faasd device." | ||
type = string | ||
default = "am" | ||
} | ||
|
||
variable "plan" { | ||
description = "The faasd device plan slug." | ||
type = string | ||
default = "c3.small.x86" | ||
} | ||
|
||
variable "ufw_enabled" { | ||
description = "Flag to indicate if UFW (Uncomplicated Firewall) should be enabled or not." | ||
type = bool | ||
default = true | ||
} | ||
|