Skip to content

Add actions to provider interface #37006

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Add actions to provider interface #37006

wants to merge 4 commits into from

Conversation

DanielMSchmidt
Copy link
Contributor

This PR adds actions to the provider interface and implements the basic functionality against the provider protocol.

Fixes #

Target Release

1.13.x

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

Copy link

@SBGoods SBGoods left a comment

Choose a reason for hiding this comment

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

Approving the protocol changes

@ansgarm
Copy link
Member

ansgarm commented May 21, 2025

Will the version of the protocol version stay at 6.10?

Copy link
Contributor

@mildwonkey mildwonkey left a comment

Choose a reason for hiding this comment

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

I left a couple of questions and comments - I won't make a fuss about the nitpicks (like newlines) so feel free to fix or ignore those as you will. Overall this looks reasonable to me!

return resp
}

func (p *GRPCProvider) InvokeAction(r providers.InvokeActionRequest) (resp providers.InvokeActionResponse) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This one is just a genuine question I'm curious about, not a review:

How will the action event stream get cancelled from the terraform side (ie user ctrl-c or a timeout)? Does that get handled by the provider when tf calls Stop()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would have assumed it stops when we call Stop and the provider winds down, but it's sth we should test for sure

Copy link
Member

Choose a reason for hiding this comment

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

The framework shouldbe connecting it's global context to interrupt the call when Stop is called, but Terraform can't control that.

For managed resources we don't want to directly interrupt them from the CLI because they may have state to save, and so we wait for the provider to do the cancelation and return whatever info it can. Since list resources can't have side effects however, we might want to someday pipe through our cancellation context here, but I don't think that's required for now, and would require some new plumbing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog-needed Add this to your PR if the change does not require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants