terraform: don't prune resource if count contains interpolations

This commit is contained in:
Mitchell Hashimoto 2016-02-24 12:04:42 -05:00
parent 54411301c4
commit 12b6776675
1 changed files with 7 additions and 0 deletions

View File

@ -283,6 +283,13 @@ func (n *GraphNodeConfigResource) Noop(opts *NoopOpts) bool {
return false return false
} }
// If the count has any interpolations, we can't prune this node since
// we need to be sure to evaluate the count so that splat variables work
// later (which need to know the full count).
if len(n.Resource.RawCount.Interpolations) > 0 {
return false
}
// If we have no module diff, we're certainly a noop. This is because // If we have no module diff, we're certainly a noop. This is because
// it means there is a diff, and that the module we're in just isn't // it means there is a diff, and that the module we're in just isn't
// in it, meaning we're not doing anything. // in it, meaning we're not doing anything.