Skip to content

render-oss/terraform-provider-render

Repository files navigation

Render Provider

This is the repository of the officially supported Terraform provider for managing infrastructure on Render.

Requirements

Building The Provider

  1. Clone the repository
  2. Enter the repository directory
  3. Build the provider using the Go install command:
go install

Adding Dependencies

This provider uses Go modules. Please see the Go documentation for the most up to date information about using Go modules.

To add a new dependency github.com/author/dependency to your Terraform provider:

go get github.com/author/dependency
go mod tidy

Then commit the changes to go.mod and go.sum.

Running a local version of the provider

  1. Create ~/.terraformrc with the following contents (replace <GOPATH> with your GOPATH)
    provider_installation {
       dev_overrides {
        "registry.terraform.io/render-oss/render" = "<GOPATH>/bin"
       }
    
       # For all other providers, install them directly from their origin provider
       # registries as normal. If you omit this, Terraform will _only_ use
       # the dev_overrides block, and so no other providers will be available.
       direct {}
    }
  2. Install the provider by running go install
  3. Use the provider in your Terraform configuration:
       terraform {
         required_providers {
           render = {
             source = "registry.terraform.io/render-oss/render"
           }
         }
       }
    
       provider "render" {
         api_key = "<YOUR_API_KEY>" # Alternatively, set the RENDER_API_KEY environment variable
         owner_id = "<YOUR_OWNER_ID>" # Alternatively, set the RENDER_OWNER_ID environment variable
       }

If you are successfully using a local version of the provider, you should see the following in the output of a terraform plan:

Warning: Provider development overrides are in effect

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (see Requirements above).

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

To generate or update documentation, run go generate.

In order to run the full suite of Acceptance tests, run make testacc.

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

make testacc

Generating cassettes for provider tests

To generate cassettes, run:

TF_ACC=1 RENDER_OWNER_ID=<your owner id> RENDER_API_KEY=<your api key> RENDER_HOST=<render host> UPDATE_RECORDINGS=true go test -count=1 -v

About

Source code for the official Render Terraform provider

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages