e2e: dynamically create rg resource group for minicon (#2793)

This commit is contained in:
3u13r 2024-01-04 16:01:57 +01:00 committed by GitHub
parent 8730e72319
commit 26a9639bcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,36 +46,37 @@ data "cloudinit_config" "cloud_init" {
}
}
data "azurerm_resource_group" "main" {
name = "e2e-miniconstellation"
resource "azurerm_resource_group" "main" {
name = "e2e-mini-${random_string.suffix.result}"
location = "North Europe"
}
resource "azurerm_virtual_network" "main" {
name = "e2e-mini-${random_string.suffix.result}"
address_space = ["10.0.0.0/16"]
location = data.azurerm_resource_group.main.location
resource_group_name = data.azurerm_resource_group.main.name
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
}
resource "azurerm_subnet" "main" {
name = "e2e-mini-${random_string.suffix.result}"
resource_group_name = data.azurerm_resource_group.main.name
resource_group_name = azurerm_resource_group.main.name
virtual_network_name = azurerm_virtual_network.main.name
address_prefixes = ["10.0.2.0/24"]
}
resource "azurerm_public_ip" "main" {
name = "e2e-mini-${random_string.suffix.result}"
location = data.azurerm_resource_group.main.location
resource_group_name = data.azurerm_resource_group.main.name
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
allocation_method = "Static"
sku = "Standard"
}
resource "azurerm_network_interface" "main" {
name = "e2e-mini-${random_string.suffix.result}"
resource_group_name = data.azurerm_resource_group.main.name
location = data.azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
location = azurerm_resource_group.main.location
ip_configuration {
name = "main"
@ -87,8 +88,8 @@ resource "azurerm_network_interface" "main" {
resource "azurerm_network_security_group" "ssh" {
name = "e2e-mini-${random_string.suffix.result}"
resource_group_name = data.azurerm_resource_group.main.name
location = data.azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
location = azurerm_resource_group.main.location
security_rule {
name = "ssh"
@ -110,8 +111,8 @@ resource "azurerm_subnet_network_security_group_association" "ssh" {
resource "azurerm_linux_virtual_machine" "main" {
name = "e2e-mini-${random_string.suffix.result}"
resource_group_name = data.azurerm_resource_group.main.name
location = data.azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
location = azurerm_resource_group.main.location
# Standard_D8s_v5 provides nested virtualization support
size = "Standard_D8s_v5"