terraform: deleted terraform-configurations/51
This commit is contained in:
parent
05171d0404
commit
bf07e0255b
@ -1,124 +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 = "espacios-de-datos-infraestructura"
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "azurerm_virtual_network" "simpl_vnet" {
|
|
||||||
name = "simpl-vnet-51"
|
|
||||||
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-51"
|
|
||||||
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-51"
|
|
||||||
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-51"
|
|
||||||
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-51"
|
|
||||||
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-51-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 = "l612Nt9W6l8026dWqpIH"
|
|
||||||
disable_password_authentication = false
|
|
||||||
|
|
||||||
network_interface_ids = [azurerm_network_interface.simpl_nic.id]
|
|
||||||
|
|
||||||
os_disk {
|
|
||||||
caching = "ReadWrite"
|
|
||||||
storage_account_type = "Standard_LRS"
|
|
||||||
}
|
|
||||||
|
|
||||||
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 = "I2Nsb3VkLWNvbmZpZwp1c2VyczoKICAtIGRlZmF1bHQKICAtIG5hbWU6IDQ5OFU3bTFJVVQKICAgIGdyb3Vwczogc3VkbywgZG9ja2VyCiAgICBzaGVsbDogL2Jpbi9iYXNoCiAgICBzdWRvOiBBTEw9KEFMTCkgTk9QQVNTV0Q6QUxMCiAgICBsb2NrX3Bhc3N3ZDogZmFsc2UKICAgIHBhc3N3ZDogJDYkcm91bmRzPTQwOTYkcmNSd3lIVGxmSU5Wajl2NyRCWGU0c1g2bVhnVUpnSUFUR1lxLzNzMnRnUGRJcFdWRnRucGhtajFpL1ZhMzdtLlg1TXRSaUh1RFFlZGp1S0U3QUdBMWhlazdPNXAxU1MvZGdvcTdQLwoKcGFja2FnZXM6CiAgLSBkb2NrZXIuaW8KCnBhY2thZ2VfdXBkYXRlOiB0cnVlCnBhY2thZ2VfdXBncmFkZTogdHJ1ZQpzc2hfcHdhdXRoOiB0cnVlCgpydW5jbWQ6CiAgLSBzeXN0ZW1jdGwgc3RhcnQgZG9ja2VyCiAgLSBzeXN0ZW1jdGwgZW5hYmxlIGRvY2tlcgogIC0gImRvY2tlciBsb2dpbiBhY3JldGxuZW9jay5henVyZWNyLmlvIC11IGFjcmV0bG5lb2NrIC1wICcrdnp6SkV2SXhjcEtWWC9ieG9McDlETWFNRVh0UEUzTFFmT3R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HJvb3Q6cm9vdAogICAgcGVybWlzc2lvbnM6ICcwNjQ0Jw=="
|
|
||||||
}
|
|
||||||
|
|
||||||
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