resources

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllResources

func GetAllResources[T Resource](ctx MultyContext) []T

func GetAllResourcesInCloud

func GetAllResourcesInCloud[T Resource](ctx MultyContext, cloud common.CloudProvider) []T

func GetCloudSpecificResourceId

func GetCloudSpecificResourceId(r Resource, cloud common.CloudProvider) string

func GetMainOutputId

func GetMainOutputId(r Resource, cloud common.CloudProvider) string

func GetResourceIdForCloud

func GetResourceIdForCloud(resourceId string, cloud common.CloudProvider) string

Types

type CloudSpecificResource

type CloudSpecificResource struct {
	Cloud             common.CloudProvider
	Resource          Resource
	ImplicitlyCreated bool
}

func (*CloudSpecificResource) GetLocation

func (c *CloudSpecificResource) GetLocation(ctx MultyContext) string

func (*CloudSpecificResource) GetMainOutputId

func (c *CloudSpecificResource) GetMainOutputId() string

func (*CloudSpecificResource) GetResourceId

func (c *CloudSpecificResource) GetResourceId() string

func (*CloudSpecificResource) Translate

func (c *CloudSpecificResource) Translate(ctx MultyContext) []output.TfBlock

type CommonResourceParams

type CommonResourceParams struct {
	ResourceId      string
	ResourceGroupId string
	Location        string            `hcl:"location,optional"`
	Clouds          []string          `hcl:"clouds,optional"`
	RgVars          map[string]string `hcl:"rg_vars,optional"`
	DependsOn       []string
	*validate.ResourceValidationInfo
}

func (*CommonResourceParams) GetDependencies

func (c *CommonResourceParams) GetDependencies(ctx MultyContext) []CloudSpecificResource

func (*CommonResourceParams) GetLocation

func (c *CommonResourceParams) GetLocation(cloud common.CloudProvider, ctx MultyContext) string

func (*CommonResourceParams) GetOutputValues

func (c *CommonResourceParams) GetOutputValues(cloud common.CloudProvider) map[string]cty.Value

func (*CommonResourceParams) GetResourceId

func (c *CommonResourceParams) GetResourceId() string

func (*CommonResourceParams) GetTfResourceId

func (c *CommonResourceParams) GetTfResourceId(cloud common.CloudProvider) string

type MultyContext

type MultyContext struct {
	Resources map[string]CloudSpecificResource
	Location  string
}

func (*MultyContext) GetLocation

func (ctx *MultyContext) GetLocation(specifiedLocation string, cloud common.CloudProvider) string

func (*MultyContext) GetLocationFromCommonParams

func (ctx *MultyContext) GetLocationFromCommonParams(commonParams *CommonResourceParams, cloud common.CloudProvider) string

type Resource

type Resource interface {
	Translate(cloud common.CloudProvider, ctx MultyContext) []output.TfBlock
	// GetOutputValues returns values that should be passed around when parsing the remainder of the config file.
	GetOutputValues(cloud common.CloudProvider) map[string]cty.Value

	GetResourceId() string

	GetLocation(cloud common.CloudProvider, ctx MultyContext) string

	Validate(ctx MultyContext, cloud common.CloudProvider) []validate.ValidationError

	GetMainResourceName(cloud common.CloudProvider) string

	GetDependencies(ctx MultyContext) []CloudSpecificResource
}

Jump to

Keyboard shortcuts

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