User Story 125263 (#238)
* Updated to use AzApi to obtain SSH (instead of tls)
This commit is contained in:
@ -89,12 +89,6 @@ resource "azurerm_storage_account" "my_storage_account" {
|
||||
account_replication_type = "LRS"
|
||||
}
|
||||
|
||||
# Create (and display) an SSH key
|
||||
resource "tls_private_key" "example_ssh" {
|
||||
algorithm = "RSA"
|
||||
rsa_bits = 4096
|
||||
}
|
||||
|
||||
# Create virtual machine
|
||||
resource "azurerm_linux_virtual_machine" "my_terraform_vm" {
|
||||
name = "myVM"
|
||||
@ -116,13 +110,12 @@ resource "azurerm_linux_virtual_machine" "my_terraform_vm" {
|
||||
version = "latest"
|
||||
}
|
||||
|
||||
computer_name = "myvm"
|
||||
admin_username = "azureuser"
|
||||
disable_password_authentication = true
|
||||
computer_name = "hostname"
|
||||
admin_username = var.username
|
||||
|
||||
admin_ssh_key {
|
||||
username = "azureuser"
|
||||
public_key = tls_private_key.example_ssh.public_key_openssh
|
||||
username = var.username
|
||||
public_key = jsondecode(azapi_resource_action.ssh_public_key_gen.output).publicKey
|
||||
}
|
||||
|
||||
boot_diagnostics {
|
||||
|
Reference in New Issue
Block a user