Documentation ¶
Index ¶
- type AzApiRule
- func (r *AzApiRule) Attributes() []string
- func (r *AzApiRule) BlockType() string
- func (r *AzApiRule) Check(runner tflint.Runner) error
- func (r *AzApiRule) Enabled() bool
- func (r *AzApiRule) LabelNames() []string
- func (r *AzApiRule) LabelOne() string
- func (r *AzApiRule) Link() string
- func (r *AzApiRule) Name() string
- func (r *AzApiRule) Severity() tflint.Severity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AzApiRule ¶
type AzApiRule struct { tflint.DefaultRule // Embed the default rule to reuse its implementation blockquery.BlockQuery // contains filtered or unexported fields }
AzApiRule runs the specified gjson query on the `body` attribute of `azapi_resource` resources and checks if the result is as expected.
func NewAzApiRuleQueryMustExist ¶
func NewAzApiRuleQueryMustExist( ruleName, link, resourceType, minimumApiVersion, maximumApiVersion, query string, compareFunc blockquery.ResultCompareFunc, expectedResults ...cty.Value, ) *AzApiRule
AzApiRule creates a rule to check the `body` attribute of `azapi_resource` resources. The `query` parameter is a gjson query string to run against the `body` attribute. The `compareFunc` parameter is a function to compare the result of the query with the expected results. E.g. `blockquery.IsOneOf`. The `expectedResults` parameter is a list of expected results, use the `blockquery.New*Results` functions to create them. The resource type is the first part of the `type` attribute of the resource, e.g. "Microsoft.Compute/virtualMachines" for VMs. Use the `minimumApiVersion` and `maximumApiVersion` parameters to filter resources based on their API version.
func NewAzApiRuleQueryOptionalExist ¶
func NewAzApiRuleQueryOptionalExist( ruleName, link, resourceType, minimumApiVersion, maximumApiVersion, query string, compareFunc blockquery.ResultCompareFunc, expectedResults ...cty.Value, ) *AzApiRule