terraform: deleted terraform-configurations/8
This commit is contained in:
parent
e2daf78b2d
commit
2104e81e63
@ -1,125 +0,0 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
azurerm = {
|
||||
source = "hashicorp/azurerm"
|
||||
version = "~> 4.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "azurerm" {
|
||||
features {}
|
||||
skip_provider_registration = true
|
||||
}
|
||||
|
||||
locals {
|
||||
image_parts = split(":", "Canonical:0001-com-ubuntu-server-jammy:22_04-lts-gen2:latest")
|
||||
}
|
||||
|
||||
data "azurerm_resource_group" "simpl_rg" {
|
||||
name = "rg-neoImpact-northeurope"
|
||||
}
|
||||
|
||||
resource "azurerm_virtual_network" "simpl_vnet" {
|
||||
name = "simpl-vnet-8"
|
||||
address_space = ["10.0.0.0/16"]
|
||||
location = data.azurerm_resource_group.simpl_rg.location
|
||||
resource_group_name = data.azurerm_resource_group.simpl_rg.name
|
||||
}
|
||||
|
||||
resource "azurerm_subnet" "simpl_subnet" {
|
||||
name = "simpl-subnet-8"
|
||||
resource_group_name = data.azurerm_resource_group.simpl_rg.name
|
||||
virtual_network_name = azurerm_virtual_network.simpl_vnet.name
|
||||
address_prefixes = ["10.0.1.0/24"]
|
||||
}
|
||||
|
||||
resource "azurerm_public_ip" "simpl_pip" {
|
||||
name = "simpl-pip-8"
|
||||
location = data.azurerm_resource_group.simpl_rg.location
|
||||
resource_group_name = data.azurerm_resource_group.simpl_rg.name
|
||||
allocation_method = "Static"
|
||||
sku = "Standard"
|
||||
}
|
||||
|
||||
resource "azurerm_network_interface" "simpl_nic" {
|
||||
name = "simpl-nic-8"
|
||||
location = data.azurerm_resource_group.simpl_rg.location
|
||||
resource_group_name = data.azurerm_resource_group.simpl_rg.name
|
||||
|
||||
ip_configuration {
|
||||
name = "internal"
|
||||
subnet_id = azurerm_subnet.simpl_subnet.id
|
||||
private_ip_address_allocation = "Dynamic"
|
||||
public_ip_address_id = azurerm_public_ip.simpl_pip.id
|
||||
}
|
||||
}
|
||||
|
||||
resource "azurerm_network_security_group" "simpl_nsg" {
|
||||
count = 1
|
||||
name = "simpl-nsg-8"
|
||||
location = data.azurerm_resource_group.simpl_rg.location
|
||||
resource_group_name = data.azurerm_resource_group.simpl_rg.name
|
||||
|
||||
security_rule {
|
||||
name = "allow-ssh"
|
||||
priority = 100
|
||||
direction = "Inbound"
|
||||
access = "Allow"
|
||||
protocol = "Tcp"
|
||||
source_port_range = "*"
|
||||
destination_port_range = "22"
|
||||
source_address_prefix = "*"
|
||||
destination_address_prefix = "*"
|
||||
}
|
||||
|
||||
security_rule {
|
||||
name = "allow-app"
|
||||
priority = 110
|
||||
direction = "Inbound"
|
||||
access = "Allow"
|
||||
protocol = "Tcp"
|
||||
source_port_range = "*"
|
||||
destination_port_ranges = ["80"]
|
||||
source_address_prefix = "*"
|
||||
destination_address_prefix = "*"
|
||||
}
|
||||
}
|
||||
|
||||
resource "azurerm_network_interface_security_group_association" "simpl_nic_nsg" {
|
||||
count = 1
|
||||
network_interface_id = azurerm_network_interface.simpl_nic.id
|
||||
network_security_group_id = azurerm_network_security_group.simpl_nsg[0].id
|
||||
}
|
||||
|
||||
resource "azurerm_linux_virtual_machine" "simpl_vm" {
|
||||
name = "offering-enterprise-server-8-terraform"
|
||||
resource_group_name = data.azurerm_resource_group.simpl_rg.name
|
||||
location = data.azurerm_resource_group.simpl_rg.location
|
||||
size = "Standard_B2s"
|
||||
admin_username = "simpluser"
|
||||
admin_password = "m383032mSAQQl8iK4TMY"
|
||||
disable_password_authentication = false
|
||||
|
||||
network_interface_ids = [azurerm_network_interface.simpl_nic.id]
|
||||
|
||||
os_disk {
|
||||
caching = "ReadWrite"
|
||||
storage_account_type = "Standard_LRS"
|
||||
disk_size_gb = 30
|
||||
}
|
||||
|
||||
source_image_reference {
|
||||
publisher = local.image_parts[0]
|
||||
offer = local.image_parts[1]
|
||||
sku = local.image_parts[2]
|
||||
version = local.image_parts[3]
|
||||
}
|
||||
|
||||
custom_data = "I2Ns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ldGxuZW9jay5henVyZWNyLmlvL2Rhc2hib2FyZC1pbmRpY2Fkb3Jlcy1zb2NpYWxlczoxLjQuMQogIC0gdWZ3IGFsbG93IDIyL3RjcAogIC0gdWZ3IGFsbG93IDgwL3RjcAogIC0gdWZ3IC0tZm9yY2UgZW5hYmxlCiAgLSBzeXN0ZW1jdGwgcmVzdGFydCBzc2hkCgp3cml0ZV9maWxlczoKICAtIHBhdGg6IC9ldGMvc3NoL3NzaGRfY29uZmlnLmQvc2ltcGwtaGFyZGVuaW5nLmNvbmYKICAgIGNvbnRlbnQ6IHwKICAgICAgUGVybWl0Um9vdExvZ2luIG5vCiAgICAgIFBhc3N3b3JkQXV0aGVudGljYXRpb24geWVzCiAgICAgIE1heEF1dGhUcmllcyA1CiAgICBvd25lcjogcm9vdDpyb290CiAgICBwZXJtaXNzaW9uczogIjA2NDQi"
|
||||
}
|
||||
|
||||
output "vmIps" {
|
||||
depends_on = [azurerm_linux_virtual_machine.simpl_vm]
|
||||
value = [azurerm_public_ip.simpl_pip.ip_address]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user