Skip to content

Commit

Permalink
Tidy the TuneTpl() function, though still not supporting trimming Nes…
Browse files Browse the repository at this point in the history
…tedObject
  • Loading branch information
magodo committed Sep 2, 2024
1 parent c025a68 commit bd18a56
Show file tree
Hide file tree
Showing 6 changed files with 247 additions and 124 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/hashicorp/hcl/v2 v2.21.0
github.com/hashicorp/terraform-exec v0.21.0
github.com/hashicorp/terraform-json v0.22.1
github.com/magodo/tfpluginschema v0.0.0-20240829104406-475dca949d75
github.com/magodo/tfpluginschema v0.0.0-20240902090353-0525d7d8c1c2
github.com/magodo/tfstate v0.0.0-20240829105815-03d52976fa13
github.com/mitchellh/cli v1.1.2
github.com/stretchr/testify v1.7.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/magodo/tfpluginschema v0.0.0-20240829104406-475dca949d75 h1:7hCFS4T9QwhRfs9Gdnpbxl9fIb8EyYt4FayoNjbZMxg=
github.com/magodo/tfpluginschema v0.0.0-20240829104406-475dca949d75/go.mod h1:mh3baLIzKdhegfmLrAX+mpXQBvs4sqiDRTGx5Z5FGo0=
github.com/magodo/tfpluginschema v0.0.0-20240902090353-0525d7d8c1c2 h1:Unxx8WLxzSxINnq7hItp4cXD7drihgfPltTd91efoBo=
github.com/magodo/tfpluginschema v0.0.0-20240902090353-0525d7d8c1c2/go.mod h1:mh3baLIzKdhegfmLrAX+mpXQBvs4sqiDRTGx5Z5FGo0=
github.com/magodo/tfstate v0.0.0-20240829105815-03d52976fa13 h1:HhTCs5IKRuJxqx3NDI5gWfAD4WCNXiYGXM1dKyPp9rA=
github.com/magodo/tfstate v0.0.0-20240829105815-03d52976fa13/go.mod h1:cm1odSE6eUeMQRjYRARg1sWLP3HPsWjwvmk/+T4eQxs=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
Expand Down
14 changes: 14 additions & 0 deletions tfadd/internal/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,17 @@ type Option struct {
// Set via MaskSensitive option.
MaskSensitive bool
}

type TuneOption struct {
// Whether to remove O+C attributes/blocks, as long as it doesn't violate the cross property constraint?
RemoveOC bool

// The O+C attributes/blocks to keep as otherwise it is deemed to be removed.
// The key is the string representation of the attribute's/block's address.
// For attribute, the address is separated by ".".
// For block, the address is separated by ".0.".
OCToKeep map[string]bool

// Whether to remove optional attributes, whose value equals to its default value or zero value (default not defined)
RemoveOZAttribute bool
}
Loading

0 comments on commit bd18a56

Please sign in to comment.