resource

package
v0.0.0-...-8652ae4 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: AGPL-3.0 Imports: 29 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 ContextWithTracer

func ContextWithTracer(ctx context.Context, tracer *tracing.Tracer) context.Context

ContextWithTracer returns a new context with the provided tracer attached.

func RenderKubernetes

func RenderKubernetes(ctx context.Context, manifestDir string) (resmap.ResMap, error)

RenderKubernetes renders Kubernetes manifests using Kustomize. It extracts the tracer from the context if available.

func RenderKustomize

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

func RenderTerraform

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

RenderTerraform renders a Terraform plan for the given working directory. It extracts the tracer from the context if available.

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(ctx context.Context, cdkDir string) (*CloudformationTemplate, error)

RenderCdk renders a CDK application to a CloudFormation template. It extracts the tracer from the context if available.

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