kubeform.dev/terraform-backend-sdk@v0.0.0-20220310143633-45f07fe731c5/plans/internal/planproto/planfile.proto (about) 1 syntax = "proto3"; 2 package tfplan; 3 4 // For Terraform's own parsing, the proto stub types go into an internal Go 5 // package. The public API is in github.com/hashicorp/terraform/plans/planfile . 6 option go_package = "github.com/hashicorp/terraform/internal/plans/internal/planproto"; 7 8 // Plan is the root message type for the tfplan file 9 message Plan { 10 // Version is incremented whenever there is a breaking change to 11 // the serialization format. Programs reading serialized plans should 12 // verify that version is set to the expected value and abort processing 13 // if not. A breaking change is any change that may cause an older 14 // consumer to interpret the structure incorrectly. This number will 15 // not be incremented if an existing consumer can either safely ignore 16 // changes to the format or if an existing consumer would fail to process 17 // the file for another message- or field-specific reason. 18 uint64 version = 1; 19 20 // The mode that was active when this plan was created. 21 // 22 // This is saved only for UI purposes, so that Terraform can tailor its 23 // rendering of the plan depending on the mode. This must never be used to 24 // make decisions in Terraform Core during the applying of a plan. 25 Mode ui_mode = 17; 26 27 // The variables that were set when creating the plan. Each value is 28 // a msgpack serialization of an HCL value. 29 map<string, DynamicValue> variables = 2; 30 31 // An unordered set of proposed changes to resources throughout the 32 // configuration, including any nested modules. Use the address of 33 // each resource to determine which module it belongs to. 34 repeated ResourceInstanceChange resource_changes = 3; 35 36 // An unordered set of detected drift: changes made to resources outside of 37 // Terraform, computed by comparing the previous run's state to the state 38 // after refresh. 39 repeated ResourceInstanceChange resource_drift = 18; 40 41 // An unordered set of proposed changes to outputs in the root module 42 // of the configuration. This set also includes "no action" changes for 43 // outputs that are not changing, as context for detecting inconsistencies 44 // at apply time. 45 repeated OutputChange output_changes = 4; 46 47 // An unordered set of target addresses to include when applying. If no 48 // target addresses are present, the plan applies to the whole 49 // configuration. 50 repeated string target_addrs = 5; 51 52 // An unordered set of force-replace addresses to include when applying. 53 // This must match the set of addresses that was used when creating the 54 // plan, or else applying the plan will fail when it reaches a different 55 // conclusion about what action a particular resource instance needs. 56 repeated string force_replace_addrs = 16; 57 58 // The version string for the Terraform binary that created this plan. 59 string terraform_version = 14; 60 61 // SHA256 digests of all of the provider plugin binaries that were used 62 // in the creation of this plan. 63 map<string, Hash> provider_hashes = 15; 64 65 // Backend is a description of the backend configuration and other related 66 // settings at the time the plan was created. 67 Backend backend = 13; 68 } 69 70 // Mode describes the planning mode that created the plan. 71 enum Mode { 72 NORMAL = 0; 73 DESTROY = 1; 74 REFRESH_ONLY = 2; 75 } 76 77 // Backend is a description of backend configuration and other related settings. 78 message Backend { 79 string type = 1; 80 DynamicValue config = 2; 81 string workspace = 3; 82 } 83 84 // Action describes the type of action planned for an object. 85 // Not all action values are valid for all object types. 86 enum Action { 87 NOOP = 0; 88 CREATE = 1; 89 READ = 2; 90 UPDATE = 3; 91 DELETE = 5; 92 DELETE_THEN_CREATE = 6; 93 CREATE_THEN_DELETE = 7; 94 } 95 96 // Change represents a change made to some object, transforming it from an old 97 // state to a new state. 98 message Change { 99 // Not all action values are valid for all object types. Consult 100 // the documentation for any message that embeds Change. 101 Action action = 1; 102 103 // msgpack-encoded HCL values involved in the change. 104 // - For update and replace, two values are provided that give the old and new values, 105 // respectively. 106 // - For create, one value is provided that gives the new value to be created 107 // - For delete, one value is provided that describes the value being deleted 108 // - For read, two values are provided that give the prior value for this object 109 // (or null, if no prior value exists) and the value that was or will be read, 110 // respectively. 111 // - For no-op, one value is provided that is left unmodified by this non-change. 112 repeated DynamicValue values = 2; 113 114 // An unordered set of paths into the old value which are marked as 115 // sensitive. Values at these paths should be obscured in human-readable 116 // output. This set is always empty for create. 117 repeated Path before_sensitive_paths = 3; 118 119 // An unordered set of paths into the new value which are marked as 120 // sensitive. Values at these paths should be obscured in human-readable 121 // output. This set is always empty for delete. 122 repeated Path after_sensitive_paths = 4; 123 } 124 125 // ResourceInstanceActionReason sometimes provides some additional user-facing 126 // context for why a particular action was chosen for a resource instance. 127 // This is for user feedback only and never used to drive behavior during the 128 // subsequent apply step. 129 enum ResourceInstanceActionReason { 130 NONE = 0; 131 REPLACE_BECAUSE_TAINTED = 1; 132 REPLACE_BY_REQUEST = 2; 133 REPLACE_BECAUSE_CANNOT_UPDATE = 3; 134 } 135 136 message ResourceInstanceChange { 137 // addr is a string representation of the resource instance address that 138 // this change will apply to. 139 string addr = 13; 140 141 // prev_run_addr is a string representation of the address at which 142 // this resource instance was tracked during the previous apply operation. 143 // 144 // This is populated only if it would be different from addr due to 145 // Terraform having reacted to refactoring annotations in the configuration. 146 // If empty, the previous run address is the same as the current address. 147 string prev_run_addr = 14; 148 149 // NOTE: Earlier versions of this format had fields 1 through 6 describing 150 // various indivdual parts of "addr". We're now using our standard compact 151 // string representation to capture the same information. We don't support 152 // preserving plan files from one Terraform version to the next, so we 153 // no longer declare nor accept those fields. 154 155 // deposed_key, if set, indicates that this change applies to a deposed 156 // object for the indicated instance with the given deposed key. If not 157 // set, the change applies to the instance's current object. 158 string deposed_key = 7; 159 160 // provider is the address of the provider configuration that this change 161 // was planned with, and thus the configuration that must be used to 162 // apply it. 163 string provider = 8; 164 165 // Description of the proposed change. May use "create", "read", "update", 166 // "replace", "delete" and "no-op" actions. 167 Change change = 9; 168 169 // raw blob value provided by the provider as additional context for the 170 // change. Must be considered an opaque value for any consumer other than 171 // the provider that generated it, and will be returned verbatim to the 172 // provider during the subsequent apply operation. 173 bytes private = 10; 174 175 // An unordered set of paths that prompted the change action to be 176 // "replace" rather than "update". Empty for any action other than 177 // "replace". 178 repeated Path required_replace = 11; 179 180 // Optional extra user-oriented context for why change.Action was chosen. 181 // This is for user feedback only and never used to drive behavior during 182 // apply. 183 ResourceInstanceActionReason action_reason = 12; 184 } 185 186 message OutputChange { 187 // Name of the output as defined in the root module. 188 string name = 1; 189 190 // Description of the proposed change. May use "no-op", "create", 191 // "update" and "delete" actions. 192 Change change = 2; 193 194 // Sensitive, if true, indicates that one or more of the values given 195 // in "change" is sensitive and should not be shown directly in any 196 // rendered plan. 197 bool sensitive = 3; 198 } 199 200 // DynamicValue represents a value whose type is not decided until runtime, 201 // often based on schema information obtained from a plugin. 202 // 203 // At present dynamic values are always encoded as msgpack, with extension 204 // id 0 used to represent the special "unknown" value indicating results 205 // that won't be known until after apply. 206 // 207 // In future other serialization formats may be used, possibly with a 208 // transitional period of including both as separate attributes of this type. 209 // Consumers must ignore attributes they don't support and fail if no supported 210 // attribute is present. The top-level format version will not be incremented 211 // for changes to the set of dynamic serialization formats. 212 message DynamicValue { 213 bytes msgpack = 1; 214 } 215 216 // Hash represents a hash value. 217 // 218 // At present hashes always use the SHA256 algorithm. In future other hash 219 // algorithms may be used, possibly with a transitional period of including 220 // both as separate attributes of this type. Consumers must ignore attributes 221 // they don't support and fail if no supported attribute is present. The 222 // top-level format version will not be incremented for changes to the set of 223 // hash algorithms. 224 message Hash { 225 bytes sha256 = 1; 226 } 227 228 // Path represents a set of steps to traverse into a data structure. It is 229 // used to refer to a sub-structure within a dynamic data structure presented 230 // separately. 231 message Path { 232 message Step { 233 oneof selector { 234 // Set "attribute_name" to represent looking up an attribute 235 // in the current object value. 236 string attribute_name = 1; 237 238 // Set "element_key" to represent looking up an element in 239 // an indexable collection type. 240 DynamicValue element_key = 2; 241 } 242 } 243 repeated Step steps = 1; 244 }