@@ -31,6 +31,8 @@ import (
3131 "strconv"
3232 "time"
3333
34+ "github.com/aws/aws-sdk-go/aws"
35+ "github.com/aws/aws-sdk-go/service/cloudformation"
3436 "github.com/aws/aws-sdk-go/service/iam"
3537 "github.com/gofrs/flock"
3638 . "github.com/onsi/ginkgo/v2"
@@ -140,12 +142,18 @@ func Node1BeforeSuite(e2eCtx *E2EContext) []byte {
140142 By (fmt .Sprintf ("Trying to create CloudFormation stack... attempt %d" , count ))
141143 success := true
142144 if err := createCloudFormationStack (e2eCtx .AWSSession , bootstrapTemplate , bootstrapTags ); err != nil {
145+ svc := cloudformation .New (e2eCtx .AWSSession )
146+ if events , err := svc .DescribeStackEvents (& cloudformation.DescribeStackEventsInput {
147+ StackName : aws .String (bootstrapTemplate ),
148+ }); err == nil {
149+ By (fmt .Sprintf ("Stack creation failed. Recent events:\n %v" , events ))
150+ }
143151 By (fmt .Sprintf ("Failed to create CloudFormation stack in attempt %d: %s" , count , err .Error ()))
144152 deleteCloudFormationStack (e2eCtx .AWSSession , bootstrapTemplate )
145153 success = false
146154 }
147155 return success
148- }, 10 * time .Minute , 5 * time .Second ).Should (BeTrue (), "Should've eventually succeeded creating an AWS CloudFormation stack" )
156+ }, 30 * time .Minute , 30 * time .Second ).Should (BeTrue (), "Should've eventually succeeded creating an AWS CloudFormation stack" )
149157 }
150158
151159 ensureStackTags (e2eCtx .AWSSession , bootstrapTemplate .Spec .StackName , bootstrapTags )
0 commit comments