resource

package
v0.0.0-...-e00f16c Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const KustomizationFileSuffix = "kustomization.yaml"

Variables

View Source
var NpmExecutable = "npm"
View Source
var NpmExecutablePath = ""
View Source
var NpxExecutable = "npx"
View Source
var NpxExecutablePath = ""

Functions

func RenderKubernetes

func RenderKubernetes(manifestDir string) (resmap.ResMap, error)

func RenderKustomize

func RenderKustomize(kustomizeDir string) (resmap.ResMap, error)

func RenderTerraform

func RenderTerraform(workingDir string) (*tfjson.Plan, error)

Types

type CloudformationResource

type CloudformationResource struct {
	ResName  string      `json:"resName"`
	Resource cfnResource `json:"resource"`
}

func (*CloudformationResource) Identifier

func (kr *CloudformationResource) Identifier() string

func (*CloudformationResource) Name

func (kr *CloudformationResource) Name() string

func (*CloudformationResource) Type

func (kr *CloudformationResource) Type() string

type CloudformationTemplate

type CloudformationTemplate struct {
	AWSTemplateFormatVersion string                    `json:"AWSTemplateFormatVersion,omitempty" yaml:"AWSTemplateFormatVersion"`
	Transform                *cloudformation.Transform `json:"Transform,omitempty"`
	Description              string                    `json:"Description,omitempty" yaml:"Description"`
	Metadata                 map[string]interface{}    `json:"Metadata,omitempty" yaml:"Metadata"`
	Parameters               map[string]interface{}    `json:"Parameters,omitempty" yaml:"Parameters"`
	Mappings                 map[string]interface{}    `json:"Mappings,omitempty" yaml:"Mappings"`
	Conditions               map[string]interface{}    `json:"Conditions,omitempty" yaml:"Conditions"`
	Resources                map[string]cfnResource    `json:"Resources,omitempty" yaml:"Resources"`
	Outputs                  cloudformation.Outputs    `json:"Outputs,omitempty" yaml:"Outputs"`
	Globals                  map[string]interface{}    `json:"Globals,omitempty" yaml:"Globals"`
}

Unfortunately, the CFN golang library can't be used because we don't want to bork on version mismatch

func RenderCdk

func RenderCdk(cdkDir string) (*CloudformationTemplate, error)

func RenderCloudformation

func RenderCloudformation(cfnFile string) (*CloudformationTemplate, error)

type DiffType

type DiffType string
const (
	DiffTypeCreate  DiffType = r3diff.CREATE
	DiffTypeReplace DiffType = "replace"
	DiffTypeUpdate  DiffType = r3diff.UPDATE
	DiffTypeDelete  DiffType = r3diff.DELETE
)

type KubernetesResource

type KubernetesResource struct {
	Resource *resource.Resource `json:"resource"`
	Origin   resource.Origin    `json:"origin"`
}

func (*KubernetesResource) Identifier

func (kr *KubernetesResource) Identifier() string

func (*KubernetesResource) Name

func (kr *KubernetesResource) Name() string

func (*KubernetesResource) Type

func (kr *KubernetesResource) Type() string

type Resource

type Resource interface {
	Type() string
	Identifier() string
	Name() string
}

type ResourceDiff

type ResourceDiff struct {
	Type DiffType         `json:"type"`
	Pre  Resource         `json:"pre"`
	Post Resource         `json:"post"`
	Diff r3diff.Changelog `json:"diff"`
}

func (*ResourceDiff) Identifier

func (rd *ResourceDiff) Identifier() string

func (*ResourceDiff) MarshalJSON

func (rd *ResourceDiff) MarshalJSON() ([]byte, error)

func (*ResourceDiff) Name

func (rd *ResourceDiff) Name() string

func (*ResourceDiff) String

func (rd *ResourceDiff) String() string

type ResourceDiffer

type ResourceDiffer interface {
	Diff(ctx context.Context, rs *git.RepoSpec, ep entrypoint.Entrypoint, oldPath, newPath string) ([]ResourceDiff, []Resource, []Resource, error)
}

func EntrypointDiffer

func EntrypointDiffer(ep entrypoint.Entrypoint) (ResourceDiffer, error)

type ResourceExtractor

type ResourceExtractor[T any] func(dir string, ep entrypoint.Entrypoint) (T, error)

type TerraformResource

type TerraformResource struct {
	Resource  interface{}            `json:"resource"`
	Unknown   interface{}            `json:"unknown"`
	Sensitive interface{}            `json:"sensitive"`
	Change    *tfjson.ResourceChange `json:"change"`
}

func (*TerraformResource) Identifier

func (kr *TerraformResource) Identifier() string

func (*TerraformResource) Name

func (kr *TerraformResource) Name() string

func (*TerraformResource) Type

func (kr *TerraformResource) Type() string

Jump to

Keyboard shortcuts

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