examples

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MPL-2.0 Imports: 7 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 Config added in v0.18.0

type Config string

func (Config) Join added in v0.18.0

func (c Config) Join(others ...Config) (joined Config)

func (Config) OwnedByAdminWorkspace added in v0.18.0

func (c Config) OwnedByAdminWorkspace() Config

func (Config) ReplaceAll added in v0.18.0

func (c Config) ReplaceAll(old, replacement string) (modified Config)

func (Config) SingleResourceAddress added in v0.18.0

func (c Config) SingleResourceAddress(out *Identifier) Config

func (Config) String added in v0.18.0

func (c Config) String() string

type DataSource added in v0.17.0

type DataSource struct {
	// Name is required, Suffix is optional (useful when multiple example files are present).
	Name, Suffix string
}

func (DataSource) Config added in v0.18.0

func (d DataSource) Config() Config

type Identifier added in v0.18.0

type Identifier []string

func (Identifier) Format added in v0.18.0

func (a Identifier) Format(format string, args ...any) string

func (Identifier) Join added in v0.18.0

func (a Identifier) Join(elems ...string) Identifier

func (Identifier) String added in v0.18.0

func (a Identifier) String() string

type Resource added in v0.17.0

type Resource struct {
	// Name is required, Suffix is optional (useful when multiple example files are present).
	Name, Suffix string
}

func (Resource) All added in v0.18.0

func (r Resource) All() iter.Seq[Resource]

func (Resource) Config added in v0.18.0

func (r Resource) Config() Config

func (Resource) TestSupportConfig added in v0.18.0

func (r Resource) TestSupportConfig(suffix string) Config

Jump to

Keyboard shortcuts

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