cfdl

package module
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 14 Imported by: 2

README

cfdl AWS CloudFormation Deploy library

Deploy CloudFormation as go programm.

Usage

  1. create a CloudFormation client
client := cfdl.Client()
  1. create a goformation template
import 	"github.com/awslabs/goformation/v4/cloudformation"
...	
template :=	template := cloudformation.NewTemplate()
...
  1. Populate template
import 	"github.com/awslabs/goformation/v4/cloudformation/sns"
...
	template.Resources["GoFormationCompareTopic"] = &sns.Topic{
		TopicName: "CfdCdkCompareTopic" + strconv.FormatInt(time.Now().Unix(), 10),
		};
  1. Deploy stack
	cfdl.CreateStack(client,stackname, template)

Documentation

Index

Constants

View Source
const (
	// ColorDefault default color
	ColorDefault = "\x1b[39m"
	// ColorRed red for screen
	ColorRed = "\x1b[91m"
	// ColorGreen green for screen
	ColorGreen = "\x1b[32m"
	// ColorBlue blue for screen
	ColorBlue = "\x1b[94m"
	// ColorGray for screen
	ColorGray = "\x1b[90m"
)
View Source
const StatusCreateComplete = "CREATE_COMPLETE"

StatusCreateComplete CloudFormation Status

View Source
const StatusCreateInProgress = "CREATE_IN_PROGRESS"

StatusCreateInProgress CloudFormation Status

View Source
const StatusDeleteComplete = "DELETE_COMPLETE"

StatusDeleteComplete CloudFormation Status

View Source
const StatusUpdateComplete = "UPDATE_COMPLETE"

StatusUpdateComplete text for update

Variables

This section is empty.

Functions

func Client

func Client(region string) *cfnservice.Client

Client get a CloudFormation service client

func CountCompleted added in v0.1.4

func CountCompleted(data map[string]CloudFormationResource) int

CountCompleted how many completed

func CreateChangeSet added in v0.1.4

func CreateChangeSet(client DeployInterface, name string, template *cloudformation.Template)

CreateChangeSet start an Change Set cycle

func CreateStack

func CreateStack(client DeployInterface, name string, template *cloudformation.Template)

CreateStack first time stack creation client - the aws cloudformation client name - name if the Cloudformaiton template template - a goformation template

func DeleteStack

func DeleteStack(client DeployInterface, name string)

DeleteStack first time stack creation

func DumpTemplate added in v0.1.4

func DumpTemplate(template *cloudformation.Template)

DumpTemplate for debugging

func IsStackCompleted

func IsStackCompleted(data map[string]CloudFormationResource) bool

IsStackCompleted check for everything "completed"

func PopulateData

func PopulateData(client DeployInterface, name string, data map[string]CloudFormationResource) map[string]CloudFormationResource

PopulateData update status from describe call

func ShowStatus

func ShowStatus(client DeployInterface, name string, template *cloudformation.Template, endState string)

ShowStatus status of stack

func UpdateStack added in v0.1.3

func UpdateStack(client DeployInterface, name string, template *cloudformation.Template)

UpdateStack first time stack creation client - the aws cloudformation client name - name if the Cloudformaiton template template - a goformation template

Types

type CloudFormationResource

type CloudFormationResource struct {
	LogicalResourceID    string
	PhysicalResourceID   string
	Status               string
	Type                 string
	Timestamp            time.Time
	ResourceStatusReason string
}

CloudFormationResource holder for status

type DeployInterface

type DeployInterface interface {
	CreateStack(ctx context.Context, params *cfn.CreateStackInput, optFns ...func(*cfn.Options)) (*cfn.CreateStackOutput, error)
	DescribeStackEvents(ctx context.Context, params *cfn.DescribeStackEventsInput, optFns ...func(*cfn.Options)) (*cfn.DescribeStackEventsOutput, error)
	DeleteStack(ctx context.Context, params *cfn.DeleteStackInput, optFns ...func(*cfn.Options)) (*cfn.DeleteStackOutput, error)
	UpdateStack(ctx context.Context, params *cfn.UpdateStackInput, optFns ...func(*cfn.Options)) (*cfn.UpdateStackOutput, error)
	CreateChangeSet(ctx context.Context, params *cfn.CreateChangeSetInput, optFns ...func(*cfn.Options)) (*cfn.CreateChangeSetOutput, error)
	ExecuteChangeSet(ctx context.Context, params *cfn.ExecuteChangeSetInput, optF ...func(*cfn.Options)) (*cfn.ExecuteChangeSetOutput, error)
}

DeployInterface all deployment functions

Jump to

Keyboard shortcuts

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