echoprovider

package
v1.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2025 License: MPL-2.0 Imports: 4 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL