sgterraform

package
v0.280.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(ctx context.Context, args ...string) *exec.Cmd

func CommentOnPRWithPlanSummarized added in v0.229.0

func CommentOnPRWithPlanSummarized(ctx context.Context, prNumber, environment, planFilePath string) *exec.Cmd

func CommentOnPullRequestWithPlan added in v0.61.0

func CommentOnPullRequestWithPlan(ctx context.Context, prNumber, environment, planFilePath string) *exec.Cmd

func PrepareCommand

func PrepareCommand(ctx context.Context) error

Types

type Action added in v0.229.0

type Action string

Action is a valid action type for a resource change.

Note that a singular Action is not telling of a full resource change operation. Certain resource actions, such as replacement, are a composite of more than one type. See the Actions type and its helpers for more information.

const (
	// ActionNoop denotes a no-op operation.
	ActionNoop Action = "no-op"

	// ActionCreate denotes a create operation.
	ActionCreate Action = "create"

	// ActionRead denotes a read operation.
	ActionRead Action = "read"

	// ActionUpdate denotes an update operation.
	ActionUpdate Action = "update"

	// ActionDelete denotes a delete operation.
	ActionDelete Action = "delete"
)

type Actions added in v0.229.0

type Actions []Action

Actions denotes a valid change type.

func (Actions) Create added in v0.229.0

func (a Actions) Create() bool

Create is true if this set of Actions denotes creation of a new resource.

func (Actions) CreateBeforeDestroy added in v0.229.0

func (a Actions) CreateBeforeDestroy() bool

CreateBeforeDestroy is true if this set of Actions denotes a create-before-destroy operation, usually the result of replacement to a resource that has the create_before_destroy lifecycle option set.

func (Actions) Delete added in v0.229.0

func (a Actions) Delete() bool

Delete is true if this set of Actions denotes resource removal.

func (Actions) DestroyBeforeCreate added in v0.229.0

func (a Actions) DestroyBeforeCreate() bool

DestroyBeforeCreate is true if this set of Actions denotes a destroy-before-create operation. This is the standard resource replacement method.

func (Actions) NoOp added in v0.229.0

func (a Actions) NoOp() bool

NoOp is true if this set of Actions denotes a no-op.

func (Actions) Read added in v0.229.0

func (a Actions) Read() bool

Read is true if this set of Actions denotes a read operation only.

func (Actions) Replace added in v0.229.0

func (a Actions) Replace() bool

Replace is true if this set of Actions denotes a valid replacement operation.

func (Actions) Update added in v0.229.0

func (a Actions) Update() bool

Update is true if this set of Actions denotes an update operation.

type Plan added in v0.229.0

type Plan struct {
	ResourceChanges []*struct {
		// The resource type, example: "aws_instance" for aws_instance.foo.
		Type string `json:"type,omitempty"`

		// The resource name, example: "foo" for aws_instance.foo.
		Name string `json:"name,omitempty"`

		// The data describing the change that will be made to this object.
		Change *struct {
			// The action to be carried out by this change.
			Actions Actions `json:"actions,omitempty"`
		} `json:"change,omitempty"`
	} `json:"resource_changes,omitempty"`
}

Plan contains a simplified definition of the json generated when using the -json flag for terraform plan. It only includes the fields needed to generate the plan summery used in CommentOnPRWithPlanSummarized. The full plan definition can be found in github.com/hashicorp/terraform-json.

type TfChange added in v0.229.0

type TfChange struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL