pulumi/pkg/resource
Luke Hoban 15e924b5cf
Support aliases for renaming, re-typing, or re-parenting resources (#2774)
Adds a new resource option `aliases` which can be used to rename a resource.  When making a breaking change to the name or type of a resource or component, the old name can be added to the list of `aliases` for a resource to ensure that existing resources will be migrated to the new name instead of being deleted and replaced with the new named resource.

There are two key places this change is implemented. 

The first is the step generator in the engine.  When computing whether there is an old version of a registered resource, we now take into account the aliases specified on the registered resource.  That is, we first look up the resource by its new URN in the old state, and then by any aliases provided (in order).  This can allow the resource to be matched as a (potential) update to an existing resource with a different URN.

The second is the core `Resource` constructor in the JavaScript (and soon Python) SDKs.  This change ensures that when a parent resource is aliased, that all children implicitly inherit corresponding aliases.  It is similar to how many other resource options are "inherited" implicitly from the parent.

Four specific scenarios are explicitly tested as part of this PR:
1. Renaming a resource
2. Adopting a resource into a component (as the owner of both component and consumption codebases)
3. Renaming a component instance (as the owner of the consumption codebase without changes to the component)
4. Changing the type of a component (as the owner of the component codebase without changes to the consumption codebase)
4. Combining (1) and (3) to make both changes to a resource at the same time
2019-05-31 23:01:01 -07:00
..
config Encrypt secret values in deployments 2019-05-10 17:07:52 -07:00
deploy Support aliases for renaming, re-typing, or re-parenting resources (#2774) 2019-05-31 23:01:01 -07:00
edit Retain the SecretsManager that was used to deserialize a deployment 2019-05-10 17:07:52 -07:00
graph Process deletions conservatively in parallel (#1963) 2018-09-27 15:49:08 -07:00
plugin Workaround a bug in the kubernetes provider 2019-05-29 11:53:10 -07:00
provider Implement status sinks 2018-08-31 15:56:53 -07:00
stack Support aliases for renaming, re-typing, or re-parenting resources (#2774) 2019-05-31 23:01:01 -07:00
testdata Fix asset bugs; write more tests 2017-10-24 09:00:11 -07:00
asset.go Correctly handle FileArchives when the filename contains a dot 2019-03-28 13:26:07 -07:00
asset_test.go Correctly handle FileArchives when the filename contains a dot 2019-03-28 13:26:07 -07:00
errors.go Add license headers 2018-05-22 15:02:47 -07:00
properties.go Rework secret annotation algorithm slightly 2019-05-15 09:33:02 -07:00
properties_diff.go Fix a panic during property diffing 2019-05-15 16:20:25 -07:00
properties_diff_test.go Fix a panic during property diffing 2019-05-15 16:20:25 -07:00
properties_test.go Add license headers 2018-05-22 15:02:47 -07:00
resource_goal.go Support aliases for renaming, re-typing, or re-parenting resources (#2774) 2019-05-31 23:01:01 -07:00
resource_id.go Add license headers 2018-05-22 15:02:47 -07:00
resource_id_test.go Adopt golangci-lint and address issues 2018-11-08 14:11:47 -08:00
resource_operation.go Add a list of in-flight operations to the deployment (#1759) 2018-08-10 21:39:59 -07:00
resource_state.go Support aliases for renaming, re-typing, or re-parenting resources (#2774) 2019-05-31 23:01:01 -07:00
stack.go Make a smattering of CLI UX improvements 2018-09-24 08:43:46 -07:00
status.go Partial status for resource providers 2018-07-02 13:32:23 -07:00
urn.go Add license headers 2018-05-22 15:02:47 -07:00
urn_test.go Add license headers 2018-05-22 15:02:47 -07:00