0.0.3 • Published 5 years ago

@team-lemonade/spotinst v0.0.3

Weekly downloads
20
License
Apache-2.0
Repository
github
Last release
5 years ago

Build and Publish

# 1. login to npm (if not logged in)
npm login
# 2. Build and publish
AWS_PROFILE=<role-with-s3-bucket-access> make build publish_tgz publish_packages

Terraform Bridge Provider Boilerplate

This repository contains boilerplate code for building a new Pulumi provider which wraps an existing Terraform provider, if the existing provider uses Go Modules.

Modify this README to describe:

  • The type of resources the provider manages
  • Add a build status image from Travis at the top of the README
  • Update package names in the information below
  • Add any important documentation of concepts (e.g. the "serverless" components in the AWS provider).

Creating a Pulumi Terraform Bridge Provider

Note: Go 1.12 is needed to build Pulumi providers using Go Modules. Currently, we recommend pinning the version in .travis.yml to 1.12.1 to work around an issue with running later versions on Travis CI.

First, clone this repo with the name of the desired provider in place of spotinst:

git clone https://github.com/pulumi/pulumi-tf-provider-boilerplate pulumi-spotinst

Next, replace references to spotinst with the name of your provider:

  • Search/replace the string spotinst with the name of your provider throughout this repo
  • List the configuration points for the provider in the area of the README
  • Rename the cmd/pulumi-{resource,tfgen}-spotinst directories to match the provider name
  • Replace the module name in go.mod to reflect the repository name.
  • If the pulumi provider name differs from the Terraform provider name, set TF_NAME in Makefile to the Terraform name, leaving PACK set to the Pulumi name.

Note: If the name of the desired Pulumi provider differs from the name of the Terraform provider, you will need to carefully distinguish between the references - see https://github.com/pulumi/pulumi-azure for an example.

Add dependencies

In order to properly build the sdks, the following tools are expected:

In the root of the repository, run:

  • go get github.com/pulumi/scripts/gomod-doccopy (Note: do not set GO111MODULE=on here)
  • GO111MODULE=on go get github.com/pulumi/pulumi-terraform@master
  • GO111MODULE=on go get github.com/terraform-providers/terraform-provider-spotinst (where spotinst is the name of the provider)
  • GO111MODULE=on go mod vendor
  • make ensure

Build the provider:

  • Edit resources.go to map each resource, and specify provider information
  • Enumerate any examples in examples/examples_test.go
  • make

Installing

This package is available in many languages in the standard packaging formats.

Node.js (Java/TypeScript)

To use from JavaScript or TypeScript in Node.js, install using either npm:

$ npm install @pulumi/xyx

or yarn:

$ yarn add @pulumi/xyx

Python

To use from Python, install using pip:

$ pip install pulumi_xyx

Go

To use from Go, use go get to grab the latest version of the library

$ go get github.com/pulumi/pulumi-spotinst/sdk/go/...

Configuration

The following configuration points are available for the spotinst provider:

  • spotinst:token (environment: spotinst_TOKEN) - the token for spotinst
  • spotinst:account (environment: spotinst_ACCOUNT) - the spotinst account id

Reference

For detailed reference documentation, please visit the API docs.