pkg

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

This file implements !Rain::Module

Package pkg provides functionality similar to the AWS CLI cloudformation package command but has greater flexibility, allowing content to be included anywhere in a template

To include content into your templates, use any of the following either as YAML tags or as one-property objects, much as AWS intrinsic functions are used, e.g. "Fn::Join"

`Rain::Include`: insert the content of the file into the template directly. The file must be in YAML or JSON format. `Rain::Env`: inserts environmental variable value into the template as a string. Variable must be set. `Rain::Embed`: insert the content of the file as a string `Rain::S3Http`: uploads the file or directory (zipping it first) to S3 and returns the HTTP URI (i.e. `https://bucket.s3.region.amazonaws.com/key`) `Rain::S3`: a string value uploads the file or directory (zipping it first) to S3 and returns the S3 URI (i.e. `s3://bucket/key`) `Rain::S3`: an object with the following properties

`Path`: path to the file or directory. If a directory is supplied, it will be zipped before uploading to S3
`BucketProperty`: Name of returned property that will contain the bucket name
`KeyProperty`: Name of returned property that will contain the object key
`VersionProperty`: (optional) Name of returned property that will contain the object version

`Rain::Module`: Supply a URL to a rain module, which is similar to a CloudFormation module,

but allows for type inheritance. One of the resources in the module yaml file
must be called "ModuleExtension", and it must have a Metadata entry called
"Extends" that supplies the existing type to be extended. The Parameters section
of the module can be used to define additional properties for the extension.

Package pkg provides functionality similar to the AWS CLI cloudformation package command but has greater flexibility, allowing content to be included anywhere in a template

To include content into your templates, use any of the following either as YAML tags or as one-property objects, much as AWS instrinsic functions are used, e.g. "Fn::Join"

`Rain::Include`: insert the content of the file into the template directly. The file must be in YAML or JSON format. `Rain::Env`: inserts environmental variable value into the template as a string. Variable must be set. `Rain::Embed`: insert the content of the file as a string `Rain::S3Http`: uploads the file or directory (zipping it first) to S3 and returns the HTTP URI (i.e. `https://bucket.s3.region.amazonaws.com/key`) `Rain::S3`: a string value uploads the file or directory (zipping it first) to S3 and returns the S3 URI (i.e. `s3://bucket/key`) `Rain::S3`: an object with the following properties

`Path`: path to the file or directory. If a directory is supplied, it will be zipped before uploading to S3
`BucketProperty`: Name of returned property that will contain the bucket name
`KeyProperty`: Name of returned property that will contain the object key
`VersionProperty`: (optional) Name of returned property that will contain the object version

Index

Constants

View Source
const (
	Rain                = "Rain"
	Metadata            = "Metadata"
	IfParam             = "IfParam"
	IfNotParam          = "IfNotParam"
	Overrides           = "Overrides"
	DependsOn           = "DependsOn"
	Properties          = "Properties"
	CreationPolicy      = "CreationPolicy"
	UpdatePolicy        = "UpdatePolicy"
	DeletionPolicy      = "DeletionPolicy"
	UpdateReplacePolicy = "UpdateReplacePolicy"
	Condition           = "Condition"
	Default             = "Default"
)

Variables

View Source
var Experimental bool

Experimental must be set to true to enable !Rain::Module

Functions

func ConvertCsvToSequence added in v1.4.4

func ConvertCsvToSequence(csv string) *yaml.Node

Convert a comma delimted string to a sequence node

func DownloadFromZip added in v1.20.0

func DownloadFromZip(uriString string, verifyHash string, path string) ([]byte, error)

DownloadFromZip retrieves a single file from a zip file hosted on a URI

func File

func File(path string) (cft.Template, error)

File opens path as a CloudFormation template and returns a cft.Template with assets included as per AWS CLI packaging rules and any Rain:: functions used

func IsSubNeeded added in v1.19.0

func IsSubNeeded(s string) bool

func Template

func Template(t cft.Template, rootDir string, fs *embed.FS) (cft.Template, error)

Template returns t with assets included as per AWS CLI packaging rules and any Rain:: functions used. rootDir must be passed in so that any included assets can be loaded from the same directory

func Unzip added in v1.20.0

func Unzip(f *os.File, dest string) error

Unzip unzips a zip file to a destination directory

Types

This section is empty.

Jump to

Keyboard shortcuts

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