aboutsummaryrefslogtreecommitdiffstats
path: root/hetzner-account
diff options
context:
space:
mode:
Diffstat (limited to 'hetzner-account')
-rw-r--r--hetzner-account/main.tf4
-rw-r--r--hetzner-account/outputs.tf4
-rw-r--r--hetzner-account/provider.tf21
3 files changed, 29 insertions, 0 deletions
diff --git a/hetzner-account/main.tf b/hetzner-account/main.tf
new file mode 100644
index 0000000..b6ec546
--- /dev/null
+++ b/hetzner-account/main.tf
@@ -0,0 +1,4 @@
+resource "hcloud_ssh_key" "default" {
+ name = "default-key"
+ public_key = file("~/.ssh/id_rsa.pub")
+}
diff --git a/hetzner-account/outputs.tf b/hetzner-account/outputs.tf
new file mode 100644
index 0000000..f7eb536
--- /dev/null
+++ b/hetzner-account/outputs.tf
@@ -0,0 +1,4 @@
+output "ssh_key_name" {
+ description = "Account ssh key"
+ value = hcloud_ssh_key.default.name
+}
diff --git a/hetzner-account/provider.tf b/hetzner-account/provider.tf
new file mode 100644
index 0000000..cd32b31
--- /dev/null
+++ b/hetzner-account/provider.tf
@@ -0,0 +1,21 @@
+terraform {
+ required_providers {
+ hcloud = {
+ source = "hetznercloud/hcloud"
+ version = "~> 1.68.0"
+ }
+ }
+
+ backend "s3" {
+ bucket = "eugenetriguba-terraform-state"
+ key = "eugenetriguba.com/hetzner-account/terraform.tfstate"
+ region = "us-west-004"
+ endpoint = "https://s3.us-west-004.backblazeb2.com"
+
+ skip_credentials_validation = true
+ skip_region_validation = true
+ skip_metadata_api_check = true
+ skip_requesting_account_id = true
+ skip_s3_checksum = true
+ }
+}