github.com/hashicorp/terraform-plugin-sdk@v1.17.2/internal/states/instance_generation.go (about) 1 package states 2 3 // Generation is used to represent multiple objects in a succession of objects 4 // represented by a single resource instance address. A resource instance can 5 // have multiple generations over its lifetime due to object replacement 6 // (when a change can't be applied without destroying and re-creating), and 7 // multiple generations can exist at the same time when create_before_destroy 8 // is used. 9 // 10 // A Generation value can either be the value of the variable "CurrentGen" or 11 // a value of type DeposedKey. Generation values can be compared for equality 12 // using "==" and used as map keys. The zero value of Generation (nil) is not 13 // a valid generation and must not be used. 14 type Generation interface { 15 generation() 16 } 17 18 // CurrentGen is the Generation representing the currently-active object for 19 // a resource instance. 20 var CurrentGen Generation