Skip to content
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

ephemeral resource deferrals #35793

Merged
merged 4 commits into from
Oct 14, 2024

Conversation

DanielMSchmidt
Copy link
Collaborator

@DanielMSchmidt DanielMSchmidt commented Sep 30, 2024

Target Release

1.10.x

Draft CHANGELOG entry

ENHANCEMENTS

  • Ephemeral Resources: Support providers deferring ephemeral resource open calls

@jbardin
Copy link
Member

jbardin commented Oct 1, 2024

Another place to check is nodeExpandPlannableResource is currently bypassing the dynamicExpandPartial method. I have not looked to see if that method is relevant to ephemeral resources or not.

I wouldn't worry about exactly how that gets called right now (if we need it), all that dynamic expand code will get refactored to accommodate the ephemeral mode, since the current structure doesn't allow us to reuse the code during apply.

Copy link
Member

@jbardin jbardin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this look good! Any refactoring we need in the plan nodes will probably come up again as I work on apply, since it needs to use the same codepaths as planning for ephemeral values.

@@ -66,6 +67,19 @@ type Deferred struct {
// all of those options to decide if each instance is relevant.
resourceInstancesDeferred addrs.Map[addrs.ConfigResource, addrs.Map[addrs.AbsResourceInstance, *plans.DeferredResourceInstanceChange]]

// ephemeralResourceInstancesDeferred tracks the ephemeral resource instances
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need to refactor now, but would it make sense to just track all these in resourceInstancesDeferred? The address are all the same type and are differentiated by mode, but I don't know if it helps reduce code otherwise or not.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I discussed this with @liamcervante and we think that since we serialize the other deferred changes into the plan, differentiating them by mode alone would put us at more risk of accidentally not accounting for ephemeral resources. The extra effort we need to put in now does not feel major to warrant that risk.

@DanielMSchmidt DanielMSchmidt force-pushed the ds/deferred-ephemeral-resources-without-change branch from c730a14 to 916597c Compare October 14, 2024 08:48
@DanielMSchmidt DanielMSchmidt merged commit 1719c90 into main Oct 14, 2024
6 checks passed
@DanielMSchmidt DanielMSchmidt deleted the ds/deferred-ephemeral-resources-without-change branch October 14, 2024 09:01
Copy link
Contributor

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants