examples

package
v0.20.4 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MPL-2.0 Imports: 6 Imported by: 0

README

Examples

This directory contains examples that are mostly used for documentation, but can also be run/tested manually via the Terraform CLI.

The terraform-plugin-docs document generation tool looks for files in the following locations by default. All other files besides the ones mentioned below are ignored by the documentation tool. This is useful for creating examples that can run and/or ar testable even if some parts are not relevant for the documentation.

  • provider/provider.tf example file for the provider index page
  • data-sources/<full resource name>/data-source.tf example file for the named data source page
  • resources/<full resource name>/resource.tf example file for the named data source page
  • resources/<<full resource name>>/import.sh

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Example added in v0.20.4

type Example string
const (
	DataSource Example = "data-source"
	Resource   Example = "resource"
)

func (Example) Read added in v0.20.4

func (e Example) Read(t *testing.T, name string, fileNameParts ...string) []byte

Read reads the embedded example Terraform code for the named resource/datasource, If file name parts are empty or only one is provided, the parts are prefixed with the Example value as string: The empty case reflects the simple case of examples/resources/meshstack_<name>/resource.tf or examples/data-sources/meshstack_<name>/data-source.tf, respectively. The case of one part adds a suffix to the .tf files.

Jump to

Keyboard shortcuts

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