Skip to content

Instantly share code, notes, and snippets.

@PradeepLoganathan
Last active May 10, 2020 21:09
Show Gist options
  • Select an option

  • Save PradeepLoganathan/79a3c341a19ee6913b8b17cecce7f7cc to your computer and use it in GitHub Desktop.

Select an option

Save PradeepLoganathan/79a3c341a19ee6913b8b17cecce7f7cc to your computer and use it in GitHub Desktop.
terraform resource using variables - for the blog post https://pradeeploganathan.com/cloud/terraform-getting-started/
#create the resource group
resource "azurerm_resource_group" "rg" {
name = "ateam-resource-group"
location = var.location
}
#create the virtual network
resource "azurerm_virtual_network" "vnet1" {
resource_group_name = azurerm_resource_group.rg.name
location = var.location
name = "dev"
address_space = var.vnet_address_space
}
#create a subnet within the virtual network
resource "azurerm_subnet" "subnet1" {
resource_group_name = azurerm_resource_group.rg.name
virtual_network_name = azurerm_virtual_network.vnet1.name
name = "devsubnet"
address_prefixes = ["10.0.0.0/24"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment