Documentation ¶
Overview ¶
Package jsdecode contains the functions that are used to retrieve information about resources and changes from json plan files that Terraform will make to update remote objects to match with changes to the configuration.
Index ¶
Constants ¶
const ( ComputeDiskType = "google_compute_disk" ComputeInstanceType = "google_compute_instance" )
ComputeInstanceType and ComputeDiskType are the supported by this package types of ResourceChange and Resource.
const ( ActionCreate string = "create" ActionDelete string = "delete" ActionNoop string = "no-op" ActionReplace string = "replace" ActionUpdate string = "update" )
Possible actions in resource changes.
Variables ¶
This section is empty.
Functions ¶
func ExtractPlanStruct ¶
ExtractPlanStruct extracts tfjson.Plan struct from file in provided path if it is possible.
func GetResources ¶
func GetResources(details *cd.ResourceDetail, plan *tfjson.Plan) []resources.ResourceState
GetResources extracts all resources of ComputeInstance and ComputeDisk type and their before and after states from plan file.
Types ¶
type ResourceInfo ¶
type ResourceInfo struct { Name string `json:"name,omitempty"` InstanceID string `json:"instance_id,omitempty"` Zone string `json:"zone,omitempty"` MachineType string `json:"machine_type,omitempty"` DiskType string `json:"type,omitempty"` Image string `json:"image,omitempty"` Snapshot string `json:"snapshot,omitempty"` SizeGiB int64 `json:"size,omitempty"` Scheduling []UsageType `json:"scheduling,omitempty"` }
ResourceInfo contains the information about Resource in json plan file, this struct is used to cast interface of before/after states to the certain Resource.