Compare commits
26 Commits
2023-07-02
...
master
Author | SHA1 | Date | |
---|---|---|---|
5acdb31ab5
|
|||
70835b86af
|
|||
46c95c1c6d
|
|||
1df1f4595a
|
|||
2c061156e7
|
|||
8e3411f7f1
|
|||
9226c1ad7a
|
|||
0e1347935b
|
|||
76233b84ea
|
|||
8d66adf74a
|
|||
efbba9cd51
|
|||
b1f8b7dfbc
|
|||
8bf63838c8
|
|||
f0cb096503
|
|||
345ea61288
|
|||
ad2657ce14
|
|||
037c3fb707
|
|||
42ad8e5fe8 | |||
072ee45d97 | |||
6c1860a9c8 | |||
4feec6f283 | |||
a0a34fa304 | |||
6e5c110821 | |||
0e8563fc55 | |||
1052daee73 | |||
b5bd33e13a |
8
Makefile
8
Makefile
@@ -3,19 +3,19 @@ all: init fmt validate
|
|||||||
|
|
||||||
.PHONY: init
|
.PHONY: init
|
||||||
init:
|
init:
|
||||||
terraform init -upgrade=false
|
tofu init -upgrade=false
|
||||||
|
|
||||||
.PHONY: initupgrade
|
.PHONY: initupgrade
|
||||||
initupgrade:
|
initupgrade:
|
||||||
terraform init -upgrade=true
|
tofu init -upgrade=true
|
||||||
|
|
||||||
.PHONY: fmt
|
.PHONY: fmt
|
||||||
fmt: init
|
fmt: init
|
||||||
terraform fmt
|
tofu fmt
|
||||||
|
|
||||||
.PHONY: validate
|
.PHONY: validate
|
||||||
validate: init fmt
|
validate: init fmt
|
||||||
terraform validate
|
tofu validate
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
@@ -1,7 +1,17 @@
|
|||||||
resource "digitalocean_droplet" "this" {
|
resource "digitalocean_droplet" "this" {
|
||||||
backups = "true"
|
backups = "true"
|
||||||
|
backup_policy {
|
||||||
|
plan = var.backup_policy_plan
|
||||||
|
weekday = var.backup_policy_weekday
|
||||||
|
hour = var.backup_policy_hour
|
||||||
|
}
|
||||||
image = var.image_name
|
image = var.image_name
|
||||||
ipv6 = "true"
|
ipv6 = "true"
|
||||||
|
lifecycle {
|
||||||
|
ignore_changes = [
|
||||||
|
image,
|
||||||
|
]
|
||||||
|
}
|
||||||
monitoring = "true"
|
monitoring = "true"
|
||||||
name = "${var.host_name}.${var.domain_name}"
|
name = "${var.host_name}.${var.domain_name}"
|
||||||
region = var.region
|
region = var.region
|
||||||
|
@@ -2,8 +2,8 @@ terraform {
|
|||||||
required_providers {
|
required_providers {
|
||||||
digitalocean = {
|
digitalocean = {
|
||||||
source = "digitalocean/digitalocean"
|
source = "digitalocean/digitalocean"
|
||||||
version = ">= 2.28.1"
|
version = ">= 2.55.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
required_version = ">= 1.5.2"
|
required_version = ">= 1.9.1"
|
||||||
}
|
}
|
||||||
|
5
variable.backup_policy_hour.tf
Normal file
5
variable.backup_policy_hour.tf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
variable "backup_policy_hour" {
|
||||||
|
# UTC Hour : 0, 4, 8, 12, 16, 20
|
||||||
|
default = "0"
|
||||||
|
type = string
|
||||||
|
}
|
5
variable.backup_policy_plan.tf
Normal file
5
variable.backup_policy_plan.tf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
variable "backup_policy_plan" {
|
||||||
|
# daily or weekly
|
||||||
|
default = "weekly"
|
||||||
|
type = string
|
||||||
|
}
|
5
variable.backup_policy_weekday.tf
Normal file
5
variable.backup_policy_weekday.tf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
variable "backup_policy_weekday" {
|
||||||
|
# SUN, MON, TUE, WED, THU, FRI, SAT
|
||||||
|
default = "SUN"
|
||||||
|
type = string
|
||||||
|
}
|
@@ -1,4 +1,4 @@
|
|||||||
variable "image_name" {
|
variable "image_name" {
|
||||||
default = "fedora-36-x64"
|
default = "fedora-38-x64"
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user