-
Notifications
You must be signed in to change notification settings - Fork 90
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
terraform plugin framework external client & connectors #329
Conversation
} | ||
} | ||
|
||
p.Resources[name] = DefaultResource(name, terraformResource, terraformPluginFrameworkResource, providerMetadata.Resources[name], p.DefaultResourceOptions...) | ||
p.Resources[name].useNoForkClient = isNoFork |
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.
Now that we are introducing TerraformPluginFramework terminology, could we please refactor "noFork" terminology to TerraformPluginSDK throughout the code base for uniformity and clearer understanding?
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.
Let's keep renaming the no-fork external client out of scope for this PR and we will follow-up with a new PR after we merge this one. Thank you.
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.
Thank you @erhancagirici & @mergenci for attacking the remaining issue of reconciling the Terraform plugin framework resources natively without the TF CLI. Outstanding work here. Left some comments for you to consider. Also planning a second pass.
@erhancagirici, could you please also update the description of the PR and briefly discuss the architecture and the newly introduced APIs (tf plugin fw external connecter/client, extensions to the async tracker, etc.) with this PR?
pkg/config/provider.go
Outdated
"but either config.Provider.TerraformProvider is not configured or the Go schema does not exist for the resource", name)) | ||
} | ||
|
||
for _, resourceFunc := range terraformPluginFrameworkResourceFunctions { |
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.
for _, resourceFunc := range terraformPluginFrameworkResourceFunctions { | |
for _, resourceFunc := range p.TerraformPluginFrameworkProvider.Resources(ctx) { |
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.
as mentioned in #329 (comment), we prefer to call p.TerraformPluginFrameworkProvider.Resources(ctx)
one time out of the main loop.
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.
For loop here is now removed, as part of a further performance improved. See the comment above.
@@ -122,6 +123,8 @@ type Setup struct { | |||
Scheduler ProviderScheduler | |||
|
|||
Meta any | |||
|
|||
FrameworkProvider fwprovider.Provider |
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.
Leaving a comment here as a reminder for what we had discussed previously: Because we initialize the framework server and the framework provider at each reconciliation, we may try to extend the provider configuration framework and have the provider directly initialized at each reconciliation in the ExternalConnecter.Connect
instead of the provider's terraform.SetupFn
so that we don't have to carry it via the terraform.Setup
. Let's keep it out of scope for this PR though. We may attempt this "optimization" in a follow-up PR.
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.
Thank you @erhancagirici & @mergenci. We will also need to implement the unit tests for these changes.
Signed-off-by: Cem Mergenci <[email protected]>
Configuring provider server with a nil configuration request lets server retrieve already-configured provider's configuration. Signed-off-by: Cem Mergenci <[email protected]>
Signed-off-by: Erhan Cagirici <[email protected]>
Signed-off-by: Erhan Cagirici <[email protected]>
Signed-off-by: Erhan Cagirici <[email protected]>
Signed-off-by: Erhan Cagirici <[email protected]>
Signed-off-by: Erhan Cagirici <[email protected]>
Signed-off-by: Erhan Cagirici <[email protected]>
Signed-off-by: Erhan Cagirici <[email protected]>
Signed-off-by: Erhan Cagirici <[email protected]>
Signed-off-by: Erhan Cagirici <[email protected]>
Signed-off-by: Erhan Cagirici <[email protected]>
Signed-off-by: Erhan Cagirici <[email protected]>
Signed-off-by: Erhan Cagirici <[email protected]>
Signed-off-by: Erhan Cagirici <[email protected]>
Speedup in upbound/provider-aws, obtained via non-rigorous measurement techniques, is around 1.1x. Performance benefits would be higher, if there were more Terraform Plugin Framework resources configured. Signed-off-by: Cem Mergenci <[email protected]>
Signed-off-by: Cem Mergenci <[email protected]>
Signed-off-by: Erhan Cagirici <[email protected]>
Signed-off-by: Erhan Cagirici <[email protected]>
Signed-off-by: Erhan Cagirici <[email protected]>
2c2b7b1
to
2b2812f
Compare
Signed-off-by: Erhan Cagirici <[email protected]>
Signed-off-by: Erhan Cagirici <[email protected]>
Signed-off-by: Erhan Cagirici <[email protected]>
Signed-off-by: Erhan Cagirici <[email protected]>
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.
Thanks @erhancagirici & @mergenci for tackling with the framework resources. It's been a really fruitful journey with lots of learning and at the end we've been able to add support for framework resources natively. We will pursue increasing the unit test coverage in #336 in addition to the integration tests we've already performed. There are also two additional framework resources waiting for this PR and we will have validated the changes introduced here with those. In addition, changes from this PR are being tested as part crossplane-contrib/provider-upjet-aws#1086, which depends on this PR.
Thank you for the great work!
Description of your changes
Introduces new external clients for terraform plugin framework resources
I have:
make reviewable
to ensure this PR is ready for review.backport release-x.y
labels to auto-backport this PR if necessary.How has this code been tested
Tested with crossplane-contrib/provider-upjet-aws#1086.