Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/configs/configschema/validate_traversal.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
// diagnostics if any problems are found.
//
// This method is "optimistic" in that it will not return errors for possible
// problems that cannot be detected statically. It is possible that an
// problems that cannot be detected statically. It is possible that a
// traversal which passed static validation will still fail when evaluated.
func (b *Block) StaticValidateTraversal(traversal hcl.Traversal) tfdiags.Diagnostics {
if !traversal.IsRelative() {
Expand Down
3 changes: 3 additions & 0 deletions internal/configs/module_merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ func (r *Resource) merge(or *Resource, rps map[string]*RequiredProvider) hcl.Dia
if len(or.Managed.IgnoreChanges) != 0 {
r.Managed.IgnoreChanges = or.Managed.IgnoreChanges
}
if or.Managed.IgnoreAllChanges {
r.Managed.IgnoreAllChanges = true
}
if or.Managed.PreventDestroySet {
r.Managed.PreventDestroy = or.Managed.PreventDestroy
r.Managed.PreventDestroySet = or.Managed.PreventDestroySet
Expand Down
10 changes: 10 additions & 0 deletions internal/configs/module_merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,3 +320,13 @@ func TestModuleOverrideResourceFQNs(t *testing.T) {
t.Fatalf("wrong result: found provider config ref %s, expected nil", got.ProviderConfigRef)
}
}

func TestModuleOverrideIgnoreAllChanges(t *testing.T) {
mod, diags := testModuleFromDir("testdata/valid-modules/override-ignore-changes")
assertNoDiagnostics(t, diags)

r := mod.ManagedResources["test_instance.foo"]
if !r.Managed.IgnoreAllChanges {
t.Fatalf("wrong result: expected r.Managed.IgnoreAllChanges to be true")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resource "test_instance" "foo" {
foo = "bar"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "test_instance" "foo" {
foo = "bar"
lifecycle {
ignore_changes = all
}
}