cftv1

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// YAMLExtension yaml
	YAMLExtension = "yaml"

	// YAMLExtension2 yml
	YAMLExtension2 = "yml"

	// JSONExtension json
	JSONExtension = "json"

	// TXTExtension txt
	TXTExtension = "txt"

	// TemplateExtension template
	TemplateExtension = "template"

	// UnknownExtension unknown
	UnknownExtension = "unknown"
)
View Source
const PARAMETERS = "Parameters"

PARAMETERS is a constant to fetch Parameters from CFT

View Source
const RESOURCES = "Resources"

RESOURCES is a constant to fetch Resources from CFT

Variables

View Source
var Tags = map[string]string{
	"!And":           "Fn::And",
	"!Base64":        "Fn::Base64",
	"!Cidr":          "Fn::Cidr",
	"!Equals":        "Fn::Equals",
	"!FindInMap":     "Fn::FindInMap",
	"!GetAZs":        "Fn::GetAZs",
	"!GetAtt":        "Fn::GetAtt",
	"!If":            "Fn::If",
	"!ImportValue":   "Fn::ImportValue",
	"!Join":          "Fn::Join",
	"!Not":           "Fn::Not",
	"!Or":            "Fn::Or",
	"!Select":        "Fn::Select",
	"!Split":         "Fn::Split",
	"!Sub":           "Fn::Sub",
	"!Ref":           "Ref",
	"!Condition":     "Condition",
	"!Rain::Embed":   "Rain::Embed",
	"!Rain::Include": "Rain::Include",
	"!Rain::Env":     "Rain::Env",
	"!Rain::S3Http":  "Rain::S3Http",
	"!Rain::S3":      "Rain::S3",
	"!Rain::Module":  "Rain::Module",
}

Tags is a mapping from YAML short tags to full instrincic function names

Functions

func AppendStateMap added in v1.19.1

func AppendStateMap(state Template) *yaml.Node

AppendStateMap appends a "State" section to the template

func CFTFileExtensions

func CFTFileExtensions() []string

CFTFileExtensions returns the valid extensions for AWS CFT (json | YAML | txt | template)

func Clone added in v1.19.1

func Clone(node *yaml.Node) *yaml.Node

Clone returns a copy of the provided node

func TransformNode added in v1.19.1

func TransformNode(n *yaml.Node) error

TransformNode takes a *yaml.Node and convert tag-style names into map-style, and converts other scalars into a canonical format

Types

type CFTV1

type CFTV1 struct {
	// contains filtered or unexported fields
}

CFTV1 struct implements the IacProvider interface

func (*CFTV1) File added in v1.19.1

func (a *CFTV1) File(fileName string) (Template, error)

File reads the file and returns string

func (*CFTV1) LoadIacDir

func (a *CFTV1) LoadIacDir(absRootDir string, options map[string]interface{}) (output.AllResourceConfigs, error)

LoadIacDir loads all CFT template files in the current directory.

func (*CFTV1) LoadIacFile

func (a *CFTV1) LoadIacFile(absFilePath string, options map[string]interface{}) (allResourcesConfig output.AllResourceConfigs, err error)

LoadIacFile loads the specified CFT template file. Note that a single CFT template json file may contain multiple resource definitions.

func (*CFTV1) Name

func (*CFTV1) Name() string

Name returns name of the provider

func (*CFTV1) ReadYAMLFileIntoJSON added in v1.19.1

func (a *CFTV1) ReadYAMLFileIntoJSON(fileName string) ([]byte, error)

ReadYAMLFileIntoJSON converts the given file into JSON string

type Template added in v1.19.1

type Template struct {
	*yaml.Node
}

Template represents a CloudFormation template. The Template type is minimal for now but will likely grow new features as needed by rain.

func Node added in v1.19.1

func Node(node *yaml.Node) (Template, error)

Node returns a cft.Template parse from a *yaml.Node

func String added in v1.19.1

func String(input string) (Template, error)

String returns a cft.Template parsed from a string

func (Template) Map added in v1.19.1

func (t Template) Map() (map[string]interface{}, error)

Map returns the template as a map[string]interface{}

Jump to

Keyboard shortcuts

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