first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
output "vm_name" {
|
||||
value = azurerm_linux_virtual_machine.main.name
|
||||
}
|
||||
|
||||
output "ip" {
|
||||
value = azurerm_public_ip.main.ip_address
|
||||
}
|
||||
|
||||
output "ssh_username" {
|
||||
value = azurerm_linux_virtual_machine.main.admin_username
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
variable "location" {
|
||||
description = "Region to deploy resources"
|
||||
default = "East US"
|
||||
}
|
||||
|
||||
variable "resource_group_name" {
|
||||
description = "Name of the resource group"
|
||||
}
|
||||
|
||||
variable "prefix" {
|
||||
description = "Prefix to append to resources"
|
||||
}
|
||||
|
||||
variable "dedicated_host_id" {
|
||||
description = "Dedicated Host ID"
|
||||
}
|
||||
|
||||
variable "ssh_public_key" {
|
||||
description = "SSH Public Key"
|
||||
}
|
||||
|
||||
variable "vm_size" {
|
||||
description = "VM Size"
|
||||
}
|
||||
|
||||
variable "tags" {
|
||||
description = "Tags to apply to all resources created by this module"
|
||||
type = map(string)
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
# Network
|
||||
|
||||
resource "azurerm_virtual_network" "main" {
|
||||
name = "${var.prefix}-vnet"
|
||||
location = var.location
|
||||
resource_group_name = var.resource_group_name
|
||||
address_space = ["10.0.0.0/16"]
|
||||
|
||||
tags = var.tags
|
||||
}
|
||||
|
||||
resource "azurerm_subnet" "main" {
|
||||
name = "${var.prefix}-subnet"
|
||||
resource_group_name = var.resource_group_name
|
||||
virtual_network_name = azurerm_virtual_network.main.name
|
||||
address_prefixes = ["10.0.0.0/24"]
|
||||
}
|
||||
|
||||
resource "azurerm_network_security_group" "ssh" {
|
||||
name = "${var.prefix}-nsg"
|
||||
location = var.location
|
||||
resource_group_name = var.resource_group_name
|
||||
|
||||
security_rule {
|
||||
name = "AllowSSH"
|
||||
priority = 1001
|
||||
direction = "Inbound"
|
||||
access = "Allow"
|
||||
protocol = "Tcp"
|
||||
source_port_range = "*"
|
||||
destination_port_range = "22"
|
||||
source_address_prefix = "*"
|
||||
destination_address_prefix = "*"
|
||||
}
|
||||
|
||||
tags = var.tags
|
||||
}
|
||||
|
||||
resource "azurerm_public_ip" "main" {
|
||||
name = "${var.prefix}-pip"
|
||||
location = var.location
|
||||
resource_group_name = var.resource_group_name
|
||||
allocation_method = "Static"
|
||||
sku = "Standard"
|
||||
|
||||
tags = var.tags
|
||||
}
|
||||
|
||||
resource "azurerm_network_interface" "main" {
|
||||
name = "${var.prefix}-nic"
|
||||
location = var.location
|
||||
resource_group_name = var.resource_group_name
|
||||
|
||||
ip_configuration {
|
||||
name = "${var.prefix}-ipconfig"
|
||||
subnet_id = azurerm_subnet.main.id
|
||||
private_ip_address_allocation = "Dynamic"
|
||||
public_ip_address_id = azurerm_public_ip.main.id
|
||||
}
|
||||
|
||||
tags = var.tags
|
||||
}
|
||||
|
||||
resource "azurerm_network_interface_security_group_association" "ssh" {
|
||||
network_interface_id = azurerm_network_interface.main.id
|
||||
network_security_group_id = azurerm_network_security_group.ssh.id
|
||||
}
|
||||
|
||||
# Disk
|
||||
|
||||
resource "azurerm_managed_disk" "data" {
|
||||
name = "${var.prefix}-disk"
|
||||
location = var.location
|
||||
resource_group_name = var.resource_group_name
|
||||
storage_account_type = "PremiumV2_LRS"
|
||||
create_option = "Empty"
|
||||
disk_size_gb = "32"
|
||||
zone = 1
|
||||
|
||||
tags = var.tags
|
||||
}
|
||||
|
||||
resource "azurerm_virtual_machine_data_disk_attachment" "data" {
|
||||
managed_disk_id = azurerm_managed_disk.data.id
|
||||
virtual_machine_id = azurerm_linux_virtual_machine.main.id
|
||||
lun = "1"
|
||||
caching = "None"
|
||||
}
|
||||
|
||||
# VM
|
||||
|
||||
resource "azurerm_linux_virtual_machine" "main" {
|
||||
name = "${var.prefix}-vm"
|
||||
location = var.location
|
||||
resource_group_name = var.resource_group_name
|
||||
network_interface_ids = [azurerm_network_interface.main.id]
|
||||
dedicated_host_id = var.dedicated_host_id
|
||||
zone = 1
|
||||
|
||||
size = var.vm_size
|
||||
|
||||
admin_username = "benchmark"
|
||||
|
||||
admin_ssh_key {
|
||||
username = "benchmark"
|
||||
public_key = var.ssh_public_key
|
||||
}
|
||||
|
||||
os_disk {
|
||||
caching = "ReadWrite"
|
||||
storage_account_type = "Premium_LRS"
|
||||
}
|
||||
|
||||
source_image_reference {
|
||||
publisher = "Canonical"
|
||||
offer = "0001-com-ubuntu-server-jammy"
|
||||
sku = "22_04-lts-gen2"
|
||||
version = "latest"
|
||||
}
|
||||
|
||||
identity {
|
||||
type = "SystemAssigned"
|
||||
}
|
||||
|
||||
tags = var.tags
|
||||
}
|
||||
Reference in New Issue
Block a user