Skip to content

Instantly share code, notes, and snippets.

@jfhbrook
Last active November 13, 2024 04:04
Show Gist options
  • Save jfhbrook/eecdfeb9acabab2438e983517aec8180 to your computer and use it in GitHub Desktop.
Save jfhbrook/eecdfeb9acabab2438e983517aec8180 to your computer and use it in GitHub Desktop.
locals {
hostname = "thisistheremix.dev"
ssh_host = "lil-nas-x.local"
op_account = "lmao"
op_vault = "roffle"
op_ssh_key = "Dokku SSH Key"
letsencrypt_email = "[email protected]"
}
terraform {
required_version = ">= 1.7.2"
required_providers {
onepassword = {
source = "1Password/onepassword"
version = "2.1.2"
}
dokku = {
source = "registry.terraform.io/aliksend/dokku"
version = "~> 1.0.22"
}
shell = {
source = "scottwinkler/shell"
version = "1.7.10"
}
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
backend "s3" {
bucket = "jfhbrook-terraform-state"
key = "dnslookup.tfstate"
region = "us-west-2"
dynamodb_table = "terraform-locks"
encrypt = true
}
}
provider "onepassword" {
account = local.op_account
}
data "onepassword_item" "ssh_key" {
vault = local.op_vault
title = local.op_ssh_key
}
provider "dokku" {
ssh_host = local.ssh_host
ssh_cert = data.onepassword_item.ssh_key.private_key
}
module "app" {
source = "git::ssh://[email protected]/jfhbrook/tf-modules//dokku-deployment?ref=v1.1.0"
hostname = local.hostname
ssh_host = local.ssh_host
letsencrypt = {
enable = true
email = local.letsencrypt_email
}
}
output "app_name" {
value = module.app.app_name
}
output "app_url" {
value = module.app.app_url
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment