github.com/muratcelep/terraform@v1.1.0-beta2-not-internal-4/not-internal/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/muratcelep/terraform/plans/planfile .
     6  option go_package = "github.com/muratcelep/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      // Backend is a description of the backend configuration and other related
    62      // settings at the time the plan was created.
    63      Backend backend = 13;
    64  }
    65  
    66  // Mode describes the planning mode that created the plan.
    67  enum Mode {
    68      NORMAL = 0;
    69      DESTROY = 1;
    70      REFRESH_ONLY = 2;
    71  }
    72  
    73  // Backend is a description of backend configuration and other related settings.
    74  message Backend {
    75      string type = 1;
    76      DynamicValue config = 2;
    77      string workspace = 3;
    78  }
    79  
    80  // Action describes the type of action planned for an object.
    81  // Not all action values are valid for all object types.
    82  enum Action {
    83      NOOP = 0;
    84      CREATE = 1;
    85      READ = 2;
    86      UPDATE = 3;
    87      DELETE = 5;
    88      DELETE_THEN_CREATE = 6;
    89      CREATE_THEN_DELETE = 7;
    90  }
    91  
    92  // Change represents a change made to some object, transforming it from an old
    93  // state to a new state.
    94  message Change {
    95      // Not all action values are valid for all object types. Consult
    96      // the documentation for any message that embeds Change.
    97      Action action = 1;
    98  
    99      // msgpack-encoded HCL values involved in the change.
   100      // - For update and replace, two values are provided that give the old and new values,
   101      //   respectively.
   102      // - For create, one value is provided that gives the new value to be created
   103      // - For delete, one value is provided that describes the value being deleted
   104      // - For read, two values are provided that give the prior value for this object
   105      //   (or null, if no prior value exists) and the value that was or will be read,
   106      //   respectively.
   107      // - For no-op, one value is provided that is left unmodified by this non-change.
   108      repeated DynamicValue values = 2;
   109  
   110      // An unordered set of paths into the old value which are marked as
   111      // sensitive. Values at these paths should be obscured in human-readable
   112      // output. This set is always empty for create.
   113      repeated Path before_sensitive_paths = 3;
   114  
   115      // An unordered set of paths into the new value which are marked as
   116      // sensitive. Values at these paths should be obscured in human-readable
   117      // output. This set is always empty for delete.
   118      repeated Path after_sensitive_paths = 4;
   119  }
   120  
   121  // ResourceInstanceActionReason sometimes provides some additional user-facing
   122  // context for why a particular action was chosen for a resource instance.
   123  // This is for user feedback only and never used to drive behavior during the
   124  // subsequent apply step.
   125  enum ResourceInstanceActionReason {
   126      NONE = 0;
   127      REPLACE_BECAUSE_TAINTED = 1;
   128      REPLACE_BY_REQUEST = 2;
   129      REPLACE_BECAUSE_CANNOT_UPDATE = 3;
   130      DELETE_BECAUSE_NO_RESOURCE_CONFIG = 4;
   131      DELETE_BECAUSE_WRONG_REPETITION = 5;
   132      DELETE_BECAUSE_COUNT_INDEX = 6;
   133      DELETE_BECAUSE_EACH_KEY = 7;
   134      DELETE_BECAUSE_NO_MODULE = 8;
   135  }
   136  
   137  message ResourceInstanceChange {
   138      // addr is a string representation of the resource instance address that
   139      // this change will apply to.
   140      string addr = 13;
   141  
   142      // prev_run_addr is a string representation of the address at which
   143      // this resource instance was tracked during the previous apply operation.
   144      //
   145      // This is populated only if it would be different from addr due to
   146      // Terraform having reacted to refactoring annotations in the configuration.
   147      // If empty, the previous run address is the same as the current address.
   148      string prev_run_addr = 14;
   149  
   150      // NOTE: Earlier versions of this format had fields 1 through 6 describing
   151      // various indivdual parts of "addr". We're now using our standard compact
   152      // string representation to capture the same information. We don't support
   153      // preserving plan files from one Terraform version to the next, so we
   154      // no longer declare nor accept those fields.
   155  
   156      // deposed_key, if set, indicates that this change applies to a deposed
   157      // object for the indicated instance with the given deposed key. If not
   158      // set, the change applies to the instance's current object.
   159      string deposed_key = 7;
   160  
   161      // provider is the address of the provider configuration that this change
   162      // was planned with, and thus the configuration that must be used to
   163      // apply it.
   164      string provider = 8;
   165  
   166      // Description of the proposed change. May use "create", "read", "update",
   167      // "replace", "delete" and "no-op" actions.
   168      Change change = 9;
   169  
   170      // raw blob value provided by the provider as additional context for the
   171      // change. Must be considered an opaque value for any consumer other than
   172      // the provider that generated it, and will be returned verbatim to the
   173      // provider during the subsequent apply operation.
   174      bytes private = 10;
   175  
   176      // An unordered set of paths that prompted the change action to be
   177      // "replace" rather than "update". Empty for any action other than
   178      // "replace".
   179      repeated Path required_replace = 11;
   180  
   181      // Optional extra user-oriented context for why change.Action was chosen.
   182      // This is for user feedback only and never used to drive behavior during
   183      // apply.
   184      ResourceInstanceActionReason action_reason = 12;
   185  }
   186  
   187  message OutputChange {
   188      // Name of the output as defined in the root module.
   189      string name = 1;
   190  
   191      // Description of the proposed change. May use "no-op", "create",
   192      // "update" and "delete" actions.
   193      Change change = 2;
   194  
   195      // Sensitive, if true, indicates that one or more of the values given
   196      // in "change" is sensitive and should not be shown directly in any
   197      // rendered plan.
   198      bool sensitive = 3;
   199  }
   200  
   201  // DynamicValue represents a value whose type is not decided until runtime,
   202  // often based on schema information obtained from a plugin.
   203  //
   204  // At present dynamic values are always encoded as msgpack, with extension
   205  // id 0 used to represent the special "unknown" value indicating results
   206  // that won't be known until after apply.
   207  //
   208  // In future other serialization formats may be used, possibly with a
   209  // transitional period of including both as separate attributes of this type.
   210  // Consumers must ignore attributes they don't support and fail if no supported
   211  // attribute is present. The top-level format version will not be incremented
   212  // for changes to the set of dynamic serialization formats.
   213  message DynamicValue {
   214      bytes msgpack = 1;
   215  }
   216  
   217  // Path represents a set of steps to traverse into a data structure. It is
   218  // used to refer to a sub-structure within a dynamic data structure presented
   219  // separately.
   220  message Path {
   221      message Step {
   222          oneof selector {
   223              // Set "attribute_name" to represent looking up an attribute
   224              // in the current object value.
   225              string attribute_name = 1;
   226  
   227              // Set "element_key" to represent looking up an element in
   228              // an indexable collection type.
   229              DynamicValue element_key = 2;
   230          }
   231      }
   232      repeated Step steps = 1;
   233  }