-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for explicit delete-before-replace #2415
Conversation
These changes add a new flag to the various `ResourceOptions` types that indicates that a resource should be deleted before it is replaced, even if the provider does not require this behavior. The usual delete-before-replace cascade semantics apply. Fixes #1620.
@@ -182,7 +182,8 @@ def do_resolve(value: Any, perform_apply: bool, exn: Optional[Exception]): | |||
protect=opts.protect, | |||
provider=resolver.provider_ref, | |||
dependencies=resolver.dependencies, | |||
propertyDependencies=property_dependencies | |||
propertyDependencies=property_dependencies, | |||
deleteBeforeReplace=opts.delete_before_replace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure--what sort? just a unit test to ensure that it's passed appropriately?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, something simple like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I had a bug with opts.protect
where it didn't get passed, so I'm hoping to get good test coverage on fundamentals like passing opts
to the engine 😆 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Please update |
These changes add a new flag to the various
ResourceOptions
types thatindicates that a resource should be deleted before it is replaced, even
if the provider does not require this behavior. The usual
delete-before-replace cascade semantics apply.
Fixes #1620.