terraform-provider-epcc

command module
v0.0.1-alpha4 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: AGPL-3.0 Imports: 5 Imported by: 0

README

Elastic Path Commerce Cloud Terraform Provider

This repository contains a Terraform provider for the Elastic Path Commerce Cloud API.

This project was based upon the Terraform Provider Scaffolding Project

Requirements

Building The Provider

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

Environment Variables

The following environment variables are defined in Account Management, and can be used to influence behaviour.

Name Default Description
EPCC_API_BASE_URL - The Base URL of the EPCC API
EPCC_BETA_API_FEATURES - The value of the EP-Beta-Features header being sent to the EPCC API
EPCC_CLIENT_ID - Client ID used for authenticating to the EPCC API
EPCC_CLIENT_SECRET - Client Secret used for authenticating to the EPCC API
EPCC_LOG_DIR (work directory) The directory of the http log files

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.

Project Layout

This project follows the terraform provider template: GitHub template repository documentation

Directory Description
docs/ Folder that contains documentation
examples/ Directory for sample resources and data sources
component-tests/ Component tests for the service are located in here.
external/ Any Go package that can be shared with other projects
internal/ Application specific Go packages, e.g., they cannot be shared and are specific to this service

Using the provider

You would use the epcc-terraform-provider just as any other terraform provider. See the ./examples directory for sample resources and data sources.

See the [Core Terraform Workflow] (https://www.terraform.io/guides/core-workflow.html) page for more info on using Terraform.

Useful commands

Command Description
go install Compile the provider. This will build the provider and put the provider binary in the $GOPATH/bin directory.
go generate Generate or update documentation
make testacc Runs the full suite of Acceptance tests

Debugging the Provider

  1. Run make build

  2. Run the following command (assuming you've installed delve)

dlv exec --headless ./bin/terraform-provider-my-provider -- --debug
  1. Connect with your Debugger

  2. Find the line TF_REATTACH_PROVIDERS in the output

  3. When running terraform prefix the above to the command, for example:

TF_REATTACH_PROVIDERS='...' terraform apply

Debugging Providers

  1. AWS SDK for Go
  2. Extending Terraform
  3. AWS Terraform Provider

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
external
internal

Jump to

Keyboard shortcuts

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