github.com/terraform-linters/tflint-plugin-sdk@v0.22.0/tflint/option.go (about) 1 package tflint 2 3 import "github.com/zclconf/go-cty/cty" 4 5 // ModuleCtxType represents target module. 6 // 7 //go:generate stringer -type=ModuleCtxType 8 type ModuleCtxType int32 9 10 const ( 11 // SelfModuleCtxType targets the current module. The default is this behavior. 12 SelfModuleCtxType ModuleCtxType = iota 13 // RootModuleCtxType targets the root module. This is useful when you want to refer to a provider config. 14 RootModuleCtxType 15 ) 16 17 // ExpandMode represents whether the block retrieved by GetModuleContent is expanded by the meta-arguments. 18 // 19 //go:generate stringer -type=ExpandMode 20 type ExpandMode int32 21 22 const ( 23 // ExpandModeExpand is the mode for expanding blocks based on the meta-arguments. The default is this behavior. 24 ExpandModeExpand ExpandMode = iota 25 // ExpandModeNone is the mode that does not expand blocks. 26 ExpandModeNone 27 ) 28 29 // GetModuleContentOption is an option that controls the behavior when getting a module content. 30 type GetModuleContentOption struct { 31 // Specify the module to be acquired. 32 ModuleCtx ModuleCtxType 33 // Whether resources and modules are expanded by the count/for_each meta-arguments. 34 ExpandMode ExpandMode 35 // Hint is info for optimizing a query. This is an advanced option and it is not intended to be used directly from plugins. 36 Hint GetModuleContentHint 37 } 38 39 // GetModuleContentHint is info for optimizing a query. This is an advanced option and it is not intended to be used directly from plugins. 40 type GetModuleContentHint struct { 41 ResourceType string 42 } 43 44 // EvaluateExprOption is an option that controls the behavior when evaluating an expression. 45 type EvaluateExprOption struct { 46 // Specify what type of value is expected. 47 WantType *cty.Type 48 // Set the scope of the module to evaluate. 49 ModuleCtx ModuleCtxType 50 }