Skip to content

Commit

Permalink
Merge pull request #6 from v-bus/add-tags
Browse files Browse the repository at this point in the history
Added labels to VPS
  • Loading branch information
v-bus committed Apr 27, 2020
2 parents 1018db1 + a98a4fb commit 6f96e05
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module "hdevs" {
vps_list = {"ubuntu_18" = 2}
dev_user = "username"
hcloud_token = "sdfghj,hgffghjkjhgf"
tags = {"key" = "value"}
}
output "out" {
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module "vps" {
vps_list = var.vps_list
dev_user = var.dev_user
hcloud_token = var.hcloud_token
tags = var.tags
}

module "dns" {
Expand Down
3 changes: 2 additions & 1 deletion modules/hcloud/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ resource "hcloud_server" "dev_vps" {
server_type = var.server_type
ssh_keys = [
hcloud_ssh_key.dev_ssh_key.id
]
]
labels = var.tags
}
4 changes: 4 additions & 0 deletions modules/hcloud/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ variable "server_type" {
description = "hcloud server type"
default = "cx11"
}
variable "tags" {
description = "Tags to VPS. User-defined labels map (key-value pairs)"
type = map(string)
}
4 changes: 4 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ variable "dev_user" {
}
variable "hcloud_token" {
description = "Access token to hcloud API"
}
variable "tags" {
description = "Tags to VPS. User-defined labels map (key-value pairs)"
type = map(string)
}

0 comments on commit 6f96e05

Please sign in to comment.