Add support for CloudFormation Resource Import to CFn glue code #36513
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This update to
AWS::CloudFormation
makes it possible to import existing resources into a stack using theIMPORT
type of theCreateChangeSet
API operation.The implementation defines a new
import_resources
option to trigger importing resources, derived from theIMPORT_RESOURCES
env variable via thestack
/adhoc
rake tasks.For example, to import an
AWS::EC2::Instance
resource with a logical-id ofDaemon
and an instance idi-0123456789abcdef
:Note the existing limitation of resource imports, which will cause the process to fail if not satisfied:
DeletionPolicy
must be specified for imported resources.Since resource import is only possible through creating/executing a Change Set, I also had to change the implementation to apply stack updates through
ExecuteChangeSet
instead ofUpdateStack
directly, making this a much more substantial change. I added an extraProceed? [y/n]
confirmation dialog tocreate_or_update
(:start
rake tasks), so manually running:validate
before running:start
is now slightly less crucial to prevent accidental changes from being applied.