Difference between revisions of "Terraform: data.aws subnets"

From wikieduonline
Jump to navigation Jump to search
(Created page with " data. {{data.}}")
 
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
* https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/subnets
 +
data.aws_subnets
  
  
Line 4: Line 6:
 
  [[data.]]
 
  [[data.]]
  
 +
data "aws_subnet" "all_db" {
 +
  for_each = [[toset]](data.aws_subnets.all_db.ids)
 +
  id      = [[each.]]value
 +
}
  
 +
[[subnet_id]] = [[element]](data.aws_subnets.all_private.ids, 0)
  
{{data.}}
+
== See also ==
 +
* {{data.}}
 +
 
 +
[[Category:IT]]

Latest revision as of 06:58, 3 June 2024

data.aws_subnets


data.
data "aws_subnet" "all_db" {
  for_each = toset(data.aws_subnets.all_db.ids)
  id       = each.value
}
subnet_id = element(data.aws_subnets.all_private.ids, 0)

See also[edit]

Advertising: