Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Terraform Provider Development

Ringo
March 28, 2018

Terraform Provider Development

The ins and outs of developping a custom Terraform Provider

Presentation given at the Belgium Hashicorp User Group Meeting on Wednesday 28 March 2018

Ringo

March 28, 2018
Tweet

More Decks by Ringo

Other Decks in Technology

Transcript

  1. Agenda • Runtime Model • Bootstrapping a plugin • Datasources

    & Resources • Code structuring • Testing • Distribution • Some pointers … and one more thing!
  2. Exposing all config options for the provider block supported datasources

    supported resources callback function to configure the provider, e.g. connection
  3. Code structuring Split client SDK from Terraform provider sources, e.g.

    AWS https://github.com/aws/aws-sdk-go https://github.com/terraform-providers/terraform-provider-aws XenServer https://github.com/ringods/go-xen-api-client https://github.com/ringods/terraform-provider-xenserver
  4. Testing • No unit testing • Terraform core is unit

    tested • Your client SDK is (or should be) tested • Acceptance Testing • Starts the provider under test • Real resources in use, possibly cost involved (AWS, …) • System Testing • kitchen-terraform • test full Terraform setups with tools like serverspec
  5. Distribution • Supported providers are automatically downloaded • Not yet

    so for third-party providers • Download manually • Put in ~/.terraform.d/plugins • Versioning: terraform-provider-vX.Y.Z • Support discussed in hashicorp/terraform#15252
  6. Information Pointers • Terraform Internals • Terraform Providers • Terraform

    Provider Versioning • Chat: https://gitter.im/hashicorp-terraform/Lobby