Documentation ¶
Index ¶
- func Command(ctx context.Context, args ...string) *exec.Cmd
- func CommentOnPRWithPlanSummarized(ctx context.Context, prNumber, environment, planFilePath string) *exec.Cmd
- func CommentOnPullRequestWithPlan(ctx context.Context, prNumber, environment, planFilePath string) *exec.Cmd
- func PrepareCommand(ctx context.Context) error
- type Action
- type Actions
- type Plan
- type TfChange
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommentOnPRWithPlanSummarized ¶ added in v0.229.0
func CommentOnPullRequestWithPlan ¶ added in v0.61.0
func PrepareCommand ¶
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
Create is true if this set of Actions denotes creation of a new resource.
func (Actions) CreateBeforeDestroy ¶ added in v0.229.0
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
Delete is true if this set of Actions denotes resource removal.
func (Actions) DestroyBeforeCreate ¶ added in v0.229.0
DestroyBeforeCreate is true if this set of Actions denotes a destroy-before-create operation. This is the standard resource replacement method.
func (Actions) Read ¶ added in v0.229.0
Read is true if this set of Actions denotes a read operation only.
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.