[OPB-xxx] adding terraform config

This commit is contained in:
Sheldan
2022-07-14 01:59:45 +02:00
parent 0879c7cc93
commit 653246f3ee
6 changed files with 76 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
# 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*

View File

@@ -0,0 +1,23 @@
# This file is maintained automatically by "terraform init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/hetznercloud/hcloud" {
version = "1.34.3"
hashes = [
"h1:ZAFEiotL15xHI957CrTJEm3z83/lFMQdNWiMqN7Dyu4=",
"zh:08e4aea3c4e895d941c24d76f373977e5fae112c531b56cb2fcdaa8b5086ebec",
"zh:09f1255aad8f790c86a14522c7fff2fcb6529bb18f1e49a7423ca79db07f5a47",
"zh:0b2bcab12aa913adaf89228a250eb41e827c64723a741f2b74b318833f77c9df",
"zh:0c6947f73dc5779b2425e231b22643741b1877705fb4135df06f7a201f10d094",
"zh:26513bdefecae83411997a5c4e11dffd886b4594cb8663f4b0c36a064b1a650e",
"zh:42790576142fb7d0ce851923f58a642e7e4c9e6df9a02b531703131d836daade",
"zh:5095ea6c8b31dfebd52a03f9ba4e2a8a7ecb0c0442f68c98cab76b677c343e81",
"zh:6b80223b2831f9f2adf72c7ed37692cef67c8f43de62c405c7162bf524896bc3",
"zh:6b90164e839ad0977b3feb4dbec153ab76a4f7ee8451ee2d202992ff5a4157b1",
"zh:72d88705afb9d0a9d90a5ad342c605cb119b678e76f45c5e4c516da5d591f907",
"zh:881889a9e974a15c616cd7648f1c415a4fb3e9a08c166bcb17e488bfcbb67985",
"zh:967286f7ef73bb15c2412b9ae8853d1176a039374c5ea39cbfd75e7ebe13bcfd",
"zh:967a6cc506a019c1720f0207068097a06eb006e940ecc63060373b4b4b6181cc",
"zh:a68e5e2e2f03656e427045e32ca999422e00be299fc6ecedbd41bef48871b7c5",
]
}

View File

@@ -0,0 +1,10 @@
terraform {
cloud {
hostname = "app.terraform.io"
organization = "OnePlusBot"
workspaces {
name = "main"
}
}
}

View File

@@ -0,0 +1,7 @@
module "hetzner" {
source = "git@github.com:Sheldan/discord-bot-terraform-module.git//hetzner-bot?ref=v1.0.0"
ssh_key_key = "Sheldan"
project_name = "OnePlusBot"
user_name = "sheldan"
hcloud_token = var.hcloud_token
}

View File

@@ -0,0 +1,4 @@
output "instance_ipv4" {
description = "IPv4 address of the instance"
value = module.hetzner.instance_ipv4
}

View File

@@ -0,0 +1,3 @@
variable "hcloud_token" {
type = string
}