Learn what Terraform modules are and how to create one.
This repo is a companion repo to the Build a Module tutorial.
Home Page: https://developer.hashicorp.com/terraform/tutorials/modules/module-create?in=terraform/modules
License: Mozilla Public License 2.0
Learn what Terraform modules are and how to create one.
This repo is a companion repo to the Build a Module tutorial.
Hi,
i'm new to child modules and i want to create multiple resource with child module using loop but getting error while creating resources. Please help me to fix this issue.
resource "azurerm_resource_group" "rg" {
name = var.resource_group_name
location = var.resource_group_location
}
module "vnet" {
source = "./module/vnet"
resource_group_name = var.resource_group_name
resource_group_location = var.resource_group_location
vnet_name = var.vnet_name
address_space = var.address_space
}
module "subnet" {
source = "./module/subnet"
subent_name = var.subent_name
resource_group_name = var.resource_group_name
vnet_name_outout = module.vnet.vnet_name_outout # output
address_prefixes = var.address_prefixes
}
module "nic" {
source = "./module/nic"
resource_group_name = var.resource_group_name
resource_group_location = var.resource_group_location
nic_names_list = toset(var.nic_names_list)
prodsubnet_id = module.subnet.prodsubnet_id # output
}
module "nsg" {
source = "./module/nsg"
resource_group_name = var.resource_group_name
resource_group_location = var.resource_group_location
nsg_names_list = toset(var.nsg_names_list)
nic_id = module.nic.nic_id # output "nic_id"
}
output "nic_id" {
value = [for s in azurerm_network_interface.web_windows_vm_nic : s.id]
}
Error: Invalid value for module argument
│
│ on main.tf line 28, in module "nsg":
│ 28: nic_id = module.nic.nic_id
│
│ The given value is not suitable for child module variable "nic_id" defined at module\nsg\variable.tf:14,1-18: string required.
resource "azurerm_network_interface_security_group_association" "web_vmnic_nsg_associate" {
for_each = azurerm_network_security_group.prod_subnet_nsg
network_interface_id = var.nic_id
network_security_group_id = each.value.id
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.