Archived
1

Compare commits

...

2 Commits

Author SHA1 Message Date
ventilaar
c77485c4a1 Merge remote-tracking branch 'origin/master' 2022-04-04 22:23:35 +02:00
ventilaar
755e3be41e works but need to set network security groups straight 2022-04-04 22:23:26 +02:00

View File

@@ -0,0 +1,64 @@
# Configure the Azure provider
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 2.65"
}
}
required_version = ">= 1.1.0"
}
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "rg" {
name = "myTFResourceGroup"
location = "westeurope"
}
module "vnet" {
source = "Azure/vnet/azurerm"
resource_group_name = azurerm_resource_group.rg.name
address_space = ["10.0.0.0/16"]
subnet_prefixes = ["10.0.1.0/24"]
subnet_names = ["master"]
depends_on = [azurerm_resource_group.rg]
}
module "linuxservers" {
source = "Azure/compute/azurerm"
resource_group_name = azurerm_resource_group.rg.name
vm_os_simple = "UbuntuServer"
public_ip_dns = ["binddnsserver6"]
vnet_subnet_id = module.vnet.vnet_subnets[0]
custom_data = <<-EOT
#cloud-config
bootcmd:
- echo "making directories"
- mkdir -p /etc/bind
- mkdir -p /var/lib/bind
- echo "downloading files"
- wget https://git.ventilaar.nl/ventilaar/clim/raw/branch/master/eindopdracht/testomgeving/bind/named.conf.local -O /etc/bind/named.conf.local
- wget https://git.ventilaar.nl/ventilaar/clim/raw/branch/master/eindopdracht/testomgeving/bind/dns.mashallah.nl.zone -O /var/lib/bind/dns.mashallah.nl.zone
packages:
- bind9
EOT
delete_data_disks_on_termination = true
delete_os_disk_on_termination = true
vm_hostname = "bind"
vm_size = "Standard_B1ls"
ssh_key = "~/.ssh/id_rsa.pub.old"
remote_port = "53"
depends_on = [azurerm_resource_group.rg]
}
output "linux_vm_public_name" {
value = module.linuxservers.public_ip_dns_name
}