Skip to content

Instantly share code, notes, and snippets.

@danidiaz
Last active March 26, 2023 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danidiaz/53ff1030e6bae7330ac91c71f277c376 to your computer and use it in GitHub Desktop.
Save danidiaz/53ff1030e6bae7330ac91c71f277c376 to your computer and use it in GitHub Desktop.
Hetzner terraform file
# https://developer.hashicorp.com/terraform/language/providers/requirements
# https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli
terraform {
required_providers {
hcloud = {
source = "hetznercloud/hcloud"
version = "1.36.2"
}
}
}
# Set the variable value in *.tfvars file
# or using the -var="hcloud_token=..." CLI option
# https://developer.hashicorp.com/terraform/language/values/variables
variable "hcloud_token" {
sensitive = true # Requires terraform >= 0.14
}
# Configure the Hetzner Cloud Provider
# https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs
provider "hcloud" {
token = var.hcloud_token
}
# resource "docker_image" "nginx" {
# name = "nginx"
# keep_locally = false
# }
#
# resource "docker_container" "nginx" {
# image = docker_image.nginx.image_id
# name = "tutorial"
#
# ports {
# internal = 80
# external = 8000
# }
# }
# https://developer.hashicorp.com/terraform/cli/commands/state/show
# $ terraform state list
# $ terraform state show 'data.hcloud_server_types.ds'
data "hcloud_server_types" "ds" {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment