parser

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const ConnectorSeparator = "connector--"

ConnectorSeparator is used to separate the connector id and the instance name.

Variables

This section is empty.

Functions

func ParseInstanceID

func ParseInstanceID(is instanceObjectState) (string, error)

ParseInstanceID get the real instance id from the instance object state. The instance id is stored in the "name" attribute of application resource.

func ParseInstanceMetadata

func ParseInstanceMetadata(is instanceObjectState) ([]byte, error)

ParseInstanceMetadata get the metadata from the instance object state.

func ParseInstanceProviderConnector

func ParseInstanceProviderConnector(providerString string) (string, error)

ParseInstanceProviderConnector get the provider connector from the provider instance string.

func ParseStateProviders

func ParseStateProviders(s string) ([]string, error)

ParseStateProviders parse terraform state and get providers.

Types

type AbsProviderConfig

type AbsProviderConfig struct {
	Provider Provider
	Alias    string
}

AbsProviderConfig is the absolute address of a provider configuration within a particular module instance.

func ParseAbsProviderConfig

func ParseAbsProviderConfig(traversal hcl.Traversal) (*AbsProviderConfig, error)

ParseAbsProviderConfig parses the given traversal as an absolute provider configuration address.

func ParseAbsProviderString

func ParseAbsProviderString(str string) (*AbsProviderConfig, error)

type OutputState deprecated

type OutputState struct {
	Value     property.Value `json:"value"`
	Type      cty.Type       `json:"type"`
	Sensitive bool           `json:"sensitive,omitempty"`
}

OutputState is the state of the output.

Deprecated: please use types.OutputValue instead.

type Provider

type Provider = tfaddr.Provider

type ResourceRevisionParser added in v0.5.0

type ResourceRevisionParser struct{}

func (ResourceRevisionParser) GetOriginalOutputs added in v0.5.0

func (p ResourceRevisionParser) GetOriginalOutputs(revision *model.ResourceRevision) ([]types.OutputValue, error)

GetOriginalOutputs returns the original outputs after parsed the resource revision output(terraform state).

The given revision must carry the resource on the edges, especially the resource's name.

This function returns the original outputs, which means the output's name(hcl label) is the same as the original one defined on the terraform template.

func (ResourceRevisionParser) GetOriginalOutputsMap added in v0.5.0

func (p ResourceRevisionParser) GetOriginalOutputsMap(
	revision *model.ResourceRevision,
) (map[string]types.OutputValue, error)

GetOriginalOutputsMap is similar to GetOriginalOutputs, but returns the original outputs in map form.

func (ResourceRevisionParser) GetOutputsMap added in v0.5.0

func (ResourceRevisionParser) GetOutputsMap(revision *model.ResourceRevision) (map[string]types.OutputValue, error)

GetOutputsMap returns the original outputs after parsed the resource revision output(terraform state).

Since we mutate the output names before executing a terraform deployment, the output's name(hcl label) is not the same as the original one defined on the terraform template.

This function is used for bridging the referring between multiple (walrus)resources. Use GetOriginalOutputsMap if wanna the original outputs.

func (ResourceRevisionParser) GetResourcesAndDependencies added in v0.5.0

func (ResourceRevisionParser) GetResourcesAndDependencies(revision *model.ResourceRevision) (
	resources model.ResourceComponents,
	dependencies map[string][]string,
	err error,
)

GetResourcesAndDependencies returns the resources and dependency resources after parsed the resource revision output.

GetResourcesAndDependencies returns list must not be `nil` unless unexpected input or raising error, it can be used to clean stale items safety if got an empty list.

Jump to

Keyboard shortcuts

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