Skip to main content

Module provider

Module provider 

Source
Expand description

Typed provider-RPC wrappers (configure / plan / apply) over a dialed channel, speaking magma-cty values. The layer that makes apply real. Typed provider-RPC wrappers — the tfplugin5/6 Provider service over a dialed [Channel], speaking magma_cty values.

This is the layer that lets magma-apply stop being a structural no-op and actually create resources (magma#2). Plugin::dial hands back a gRPC Channel + the negotiated protocol; [ProviderConn] wraps the matching generated client and exposes the four RPCs the apply engine needs:

  • [ProviderConn::get_schema] — resource type → implied [CtyType].
  • [ProviderConn::configure] — provider credentials / settings.
  • [ProviderConn::plan_resource_change] — provider-proposed new state.
  • [ProviderConn::apply_resource_change] — create/update/delete; the returned DynamicValue is the resource’s new state.

Both protocols are dispatched. SDKv2 providers (github — galho’s target — aws, …) speak tfplugin5; framework providers speak tfplugin6. ProviderConn::new selects the client from the handshake’s negotiated PluginProtocol. The schema parser is shared (v5 schemas convert to v6 via crate::schema::block5_implied_type); error-severity diagnostics (severity 1 in both protocols) become a typed [ProviderError].

Structs§

Diag
── THE PROTOCOL DATA MODEL MOVED TO magma-provider-api ──────────── ProviderSchema, PlannedChange, Diag, Severity, ProviderError and is_retryable were defined here. They describe what a provider SAYS, not how it is reached, so they now live in the contract crate — which depends on magma-cty alone, so a native provider can implement the contract without dragging in tonic.
PlannedChange
── THE PROTOCOL DATA MODEL MOVED TO magma-provider-api ──────────── ProviderSchema, PlannedChange, Diag, Severity, ProviderError and is_retryable were defined here. They describe what a provider SAYS, not how it is reached, so they now live in the contract crate — which depends on magma-cty alone, so a native provider can implement the contract without dragging in tonic.
ProviderConn
A connected provider — the protocol-matched client over a dialed channel.
ProviderSchema
── THE PROTOCOL DATA MODEL MOVED TO magma-provider-api ──────────── ProviderSchema, PlannedChange, Diag, Severity, ProviderError and is_retryable were defined here. They describe what a provider SAYS, not how it is reached, so they now live in the contract crate — which depends on magma-cty alone, so a native provider can implement the contract without dragging in tonic.

Enums§

ProviderError
── THE PROTOCOL DATA MODEL MOVED TO magma-provider-api ──────────── ProviderSchema, PlannedChange, Diag, Severity, ProviderError and is_retryable were defined here. They describe what a provider SAYS, not how it is reached, so they now live in the contract crate — which depends on magma-cty alone, so a native provider can implement the contract without dragging in tonic.
Severity
── THE PROTOCOL DATA MODEL MOVED TO magma-provider-api ──────────── ProviderSchema, PlannedChange, Diag, Severity, ProviderError and is_retryable were defined here. They describe what a provider SAYS, not how it is reached, so they now live in the contract crate — which depends on magma-cty alone, so a native provider can implement the contract without dragging in tonic.

Traits§

Provider
── THE PROTOCOL DATA MODEL MOVED TO magma-provider-api ──────────── ProviderSchema, PlannedChange, Diag, Severity, ProviderError and is_retryable were defined here. They describe what a provider SAYS, not how it is reached, so they now live in the contract crate — which depends on magma-cty alone, so a native provider can implement the contract without dragging in tonic.

Functions§

is_retryable
── THE PROTOCOL DATA MODEL MOVED TO magma-provider-api ──────────── ProviderSchema, PlannedChange, Diag, Severity, ProviderError and is_retryable were defined here. They describe what a provider SAYS, not how it is reached, so they now live in the contract crate — which depends on magma-cty alone, so a native provider can implement the contract without dragging in tonic.