Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: im2nguyen/rover
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.1.4
Choose a base ref
...
head repository: im2nguyen/rover
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Jul 2, 2021

  1. Copy the full SHA
    79f1a2e View commit details
  2. Copy the full SHA
    121fafd View commit details
  3. Update copy in readme

    im2nguyen committed Jul 2, 2021
    Copy the full SHA
    537f70a View commit details
  4. Merge pull request #5 from im2nguyen/tfvarsfile-tfvar-arguments

    Add tfvarsfile and tfVar arguments
    im2nguyen authored Jul 2, 2021
    Copy the full SHA
    ac1b0af View commit details

Commits on Jul 9, 2021

  1. Add standalone mode

    im2nguyen committed Jul 9, 2021
    Copy the full SHA
    afa64cc View commit details
  2. Merge pull request #7 from im2nguyen/standalone

    Add standalone mode
    im2nguyen authored Jul 9, 2021
    Copy the full SHA
    c41b06d View commit details
  3. Update readme headers

    im2nguyen committed Jul 9, 2021
    Copy the full SHA
    232edd0 View commit details
  4. Merge pull request #8 from im2nguyen/update-readme-headers

    Update readme headers
    im2nguyen authored Jul 9, 2021
    Copy the full SHA
    4649a0d View commit details

Commits on Aug 25, 2021

  1. Create LICENSE

    Resolves #11
    im2nguyen authored Aug 25, 2021
    Copy the full SHA
    6921c0d View commit details
  2. Merge pull request #13 from im2nguyen/add-license-1

    Create LICENSE
    im2nguyen authored Aug 25, 2021
    Copy the full SHA
    65f27d5 View commit details

Commits on Aug 26, 2021

  1. Copy the full SHA
    692dc57 View commit details
  2. Merge pull request #14 from Xide/fix/attribute-dependencies

    fix(graph): allow rendering of attributes dependencies
    im2nguyen authored Aug 26, 2021
    Copy the full SHA
    1fa5b94 View commit details

Commits on Sep 26, 2021

  1. add flag planFileName

    Update doc
    sujithq committed Sep 26, 2021
    Copy the full SHA
    360b43b View commit details

Commits on Sep 27, 2021

  1. Update Dockerfile

    make use of multistage builds
    update versions
    sujithq committed Sep 27, 2021
    Copy the full SHA
    5beee43 View commit details

Commits on Sep 28, 2021

  1. Remove .DS_Store

    im2nguyen committed Sep 28, 2021
    Copy the full SHA
    2578f9a View commit details
  2. Copy the full SHA
    3c8b764 View commit details
  3. Copy the full SHA
    51b2a40 View commit details
  4. Merge pull request #33 from sujithq/feature/providePlan

    Use sujithq's PR as a base to accepting plan binaries
    im2nguyen authored Sep 28, 2021
    Copy the full SHA
    d01f868 View commit details
  5. Copy the full SHA
    99f1391 View commit details
  6. Copy the full SHA
    3f1d9a4 View commit details
  7. Copy the full SHA
    07e35cc View commit details
  8. Copy the full SHA
    5a10c61 View commit details
  9. Copy the full SHA
    19d27b6 View commit details
  10. Copy the full SHA
    ccf8bb7 View commit details
  11. Copy the full SHA
    6038555 View commit details
  12. Copy the full SHA
    a5179af View commit details
  13. Fix no-config UI

    im2nguyen committed Sep 28, 2021
    Copy the full SHA
    e9397d6 View commit details
  14. Merge pull request #32 from im2nguyen/v0.2.0

    New Rover features from user feature requests
    im2nguyen authored Sep 28, 2021
    Copy the full SHA
    be42b54 View commit details
  15. Update Dockerfile

    Add ENTRYPOINT
    sujithq authored Sep 28, 2021
    Copy the full SHA
    77e8aa9 View commit details
  16. Use original Dockerfile

    @sujithq Dockerfile is a good improvement, but still needs some work. Was running into errors with it
    im2nguyen authored Sep 28, 2021
    Copy the full SHA
    d794f7d View commit details
  17. Copy the full SHA
    f2266ac View commit details
  18. Add version command

    im2nguyen committed Sep 28, 2021
    Copy the full SHA
    8c1860c View commit details
  19. Copy the full SHA
    59183a2 View commit details
  20. Copy the full SHA
    9aaa78e View commit details
  21. Fix sensitive output error

    im2nguyen committed Sep 28, 2021
    Copy the full SHA
    1434ada View commit details

Commits on Sep 29, 2021

  1. embed ui/dist

    sujithq committed Sep 29, 2021
    Copy the full SHA
    a6b39ea View commit details
  2. Copy the full SHA
    a615425 View commit details
  3. Not a major change.

    Just corrected one spelling and an easy to read word.
    AATHITH authored Sep 29, 2021
    Copy the full SHA
    e8a874d View commit details

Commits on Sep 30, 2021

  1. Copy the full SHA
    494741f View commit details
  2. Publish to DockerHub

    Final version
    sujithq committed Sep 30, 2021
    Copy the full SHA
    af039b6 View commit details

Commits on Oct 1, 2021

  1. Copy the full SHA
    24e6ed5 View commit details

Commits on Oct 2, 2021

  1. Merge pull request #38 from sujithq/sujithq-patch-1

    Update Dockerfile
    im2nguyen authored Oct 2, 2021
    Copy the full SHA
    5308517 View commit details
  2. Cleaned Dockerfile

    im2nguyen committed Oct 2, 2021
    Copy the full SHA
    c9ecb0f View commit details
  3. Copy the full SHA
    70582dc View commit details
  4. Merge pull request #41 from sujithq/feature/publish2DockerHub

    Publish to DockerHub
    im2nguyen authored Oct 2, 2021
    Copy the full SHA
    1e04495 View commit details
  5. Merge pull request #42 from severeone/feature/addBackendConfigParam

    Adding support of -backend-config Terraform parameter.
    im2nguyen authored Oct 2, 2021
    Copy the full SHA
    ba50369 View commit details
  6. Copy the full SHA
    3767d37 View commit details

Commits on Oct 11, 2021

  1. Copy the full SHA
    1efa316 View commit details

Commits on Oct 12, 2021

  1. Merge pull request #54 from vladdoster/patch-1

    (maint): delete push artifact `.DS_Store`
    im2nguyen authored Oct 12, 2021
    Copy the full SHA
    a3e29b3 View commit details

Commits on Nov 4, 2021

  1. Copy the full SHA
    d0c4af1 View commit details
Showing with 5,840 additions and 29,918 deletions.
  1. BIN .DS_Store
  2. +8 −0 .dockerignore
  3. +30 −0 .github/workflows/build.yml
  4. +37 −0 .github/workflows/publishDockerImage.yml
  5. +7 −7 .github/workflows/release.yml
  6. +11 −1 .gitignore
  7. +35 −5 Dockerfile
  8. +21 −0 LICENSE
  9. +61 −15 README.md
  10. BIN example/.DS_Store
  11. +0 −1 example/eks-cluster
  12. +4 −0 example/multiple-files-same-resource-type-test/file-one.tf
  13. +4 −0 example/multiple-files-same-resource-type-test/file-two.tf
  14. +4 −0 example/nested-test/main.tf
  15. +6 −0 example/nested-test/nested-module/main.tf
  16. +22 −1 example/random-test/.terraform.lock.hcl
  17. +25 −0 example/random-test/main.tf
  18. +1 −0 example/random-test/test.tfvars
  19. +3 −0 example/simple-test/main.tf
  20. +35 −3 go.mod
  21. +85 −23 go.sum
  22. +231 −511 graph.go
  23. +337 −92 main.go
  24. +210 −167 map.go
  25. +327 −154 rso.go
  26. +95 −0 screenshot.go
  27. +79 −0 server.go
  28. +3 −4 ui/babel.config.js
  29. +0 −1 ui/dist/css/app.52fc4fd2.css
  30. +1 −0 ui/dist/css/app.620d0115.css
  31. +1 −1 ui/dist/index.html
  32. +2 −0 ui/dist/js/app.3f69df0b.js
  33. +1 −0 ui/dist/js/app.3f69df0b.js.map
  34. +0 −2 ui/dist/js/app.53202c6f.js
  35. +0 −1 ui/dist/js/app.53202c6f.js.map
  36. +0 −30 ui/dist/js/chunk-vendors.bd6ebaf4.js
  37. +0 −1 ui/dist/js/chunk-vendors.bd6ebaf4.js.map
  38. +30 −0 ui/dist/js/chunk-vendors.f533c4a1.js
  39. +1 −0 ui/dist/js/chunk-vendors.f533c4a1.js.map
  40. +3,775 −6,116 ui/package-lock.json
  41. +3 −2 ui/package.json
  42. +1 −1 ui/src/App.vue
  43. +0 −1,142 ui/src/assets/eks-graph.json
  44. +0 −652 ui/src/assets/eks-map.json
  45. +0 −20,320 ui/src/assets/eks-overview.json
  46. +0 −1 ui/src/assets/overview-eks.json
  47. +0 −1 ui/src/assets/overview.json
  48. +0 −120 ui/src/assets/pet-map.json
  49. +0 −398 ui/src/assets/pet-overview.json
  50. +13 −5 ui/src/components/Explorer.vue
  51. +1 −1 ui/src/components/File.vue
  52. +42 −20 ui/src/components/Graph/Graph.vue
  53. +3 −1 ui/src/components/MainNav.vue
  54. +20 −8 ui/src/components/ResourceCard.vue
  55. +94 −110 ui/src/components/ResourceDetail.vue
  56. +171 −0 zip.go
Binary file removed .DS_Store
Binary file not shown.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ignore .git
.git
.github
docs
example
rover
**/node_modules
**/dist
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: UI build
run: |
cd ui
npm install
npm run build
- name: Go Build
run: go build
37 changes: 37 additions & 0 deletions .github/workflows/publishDockerImage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: PublishDockerImage

# Run whenever the publish job runs
on:
push:
tags:
- "v*"

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: im2nguyen/rover

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args:
TF_VERSION=1.1.2
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -19,19 +19,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Unshallow
run: git fetch --prune --unshallow
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.16
go-version-file: go.mod
- name: Import GPG key
id: import_gpg
uses: hashicorp/ghaction-import-gpg@v2.1.0
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
rover
build/rover
.DS_Store
rover.zip
plan.out

# Ignore generated terraform files
.terraform**

.idea/

build/
40 changes: 35 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,44 @@
# Prep base stage
ARG TF_VERSION=light

FROM hashicorp/terraform:$TF_VERSION
# Build ui
FROM node:20-alpine as ui
WORKDIR /src
# Copy specific package files
COPY ./ui/package-lock.json ./
COPY ./ui/package.json ./
COPY ./ui/babel.config.js ./
# Set Progress, Config and install
RUN npm set progress=false && npm config set depth 0 && npm install
# Copy source
# Copy Specific Directories
COPY ./ui/public ./public
COPY ./ui/src ./src
# build (to dist folder)
RUN NODE_OPTIONS='--openssl-legacy-provider' npm run build

RUN cp /bin/terraform /usr/local/bin/terraform
# Build rover
FROM golang:1.21 AS rover
WORKDIR /src
# Copy full source
COPY . .
# Copy ui/dist from ui stage as it needs to embedded
COPY --from=ui ./src/dist ./ui/dist
# Build rover
RUN go get -d -v golang.org/x/net/html
RUN CGO_ENABLED=0 GOOS=linux go build -o rover .

COPY ./rover /bin/rover
# Release stage
FROM hashicorp/terraform:$TF_VERSION AS release
# Copy terraform binary to the rover's default terraform path
RUN cp /bin/terraform /usr/local/bin/terraform
# Copy rover binary
COPY --from=rover /src/rover /bin/rover
RUN chmod +x /bin/rover

# Install Google Chrome
RUN apk add chromium

WORKDIR /src

ENTRYPOINT [ "/bin/rover" ]

# CMD ["rover"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 rover

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
76 changes: 61 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
## Rover - Terraform Visualizer

Rover is a [Terraform](http://terraform.io/) visualizer.
Rover is a [Terraform](http://terraform.io/) visualizer.

In order to do this, Rover:

1. generates a [`plan`](https://www.terraform.io/docs/cli/commands/plan.html#out-filename) file and parses the configuration in the root directory.
1. generates a [`plan`](https://www.terraform.io/docs/cli/commands/plan.html#out-filename) file and parses the configuration in the root directory or uses a provided plan.
1. parses the `plan` and configuration files to generate three items: the resource overview (`rso`), the resource map (`map`), and the resource graph (`graph`).
1. consumes the `rso`, `map`, and `graph` to generate an interactive configuration and state visualization hosts on `localhost:9000`.
1. consumes the `rso`, `map`, and `graph` to generate an interactive configuration and state visualization hosts on `0.0.0.0:9000`.

Feedback (via issues) and pull requests are appreciated!
Feedback (via issues) and pull requests are appreciated!

![Rover Screenshot](docs/rover-cropped-screenshot.png)

@@ -28,12 +28,41 @@ $ docker run --rm -it -p 9000:9000 -v $(pwd):/src im2nguyen/rover
2021/07/02 06:46:25 Generating resource map...
2021/07/02 06:46:25 Generating resource graph...
2021/07/02 06:46:25 Done generating assets.
2021/07/02 06:46:25 Rover is running on localhost:9000
2021/07/02 06:46:25 Rover is running on 0.0.0.0:9000
```

Once Rover runs on `localhost:9000`, navigate to it to find the visualization!
Once Rover runs on `0.0.0.0:9000`, navigate to it to find the visualization!

Use `--env` or `--env-file` to set environment variables in the Docker container. For example, you can save your AWS credentials to an `.env` file.
### Run on Terraform plan file

Use `-planJSONPath` to start Rover on Terraform plan file. The `plan.json` file should be in Linux version - Unix (LF), UTF-8.

First, generate the plan file in JSON format.

```
$ terraform plan -out plan.out
$ terraform show -json plan.out > plan.json
```

Then, run Rover on it.

```
$ docker run --rm -it -p 9000:9000 -v $(pwd)/plan.json:/src/plan.json im2nguyen/rover:latest -planJSONPath=plan.json
```

### Standalone mode

Standalone mode generates a `rover.zip` file containing all the static assets.

```
$ docker run --rm -it -p 9000:9000 -v "$(pwd):/src" im2nguyen/rover -standalone true
```

After all the assets are generated, unzip `rover.zip` and open `rover/index.html` in your favourite web browser.

### Set environment variables

Use `--env` or `--env-file` to set environment variables in the Docker container. For example, you can save your AWS credentials to a `.env` file.

```
$ printenv | grep "AWS" > .env
@@ -42,19 +71,36 @@ $ printenv | grep "AWS" > .env
Then, add it as environment variables to your Docker container with `--env-file`.

```
$ docker run --rm -it -p 9000:9000 -v $(pwd):/src --env-file ./.env im2nguyen/rover
$ docker run --rm -it -p 9000:9000 -v "$(pwd):/src" --env-file ./.env im2nguyen/rover
```

### Define tfbackend, tfvars and Terraform variables

Use `-tfBackendConfig` to define backend config files and `-tfVarsFile` or `-tfVar` to define variables. For example, you can run the following in the `example/random-test` directory to overload variables.

```
$ docker run --rm -it -p 9000:9000 -v "$(pwd):/src" im2nguyen/rover -tfBackendConfig test.tfbackend -tfVarsFile test.tfvars -tfVar max_length=4
```

### Image generation

Use `-genImage` to generate and save the visualization as a SVG image.

```
$ docker run --rm -it -v "$(pwd):/src" im2nguyen/rover -genImage true
```

## Installation

You can download Rover binary specific to your system by visiting the [Releases page](https://github.com/im2nguyen/rover/releases). Download the binary, unzip, then move `rover` into your `PATH`.

- [rover zip — MacOS](https://github.com/im2nguyen/rover/releases/download/v0.1.3/rover_0.1.3_darwin_amd64.zip)
- [rover zip — Windows](https://github.com/im2nguyen/rover/releases/download/v0.1.3/rover_0.1.3_windows_amd64.zip)
- [rover zip — MacOS - intel](https://github.com/im2nguyen/rover/releases/download/v0.3.2/rover_0.3.2_darwin_amd64.zip)
- [rover zip — MacOS - Apple Silicon](https://github.com/im2nguyen/rover/releases/download/v0.3.2/rover_0.3.2_darwin_arm64.zip)
- [rover zip — Windows](https://github.com/im2nguyen/rover/releases/download/v0.3.2/rover_0.3.2_windows_amd64.zip)

### Build from source

You can build Rover manually by cloning this repository, then building the frontend and compiling the binary. It requires Go v1.16+ and `npm`.
You can build Rover manually by cloning this repository, then building the frontend and compiling the binary. It requires Go v1.21+ and `npm`.

#### Build frontend

@@ -101,13 +147,13 @@ $ env GOOS=linux GOARCH=amd64 go build .
Then, build the Docker image.

```
$ docker build . -t im2nguyen/rover
$ docker build . -t im2nguyen/rover --no-cache
```


## Basic usage

This repository contains two example Terraform configurations in `example`.
This repository contains two examples of Terraform configurations in `example`.

Navigate into `random-test` example configuration. This directory contains configuration that showcases a wide variety of features common in Terraform (modules, count, output, locals, etc) with the [`random`](https://registry.terraform.io/providers/hashicorp/random/latest) provider.

@@ -127,7 +173,7 @@ $ rover
2021/06/23 22:51:28 Generating resource map...
2021/06/23 22:51:28 Generating resource graph...
2021/06/23 22:51:28 Done generating assets.
2021/06/23 22:51:28 Rover is running on localhost:9000
2021/06/23 22:51:28 Rover is running on 0.0.0.0:9000
```

You can specify the working directory (where your configuration is living) and the Terraform binary location using flags.
@@ -136,4 +182,4 @@ You can specify the working directory (where your configuration is living) and t
$ rover -workingDir "example/eks-cluster" -tfPath "/Users/dos/terraform"
```

Once Rover runs on `localhost:9000`, navigate to it to find the visualization!
Once Rover runs on `0.0.0.0:9000`, navigate to it to find the visualization!
Binary file removed example/.DS_Store
Binary file not shown.
1 change: 0 additions & 1 deletion example/eks-cluster
Submodule eks-cluster deleted from 434cd8
4 changes: 4 additions & 0 deletions example/multiple-files-same-resource-type-test/file-one.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resource "random_integer" "one" {
min = 1
max = 3
}
4 changes: 4 additions & 0 deletions example/multiple-files-same-resource-type-test/file-two.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resource "random_integer" "two" {
min = 1
max = 4
}
4 changes: 4 additions & 0 deletions example/nested-test/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module "sub_module" {
source = "./nested-module"

}
6 changes: 6 additions & 0 deletions example/nested-test/nested-module/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module "remote_module" {
source = "git::https://github.com/im2nguyen/rover.git//example/random-test/random-name"

max_length = "3"

}
23 changes: 22 additions & 1 deletion example/random-test/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading