Documentation ¶
Index ¶
- Constants
- func ParseIndexKey(rs resourceState, is instanceObjectState) (string, error)
- func ParseInstanceID(rs resourceState, is instanceObjectState) (string, error)
- func ParseInstanceMetadata(is instanceObjectState) ([]byte, error)
- func ParseInstanceProviderConnector(providerString string) (string, error)
- func ParseStateProviders(s string) ([]string, error)
- type AbsProviderConfig
- type OutputStatedeprecated
- type Provider
- type StateParser
- func (StateParser) GetComponentsAndExtractDependencies(ctx context.Context, mc model.ClientSet, run *model.ResourceRun) (components model.ResourceComponents, dependencies map[string][]string, ...)
- func (p StateParser) GetOriginalOutputs(stateData, resourceName string) ([]types.OutputValue, error)
- func (p StateParser) GetOriginalOutputsMap(stateData, resourceName string) (map[string]types.OutputValue, error)
- func (StateParser) GetOutputMap(stateData string) (map[string]types.OutputValue, error)
Constants ¶
const ConnectorSeparator = "connector--"
ConnectorSeparator is used to separate the connector id and the instance name.
const TerraformTypeData = "terraform_data"
The type terraform data implements the standard resource lifecycle, but does not directly take any other actions. Resource components should skip the data type.
Variables ¶
This section is empty.
Functions ¶
func ParseIndexKey ¶ added in v0.6.0
ParseIndexKey parse the index key from the instance object state. The index key is used to identify the terraform resource instance, e.g. `helm_release.foo[0]`.
func ParseInstanceID ¶
ParseInstanceID get the real instance id from the instance object state. The instance id is stored in the "name" attribute of resource component.
func ParseInstanceMetadata ¶
ParseInstanceMetadata get the metadata from the instance object state.
func ParseInstanceProviderConnector ¶
ParseInstanceProviderConnector get the provider connector from the provider instance string.
func ParseStateProviders ¶
ParseStateProviders parse terraform state and get providers.
Types ¶
type AbsProviderConfig ¶
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 StateParser ¶ added in v0.6.0
type StateParser struct{}
func (StateParser) GetComponentsAndExtractDependencies ¶ added in v0.6.0
func (StateParser) GetComponentsAndExtractDependencies( ctx context.Context, mc model.ClientSet, run *model.ResourceRun, ) ( components model.ResourceComponents, dependencies map[string][]string, err error, )
GetComponentsAndExtractDependencies returns the components and dependency components after parse the resource state.
GetComponentsAndExtractDependencies 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.
func (StateParser) GetOriginalOutputs ¶ added in v0.6.0
func (p StateParser) GetOriginalOutputs(stateData, resourceName string) ([]types.OutputValue, error)
GetOriginalOutputs returns the original outputs after parsed the resource run output(terraform state).
The given run 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 (StateParser) GetOriginalOutputsMap ¶ added in v0.6.0
func (p StateParser) GetOriginalOutputsMap(stateData, resourceName string) (map[string]types.OutputValue, error)
GetOriginalOutputsMap is similar to GetOriginalOutputs, but returns the original outputs in map form.
func (StateParser) GetOutputMap ¶ added in v0.6.0
func (StateParser) GetOutputMap(stateData string) (map[string]types.OutputValue, error)
GetOutputMap returns the original outputs after parsed the resource run 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.