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 ¶
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.