Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBP-645-privac-idea-fix-for-server-resource #24

Merged
merged 5 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading