google

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2021 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GoogleProviderBlockSchema = &hcl.BodySchema{
	Attributes: []hcl.AttributeSchema{
		{Name: "project"},
	},
}

GoogleProviderBlockSchema is a schema of `google` provider block

Functions

func GetProject

func GetProject(runner tflint.Runner) (string, error)

GetProject retrieves project_id from the "provider" block in the Terraform configuration and environment variables

Types

type Client

type Client struct {
	ServiceUsage *serviceusage.Service
}

Client is a wrapper of the Google API client

func NewClient

func NewClient() (*Client, error)

NewClient returns a new Client

type Config

type Config struct {
	DeepCheck bool `hcl:"deep_check,optional"`

	Remain hcl.Body `hcl:",remain"`
}

Config is the configuration for the ruleset.

type ProviderData

type ProviderData struct {
	// contains filtered or unexported fields
}

ProviderData represents a provider block with an eval context (runner)

func (*ProviderData) Get

func (d *ProviderData) Get(key string) (string, bool, error)

Get returns a value corresponding to the given key It should be noted that the value is evaluated if it is evaluable The second return value is a flag that determines whether a value exists We assume the provider has only simple attributes, so it just returns string

type RuleSet

type RuleSet struct {
	tflint.BuiltinRuleSet
	APIRules []tflint.Rule
	// contains filtered or unexported fields
}

RuleSet is the custom ruleset for the Google provider plugin.

func (*RuleSet) ApplyConfig

func (r *RuleSet) ApplyConfig(config *tflint.Config) error

ApplyConfig reflects the plugin configuration to the ruleset.

func (*RuleSet) Check

func (r *RuleSet) Check(rr tflint.Runner) error

Check runs inspections for each rule with the custom Google runner.

func (*RuleSet) RuleNames

func (r *RuleSet) RuleNames() []string

RuleNames is a list of rule names provided by the plugin.

type Runner

type Runner struct {
	tflint.Runner
	Client  *Client
	Project string
}

Runner is a wrapper of RPC client for inserting custom actions for Google provider.

func NewRunner

func NewRunner(runner tflint.Runner, config *Config) (*Runner, error)

NewRunner returns a custom Google runner.

func (*Runner) ParentProject

func (r *Runner) ParentProject() string

ParentProject returns a part of the API path about the parent project

Jump to

Keyboard shortcuts

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