Skip to content

Commit

Permalink
fix: support deleting all resources from a stack (#3252)
Browse files Browse the repository at this point in the history
We want to still keep the stack around, as it contains history of infra
changes
  • Loading branch information
jvmakine authored Oct 31, 2024
1 parent f8f8f44 commit 276153e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/ftl-provisioner-cloudformation/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"connectrpc.com/connect"
"github.com/aws/aws-sdk-go-v2/service/cloudformation"
goformation "github.com/awslabs/goformation/v7/cloudformation"
cf "github.com/awslabs/goformation/v7/cloudformation/cloudformation"
"github.com/awslabs/goformation/v7/cloudformation/rds"
"github.com/awslabs/goformation/v7/cloudformation/tags"
"golang.org/x/text/cases"
Expand Down Expand Up @@ -118,6 +119,10 @@ func (c *CloudformationProvisioner) createTemplate(req *provisioner.ProvisionReq
return "", err
}
}
// Stack can not be empty, insert a null resource to keep the stack around
if len(req.DesiredResources) == 0 {
template.Resources["NullResource"] = &cf.WaitConditionHandle{}
}

bytes, err := template.JSON()
if err != nil {
Expand Down

0 comments on commit 276153e

Please sign in to comment.