github.com/pulumi/terraform@v1.4.0/pkg/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 // Errored is true for any plan whose creation was interrupted by an 28 // error. A plan with this flag set cannot be applied, and the changes 29 // it proposes are likely to be incomplete. 30 bool errored = 20; 31 32 // The variables that were set when creating the plan. Each value is 33 // a msgpack serialization of an HCL value. 34 map<string, DynamicValue> variables = 2; 35 36 // An unordered set of proposed changes to resources throughout the 37 // configuration, including any nested modules. Use the address of 38 // each resource to determine which module it belongs to. 39 repeated ResourceInstanceChange resource_changes = 3; 40 41 // An unordered set of detected drift: changes made to resources outside of 42 // Terraform, computed by comparing the previous run's state to the state 43 // after refresh. 44 repeated ResourceInstanceChange resource_drift = 18; 45 46 // An unordered set of proposed changes to outputs in the root module 47 // of the configuration. This set also includes "no action" changes for 48 // outputs that are not changing, as context for detecting inconsistencies 49 // at apply time. 50 repeated OutputChange output_changes = 4; 51 52 // An unordered set of check results for the entire configuration. 53 // 54 // Each element represents a single static configuration object that has 55 // checks, and each of those may have zero or more dynamic objects that 56 // the checks were applied to nested within. 57 repeated CheckResults check_results = 19; 58 59 // An unordered set of target addresses to include when applying. If no 60 // target addresses are present, the plan applies to the whole 61 // configuration. 62 repeated string target_addrs = 5; 63 64 // An unordered set of force-replace addresses to include when applying. 65 // This must match the set of addresses that was used when creating the 66 // plan, or else applying the plan will fail when it reaches a different 67 // conclusion about what action a particular resource instance needs. 68 repeated string force_replace_addrs = 16; 69 70 // The version string for the Terraform binary that created this plan. 71 string terraform_version = 14; 72 73 // Backend is a description of the backend configuration and other related 74 // settings at the time the plan was created. 75 Backend backend = 13; 76 77 message resource_attr { 78 string resource = 1; 79 Path attr= 2; 80 }; 81 82 // RelevantAttributes lists individual resource attributes from 83 // ResourceDrift which may have contributed to the plan changes. 84 repeated resource_attr relevant_attributes = 15; 85 } 86 87 // Mode describes the planning mode that created the plan. 88 enum Mode { 89 NORMAL = 0; 90 DESTROY = 1; 91 REFRESH_ONLY = 2; 92 } 93 94 // Backend is a description of backend configuration and other related settings. 95 message Backend { 96 string type = 1; 97 DynamicValue config = 2; 98 string workspace = 3; 99 } 100 101 // Action describes the type of action planned for an object. 102 // Not all action values are valid for all object types. 103 enum Action { 104 NOOP = 0; 105 CREATE = 1; 106 READ = 2; 107 UPDATE = 3; 108 DELETE = 5; 109 DELETE_THEN_CREATE = 6; 110 CREATE_THEN_DELETE = 7; 111 } 112 113 // Change represents a change made to some object, transforming it from an old 114 // state to a new state. 115 message Change { 116 // Not all action values are valid for all object types. Consult 117 // the documentation for any message that embeds Change. 118 Action action = 1; 119 120 // msgpack-encoded HCL values involved in the change. 121 // - For update and replace, two values are provided that give the old and new values, 122 // respectively. 123 // - For create, one value is provided that gives the new value to be created 124 // - For delete, one value is provided that describes the value being deleted 125 // - For read, two values are provided that give the prior value for this object 126 // (or null, if no prior value exists) and the value that was or will be read, 127 // respectively. 128 // - For no-op, one value is provided that is left unmodified by this non-change. 129 repeated DynamicValue values = 2; 130 131 // An unordered set of paths into the old value which are marked as 132 // sensitive. Values at these paths should be obscured in human-readable 133 // output. This set is always empty for create. 134 repeated Path before_sensitive_paths = 3; 135 136 // An unordered set of paths into the new value which are marked as 137 // sensitive. Values at these paths should be obscured in human-readable 138 // output. This set is always empty for delete. 139 repeated Path after_sensitive_paths = 4; 140 } 141 142 // ResourceInstanceActionReason sometimes provides some additional user-facing 143 // context for why a particular action was chosen for a resource instance. 144 // This is for user feedback only and never used to drive behavior during the 145 // subsequent apply step. 146 enum ResourceInstanceActionReason { 147 NONE = 0; 148 REPLACE_BECAUSE_TAINTED = 1; 149 REPLACE_BY_REQUEST = 2; 150 REPLACE_BECAUSE_CANNOT_UPDATE = 3; 151 DELETE_BECAUSE_NO_RESOURCE_CONFIG = 4; 152 DELETE_BECAUSE_WRONG_REPETITION = 5; 153 DELETE_BECAUSE_COUNT_INDEX = 6; 154 DELETE_BECAUSE_EACH_KEY = 7; 155 DELETE_BECAUSE_NO_MODULE = 8; 156 REPLACE_BY_TRIGGERS = 9; 157 READ_BECAUSE_CONFIG_UNKNOWN = 10; 158 READ_BECAUSE_DEPENDENCY_PENDING = 11; 159 DELETE_BECAUSE_NO_MOVE_TARGET = 12; 160 } 161 162 message ResourceInstanceChange { 163 // addr is a string representation of the resource instance address that 164 // this change will apply to. 165 string addr = 13; 166 167 // prev_run_addr is a string representation of the address at which 168 // this resource instance was tracked during the previous apply operation. 169 // 170 // This is populated only if it would be different from addr due to 171 // Terraform having reacted to refactoring annotations in the configuration. 172 // If empty, the previous run address is the same as the current address. 173 string prev_run_addr = 14; 174 175 // NOTE: Earlier versions of this format had fields 1 through 6 describing 176 // various indivdual parts of "addr". We're now using our standard compact 177 // string representation to capture the same information. We don't support 178 // preserving plan files from one Terraform version to the next, so we 179 // no longer declare nor accept those fields. 180 181 // deposed_key, if set, indicates that this change applies to a deposed 182 // object for the indicated instance with the given deposed key. If not 183 // set, the change applies to the instance's current object. 184 string deposed_key = 7; 185 186 // provider is the address of the provider configuration that this change 187 // was planned with, and thus the configuration that must be used to 188 // apply it. 189 string provider = 8; 190 191 // Description of the proposed change. May use "create", "read", "update", 192 // "replace", "delete" and "no-op" actions. 193 Change change = 9; 194 195 // raw blob value provided by the provider as additional context for the 196 // change. Must be considered an opaque value for any consumer other than 197 // the provider that generated it, and will be returned verbatim to the 198 // provider during the subsequent apply operation. 199 bytes private = 10; 200 201 // An unordered set of paths that prompted the change action to be 202 // "replace" rather than "update". Empty for any action other than 203 // "replace". 204 repeated Path required_replace = 11; 205 206 // Optional extra user-oriented context for why change.Action was chosen. 207 // This is for user feedback only and never used to drive behavior during 208 // apply. 209 ResourceInstanceActionReason action_reason = 12; 210 } 211 212 message OutputChange { 213 // Name of the output as defined in the root module. 214 string name = 1; 215 216 // Description of the proposed change. May use "no-op", "create", 217 // "update" and "delete" actions. 218 Change change = 2; 219 220 // Sensitive, if true, indicates that one or more of the values given 221 // in "change" is sensitive and should not be shown directly in any 222 // rendered plan. 223 bool sensitive = 3; 224 } 225 226 message CheckResults { 227 // Status describes the status of a particular checkable object at the 228 // completion of the plan. 229 enum Status { 230 UNKNOWN = 0; 231 PASS = 1; 232 FAIL = 2; 233 ERROR = 3; 234 } 235 236 enum ObjectKind { 237 UNSPECIFIED = 0; 238 RESOURCE = 1; 239 OUTPUT_VALUE = 2; 240 } 241 242 message ObjectResult { 243 string object_addr = 1; 244 Status status = 2; 245 repeated string failure_messages = 3; 246 } 247 248 ObjectKind kind = 1; 249 250 // Address of the configuration object that declared the checks. 251 string config_addr = 2; 252 253 // The aggregate status of the entire configuration object, based on 254 // the statuses of its zero or more checkable objects. 255 Status status = 3; 256 257 // The results for individual objects that were declared by the 258 // configuration object named in config_addr. 259 repeated ObjectResult objects = 4; 260 } 261 262 // DynamicValue represents a value whose type is not decided until runtime, 263 // often based on schema information obtained from a plugin. 264 // 265 // At present dynamic values are always encoded as msgpack, with extension 266 // id 0 used to represent the special "unknown" value indicating results 267 // that won't be known until after apply. 268 // 269 // In future other serialization formats may be used, possibly with a 270 // transitional period of including both as separate attributes of this type. 271 // Consumers must ignore attributes they don't support and fail if no supported 272 // attribute is present. The top-level format version will not be incremented 273 // for changes to the set of dynamic serialization formats. 274 message DynamicValue { 275 bytes msgpack = 1; 276 } 277 278 // Path represents a set of steps to traverse into a data structure. It is 279 // used to refer to a sub-structure within a dynamic data structure presented 280 // separately. 281 message Path { 282 message Step { 283 oneof selector { 284 // Set "attribute_name" to represent looking up an attribute 285 // in the current object value. 286 string attribute_name = 1; 287 288 // Set "element_key" to represent looking up an element in 289 // an indexable collection type. 290 DynamicValue element_key = 2; 291 } 292 } 293 repeated Step steps = 1; 294 }