mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-05 17:52:38 +00:00
google_compute_firewall: Support target tags
This commit is contained in:
parent
51bfd6f6ef
commit
97370fdac1
|
@ -72,6 +72,15 @@ func resourceComputeFirewall() *schema.Resource {
|
||||||
return hashcode.String(v.(string))
|
return hashcode.String(v.(string))
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"target_tags": &schema.Schema{
|
||||||
|
Type: schema.TypeSet,
|
||||||
|
Optional: true,
|
||||||
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
|
Set: func(v interface{}) int {
|
||||||
|
return hashcode.String(v.(string))
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -285,6 +294,15 @@ func resourceFirewall(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Build up the list of targets
|
||||||
|
var targetTags []string
|
||||||
|
if v := d.Get("target_tags").(*schema.Set); v.Len() > 0 {
|
||||||
|
targetTags = make([]string, v.Len())
|
||||||
|
for i, v:= range v.List() {
|
||||||
|
targetTags[i] = v.(string)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Build the firewall parameter
|
// Build the firewall parameter
|
||||||
return &compute.Firewall{
|
return &compute.Firewall{
|
||||||
Name: d.Get("name").(string),
|
Name: d.Get("name").(string),
|
||||||
|
@ -292,5 +310,6 @@ func resourceFirewall(
|
||||||
Allowed: allowed,
|
Allowed: allowed,
|
||||||
SourceRanges: sourceRanges,
|
SourceRanges: sourceRanges,
|
||||||
SourceTags: sourceTags,
|
SourceTags: sourceTags,
|
||||||
|
TargetTags: targetTags,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user