pulumi/pkg/engine/destroy.go
Matt Ellis daa083636c Rename envCmdInfo to planContext
This name is still not great, but the old name was really, really bad.
2017-10-02 18:03:07 -07:00

34 lines
710 B
Go

// Copyright 2017, Pulumi Corporation. All rights reserved.
package engine
import (
"github.com/pulumi/pulumi/pkg/tokens"
"github.com/pulumi/pulumi/pkg/util/contract"
)
type DestroyOptions struct {
Package string
DryRun bool
Debug bool
Parallel int
Summary bool
}
func (eng *Engine) Destroy(environment tokens.QName, opts DestroyOptions) error {
contract.Require(environment != tokens.QName(""), "environment")
info, err := eng.planContextFromEnvironment(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,
})
}