Documentation
¶
Overview ¶
Package echoprovider contains a protocol v6 Terraform provider that can be used to transfer data from provider configuration to state via a managed resource. This is only meant for provider acceptance testing of data that cannot be stored in Terraform artifacts (plan/state), such as an ephemeral resource.
Example Usage:
// Ephemeral resource that is under test ephemeral "examplecloud_thing" "this" { name = "thing-one" } provider "echo" { data = ephemeral.examplecloud_thing.this } resource "echo" "test" {} // The `echo.test.data` attribute will contain the ephemeral data from `ephemeral.examplecloud_thing.this`
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewProviderServer ¶
func NewProviderServer() func() (tfprotov6.ProviderServer, error)
NewProviderServer returns the "echo" provider, which is a protocol v6 Terraform provider meant only to be used for testing data which cannot be stored in Terraform artifacts (plan/state), such as an ephemeral resource. The "echo" provider can be included in an acceptance test with the `(resource.TestCase).ProtoV6ProviderFactories` field, for example:
resource.UnitTest(t, resource.TestCase{ // .. other TestCase fields ProtoV6ProviderFactories: map[string]func() (tfprotov6.ProviderServer, error){ "echo": echoprovider.NewProviderServer(), }, // .. TestSteps })
The "echo" provider configuration accepts in a dynamic "data" attribute, which will be stored in the "echo" managed resource "data" attribute, for example:
// Ephemeral resource that is under test ephemeral "examplecloud_thing" "this" { name = "thing-one" } provider "echo" { data = ephemeral.examplecloud_thing.this } resource "echo" "test" {} // The `echo.test.data` attribute will contain the ephemeral data from `ephemeral.examplecloud_thing.this`
Types ¶
This section is empty.