Giter VIP home page Giter VIP logo

terraform-provider-lightstep's Introduction

Lightstep Terraform Provider

In August 2023, Lightstep became ServiceNow Cloud Observability. To ease the transition, all code artifacts will continue to use the Lightstep name. You don't need to do anything to keep using this provider.

Requirements

Using the provider

  • Install Terraform
  • Write some code to initialize the provider with your Lightstep organization and API Key with member permissions:
terraform {
  required_providers {
    lightstep = {
      source = "lightstep/lightstep"
      version = "1.77.2"
    }
  }
}

provider "lightstep" {
  api_key         = "your-lightstep-org-api-key"
  organization    = "your-lightstep-organization"
}

# Example: Create AWS EC2 Dashboard
module "aws-dashboards" {
  source            = "lightstep/aws-dashboards/lightstep//modules/ec2-dashboard"
  lightstep_project = "your-lightstep-project"
}
  • Run terraform init
  • Add some code to define dashboards, streams, alerts, and more. See documentation for examples or use pre-built Lightstep Terraform modules.
  • After setting an environment variable with your API Key that matches the name in the provider configuration above, run terraform plan to preview changes.

⚠️ If you're creating many Lightstep resources at once, we recommend running the apply with the parallelism flag set to a low value to avoid API 500 errors:

   # Avoids 500 errors when creating many resources.
   terraform apply -parallelism=1

Development

See DEVELOPMENT.md.

Exporter

It's possible to export an existing Lightstep dashboard to HCL code using the provider. This allows you to generate terrform code for a dashboard you created in the Lightstep UI ("reverse terraform").

The exporter utility is built-in to the provider binary and requires certain environment variables to be set:

$ export LIGHTSTEP_API_KEY=....
$ export LIGHTSTEP_ORG=your-org
$ export LIGHTSTEP_API_BASE_URL='https://api.lightstep.com'

# exports to console dashboard id = rZbPJ33q from project terraform-shop
$ go run github.com/lightstep/terraform-provider-lightstep exporter lightstep_dashboard terraform-shop rZbPJ33q

terraform-provider-lightstep's People

Contributors

mistersquishy avatar ishg avatar bcronin avatar lambcode avatar cboppert avatar smithclay avatar mattcarmody avatar ltyson avatar paivagustavo avatar dantulovsky avatar danhurwit avatar gdfast avatar matthagenbuch avatar mi-lee avatar amburvill avatar dependabot[bot] avatar wfro avatar rafaeljesus avatar dolphinsgrin avatar erik-snow avatar carolynblumberg avatar benpbrown avatar gdvalle avatar frenchfrywpepper avatar neilwa avatar heidmotron avatar therealakhil avatar isaaczinda avatar karticus avatar srjames90 avatar

Stargazers

Vesna Milovanovic avatar  avatar Ashley Jackson avatar Ana Margarita Medina avatar Dan Hedgecock avatar Zach Eddy avatar  avatar  avatar George Kontridze avatar Jacob Aronoff avatar  avatar  avatar

Watchers

Brett Buddin avatar Ted Young avatar Todd Persen avatar Bryan Culbertson avatar Sean Stangl avatar Rob Benson avatar Douglas Graves avatar Doug Odegaard avatar Tal Danzig avatar Gregory Marshall avatar James Cloos avatar Danica Shei avatar  avatar Sridharan Ravichandran avatar Chris Dion avatar alexpaxton avatar Matthew Wear avatar Brie Anne Demkiw avatar Bryan Branson avatar Arthur Sampaio avatar Joshua MacDonald avatar  avatar Ana Margarita Medina avatar Salvatore Candela avatar Christopher Plain avatar Martin Kuba avatar Forrest Knight avatar  avatar  avatar Kelley Scanlon avatar  avatar Chris Murray avatar  avatar Chris Sackes avatar  avatar  avatar  avatar Jeremy Drouillard avatar Heber Silva avatar  avatar  avatar  avatar Daniel Sellars avatar Tania Pham avatar Kristina Pathak avatar Silvia Camara avatar  avatar  avatar Isaak Krautwurst avatar

Forkers

adcharre

terraform-provider-lightstep's Issues

bad version in README

when trying to initialize the module with terraform init, I got error:
│ Error: Failed to install provider

│ Error while installing lightstep/lightstep v1.61.1: checksum list has unexpected SHA-256 hash 75e765cc04c11a77a46af8d9df1672814c7676e9d69ff04d96de2b3fa5701ca0 (expected
│ 70279d592510f4800049d6e5223100822ca21826eb7e744460ed6129e47bed11)

In order to workaround the issue I had to change the version in my main.tf:

  • from version = "1.61.1" (generating error above) to version = "~> 1.61.0", working and installing version 1.61.2

Invalid resource type "lightstep_dashboard"

I exported a dashboard from one project in order to import it back in another one, but when importing my dashboard, I got error:
│ Error: Invalid resource type

│ on dashboard-mainframe-red-metrics.tf line 2, in resource "lightstep_dashboard" "mainframe_red":
│ 2: resource "lightstep_dashboard" "mainframe_red" {

│ The provider lightstep/lightstep does not support resource type "lightstep_dashboard".

Instructions to set project missing

Instructions to set the project are missing from the readme.
So, if you use a file you exported before and try to import it back, it won't work

Provider failed after apply

I just followed this instruction.

lightstep_stream.my_stream: Creating...
╷
│ Error: Request cancelled
│ 
│   with lightstep_stream.my_stream,
│   on main.tf line 16, in resource "lightstep_stream" "my_stream":
│   16: resource "lightstep_stream" "my_stream" {
│ 
│ The plugin.(*GRPCProvider).ApplyResourceChange request was cancelled.
╵

Stack trace from the terraform-provider-lightstep_v1.84.4 plugin:

panic: interface conversion: interface {} is nil, not string

goroutine 78 [running]:
github.com/lightstep/terraform-provider-lightstep/client.CustomDataConvert(...)
        github.com/lightstep/terraform-provider-lightstep/client/streams.go:54
github.com/lightstep/terraform-provider-lightstep/client.(*Client).CreateStream(0x14000468d00?, {0x1012a3108, 0x1400053dad0}, {0x140004601e0, 0xa}, {0x1400058a0a0, 0x1b}, {0x140000dc210, 0xa4}, {0x140004a1ff0, ...})
        github.com/lightstep/terraform-provider-lightstep/client/streams.go:81 +0x580
github.com/lightstep/terraform-provider-lightstep/lightstep.resourceStreamCreate.func1()
        github.com/lightstep/terraform-provider-lightstep/lightstep/resource_stream.go:62 +0x174
github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource.RetryContext.func1()
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/resource/wait.go:27 +0x48
github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource.(*StateChangeConf).WaitForStateContext.func1()
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/resource/state.go:110 +0x144
created by github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource.(*StateChangeConf).WaitForStateContext
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/resource/state.go:83 +0x1a4

Error: The terraform-provider-lightstep_v1.84.4 plugin crashed!

Missing release artifacts for 1.61.1

It appears the release artifacts are missing for the latest patch release: https://github.com/lightstep/terraform-provider-lightstep/releases

terraform {
  required_providers {
    lightstep = {
      source = "lightstep/lightstep"
      version = "1.61.1"
    }
  }
}

provider "lightstep" {
  # Configuration options
}
terraform init
Initializing the backend...

Initializing provider plugins...
- Finding lightstep/lightstep versions matching "1.61.1"...
╷
│ Error: Failed to install provider
│
│ Error while installing lightstep/lightstep v1.61.1: could not query provider registry for registry.terraform.io/lightstep/lightstep: failed to retrieve
│ authentication checksums for provider: 404 Not Found
╵

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.