Fixing command to get public key
This commit is contained in:
parent
40be72ba42
commit
0fd2a5d129
@ -141,7 +141,7 @@ resource "azurerm_linux_virtual_machine" "my_terraform_vm" {
|
||||
|
||||
admin_ssh_key {
|
||||
username = var.username
|
||||
public_key = jsondecode(azapi_resource_action.ssh_public_key_gen.output).publicKey
|
||||
public_key = azapi_resource_action.ssh_public_key_gen.output.publicKey
|
||||
}
|
||||
|
||||
boot_diagnostics {
|
||||
|
@ -20,5 +20,5 @@ resource "azapi_resource" "ssh_public_key" {
|
||||
}
|
||||
|
||||
output "key_data" {
|
||||
value = jsondecode(azapi_resource_action.ssh_public_key_gen.output).publicKey
|
||||
value = azapi_resource_action.ssh_public_key_gen.output.publicKey
|
||||
}
|
@ -102,7 +102,7 @@ resource "azurerm_linux_virtual_machine" "test" {
|
||||
|
||||
admin_ssh_key {
|
||||
username = var.username
|
||||
public_key = jsondecode(azapi_resource_action.ssh_public_key_gen.output).publicKey
|
||||
public_key = azapi_resource_action.ssh_public_key_gen.output.publicKey
|
||||
}
|
||||
|
||||
os_disk {
|
||||
|
@ -20,5 +20,5 @@ resource "azapi_resource" "ssh_public_key" {
|
||||
}
|
||||
|
||||
output "key_data" {
|
||||
value = jsondecode(azapi_resource_action.ssh_public_key_gen.output).publicKey
|
||||
value = azapi_resource_action.ssh_public_key_gen.output.publicKey
|
||||
}
|
@ -115,7 +115,7 @@ resource "azurerm_linux_virtual_machine" "my_terraform_vm" {
|
||||
|
||||
admin_ssh_key {
|
||||
username = var.username
|
||||
public_key = jsondecode(azapi_resource_action.ssh_public_key_gen.output).publicKey
|
||||
public_key = azapi_resource_action.ssh_public_key_gen.output.publicKey
|
||||
}
|
||||
|
||||
boot_diagnostics {
|
||||
|
@ -20,5 +20,5 @@ resource "azapi_resource" "ssh_public_key" {
|
||||
}
|
||||
|
||||
output "key_data" {
|
||||
value = jsondecode(azapi_resource_action.ssh_public_key_gen.output).publicKey
|
||||
value = azapi_resource_action.ssh_public_key_gen.output.publicKey
|
||||
}
|
@ -210,7 +210,7 @@ resource "azurerm_linux_virtual_machine" "vm_server" {
|
||||
admin_username = var.admin_username
|
||||
admin_ssh_key {
|
||||
username = var.admin_username
|
||||
public_key = jsondecode(azapi_resource_action.ssh_public_key_gen.output).publicKey
|
||||
public_key = azapi_resource_action.ssh_public_key_gen.output.publicKey
|
||||
}
|
||||
network_interface_ids = [azurerm_network_interface.vm_server_nic.id]
|
||||
os_disk {
|
||||
@ -241,7 +241,7 @@ resource "azurerm_linux_virtual_machine" "vm_jump" {
|
||||
}
|
||||
admin_ssh_key {
|
||||
username = var.admin_username
|
||||
public_key = jsondecode(azapi_resource_action.ssh_public_key_gen.output).publicKey
|
||||
public_key = azapi_resource_action.ssh_public_key_gen.output.publicKey
|
||||
}
|
||||
source_image_reference {
|
||||
publisher = "Canonical"
|
||||
|
@ -20,6 +20,6 @@ resource "azapi_resource" "ssh_public_key" {
|
||||
}
|
||||
|
||||
output "key_data" {
|
||||
value = jsondecode(azapi_resource_action.ssh_public_key_gen.output).publicKey
|
||||
value = azapi_resource_action.ssh_public_key_gen.output.publicKey
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ resource "azurerm_kubernetes_cluster" "k8s" {
|
||||
admin_username = var.username
|
||||
|
||||
ssh_key {
|
||||
key_data = jsondecode(azapi_resource_action.ssh_public_key_gen.output).publicKey
|
||||
key_data = azapi_resource_action.ssh_public_key_gen.output.publicKey
|
||||
}
|
||||
}
|
||||
network_profile {
|
||||
|
@ -20,5 +20,5 @@ resource "azapi_resource" "ssh_public_key" {
|
||||
}
|
||||
|
||||
output "key_data" {
|
||||
value = jsondecode(azapi_resource_action.ssh_public_key_gen.output).publicKey
|
||||
value = azapi_resource_action.ssh_public_key_gen.output.publicKey
|
||||
}
|
@ -146,7 +146,7 @@ resource "azurerm_linux_virtual_machine" "my_terraform_vm" {
|
||||
|
||||
admin_ssh_key {
|
||||
username = var.username
|
||||
public_key = jsondecode(azapi_resource_action.ssh_public_key_gen.output).publicKey
|
||||
public_key = azapi_resource_action.ssh_public_key_gen.output.publicKey
|
||||
}
|
||||
|
||||
boot_diagnostics {
|
||||
|
@ -20,5 +20,5 @@ resource "azapi_resource" "ssh_public_key" {
|
||||
}
|
||||
|
||||
output "key_data" {
|
||||
value = jsondecode(azapi_resource_action.ssh_public_key_gen.output).publicKey
|
||||
value = azapi_resource_action.ssh_public_key_gen.output.publicKey
|
||||
}
|
@ -181,7 +181,7 @@ resource "azurerm_virtual_machine_scale_set" "vmss" {
|
||||
|
||||
ssh_keys {
|
||||
path = "/home/azureuser/.ssh/authorized_keys"
|
||||
key_data = jsondecode(azapi_resource_action.ssh_public_key_gen.output).publicKey
|
||||
key_data = azapi_resource_action.ssh_public_key_gen.output.publicKey
|
||||
}
|
||||
}
|
||||
|
||||
@ -256,7 +256,7 @@ resource "azurerm_virtual_machine" "jumpbox" {
|
||||
|
||||
ssh_keys {
|
||||
path = "/home/azureuser/.ssh/authorized_keys"
|
||||
key_data = jsondecode(azapi_resource_action.ssh_public_key_gen.output).publicKey
|
||||
key_data = azapi_resource_action.ssh_public_key_gen.output.publicKey
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user