44

GitHub - terraform-providers/terraform-provider-linode: Terraform Linode provide...

 5 years ago
source link: https://github.com/terraform-providers/terraform-provider-linode
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

Terraform Provider for Linode

68747470733a2f2f63646e2e7261776769742e636f6d2f6861736869636f72702f7465727261666f726d2d776562736974652f6d61737465722f636f6e74656e742f736f757263652f6173736574732f696d616765732f6c6f676f2d6861736869636f72702e737667

Maintainers

This provider plugin is maintained by Linode.

Requirements

  • Terraform 0.10+
  • Go 1.11.0 or higher (to build the provider plugin)

Using the provider

See the Linode Provider documentation to get started using the Linode provider. The examples included in this repository demonstrate usage of many of the Linode provider resources.

Additional documentation and examples are provided in the Linode Guide, Using Terraform to Provision Linode Environments.

Development

Building the provider

If you wish to build or contribute code to the provider, you'll first need Git and Go installed on your machine (version 1.8+ is required).

You'll also need to correctly configure a GOPATH, as well as adding $GOPATH/bin to your $PATH.

To compile the provider, run make build. This will build the provider and put the provider binary in the $GOPATH/bin directory.

Clone this repository to: $GOPATH/src/github.com/terraform-providers/terraform-provider-linode

mkdir -p $GOPATH/src/github.com/terraform-providers
cd $GOPATH/src/github.com/terraform-providers
git clone https://github.com/terraform-providers/terraform-provider-linode.git

Enter the provider directory and build the provider

cd $GOPATH/src/github.com/terraform-providers/terraform-provider-linode
make build

Testing the provider

In order to test the provider, you can simply run make test.

make test

In order to run the full suite of Acceptance tests, run make testacc. Acceptance testing will require the LINODE_TOKEN variable to be populated with a Linode APIv4 Token. See Linode Provider documentation for more details.

Note: Acceptance tests create real resources, and often cost money to run.

make testacc

There are a number of useful flags and variables to aid in debugging.

  • LINODE_DEBUG - If truthy, this will emit all HTTP requests and responses to the Linode API.

  • TF_LOG - This instructs Terraform to emit trace level (and higher) logging messages.

  • TF_SCHEMA_PANIC_ON_ERROR - This forces Terraform to panic if a Schema Set command failed.

These values (along with LINODE_TOKEN) can be placed in a .env file in the repository root to avoid repeating them on the command line.

LINODE_TOKEN="__YOUR_APIV4_TOKEN__" TESTARGS="-run TestAccLinodeVolume -count=1"  make testacc

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK