Skip to content

everis-technology/Tfe.NetClient

Repository files navigation

Tfe.NetClient

Tfe.NetClient

Tfe.NetClient is a .NET Client for Terraform Enterprise.

Features

Terraform Cloud API Documentation can be found here.

Basic usage

Add the package to your project

dotnet add package Tfe.NetClient

Create a TfeConfig object

var httpClient = new HttpClient();
var config = new TfeConfig(<YOUR TOKEN HERE>, httpClient);

Create the TfeClient

var client = new TfeClient(config);

Create a request and call the correponding method

/// This sample creates a workspace
/// Create a WorkspacesRequest
var request = new WorkspacesRequest();
var workspaceName = $"test-{Guid.NewGuid().ToString()}";
request.Data.Attributes.Name = workspaceName;

/// Call the CreateAsync method.
var result = await client.Workspace.CreateAsync(organizationName, request);

Please check the Integration tests here for more samples.

Contributing to Tfe.NetClient

Check our Contributing guidelines here.

Clone the repo

mkdir -p everis-technology/Tfe.NetClient
git clone https://github.com/everis-technology/Tfe.NetClient everis-technology/Tfe.NetClient