pulumi/pkg/engine/destroy.go

30 lines
608 B
Go
Raw Normal View History

// Copyright 2017, Pulumi Corporation. All rights reserved.
package engine
import "github.com/pulumi/pulumi/pkg/tokens"
2017-08-24 01:50:20 +02:00
type DestroyOptions struct {
Environment string
Package string
DryRun bool
Debug bool
Parallel int
2017-08-24 01:50:20 +02:00
Summary bool
}
func (eng *Engine) Destroy(opts DestroyOptions) error {
info, err := eng.initEnvCmdName(tokens.QName(opts.Environment), opts.Package)
if err != nil {
return err
}
return eng.deployLatest(info, deployOptions{
Debug: opts.Debug,
Destroy: true,
DryRun: opts.DryRun,
Parallel: opts.Parallel,
Summary: opts.Summary,
})
}