diff options
| author | EuAndreh <eu@euandre.org> | 2020-08-10 17:16:22 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2020-08-10 17:16:22 -0300 |
| commit | 1ec6471eb4dcb4671ee125113a529adbfb2e10a3 (patch) | |
| tree | cdf83293d6682a3f832cea71977d8fd7bc7005ba /vps.tf | |
| parent | Interactive Terraform plan -> apply cycle (diff) | |
| download | server-1ec6471eb4dcb4671ee125113a529adbfb2e10a3.tar.gz server-1ec6471eb4dcb4671ee125113a529adbfb2e10a3.tar.xz | |
Semi working setup: Terraform and LetsEncrypt working
Diffstat (limited to 'vps.tf')
| -rw-r--r-- | vps.tf | 35 |
1 files changed, 2 insertions, 33 deletions
@@ -10,21 +10,11 @@ variable "tld" { description = "Root Top-Level Domain. Subdomains will be derived from it." } -variable "nextcloud_tld_prefix" { - type = string - description = "DNS prefix used for the Nextcloud installation. Does not contain a dot at the end." -} - variable "hostname" { type = string description = "Human name of the host. This is a pet name, not cattle name :)" } -variable "storage_name" { - type = string - description = "Name of the block storage volume, which will also be the name of it's mount point." -} - # Vultr @@ -46,39 +36,18 @@ resource "vultr_server" "vps_server" { # $ curl https://api.vultr.com/v1/plans/list?type=vc2 | jq '.["201"]' plan_id = 201 # $ curl -H "API-Key: $TF_VAR_vultr_api_key" https://api.vultr.com/v1/snapshot/list | jq - snapshot_id = "e1d5f317b0f7a" + snapshot_id = "c565f318e4aea" } output "public_ip" { value = vultr_server.vps_server.main_ip } -resource "vultr_block_storage" "vps_storage" { - size_gb = 10 - region_id = 9 - attached_id = vultr_server.vps_server.id - label = var.storage_name - live = "yes" -} - # DNS and IP configuration resource "vultr_dns_domain" "vps_tld" { + # The CNAME record is already generated by Vultr domain = var.tld server_ip = vultr_server.vps_server.main_ip } - -resource "vultr_dns_record" "at_sign" { - domain = var.tld - type = "A" - name = "@" - data = vultr_server.vps_server.main_ip -} - -resource "vultr_dns_record" "nextcloud" { - domain = var.tld - type = "CNAME" - name = var.nextcloud_tld_prefix - data = vultr_server.vps_server.main_ip -} |
