Skip to content

denis-codefresh/terraform-provider-codefresh

 
 

Repository files navigation

Terraform provider for Codefresh

This provider was initialized by LightStep and will be maintained as the official Terraform provider for Codefresh.

The provider is still under development, and can be used as a terraform third-party plugin only.

Requirements

  • Terraform 0.12+ ;
  • Go 1.12+ (to build the provider plugin).

Download Provider

Download and extract terraform-provider-codefresh from releases

Building the Provider

go build -o terraform-provider-codefresh

Using the Provider

Compile or take from the Releases terraform-provider-codefresh binary and place it locally according the Terraform plugins documentation.

for terraform 0.12:

  • ~/.terraform.d/plugins/linux_amd64
  • ./terraform.d/plugins/linux_amd64. The relative path in your Terraform project.

for terraform 0.13 follow required providers:

# OS  is linux|windows|darwin, ARCH is amd64|arm|x86
PLUGIN_DIR=~/.terraform.d/plugins/codefresh.io/app/codefresh/0.1.0/<OS_ARCH>
mkdir -p ${PLUGIN_DIR}
cp terraform-provider-codefresh  ${PLUGIN_DIR}/

add required_providers block

terraform {

  required_providers {
    codefresh = {
      versions = ["0.1.0"]
      source = "codefresh.io/app/codefresh"
    }
  }
}

To configure Codefresh provider:

provider "codefresh" {
  api_url = "<MY API URL>" # Default value - https://g.codefresh.io/api
  token = "<MY API TOKEN>" # If token isn't set the provider expects the $CODEFRESH_API_KEY env variable
}

Get an API key from Codefresh and set the following scopes:

  • Environments-V2
  • Pipeline
  • Project
  • Repos
  • Step-Type
  • Step-Types
  • View
export CODEFRESH_API_KEY='xyz'

Testing the Provider

License

Copyright 2020 Codefresh.

The Codefresh Provider is available under MPL2.0 license.

About

Terraform provider for Codefresh API - https://g.codefresh.io/api/

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 95.4%
  • HCL 2.9%
  • Other 1.7%