Skip to content

Commit

Permalink
Refactor Lightstep to cloud observability (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
heydbut authored Aug 29, 2023
1 parent 1efc7ae commit 37caa4b
Show file tree
Hide file tree
Showing 205 changed files with 579 additions and 581 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Setup Terraform Lint
uses: terraform-linters/setup-tflint@v1
with:
tflint_version: v0.34.1
tflint_version: v0.47.0

- name: Terraform Init
id: init
Expand All @@ -56,20 +56,17 @@ jobs:
- name: Lint root module
run: |
tflint --config ${{ github.workspace }}/.tflint.hcl ${{ github.workspace }}
tflint --config ${{ github.workspace }}/.tflint.hcl --chdir ${{ github.workspace }}
- name: Lint modules directory in a loop
run: |
for m in $(ls -1d modules/*/)
do
tflint \
--config ${{ github.workspace }}/.tflint.hcl \
${{ github.workspace }}/${m}
tflint --config ${{ github.workspace }}/.tflint.hcl --chdir ${{ github.workspace }}/${m}
done
- name: Lint examples directory in a loop
run: |
for m in $(ls -1d examples/*/)
do
tflint \
--config ${{ github.workspace }}/.tflint.hcl \
${{ github.workspace }}/${m}
terraform -chdir=${{ github.workspace }}/${m} init
tflint --config ${{ github.workspace }}/.tflint.hcl --chdir ${{ github.workspace }}/${m} --minimum-failure-severity=error
done
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2022 Lightstep
Copyright 2022 ServiceNow Cloud Observability

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
21 changes: 11 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.PHONY: ready gen fmt check clean init apply destroy fresh

ready: gen fmt
ready: gen fmt check

# generates the root module main.tf, variables.tf, outputs.tf and README.md
gen:
Expand All @@ -11,7 +12,7 @@ fmt:

check:
terraform fmt -check -recursive
tflint --config .tflint.hcl --recursive
tflint --config .tflint.hcl --recursive --minimum-failure-severity=error

clean:
rm -rf .terraform*
Expand All @@ -21,16 +22,16 @@ init:

apply:
terraform apply \
-var="lightstep_organization=LightStep" \
-var="lightstep_env=staging" \
-var="lightstep_project=dev-integrations" \
-var="lightstep_api_key_env_var=LIGHTSTEP_API_KEY"
-var="cloud_observability_organization=LightStep" \
-var="cloud_observability_env=staging" \
-var="cloud_observability_project=dev-integrations" \
-var="cloud_observability_api_key_env_var=LIGHTSTEP_API_KEY"

destroy:
terraform destroy \
-var="lightstep_organization=LightStep" \
-var="lightstep_env=staging" \
-var="lightstep_project=dev-integrations" \
-var="lightstep_api_key_env_var=LIGHTSTEP_API_KEY"
-var="cloud_observability_organization=LightStep" \
-var="cloud_observability_env=staging" \
-var="cloud_observability_project=dev-integrations" \
-var="cloud_observability_api_key_env_var=LIGHTSTEP_API_KEY"

fresh: clean init apply
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Terraform Module for Lightstep AWS Dashboards
# Terraform Module for Cloud Observability AWS Dashboards

**:warning:** You are viewing a **beta version** of the official
module to create and manage AWS Dashboards inside Lightstep.
module to create and manage AWS Dashboards inside Cloud Observability.

This is a Terraform module for deploying pre-defined set of AWS dashboards in Lightstep meant to be used with the [Lightstep Cloudwatch Metrics Streams Integration](https://docs.lightstep.com/docs/setup-aws-for-metrics).
This is a Terraform module for deploying pre-defined set of AWS dashboards in Cloud Observability meant to be used with the [Cloud Observability Cloudwatch Metrics Streams Integration](https://docs.lightstep.com/docs/setup-aws-for-metrics).

## Pre-requisites

* Lightstep account and API Key with `member` permissons.
* [Lightstep Cloudwatch Metrics Streams integration](https://docs.lightstep.com/docs/setup-aws-for-metrics) sending data to a Lightstep project.
* Cloud Observability account and API Key with `member` permissions.
* [Cloud Observability Cloudwatch Metrics Streams integration](https://docs.lightstep.com/docs/setup-aws-for-metrics) sending data to a Cloud Observability project.
* Terraform v1.0+

## Supported AWS Resources

Each AWS resource has an associated module that will create Lightstep dashboards to view Cloudwatch metrics. Currently, these resources are supported:
Each AWS resource has an associated module that will create Cloud Observability dashboards to view Cloudwatch metrics. Currently, these resources are supported:

<!-- modules autogenerated section -->
* __Amplify__ (module: [`amplify-dashboard`](https://github.com/lightstep/terraform-lightstep-aws-dashboards/tree/main/modules/amplify-dashboard))
Expand Down Expand Up @@ -61,12 +61,12 @@ Each AWS resource has an associated module that will create Lightstep dashboards

This repo has the following folder structure:

* [modules](https://github.com/lightstep/terraform-lightstep-aws-dashboards/tree/master/modules): This folder contains several standalone, reusable, modules that you can use to create different types of Lightstep dashboards for AWS resources.
* [modules](https://github.com/lightstep/terraform-lightstep-aws-dashboards/tree/master/modules): This folder contains several standalone, reusable, modules that you can use to create different types of Cloud Observability dashboards for AWS resources.
* [examples](https://github.com/lightstep/terraform-lightstep-aws-dashboards/tree/master/examples): This folder shows examples of different ways to define creation of dashboards.
* [root folder](https://github.com/lightstep/terraform-lightstep-aws-dashboards/tree/master): The root folder is *an example* of how to use the [terraform-lightstep-aws-dashboards module](https://github.com/hashicorp/terraform-aws-consul/tree/master/modules/consul-cluster)
module to create Lightstep AWS Dashboards. The Terraform Registry requires the root of every repo to contain Terraform code, so we've put one of the examples there. This example is great for learning and experimenting, but for production use, please use the underlying modules in the [modules folder](https://github.com/lightstep/terraform-lightstep-aws-dashboards/tree/master/modules) directly.
module to create Cloud Observability AWS Dashboards. The Terraform Registry requires the root of every repo to contain Terraform code, so we've put one of the examples there. This example is great for learning and experimenting, but for production use, please use the underlying modules in the [modules folder](https://github.com/lightstep/terraform-lightstep-aws-dashboards/tree/master/modules) directly.

To deploy create Lightstep dashboards for production using this repo:
To deploy create Cloud Observability dashboards for production using this repo:

- Ensure account meets module pre-requisites from above.

Expand Down
4 changes: 2 additions & 2 deletions examples/applicationelb-dashboard/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Lightstep AWS Application ELB Dashboard Example
# Cloud Observability AWS Application ELB Dashboard Example

This folder shows an example of using Terraform code to create a dashboard in Lightstep for Amazon Application ELBs using data from the [Lightstep Cloudwatch Metrics Streams integration](https://docs.lightstep.com/docs/setup-aws-for-metrics).
This folder shows an example of using Terraform code to create a dashboard in Cloud Observability for Amazon Application ELBs using data from the [Cloud Observability Cloudwatch Metrics Streams integration](https://docs.lightstep.com/docs/setup-aws-for-metrics).
10 changes: 5 additions & 5 deletions examples/applicationelb-dashboard/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ terraform {
}

provider "lightstep" {
api_key_env_var = var.lightstep_api_key_env_var
organization = var.lightstep_organization
environment = var.lightstep_env
api_key_env_var = var.cloud_observability_api_key_env_var
organization = var.cloud_observability_organization
environment = var.cloud_observability_env
}

module "lightstep_applicationelb_dashboard" {
# When using these modules in your own templates, you will need to use a Git URL with a ref attribute that pins you
# to a specific version of the modules, such as the following example:
# source = "git::[email protected]:lightstep/terraform-lightstep-aws-dashboards.git//modules/ec2-dashboard?ref=v0.0.1"
source = "../../modules/applicationelb-dashboard"
lightstep_project = var.lightstep_project
source = "../../modules/applicationelb-dashboard"
cloud_observability_project = var.cloud_observability_project
}
2 changes: 1 addition & 1 deletion examples/applicationelb-dashboard/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
output "lightstep_app_elb_dashboard_url" {
value = module.lightstep_applicationelb_dashboard.dashboard_url
description = "Lightstep AWS Application ELB Dashboard URL"
description = "Cloud Observability AWS Application ELB Dashboard URL"
}
16 changes: 8 additions & 8 deletions examples/applicationelb-dashboard/variables.tf
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
variable "lightstep_project" {
description = "Name of Lightstep project"
variable "cloud_observability_project" {
description = "Name of Cloud Observability project"
type = string
}

variable "lightstep_organization" {
description = "Name of Lightstep organization"
variable "cloud_observability_organization" {
description = "Name of Cloud Observability organization"
type = string
}

variable "lightstep_env" {
description = "Lightstep environment"
variable "cloud_observability_env" {
description = "Cloud Observability environment"
type = string
default = "public"
}

variable "lightstep_api_key_env_var" {
description = "Name of the local environment variable that contains the Lightstep API key"
variable "cloud_observability_api_key_env_var" {
description = "Name of the local environment variable that contains the Cloud Observability API key"
type = string
default = "LIGHTSTEP_API_KEY"
}
8 changes: 4 additions & 4 deletions examples/ec2-dashboard/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Lightstep AWS EC2 Dashboard Example
# Cloud Observability AWS EC2 Dashboard Example

This folder shows an example of using Terraform code to create a dashboard in Lightstep for EC2 Instances using data from the [Lightstep Cloudwatch Metrics Streams integration](https://docs.lightstep.com/docs/setup-aws-for-metrics).
This folder shows an example of using Terraform code to create a dashboard in Cloud Observability for EC2 Instances using data from the [Cloud Observability Cloudwatch Metrics Streams integration](https://docs.lightstep.com/docs/setup-aws-for-metrics).

### Prerequisites

1. Configure the [Lightstep Cloudwatch Metrics Streams integration](https://docs.lightstep.com/docs/setup-aws-for-metrics) to send data to your Lightstep project.
2. Set your Lightstep API Key
1. Configure the [Cloud Observability Cloudwatch Metrics Streams integration](https://docs.lightstep.com/docs/setup-aws-for-metrics) to send data to your Cloud Observability project.
2. Set your Cloud Observability API Key

```
export LIGHTSTEP_API_KEY=...
Expand Down
6 changes: 3 additions & 3 deletions examples/ec2-dashboard/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module "lightstep_ec2_dashboard" {
# When using these modules in your own templates, you will need to use a Git URL with a ref attribute that pins you
# to a specific version of the modules, such as the following example:
# source = "git::[email protected]:lightstep/terraform-lightstep-aws-dashboards.git//modules/ec2-dashboard?ref=v0.0.1"
source = "../../modules/ec2-dashboard"
lightstep_project = var.lightstep_project
aws_region = "us-west-2"
source = "../../modules/ec2-dashboard"
cloud_observability_project = var.cloud_observability_project
aws_region = "us-west-2"
}
2 changes: 1 addition & 1 deletion examples/ec2-dashboard/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
output "lightstep_aws_ec2_dashboard_url" {
value = module.lightstep_ec2_dashboards.dashboard_url
description = "Lightstep AWS EC2 Dashboard URL"
description = "Cloud Observability AWS EC2 Dashboard URL"
}
10 changes: 5 additions & 5 deletions examples/ec2-dashboard/variables.tf
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
variable "lightstep_project" {
description = "Name of Lightstep project"
variable "cloud_observability_project" {
description = "Name of Cloud Observability project"
type = string
}

variable "lightstep_organization" {
description = "Name of Lightstep organization"
description = "Name of Cloud Observability organization"
type = string
}

variable "lightstep_env" {
description = "Lightstep environment"
description = "Cloud Observability environment"
type = string
default = "public"
}

variable "lightstep_api_key_env_var" {
description = "Name of the local environment variable that contains the Lightstep API key"
description = "Name of the local environment variable that contains the Cloud Observability API key"
type = string
default = "LIGHTSTEP_API_KEY"
}
4 changes: 2 additions & 2 deletions examples/rds-dashboard/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Lightstep AWS RDS Dashboard Example
# Cloud Observability AWS RDS Dashboard Example

This folder shows an example of using Terraform code to create a dashboard in Lightstep for Amazon RDS databases using data from the [Lightstep Cloudwatch Metrics Streams integration](https://docs.lightstep.com/docs/setup-aws-for-metrics).
This folder shows an example of using Terraform code to create a dashboard in Cloud Observability for Amazon RDS databases using data from the [Cloud Observability Cloudwatch Metrics Streams integration](https://docs.lightstep.com/docs/setup-aws-for-metrics).
6 changes: 3 additions & 3 deletions examples/rds-dashboard/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module "lightstep_ec2_dashboard" {
# When using these modules in your own templates, you will need to use a Git URL with a ref attribute that pins you
# to a specific version of the modules, such as the following example:
# source = "git::[email protected]:lightstep/terraform-lightstep-aws-dashboards.git//modules/ec2-dashboard?ref=v0.0.1"
source = "../../modules/rds-dashboard"
lightstep_project = var.lightstep_project
aws_region = "us-west-2"
source = "../../modules/rds-dashboard"
cloud_observability_project = var.cloud_observability_project
aws_region = "us-west-2"
}
2 changes: 1 addition & 1 deletion examples/rds-dashboard/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
output "lightstep_aws_rds_dashboard_url" {
value = module.lightstep_rds_dashboard.dashboard_url
description = "Lightstep AWS RDS Dashboard URL"
description = "Cloud Observability AWS RDS Dashboard URL"
}
16 changes: 8 additions & 8 deletions examples/rds-dashboard/variables.tf
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
variable "lightstep_project" {
description = "Name of Lightstep project"
variable "cloud_observability_project" {
description = "Name of Cloud Observability project"
type = string
}

variable "lightstep_organization" {
description = "Name of Lightstep organization"
variable "cloud_observability_organization" {
description = "Name of Cloud Observability organization"
type = string
}

variable "lightstep_env" {
description = "Lightstep environment"
variable "cloud_observability_env" {
description = "Cloud Observability environment"
type = string
default = "public"
}

variable "lightstep_api_key_env_var" {
description = "Name of the local environment variable that contains the Lightstep API key"
variable "cloud_observability_api_key_env_var" {
description = "Name of the local environment variable that contains the Cloud Observability API key"
type = string
default = "LIGHTSTEP_API_KEY"
}
Loading

0 comments on commit 37caa4b

Please sign in to comment.