terraform-plugin-sdk

module
v2.0.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: MPL-2.0

README

Terraform Plugin SDK

This SDK enables building Terraform plugin which allows Terraform's users to manage existing and popular service providers as well as custom in-house solutions.

Terraform itself is a tool for building, changing, and versioning infrastructure safely and efficiently. You can find more about Terraform on its website and its GitHub repository.

Documentation

See Extending Terraform section on the website.

Scope (Providers VS Core)

Terraform Core
  • acts as gRPC client
  • interacts with the user
  • parses (HCL/JSON) configuration
  • manages state as whole, asks Provider(s) to mutate provider-specific parts of state
  • handles backends & provisioners
  • handles inputs, outputs, modules, and functions
  • discovers Provider(s) and their versions per configuration
  • manages Provider(s) lifecycle (i.e. spins up & tears down provider process)
  • passes relevant parts of parsed (valid JSON/HCL) and interpolated configuration to Provider(s)
  • decides ordering of (Create, Read, Update, Delete) operations on resources and data sources
  • ...
Terraform Provider (via this SDK)
  • acts as gRPC server
  • executes any domain-specific logic based on received parsed configuration
    • (Create, Read, Update, Delete, Import, Validate) a Resource
    • Read a Data Source
  • tests domain-specific logic via provided acceptance test framework
  • provides Core updated state of a resource or data source and/or appropriate feedback in the form of validation or other errors

Migrating to SDK v1 from built-in SDK

Migrating to the standalone SDK v1 is covered on the Plugin SDK section of the website.

Versioning

The Terraform Plugin SDK is a Go module versioned using semantic versioning.

Contributing

See .github/CONTRIBUTING.md

License

Mozilla Public License v2.0

Directories

Path Synopsis
Package acctest provides the ability to use the binary test driver.
Package acctest provides the ability to use the binary test driver.
helper
customdiff
Package customdiff provides a set of reusable and composable functions to enable more "declarative" use of the CustomizeDiff mechanism available for resources in package helper/schema.
Package customdiff provides a set of reusable and composable functions to enable more "declarative" use of the CustomizeDiff mechanism available for resources in package helper/schema.
pathorcontents
Helpers for dealing with file paths and their contents
Helpers for dealing with file paths and their contents
schema
schema is a high-level framework for easily writing new providers for Terraform.
schema is a high-level framework for easily writing new providers for Terraform.
internal
addrs
Package addrs contains types that represent "addresses", which are references to specific objects within a Terraform configuration or state.
Package addrs contains types that represent "addresses", which are references to specific objects within a Terraform configuration or state.
configs/configschema
Package configschema contains types for describing the expected structure of a configuration block whose shape is not known until runtime.
Package configschema contains types for describing the expected structure of a configuration block whose shape is not known until runtime.
helper/plugin
Package plugin contains types and functions to help Terraform plugins implement the plugin rpc interface.
Package plugin contains types and functions to help Terraform plugins implement the plugin rpc interface.
plugin/mock_proto
Package mock_tfplugin5 is a generated GoMock package.
Package mock_tfplugin5 is a generated GoMock package.
tfdiags
Package tfdiags is a utility package for representing errors and warnings in a manner that allows us to produce good messages for the user.
Package tfdiags is a utility package for representing errors and warnings in a manner that allows us to produce good messages for the user.
The meta package provides a location to set the release version and any other relevant metadata for the SDK.
The meta package provides a location to set the release version and any other relevant metadata for the SDK.

Jump to

Keyboard shortcuts

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