cloudformation

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package cloudformation scopes CloudFormation-specific utiltities for Sparta

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToTemplateExpression

func ConvertToTemplateExpression(templateData io.Reader, additionalUserTemplateProperties map[string]interface{}) (*gocf.StringExpr, error)

ConvertToTemplateExpression transforms the templateData contents into an Fn::Join- compatible representation for template serialization. The templateData contents may include both golang text/template properties and single-line JSON Fn::Join supported serializations.

Example
package main

import (
	"strings"
)

var sampleTemplate = `
BASIC_AUTH_USERNAME={{ .Username }}
CONCOURSE_BASIC_AUTH_PASSWORD={{ .Password }}
SPARTA_CICD_BINARY_PATH=/home/ubuntu/{{ .ServiceName }}.lambda.amd64
POSTGRES_ADDRESS={ "Fn::GetAtt" : [ "{{ .PostgreSQLCloudFormationResource }}" , "Endpoint.Address" ] }
`
var sampleTemplateProps = map[string]interface{}{
	"Username":                         "MyPassword",
	"Password":                         "MyPassword",
	"PostgreSQLCloudFormationResource": "DBInstance0bef52bca519f672fddf3a6e0cbf1325e0a3263c",
}

func main() {
	templateReader := strings.NewReader(sampleTemplate)
	ConvertToTemplateExpression(templateReader, sampleTemplateProps)
}
Output:

func MapToResourceTags

func MapToResourceTags(tagMap map[string]string) []interface{}

MapToResourceTags transforms a go map[string]string to a CloudFormation-compliant Tags representation. See http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html

func S3AllKeysArnForBucket

func S3AllKeysArnForBucket(bucket interface{}) *gocf.StringExpr

S3AllKeysArnForBucket returns a CloudFormation-compatible Arn expression (string or Ref) for all bucket keys (`/*`). The bucket parameter may be either a string or an interface{} ("Ref: "myResource") value

func S3ArnForBucket

func S3ArnForBucket(bucket interface{}) *gocf.StringExpr

S3ArnForBucket returns a CloudFormation-compatible Arn expression (string or Ref) suitable for template reference. The bucket parameter may be either a string or an interface{} ("Ref: "myResource") value

Types

This section is empty.

Jump to

Keyboard shortcuts

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