rules

package
v0.0.0-...-d97564e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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

func (*AzApiRule) Attributes

func (r *AzApiRule) Attributes() []string

func (*AzApiRule) BlockType

func (r *AzApiRule) BlockType() string

func (*AzApiRule) Check

func (r *AzApiRule) Check(runner tflint.Runner) error

func (*AzApiRule) Enabled

func (r *AzApiRule) Enabled() bool

func (*AzApiRule) LabelNames

func (r *AzApiRule) LabelNames() []string

func (*AzApiRule) LabelOne

func (r *AzApiRule) LabelOne() string
func (r *AzApiRule) Link() string

func (*AzApiRule) Name

func (r *AzApiRule) Name() string

func (*AzApiRule) Severity

func (r *AzApiRule) Severity() tflint.Severity

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL