Skip to content

Commit

Permalink
DBP-645-privac-idea-fix-for-server-resource (#24)
Browse files Browse the repository at this point in the history
* fix missing ssh_key for ionos server resource

* add dns name to outputs of basic vm module

* terraform-docs: automated action

* test expression without join

* simplify expression

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
aimee-889 and github-actions[bot] authored Mar 6, 2024
1 parent b86f9e1 commit 459657f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions modules/ionos-basic-vm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@

| Name | Description |
|------|-------------|
| <a name="output_basic_vm_server_dns"></a> [basic\_vm\_server\_dns](#output\_basic\_vm\_server\_dns) | n/a |
| <a name="output_basic_vm_server_id"></a> [basic\_vm\_server\_id](#output\_basic\_vm\_server\_id) | n/a |
| <a name="output_basic_vm_server_nicuuid"></a> [basic\_vm\_server\_nicuuid](#output\_basic\_vm\_server\_nicuuid) | n/a |
| <a name="output_basic_vm_server_public_ip"></a> [basic\_vm\_server\_public\_ip](#output\_basic\_vm\_server\_public\_ip) | n/a |
Expand Down
3 changes: 2 additions & 1 deletion modules/ionos-basic-vm/locals.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
locals {
technicaluser_key_path = var.initial_public_key
public_ip = var.create_ip_pool ? ionoscloud_ipblock.public_ip[0].ips[0] : var.public_ip
dns_zone_name = var.dns_zone_name_override == "" ? module.conventions_coordinates.dns_zone_name : var.dns_zone_name_override
basic_vm_server = var.permanent_vm ? ionoscloud_server.basic_vm_server[0] : ionoscloud_server.basic_vm_server_not_permanent[0]

user_data_vars = {
"initial_user" = var.initial_user
"initial_uid" = var.initial_uid
"initial_public_key" = var.initial_public_key
"initial_public_key" = file(var.initial_public_key)
}
user_data = base64encode(templatefile("${path.module}/${var.user_data_script}", local.user_data_vars))
}
4 changes: 4 additions & 0 deletions modules/ionos-basic-vm/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ output "basic_vm_server_id" {
value = local.basic_vm_server.id
}

output "basic_vm_server_dns" {
value = trim(opentelekomcloud_dns_recordset_v2.a_records.name, ".")
}

output "basic_vm_server_public_ip" {
value = local.basic_vm_server.primary_ip
}
Expand Down
4 changes: 2 additions & 2 deletions modules/ionos-basic-vm/server.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resource "ionoscloud_server" "basic_vm_server" {
image_name = var.image
cpu_family = var.cpu_family
availability_zone = var.availability_zone
ssh_keys = []
ssh_keys = [ local.technicaluser_key_path ]

# /dev/vda1
volume {
Expand Down Expand Up @@ -45,7 +45,7 @@ resource "ionoscloud_server" "basic_vm_server_not_permanent" {
image_name = var.image
cpu_family = var.cpu_family
availability_zone = var.availability_zone
ssh_keys = []
ssh_keys = [ local.technicaluser_key_path ]

# /dev/vda1
volume {
Expand Down

0 comments on commit 459657f

Please sign in to comment.