terraform

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultProviderRegistryHost = "registry.terraform.io"

DefaultProviderRegistryHost is the hostname used for provider addresses that do not have an explicit hostname.

Variables

This section is empty.

Functions

func NewKusionResource

func NewKusionResource(p Provider, resourceType, resourceID string,
	attrs map[string]interface{}, dependsOn []string,
) (*v1.Resource, error)

NewKusionResource creates a Kusion Resource object with the given resourceType, resourceID, attributes.

func ToKusionResourceID

func ToKusionResourceID(p Provider, resourceType, resourceName string) (string, error)

ToKusionResourceID takes provider, resource info and returns string representing Kusion qualified resource ID.

Types

type Provider

type Provider struct {
	// Source address of the provider.
	Source string `yaml:"source" json:"source"`
	// Version constraint of the provider.
	Version string `yaml:"version" json:"version"`
	// Configuration arguments of the provider.
	ProviderConfigs map[string]any `yaml:"providerConfigs" json:"providerConfigs"`
}

Provider contains all the information of a specified Kusion provider, which not only includes the source address, version constraint of required provider, but also various configuration arguments used to configure required provider before Terraform can use them.

func NewProvider

func NewProvider(providerConfigs map[string]any, source, version string) (Provider, error)

NewProvider constructs a provider instance from given source, version and configuration arguments.

func (Provider) String

func (p Provider) String() string

String returns a qualified string, intended for use in resource extension.

type TFProvider

type TFProvider struct {
	Type      string
	Namespace string
	Hostname  svchost.Hostname
}

TFProvider encapsulates a single terraform provider type.

func (TFProvider) IDString

func (tp TFProvider) IDString() string

IDString returns the ProviderNamespace:ProviderName string, intended for use in a kusion resource ID.

func (TFProvider) String

func (tp TFProvider) String() string

String returns an FQN string, intended for use in machine-readable output.

Jump to

Keyboard shortcuts

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