Explorar o código

list stacks by project name for ecs

Signed-off-by: aiordache <[email protected]>
aiordache %!s(int64=5) %!d(string=hai) anos
pai
achega
66c92595e5
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      ecs/sdk.go

+ 5 - 1
ecs/sdk.go

@@ -303,7 +303,11 @@ func (s sdk) GetStackID(ctx context.Context, name string) (string, error) {
 }
 
 func (s sdk) ListStacks(ctx context.Context, name string) ([]compose.Stack, error) {
-	cfStacks, err := s.CF.DescribeStacksWithContext(ctx, &cloudformation.DescribeStacksInput{})
+	params := cloudformation.DescribeStacksInput{}
+	if name != "" {
+		params.StackName = &name
+	}
+	cfStacks, err := s.CF.DescribeStacksWithContext(ctx, &params)
 	if err != nil {
 		return nil, err
 	}