File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,12 @@ resource ibm_is_subnet vpc_subnet {
9494  network_acl               =  . network_acl . id 
9595}
9696
97+ data  ibm_is_subnet  vpc_subnet  {
98+   count       =  . subnet_count 
99+ 
100+   identifier  =  . vpc_subnet [count . index ]. id 
101+ }
102+ 
97103resource  ibm_is_security_group_rule  rule_tcp_k8s  {
98104  count      =  . subnet_count 
99105
Original file line number Diff line number Diff line change @@ -35,10 +35,11 @@ output "subnet_ids" {
3535
3636output  "subnets"  {
3737  value        =  
38-     for  subnet  in  ibm_is_subnet . vpc_subnet : 
38+     for  subnet  in  data . ibm_is_subnet . vpc_subnet : 
3939    {
4040      id    =  subnet.id
41-       label =  length (var. subnets ) >  0  ?  var.subnets[index (ibm_is_subnet. vpc_subnet , subnet)].label :  " default" 
41+       zone  =  subnet.zone
42+       label =  length (var. subnets ) >  0  ?  element (var. subnets , index (data. ibm_is_subnet . vpc_subnet [* ]. id , subnet. id )).label :  " default" 
4243    }
4344  ]
4445  depends_on   =  ibm_is_subnet . vpc_subnet ]
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments