https://github.com/data-platform-hq/terraform-azurerm-linux-vm
Terraform module for creation Azure linux vm
https://github.com/data-platform-hq/terraform-azurerm-linux-vm
azure azurerm linux-vm terraform-module
Last synced: 4 months ago
JSON representation
Terraform module for creation Azure linux vm
- Host: GitHub
- URL: https://github.com/data-platform-hq/terraform-azurerm-linux-vm
- Owner: data-platform-hq
- License: other
- Created: 2023-06-30T08:17:47.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-10T08:03:16.000Z (almost 2 years ago)
- Last Synced: 2025-06-04T04:42:45.379Z (about 1 year ago)
- Topics: azure, azurerm, linux-vm, terraform-module
- Language: HCL
- Homepage: https://registry.terraform.io/modules/data-platform-hq/linux-vm/azurerm/latest
- Size: 34.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Azure linux vm Terraform module
Terraform module for creation Azure linux vm
## Usage
```hcl
# Prerequisite resources
data "azurerm_resource_group" "example" {
name = "example"
}
data "azurerm_subnet" "example" {
name = "example"
virtual_network_name = "production"
resource_group_name = data.azurerm_resource_group.example.name
}
resource "tls_private_key" "example" {
algorithm = "RSA"
ecdsa_curve = 2048
}
module "linux_virtual_machine" {
source = "data-platform-hq/linux-vm/azurerm"
version = "~> 1.0"
project = var.project
env = var.env
resource_group = data.azurerm_resource_group.example.name
location = var.location
subnet_id = data.azurerm_subnet.example.id
admin_ssh_key = {
username = "userexample"
public_key = tls_private_key.example.public_key_openssh
}
}
```
## Requirements
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >=1.3 |
| [azurerm](#requirement\_azurerm) | ~> 4.0 |
## Providers
| Name | Version |
|------|---------|
| [azurerm](#provider\_azurerm) | ~> 4.0 |
## Modules
No modules.
## Resources
| Name | Type |
|------|------|
| [azurerm_linux_virtual_machine.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_virtual_machine) | resource |
| [azurerm_network_interface.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_interface) | resource |
| [azurerm_public_ip.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/public_ip) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [admin\_ssh\_key](#input\_admin\_ssh\_key) | Objects to configure ssh key reference for virtual machine |
object({
username = optional(string, "adminuser")
public_key = optional(string)
}) | n/a | yes |
| [custom\_network\_interface\_name](#input\_custom\_network\_interface\_name) | Specifies the name of the virtual machine interface name resource | `string` | `null` | no |
| [custom\_public\_ip\_name](#input\_custom\_public\_ip\_name) | Specifies the name of the public ip name name resource | `string` | `null` | no |
| [custom\_virtual\_machine\_name](#input\_custom\_virtual\_machine\_name) | Specifies the name of the virtual machine name resource | `string` | `null` | no |
| [env](#input\_env) | Environment name | `string` | n/a | yes |
| [identity\_enabled](#input\_identity\_enabled) | Boolean flag than enables creation of System Assigned identity to VM | `bool` | `false` | no |
| [location](#input\_location) | Azure location | `string` | n/a | yes |
| [network\_interface\_private\_ip\_address\_allocation](#input\_network\_interface\_private\_ip\_address\_allocation) | The allocation method used for the Private IP Address. | `string` | `"Dynamic"` | no |
| [os\_disk](#input\_os\_disk) | Objects to configure os disk reference for virtual machine | object({
caching = string
storage_account_type = string
}) | {
"caching": "ReadWrite",
"storage_account_type": "Standard_LRS"
} | no |
| [password\_access\_enabled](#input\_password\_access\_enabled) | Boolean flag that enables access using password | `bool` | `false` | no |
| [project](#input\_project) | Project name | `string` | n/a | yes |
| [public\_ip\_allocation\_method](#input\_public\_ip\_allocation\_method) | Defines the allocation method for this IP address. Possible values are Static or Dynamic | `string` | `"Static"` | no |
| [public\_ip\_enabled](#input\_public\_ip\_enabled) | Boolean flag to enable Public Ip address creation and assignment to Virtual Machine | `bool` | `true` | no |
| [resource\_group](#input\_resource\_group) | The name of the resource group | `string` | n/a | yes |
| [source\_image\_reference](#input\_source\_image\_reference) | Objects to configure source image reference for virtual machine | object({
publisher = string
offer = string
sku = string
version = string
}) | {
"offer": "0001-com-ubuntu-server-jammy",
"publisher": "Canonical",
"sku": "22_04-lts",
"version": "latest"
} | no |
| [subnet\_id](#input\_subnet\_id) | The ID of the Subnet where this Network Interface should be located in. | `string` | n/a | yes |
| [suffix](#input\_suffix) | Optional suffix that would be added to the end of resources names. It is recommended to use dash at the beginning of variable (e.x., '-example') | `string` | `""` | no |
| [tags](#input\_tags) | Resource tags | `map(any)` | `{}` | no |
| [vm\_admin\_password](#input\_vm\_admin\_password) | The password of the local administrator used for the Virtual Machine. | `string` | `null` | no |
| [vm\_admin\_username](#input\_vm\_admin\_username) | The username of the local administrator used for the Virtual Machine. | `string` | `"adminuser"` | no |
| [vm\_size](#input\_vm\_size) | The SKU which should be used for this Virtual Machine. | `string` | `"Standard_F2"` | no |
## Outputs
| Name | Description |
|------|-------------|
| [id](#output\_id) | The ID of the Linux Virtual Machine |
| [identity](#output\_identity) | linux virtual machine Identities list |
| [private\_ip](#output\_private\_ip) | Linux Virtual Machine private IP address |
| [public\_ip](#output\_public\_ip) | Linux Virtual Machine public IP address |
## License
Apache 2 Licensed. For more information please see [LICENSE](https://github.com/data-platform-hq/terraform-azurerm-linux-vm/blob/main/LICENSE)