github.com/pulumi/terraform@v1.4.0/pkg/addrs/moveable.go (about)

     1  package addrs
     2  
     3  // AbsMoveable is an interface implemented by address types that can be either
     4  // the source or destination of a "moved" statement in configuration, along
     5  // with any other similar cross-module state refactoring statements we might
     6  // allow.
     7  //
     8  // Note that AbsMoveable represents an absolute address relative to the root
     9  // of the configuration, which is different than the direct representation
    10  // of these in configuration where the author gives an address relative to
    11  // the current module where the address is defined. The type MoveEndpoint
    12  type AbsMoveable interface {
    13  	absMoveableSigil()
    14  	UniqueKeyer
    15  
    16  	String() string
    17  }
    18  
    19  // The following are all of the possible AbsMoveable address types:
    20  var (
    21  	_ AbsMoveable = AbsResource{}
    22  	_ AbsMoveable = AbsResourceInstance{}
    23  	_ AbsMoveable = ModuleInstance(nil)
    24  	_ AbsMoveable = AbsModuleCall{}
    25  )
    26  
    27  // AbsMoveableResource is an AbsMoveable that is either a resource or a resource
    28  // instance.
    29  type AbsMoveableResource interface {
    30  	AbsMoveable
    31  	AffectedAbsResource() AbsResource
    32  }
    33  
    34  // The following are all of the possible AbsMoveableResource types:
    35  var (
    36  	_ AbsMoveableResource = AbsResource{}
    37  	_ AbsMoveableResource = AbsResourceInstance{}
    38  )
    39  
    40  // ConfigMoveable is similar to AbsMoveable but represents a static object in
    41  // the configuration, rather than an instance of that object created by
    42  // module expansion.
    43  //
    44  // Note that ConfigMovable represents an absolute address relative to the root
    45  // of the configuration, which is different than the direct representation
    46  // of these in configuration where the author gives an address relative to
    47  // the current module where the address is defined. The type MoveEndpoint
    48  // represents the relative form given directly in configuration.
    49  type ConfigMoveable interface {
    50  	configMoveableSigil()
    51  }
    52  
    53  // The following are all of the possible ConfigMovable address types:
    54  var (
    55  	_ ConfigMoveable = ConfigResource{}
    56  	_ ConfigMoveable = Module(nil)
    57  )