Last active
March 26, 2023 22:13
-
-
Save danidiaz/53ff1030e6bae7330ac91c71f277c376 to your computer and use it in GitHub Desktop.
Hetzner terraform file
This file contains hidden or 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
# 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