terraform

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2020 License: MPL-2.0 Imports: 1 Imported by: 1

Documentation

Overview

Package terraform contains structures for Terraform's alternative representations. The reason for providing these is to avoid depending on Terraform for this plugin.

The structures provided by this package are minimal used for static analysis. Also, this is often not transferred directly from the host process, but through an intermediate representation. See the package tflint for details.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	Config hcl.Body

	DeclRange hcl.Range
}

Connection is an alternative representation of configs.Connection. https://github.com/hashicorp/terraform/blob/v0.12.26/configs/provisioner.go#L164-L170

type ManagedResource

type ManagedResource struct {
	Connection   *Connection
	Provisioners []*Provisioner

	CreateBeforeDestroy bool
	PreventDestroy      bool
	// IgnoreChanges       []hcl.Traversal
	IgnoreAllChanges bool

	CreateBeforeDestroySet bool
	PreventDestroySet      bool
}

ManagedResource is an alternative representation of configs.ManagedResource. https://github.com/hashicorp/terraform/blob/v0.12.26/configs/resource.go#L35-L47 IgnoreChanges is not supported due to the difficulty of intermediate representation.

type ProviderConfigRef

type ProviderConfigRef struct {
	Name       string
	NameRange  hcl.Range
	Alias      string
	AliasRange *hcl.Range
}

ProviderConfigRef is an alternative representation of configs.ProviderConfigRef. https://github.com/hashicorp/terraform/blob/v0.12.26/configs/resource.go#L371-L376

type Provisioner

type Provisioner struct {
	Type       string
	Config     hcl.Body
	Connection *Connection
	When       ProvisionerWhen
	OnFailure  ProvisionerOnFailure

	DeclRange hcl.Range
	TypeRange hcl.Range
}

Provisioner is an alternative representation of configs.Provisioner. https://github.com/hashicorp/terraform/blob/v0.12.26/configs/provisioner.go#L9-L20

type ProvisionerOnFailure

type ProvisionerOnFailure int

ProvisionerOnFailure is an alternative representation of configs.ProvisionerOnFailure. https://github.com/hashicorp/terraform/blob/v0.12.26/configs/provisioner.go#L183-L193

const (
	// ProvisionerOnFailureInvalid is the zero value of ProvisionerOnFailure.
	ProvisionerOnFailureInvalid ProvisionerOnFailure = iota
	// ProvisionerOnFailureContinue indicates continuation on failure.
	ProvisionerOnFailureContinue
	// ProvisionerOnFailureFail indicates failure on failure.
	ProvisionerOnFailureFail
)

type ProvisionerWhen

type ProvisionerWhen int

ProvisionerWhen is an alternative representation of configs.ProvisionerWhen. https://github.com/hashicorp/terraform/blob/v0.12.26/configs/provisioner.go#L172-L181

const (
	// ProvisionerWhenInvalid is the zero value of ProvisionerWhen.
	ProvisionerWhenInvalid ProvisionerWhen = iota
	// ProvisionerWhenCreate indicates the time of creation.
	ProvisionerWhenCreate
	// ProvisionerWhenDestroy indicates the time of deletion.
	ProvisionerWhenDestroy
)

type Resource

type Resource struct {
	Mode    ResourceMode
	Name    string
	Type    string
	Config  hcl.Body
	Count   hcl.Expression
	ForEach hcl.Expression

	ProviderConfigRef *ProviderConfigRef

	Managed *ManagedResource

	DeclRange hcl.Range
	TypeRange hcl.Range
}

Resource is an alternative representation of configs.Resource. https://github.com/hashicorp/terraform/blob/v0.12.26/configs/resource.go#L13-L33 DependsOn is not supported due to the difficulty of intermediate representation.

type ResourceMode

type ResourceMode rune

ResourceMode is an alternative representation of addrs.ResourceMode. https://github.com/hashicorp/terraform/blob/v0.12.26/addrs/resource.go#L253-L271

const (
	// InvalidResourceMode is the zero value of ResourceMode.
	InvalidResourceMode ResourceMode = 0
	// ManagedResourceMode indicates a managed resource.
	ManagedResourceMode ResourceMode = 'M'
	// DataResourceMode indicates a data resource.
	DataResourceMode ResourceMode = 'D'
)

Jump to

Keyboard shortcuts

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