Detect stack already exists

This will later be used to switch to ChangeSet logic

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2020-04-22 15:37:39 +02:00
parent 0972776e6d
commit 87f053d710
2 changed files with 10 additions and 1 deletions

View File

@ -14,7 +14,6 @@ import (
func (c client) Convert(project *compose.Project, loadBalancerArn *string) (*cloudformation.Template, error) {
template := cloudformation.NewTemplate()
vpc, err := c.GetDefaultVPC()
if err != nil {
return nil, err

View File

@ -10,6 +10,16 @@ import (
)
func (c *client) ComposeUp(project *compose.Project, loadBalancerArn *string) error {
stacks, err := c.CF.DescribeStacks(&cloudformation.DescribeStacksInput{
StackName: aws.String(project.Name),
})
if err != nil {
return err
}
if len(stacks.Stacks) > 0 {
return fmt.Errorf("we do not (yet) support updating an existing CloudFormation stack")
}
template, err := c.Convert(project, loadBalancerArn)
if err != nil {
return err