The new Setup.Stop RPC allows clients to abort long-running operations.
Each operation implementation must add itself to the server's stopper,
and listen on the given channel for a signal to abort.
In this commit, plan, apply, and validate operations translate the stop
signal into a context cancellation. This alone is not yet sufficient for
a truly graceful shutdown, so in later commits we need to adjust the
stacks runtime to instruct the modules runtime to stop on cancellation.
Adds support for including fields typically found in the Terraform CLI configuration in the RPC API handshake. This allows us to include global configuration arguments that impact the RPC API session without requiring instrumentation for each RPC service. The new Config struct currently supports only service discovery credentials, but it can be expanded in the future.
rpcapi is a normal gRPC server once it's running, so if the overall
Terraform CLI process has been configured to export telemetry then this
will emit a span for each incoming gRPC request.
In later commits we'll hopefully add further telemetry downstream to cover
interesting child spans such as running Terraform Core operations, but
this is at least enough to observe which requests a client is making
and what their outcomes were.