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