Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
emilymye committed Sep 17, 2019
1 parent 3a05bc7 commit 379ef40
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions templates/terraform/constants/router_nat.go.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ func resourceNameSetFromSelfLinkSet(v interface{}) *schema.Set {
return schema.NewSet(schema.HashString, ls)
}

// drainNatIps can only be set in update, and must have been a value in natIps prior.
// This CustomDiff validate that drainNatIps is only set on update.
// drain_nat_ips MUST be set from (just set) previous values of nat_ips
// so this customizeDiff func makes sure drainNatIps values:
// - aren't set at creation time
// - are in old value of nat_ips but not in new values
func resourceComputeRouterNatDrainNatIpsCustomDiff(diff *schema.ResourceDiff, meta interface{}) error {
o, n := diff.GetChange("drain_nat_ips")
oSet := resourceNameSetFromSelfLinkSet(o)
Expand Down

0 comments on commit 379ef40

Please sign in to comment.