resources

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const TypeLocal = "local"
View Source
const TypeModule = "module"

TypeModule is the resource string for a Module resource

View Source
const TypeOutput = "output"
View Source
const TypeRoot = "root"

TypeModule is the resource string for a Module resource

View Source
const TypeVariable = "variable"

Variables

This section is empty.

Functions

func DefaultResources

func DefaultResources() types.RegisteredTypes

DefaultResources is a collection of the default config resources

Types

type FQRN

type FQRN struct {
	// Name of the module
	Module string
	// Type of the resource
	Type string
	// Resource name
	Resource string
	// Attribute for the resource
	Attribute string
}

FQRN is the fully qualified resource name

func FQRNFromResource

func FQRNFromResource(r types.Resource) *FQRN

FQRNFromResource returns the ResourceFQDN for the given Resource

func ParseFQRN

func ParseFQRN(fqrn string) (*FQRN, error)

ParseFQRN parses a "resource" fqrn and returns the individual components e.g:

get the "resource" container called mine that is in the root "module" which also has "attributes" // resource.container.mine.property.value

get the "resource" container called mine that is in the root "module" // resource.container.mine

get the "output" called mine that is in the root "module" // output.mine

get the "local" called mine that is in the root "module" // local.mine

get the container "resource" called mine in the "module" module2 that is in the "module" module1 // module1.module2.resource.container.mine

get the "output" called mine in the "module" module2 that is in the "module" module1 // module1.module2.output.mine

get the "module" resource called module2 in the "module" module1 // module1.module2

get the "module" resource called module1 in the root "module" // module1

func (*FQRN) AppendParentModule

func (f *FQRN) AppendParentModule(parent string) FQRN

AppendParentModule creates a new FQRN by adding the parent module to the reference.

func (FQRN) String

func (f FQRN) String() string

func (FQRN) StringWithoutAttribute added in v0.28.0

func (f FQRN) StringWithoutAttribute() string

type Local

type Local struct {
	types.ResourceBase `hcl:",remain"`

	CtyValue cty.Value `hcl:"value,optional"` // value of the output
	Value    any       `json:"value"`
}

Output defines an output variable which can be set by a module

type Module

type Module struct {
	types.ResourceBase `hcl:",remain"`

	Source  string `hcl:"source" json:"source"`
	Version string `hcl:"version,optional" json:"version,omitempty"`

	Variables any `hcl:"variables,optional" json:"variables,omitempty"`

	// SubContext is used to store the variables as a context that can be
	// passed to child resources
	SubContext *hcl.EvalContext
}

Module allows Shipyard configuration to be imported from external folder or GitHub repositories

type Output

type Output struct {
	types.ResourceBase `hcl:",remain"`

	CtyValue    cty.Value `hcl:"value,optional"` // value of the output
	Value       any       `json:"value"`
	Description string    `hcl:"description,optional" json:"description,omitempty"` // description for the output
}

Output defines an output variable which can be set by a module

type Root

type Root struct {
	types.ResourceBase `hcl:",remain"`
}

Module allows Shipyard configuration to be imported from external folder or GitHub repositories

type Variable

type Variable struct {
	types.ResourceBase `hcl:",remain"`
	Default            any    `hcl:"default" json:"default"`                            // default value for a variable
	Description        string `hcl:"description,optional" json:"description,omitempty"` // description of the variable
}

Output defines an output variable which can be set by a module

Jump to

Keyboard shortcuts

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