Coder Social home page Coder Social logo

pluralith / pluralith-cli Goto Github PK

View Code? Open in Web Editor NEW
773.0 30.0 54.0 670 KB

A tool for Terraform state visualisation and automated generation of infrastructure documentation

Home Page: https://www.pluralith.com

License: Mozilla Public License 2.0

Go 98.61% HCL 0.60% Shell 0.50% Batchfile 0.08% Dockerfile 0.16% Makefile 0.05%
cli pluralith terraform cloud

pluralith-cli's Issues

BUG: Unable to `unrelate` objects with key (`for_each`)

With the following config file piece:

...
diagram:
  unrelate:
    - resource1: ml_instances.aws_eip.eipalloc-08623772f2cbfd669
      resource2: ml_instances.aws_instance.ml_ireland.a
    - resource1: ml_instances.aws_eip.eipalloc-08623772f2cbfd669
      resource2: ml_instances.aws_instance.ml_ireland.b
    - resource1: ml_instances.aws_eip.eipalloc-08623772f2cbfd669
      resource2: ml_instances.aws_instance.ml_ireland.c
    - resource1: ml_instances.aws_eip.eipalloc-08623772f2cbfd669
      resource2: ml_instances.aws_instance.ml_ireland.d
    - resource1: ml_instances.aws_eip.eipalloc-08623772f2cbfd669
      resource2: ml_instances.aws_instance.ml_ireland.e
    - resource1: ml_instances.aws_eip.eipalloc-08623772f2cbfd669
      resource2: ml_instances.aws_instance.ml_ireland.f
    - resource1: ml_instances.aws_eip.eipalloc-08623772f2cbfd669
      resource2: ml_instances.aws_instance.ml_ireland.g

All the links are still generated. In pluralith.diagram.json I see this unrelate items listed. In pluralith.cache.json:


        {
            "childResourceId": "0.ml_instances.aws_eip.eipalloc-08623772f2cbfd669",
            "parentResourceId": "0.ml_instances.aws_instance.ml_ireland.f",
            "path": [
            {
                "xStart": 104,
                "yStart": 150,
                "xEnd": 103,
                "yEnd": 150
            },
            {
                "xStart": 103,
                "yStart": 150,
                "xEnd": 57,
                "yEnd": 154
            },
            {
                "xStart": 57,
                "yStart": 154,
                "xEnd": 56,
                "yEnd": 154
            }],
            "svgPath": "M 104 150 L 104 150 C 103.5 150 102.00375941180431 150.08662961636486 101.00751882360863 150.1732592327297 L 58.992481176391365 153.8267407672703 C 57.99624058819568 153.91337038363514 56.5 154 56 154 L 56 154 ",
            "id": 58
        },
        {
            "childResourceId": "0.ml_instances.aws_eip.eipalloc-08623772f2cbfd669",
            "parentResourceId": "0.ml_instances.aws_instance.ml_ireland.e",
            "path": [
            {
                "xStart": 104,
                "yStart": 145,
                "xEnd": 103,
                "yEnd": 145
            },
            {
                "xStart": 103,
                "yStart": 145,
                "xEnd": 57,
                "yEnd": 154
            },
            {
                "xStart": 57,
                "yStart": 154,
                "xEnd": 56,
                "yEnd": 154
            }],
            "svgPath": "M 104 145 L 104 145 C 103.5 145 102.01860734513997 145.19201160638568 101.03721469027995 145.38402321277133 L 58.96278530972004 153.61597678722867 C 57.98139265486002 153.80798839361432 56.5 154 56 154 L 56 154 ",
            "id": 59
        },

These edges are still present for some reason. In actual tf files eip is connected only with ml_instances.aws_instance.ml_ireland.f, but I'm OK with wrong paths drawn as long as I can manually remove them (I have 300 lines of config to make diagram look nice anyway).

Error generating graph

Graph generation fails.
Plan is successful.
Indeed the File pluralith.cache.json is not present on the given directory

Dont know what to do here. Any suggestion?

Below the output.
Can I deliver further informations? Seems like it ha to to with node.js

$ pluralith run --show-changes
⠿ Initiating Run ⇢ Posting To Pluralith Dashboard
→ Branch detected: main

→ Verify
✔ API key is valid, you are authenticated!
✔ Project ID is valid!
✔ No graph module installed, found latest release
⠿ None → 0.1.8

Installing Latest Graph Module 100% [██████████████████████████████] (1.396 MB/s)

✔ Graph Module updated!

→ Plan
✔ Execution Plan Generated
✔ Secrets Stripped

  • Cost Calculation Skipped

→ Export
✘ Diagram Generation Failed
node:internal/modules/package_json_reader:4
const internalModuleReadJSON = function (f) { return require('fs').internalModuleReadJSON(f); };
^

TypeError: require(...).internalModuleReadJSON is not a function
at internalModuleReadJSON (node:internal/modules/package_json_reader:4:68)
at Object.read (node:internal/modules/package_json_reader:21:42)
at readPackage (node:internal/modules/cjs/loader:296:36)
at readPackageScope (node:internal/modules/cjs/loader:329:19)
at trySelf (node:internal/modules/cjs/loader:444:40)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:910:24)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at Module._preloadModules (node:internal/modules/cjs/loader:1276:12)
at loadPreloadModules (node:internal/bootstrap/pre_execution:489:5)

generating diagram failed -> RunGraph: running CLI command failed -> GenerateDiagram: exit status 1
✘ Posting Run To Pluralith Dashboard Failed
reading cache from disk failed -> HandleCIRun: open /home/ubuntu/..../aws_infrastructure/shared/.pluralith/pluralith.cache.json: no such file or directory

reading cache from disk failed

Can you check what it means below?

Is it because the terraform state code is big? Please let me know and fix plz.

→ Plan
✔ Execution Plan Generated
✔ Plan Cache Created
✔ Secrets Stripped

  • Cost Calculation Skipped

→ Graph
✔ Diagram Generated
✘ Posting Run To Pluralith Dashboard Failed
reading cache from disk failed -> PostGraph: open /Users/dae/Desktop/test/ucmp-terraform-dev/UCMP-RESOURCE/.pluralith/pluralith.cache.json: no such file or directory

Feature Request: ARM Support

Request

  • Support arm64 in pluralith-cli releases

For example, https://github.com/Pluralith/pluralith-cli/releases/tag/v0.2.1 only supports amd64

builds:
- binary: linux/pluralith
id: linux
dir: ./app
goos:
- linux
goarch:
- amd64
env:
- CGO_ENABLED=0
no_unique_dist_dir: true
- binary: windows/pluralith
id: windows
dir: ./app
goos:
- windows
goarch:
- amd64
env:
- CGO_ENABLED=0
no_unique_dist_dir: true
- binary: darwin/pluralith
id: darwin
dir: ./app
goos:
- darwin
goarch:
- amd64
env:
- CGO_ENABLED=0
no_unique_dist_dir: true

Why

  • Would be nice to use Pluralith in CI workloads running on arm nodes

Feature request: specify config file

I found myself doing cp pluralith_full.yml pluralith.yml, cp pluralith_no_iam.yml pluralith.yml and cp pluralith_global.yml pluralith.yml to create several diagrams with different detalisation (I need them locally in pdf, so that fancy "expanding" part in the webview is unrelated). Would be great to allow passing --config to pluralith executable to avoid replacing config file in place, and this should be very easy to support.

Does the CLI currently not support M1 Mac OS?

I downloaded cli binary file from following web dashboard.

image

But when I try to execute the file, following error occured.

$ sh pluralith_cli_darwin_amd64_v0.1.12

pluralith_cli_darwin_amd64_v0.1.12: pluralith_cli_darwin_amd64_v0.1.12: cannot execute binary file

I also found initial script for installation from official docs.

https://raw.githubusercontent.com/Pluralith/pluralith-cli/dev/scripts/install.sh

but this shell script is only for linux (ubuntu maybe).

Does the CLI currently not support M1 Mac OS?

posting run for PR comment failed. 400 error

Hello.
It fails run post whenever I run command 'pluralith run plan'

Error message below.

...
$ pluralith run plan
⠿ Initiating Plan Run ⇢ Posting To Pluralith Dashboard
→ Branch detected: feature/UCMPB-304-EC2템플릿-스케쥴러ASG변경

→ Authentication
✔ API key is valid, you are authenticated!

→ Project Setup
✔ Existing Org Found
✔ Existing Project Found

→ Plan
✔ Execution Plan Generated
✔ Plan Cache Created
✔ Secrets Stripped

  • Cost Calculation Skipped

→ Graph
✔ Diagram Generated
✘ Posting Run To Pluralith Dashboard Failed
posting run for PR comment failed -> PostGraph: request failed -> LogRun: map[code:400 error:map[] message:Logging run failed]

...

My cli version is 0.1.20

...
Current Version: 0.1.20

✔ You are on the latest version
⠿ Version: 0.1.20
...

Can you check this?

I have tried three terraform files. Two terraform files work well but the other fails.

My terraform line is a little big.

TF Enterprise/Cloud support

Hi,

Wanted to ask whether this CLI works with TF Enterprise or Cloud. If so any working examples?

Also, I'm trying a few rounds to work on this CLI on Bitbucket pipelines and TFC, and so far pluralith run --show-changes results in this stdout...

→ Plan
  ✘ Couldn't Generate Execution Plan
running terraform plan failed -> RunGraph: RunPlan: exit status 1
  ✘ Posting Run To Pluralith Dashboard Failed

pluralith init works though...

Thanks.
Nicholas

generating diagram failed because of proxy certificate?

Hi, pluralith fails with this error output. It look like it doesn't like the corporate proxy certificate?(a guess) It's been a while since I tried pluralith and the last time, it was with the desltop app and it worked fine.

pluralith login works fine though, so not entirely sure it's a proxy problem. But our proxy does packets inspection so it works like a man-in-the-middle attack for some apps.

  ✘ Local Diagram Generation Failed
pluralith-cli-graphing.exe graph

Render graph and export PDF

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]

Error: self signed certificate in certificate chain
    at TLSSocket.onConnectSecure (node:_tls_wrap:1532:34)
    at TLSSocket.emit (node:events:527:28)
    at TLSSocket._finishInit (node:_tls_wrap:946:8)
    at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:727:12) {
  code: 'SELF_SIGNED_CERT_IN_CHAIN',
  config: {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    adapter: [Function: httpAdapter],
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 0,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    validateStatus: [Function: validateStatus],
    headers: {
      Accept: 'application/json, text/plain, */*',
      authorization: 'Bearer abfb666c943a7f906415b72348ee73e9',
      'User-Agent': 'axios/0.26.0'
    },
    url: 'https://api.pluralith.com/v1/graph/get/current/',
    method: 'get',
    data: undefined
  },
  request: <ref *1> Writable {
    _writableState: WritableState {
      objectMode: false,
      highWaterMark: 16384,
      finalCalled: false,
      needDrain: false,
      ending: false,
      ended: false,
      finished: false,
      destroyed: false,
      decodeStrings: true,
      defaultEncoding: 'utf8',
      length: 0,
      writing: false,
      corked: 0,
      sync: true,
      bufferProcessing: false,
      onwrite: [Function: bound onwrite],
      writecb: null,
      writelen: 0,
      afterWriteTickInfo: null,
      buffered: [],
      bufferedIndex: 0,
      allBuffers: true,
      allNoop: true,
      pendingcb: 0,
      constructed: true,
      prefinished: false,
      errorEmitted: false,
      emitClose: true,
      autoDestroy: true,
      errored: null,
      closed: false,
      closeEmitted: false,
      [Symbol(kOnFinished)]: []
    },
    _events: [Object: null prototype] {
      response: [Function: handleResponse],
      error: [Function: handleRequestError],
      socket: [Function: handleRequestSocket]
    },
    _eventsCount: 3,
    _maxListeners: undefined,
    _options: {
      maxRedirects: 21,
      maxBodyLength: 10485760,
      protocol: 'https:',
      path: '/v1/graph/get/current/',
      method: 'GET',
      headers: [Object],
      agent: undefined,
      agents: [Object],
      auth: undefined,
      hostname: 'api.pluralith.com',
      port: null,
      nativeProtocols: [Object],
      pathname: '/v1/graph/get/current/'
    },
    _ended: true,
    _ending: true,
    _redirectCount: 0,
    _redirects: [],
    _requestBodyLength: 0,
    _requestBodyBuffers: [],
    _onNativeResponse: [Function (anonymous)],
    _currentRequest: ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: false,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      _contentLength: 0,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      _closed: false,
      socket: [TLSSocket],
      _header: 'GET /v1/graph/get/current/ HTTP/1.1\r\n' +
        'Accept: application/json, text/plain, */*\r\n' +
        'authorization: Bearer abfb666c943a7f906415b72348ee73e9\r\n' +
        'User-Agent: axios/0.26.0\r\n' +
        'Host: api.pluralith.com\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: nop],
      agent: [Agent],
      socketPath: undefined,
      method: 'GET',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      path: '/v1/graph/get/current/',
      _ended: false,
      res: null,
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'api.pluralith.com',
      protocol: 'https:',
      _redirectable: [Circular *1],
      [Symbol(kCapture)]: false,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype]
    },
    _currentUrl: 'https://api.pluralith.com/v1/graph/get/current/',
    [Symbol(kCapture)]: false
  },
  response: undefined,
  isAxiosError: true,
  toJSON: [Function: toJSON]
}

generating diagram failed -> GenerateGraph: running CLI command failed -> GenerateDiagram: exit status 1

Auto-Generate Projects

Currently the Pluralith CLI requires initialization with an existing project ID. This means one has to manually create a Pluralith project through the Pluralith dashboard for each corresponding Terraform project.

This is not ideal and creates a lot of initial overhead for organizations that have loads of Terraform projects.

A user should be able to specify a custom project ID and Pluralith should then push runs to the project with that ID if it exists, and if it doesn't, create a new one automatically.

Thanks to @CloudMarshall for the feature request!

Pluralith Desktop UI stuck on Fetching Provider Metadata

After running a Pluralith plan in the CLI locally the UI gets stuck on Generating execution plan with another box saying Fetching Provider Metadata

CLI output:
image

UI after CLI completes:
image

Other relevant info
CLI-Tool: Powershell
Platform: Windows
Versions:
image

Azure Devops Integration

First of all, amazing tool... loving it. Do you guys foresee any Azure Devops integration in the near future?

Pluralith cli hangs on step "Generating Diagram"

Pluralith Version:

→ CLI Version: 0.1.17
→ Graph Module Version: 0.1.13

Steps to reproduce:

image

  • Stays like this forever and never finish/terminates

Things I noticed:

  • pluralith.state.json is quite huge, 74508 lines
  • htop shows a 100% usage for the pluralith cli process. Means it utilize one complete core (but not more)
  • When using the MacOS Client it quits after a while. From the pluralith.graphlogs.json I can find a few of those lines:

image

image

I am happy to provide more input if necessary

Security Assessment

Hi team,

We are very keen on adopting pluralith for the company that I work for. However given the sensitivity of data that we have (healthcare sector) I am carrying out our due diligence in terms of assessing the security aspects of the tool.

Can you please point to the relevant documentation that I can use.

Add image options for export and not just pdf

Unfortunately most markdown implementations do not allow PDFs to be rendered which adds an extra step that end users have to do to render them in their repository markdown files. Alternative graph generation export options are handy to alleviate this manual step and allow for clean embedding of arch diagrams in a repository.

Question: Difference between pluralith plan and terraform plan?

Hi there, just started using the CLI on linux and had a question that I couldn't find an answer to in the documentation:

I'm unclear on the behavior of pluralith plan. It appears that it runs both a plan and then prompts for a subsequent apply. This differs from the Terraform behavior for CLI actions sharing the same names. IE, terraform plan does not also call terraform apply, it requires me to explicitly call apply if that is my intention.

So, does the prompted apply after a plan in Pluralith's context mean the same as terraform apply?

Thanks in advance

Have CLI and UI option to export extra PDF's for drilldown into grouped resources

I noticed that the graph to PDF only supports the current view even if there are grouped resources in the graph. It would be useful if there was something like a --export-all option that exported another PDF for each subview. The exported PDF can then have markdown style relative hyperlinks that open up the other pdf's when clicked on.

I have tested that this works by manually editing a PDF and it would be really cool to see this happen

Error: self signed certificate in certificate chain

Hi Everyone

when I try pluralith graph I get this error:

Error: self signed certificate in certificate chain at TLSSocket.onConnectSecure (node:_tls_wrap:1532:34) at TLSSocket.emit (node:events:527:28) at TLSSocket._finishInit (node:_tls_wrap:946:8) at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:727:12) { code: 'SELF_SIGNED_CERT_IN_CHAIN',

I guess it's due to the company firewall that does SSL inspection and so Pluralith stumble upon it

It would be nice to have a --ignore-ssl-errors option to skip SSL errors/verification in cases like mine

Error: building AzureRM Client: obtain subscription() from Azure CLI: parsing json result from the Azure CLI: waiting for the Azure CLI: exit status 1: ERROR: Please run 'az login' to setup account.

Unable to run pluralith graph (linux) - it results in the error below. Terraform plan and apply have no issues.

I am logged into Azure and have default subscription set (screenshot).

Screenshot_302

⠿ Initiating Graph ⇢ Posting Diagram To Pluralith Dashboard

→ Authentication
  ✔ API key is valid, you are authenticated!

→ Plan
  ✘ Couldn't Generate Local Execution Plan

Error: building AzureRM Client: obtain subscription() from Azure CLI: parsing json result from the Azure CLI: waiting for the Azure CLI: exit status 1: ERROR: Please run 'az login' to setup account.

  with provider["registry.terraform.io/hashicorp/azurerm"],
  on main.tf line 10, in provider "azurerm":
  10: provider "azurerm" {


running terraform plan failed -> GenerateGraph: RunPlan: exit status 1

Invalid character in header content ["authorization"]

Error performing pluralith graph:

TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["authorization"]
at ClientRequest.setHeader (node:_http_outgoing:579:3)
at new ClientRequest (node:_http_client:262:14)
at Object.request (node:https:353:10)
at RedirectableRequest._performRequest (/snapshot/pluralith-cli-graphing/node_modules/follow-redirects/index.js:279:24)
at new RedirectableRequest (/snapshot/pluralith-cli-graphing/node_modules/follow-redirects/index.js:61:8)
at Object.request (/snapshot/pluralith-cli-graphing/node_modules/follow-redirects/index.js:487:14)
at dispatchHttpRequest (/snapshot/pluralith-cli-graphing/node_modules/axios/lib/adapters/http.js:242:25)
at new Promise ()
at httpAdapter (/snapshot/pluralith-cli-graphing/node_modules/axios/lib/adapters/http.js:48:10)
at dispatchRequest (/snapshot/pluralith-cli-graphing/node_modules/axios/lib/core/dispatchRequest.js:58:10) {
code: 'ERR_INVALID_CHAR'

Running in WSL - Ubuntu 20.04.5

within ~/Pluralith/credentials is my API key.

Panic error on pluralith run

Hi.

Trying to configure and test pluralith with terraform config and hashicorp/google 4.37.0 provider. Both local and github CI (actions) run command returns next error:

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

goroutine 1 [running]:
pluralith/cmd.glob..func10(0x180b480?, {0x148352b?, 0x0?, 0x0?})
        /Users/dan/Code/GoProjects/src/github.com/dantheputzer/pluralith-cli/app/cmd/run.go:62 +0x85b
github.com/spf13/cobra.(*Command).execute(0x180b480, {0x1844e80, 0x0, 0x0})
        /Users/dan/Go/pkg/mod/github.com/spf13/[email protected]/command.go:860 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0x180b200)
        /Users/dan/Go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
        /Users/dan/Go/pkg/mod/github.com/spf13/[email protected]/command.go:902
pluralith/cmd.Execute()
        /Users/dan/Code/GoProjects/src/github.com/dantheputzer/pluralith-cli/app/cmd/root.go:50 +0x25
main.main()
        /Users/dan/Code/GoProjects/src/github.com/dantheputzer/pluralith-cli/app/main.go:42 +0x1c

Terraform plan \ apply works perfect. What can it be?

some aws_ssm_parameter resources are not displayed

I use pluralith for visualizing my infrastructure but I found some of aws_ssm_parameter are not displayed.
I checked aws_ssm_parameter which was not displayed and some values of them are ARN(Amazon Resource Name) .
I want to know two points.

  • Is there any filters which hide parameters?
  • If there is filter, how can I disable that?

versions

  • UI 0.1.22
  • CLI 0.1.22
  • Graphing 0.4.6

Export to PDF does not include costs when selecting the option

Like the title says the export PDF option on Pluralith Desktop does not export costs when toggling the slider to on. I have not tested all of the cost options but I think this is a good place to start. The costs do show up when navigating and selecting options in the Pluralith Desktop UI just not on export

Example of my options when trying to export costs
image

/home/mjb/Pluralith/bin/Pluralith.AppImage: no such file

Running on Ubuntu 20.04 LTS on linux_amd64, after performing terraform init (v1.2.1) and pluralith init

pluralith plan
⠿ Running Plan ⇢ Apply in the Pluralith UI

✘ Failed to launch Pluralith
launching Pluralith failed -> RunTerraform: could not run launch command -> LaunchPluralith: runOsCommand: fork/exec /home/mjb/Pluralith/bin/Pluralith.AppImage: no such file or directory

Files under ~/Pluralith:

find ~/Pluralith/
/home/mjb/Pluralith/
/home/mjb/Pluralith/credentials
/home/mjb/Pluralith/bin
/home/mjb/Pluralith/bin/pluralith-cli-graphing

Graph Failed - Error Preprocessing Variables

{ "log": { "processId": 8573845, "errors": [ { "timestamp": 1657823145629, "method": "", "log": "Error getting resource variables" }, { "timestamp": 1657823145629, "method": "", "log": "Error: Preprocessing variables." }, { "log": "Error: processor failed.", "method": "" } ], "dependencies": [], "graphingData": [], "placingData": [], "preprocessingResources": [], "resources": [], "summary": [], "warnings": [], "error": true } }

Pluralith CLI, `graph` failed.

Env

❯ sw_vers
ProductName:		macOS
ProductVersion:		13.2.1
BuildVersion:		22D68

❯ pluralith version
 _
|_)|    _ _ |._|_|_
|  ||_|| (_||| | | |

→ CLI Version: 0.2.2
→ Graph Module Version: 0.2.1

Error

# pluralith graph
TypeError: Cannot read properties of undefined (reading 'summary')
    at /snapshot/pluralith-cli-graphing/dist/build/commands/Graph.js
    at Generator.next (<anonymous>)
    at fulfilled (/snapshot/pluralith-cli-graphing/dist/build/commands/Graph.js)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Within my private terraform workspace repo, the above error occurred.
every terraform commands(init, plan, apply, ...) works well.
is the problem about envs?

"Error finding module of resource in precomputed module list." when running "pluralith.exe plan"

I have modules referenced with relative paths. terraform plan runs fine and generates a plan. Running pluralith, however, produces the following error:
{ "log": { "processId": 3576513, "errors": [ { "timestamp": 1658260510166, "method": "", "log": "No emulated resources provided." }, { "timestamp": 1658260510210, "method": "", "log": "Error finding module of resource in precomputed module list." }, { "timestamp": 1658260510210, "method": "", "log": "Error: Preprocessing create resources." }, { "log": "Error: processor failed.", "method": "" } ], "dependencies": [], "graphingData": [], "placingData": [], "preprocessingResources": [], "resources": [], "summary": [], "warnings": [], "error": true } }

panic: runtime error: invalid memory address or nil pointer dereference

Downloaded pluralith 0.2.2

On Windows 11 (after moved to windows\system32 and renamed) I get:

❯ pluralith
✔ No graph module installed, found latest release
⠿ None → 0.2.1

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x40 pc=0xe7c950]

goroutine 1 [running]:
pluralith/pkg/install.DownloadGitHubRelease({0x174aded, 0xc}, {0xc0000a6000, 0x83}, {0xc000040140, 0x41})
/Users/dan/Code/GoProjects/src/github.com/dantheputzer/pluralith-cli/app/pkg/install/DownloadGitHubRelease.go:28 +0x530
pluralith/pkg/install/components.GraphModule(0x80?)
/Users/dan/Code/GoProjects/src/github.com/dantheputzer/pluralith-cli/app/pkg/install/components/GraphModule.go:42 +0x2ac
main.initApp()
/Users/dan/Code/GoProjects/src/github.com/dantheputzer/pluralith-cli/app/main.go:32 +0x31e
main.main()
/Users/dan/Code/GoProjects/src/github.com/dantheputzer/pluralith-cli/app/main.go:42 +0x17

Support running Terraform from Docker image

I use terraform based on a docker image. Because of that, I have some alias that runs the docker image like I had the terraform installed.
Pluralith does not have a way to define a custom path/executable to terraform.

Is it possible to add this option?

Graph error : posting run for PR comment failed

Posting Run To Pluralith Dashboard Failed

➜ sudo pluralith run plan
⠿ Initiating Plan Run ⇢ Posting To Pluralith Dashboard
→ Branch detected: main

→ Verify
✔ API key is valid, you are authenticated!
✔ Project ID is valid!

→ Plan
✔ Execution Plan Generated
✔ Plan Cache Created
✔ Secrets Stripped
✔ Costs Calculated

→ Graph
✔ Diagram Generated
✘ Posting Run To Pluralith Dashboard Failed
posting run for PR comment failed -> PostGraph: parsing response failed -> LogRun: invalid character 'S' looking for beginning of value

my OS info :
Model : MacBook Pro
Model Identifiers: MacBookPro15,2
Process Name : Qurd core Intel Core i5
pluralith-cli verision : pluralith_cli_darwin_amd64_v0.1.18

Support Terraform CLI Workspaces

Currently runs are pushed to and shown in the Pluralith dashboard individually.

When using Terraform CLI workspaces in CI one might run plans in the same Terraform project on multiple workspaces/environments with only slight differences and want to document/diagram all of them.

It would be great to show several plans happening in one CI run across multiple workspaces/environments grouped in the Pluralith dashboard and let the user select which workspace/environment they want to view in the UI (presumably through a dropdown).

Shoutout to @ethanculler for the feature suggestion!

Terragrunt Support

Our infra uses terragrunt for deployment and as such our raw terraform is not in a place where it can be initiated or applied independently. I can kinda hack it together to work by running terragrunt init on a singular module and then navigating to the terragrunt cache directory where all the terraform has been setup and ready to be applied and run the pluralith plan command there.

Sure would be nice if I could do something like pluralith run-all plan and it would grab all the modules in the directory and use the terragrunt dependency config to wire the graph up properly.

If you want to see an example of this terragrunt workflow, our repo is based off the terragrunt reference architecture and is also public, here is a link to a specific minimum environment configuration, this is the folder I'd love to be able to run pluralith on: https://github.com/Dozuki/CloudPrem-Infra/tree/master/live/standard/us-east-1/min. You'll see there are 2 modules there, physical and logical, and there are terragrunt dependencies between them that terragrunt manages automatically as defined in the common config file.

Let me know if this is already possible and I just missed it in the docs or if it's something that you guys would be planning on adding.

Thanks. Really liking what you've got so far 👍

TF_DATA_DIR is ignored

When running pluralith plan initially it checks for the .terraform directory.

It looks for this directory in the current directory, irrespective of any setting of TF_DATA_DIR.

Workaround
unset TF_DATA_DIR
terraform init
pluralith plan

pluralith run does not work with 400 bad request

Hi.

Firstly, I used pluralith in github actions. but it did not worked.
I wrote the issue in this

Next, I downloaded desktop app and cli in my local.
but still pluralith run (manually) does not work.

This is what i did and result.

$ pluralith run --show-changes --show-costs --show-drift

⠿ Initiating Run ⇢ Posting To Pluralith Dashboard
 → Branch detected: test6

→ Verify
  ✔ API key is valid, you are authenticated!
  ✔ Project ID is valid!

→ Plan
  ✔ Execution Plan Generated
  ✔ Secrets Stripped
  ✔ Costs Calculated

→ Export
  ✔ Diagram Generated
  ✘ Posting Run To Pluralith Dashboard Failed
posting run for PR comment failed -> HandleCIRun: request failed -> LogRun: &{400 Bad Request 400 HTTP/2.0 2 0 map[Access-Control-Allow-Origin:[*] Content-Length:[54] Content-Type:[application/json; charset=utf-8] Date:[Fri, 09 Sep 2022 02:39:26 GMT] Etag:[W/"36-Sbx30uwj25sHt5XLThLAnENn3l8"] Server:[Google Frontend] X-Cloud-Trace-Context:[6cf1c75edd4ca9614c36783a7d54f056] X-Powered-By:[Express]] {0xc00024a480} 54 [] false false map[] 0xc0000d7600 0xc00023e0b0}

Colud you help me?

Never ending Github Actions

Hi! im using Pluralith with the CI/CD integration for Github Actions, with my personal account. I dont know if it its a billed feature
When the job runs this it never finish

    - name: Pluralith Init
      uses: Pluralith/actions/[email protected]
      with:
        terraform-path: ${{env.TF_ACTION_WORKING_DIR}}
        api-key: ${{ secrets.PLURALITH_API_KEY }}
        project-id: ${{ secrets.PLURALITH_PROJECT_ID }}

image
and when i stop the job seems like it was expecting for "Org Id" input

Desktop App?

Hello!

With the Pluralith Plan command deprecated and the new graph command only going to the SAAS version of pluralith from what I can tell, what are the plans for local use only? The docs still mention the closed source desktop app.

Graphing issue

Hello,

When trying to build a graph it has failed on multiple projects when using the CLI

CLI Version: 0.1.11
Graph Module Version: 0.1.8
UI Version: 0.1.12

I've tried in Test mode and without.

I've ran every command given in the Docs but it still fails.

Before running the command below i ensured a local terraform plan and state was built.

Error:

⠿ Initiating Run ⇢ Posting To Pluralith Dashboard
 → Branch detected: master

→ Verify
  ✔ API key is valid, you are authenticated!
  ✔ Project ID is valid!

→ Plan
  ✔ Execution Plan Generated
  ✔ Secrets Stripped
  - Cost Calculation Skipped

→ Export
  ✘ Diagram Generation Failed
pluralith-cli-graphing graph

Render graph and export PDF

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]

RangeError: Maximum call stack size exceeded
    at Function.entries (<anonymous>)
    at _0x476093.GetObjectsByKeyRec (<anonymous>:1:593342)
    at _0x476093.GetObjectsByKeyRec (<anonymous>:1:593644)
    at _0x476093.GetObjectsByKeyRec (<anonymous>:1:593644)
    at _0x476093.GetObjectsByKeyRec (<anonymous>:1:593644)
    at _0x476093.GetObjectsByKeyRec (<anonymous>:1:593644)
    at _0x476093.GetObjectsByKeyRec (<anonymous>:1:593644)
    at _0x476093.GetObjectsByKeyRec (<anonymous>:1:593644)
    at _0x476093.GetObjectsByKeyRec (<anonymous>:1:593644)
    at _0x476093.GetObjectsByKeyRec (<anonymous>:1:593644)

generating diagram failed -> RunGraph: running CLI command failed -> GenerateDiagram: exit status 1
  ✘ Posting Run To Pluralith Dashboard Failed
reading cache from disk failed -> HandleCIRun: open /aws-terraform-client/.pluralith/pluralith.cache.json: no such file or directory```

TypeError: Cannot read properties of undefined (reading 'replaceAll')

Windows 11, binary has been renamed and moved to Windows\System32 per the docs.

When I try to execute in a folder with terraform files it results in this:

pluralith.exe graph

Render graph and export PDF

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]

TypeError: Cannot read properties of undefined (reading 'replaceAll')
    at C:\snapshot\pluralith-cli-graphing\dist\build\commands\Graph.js
    at Generator.next (<anonymous>)
    at C:\snapshot\pluralith-cli-graphing\dist\build\commands\Graph.js
    at new Promise (<anonymous>)
    at C:\snapshot\pluralith-cli-graphing\dist\build\commands\Graph.js
    at Graph (C:\snapshot\pluralith-cli-graphing\dist\build\commands\Graph.js)
    at C:\snapshot\pluralith-cli-graphing\dist\build\index.js
    at Generator.next (<anonymous>)
    at C:\snapshot\pluralith-cli-graphing\dist\build\index.js
    at new Promise (<anonymous>)

Allow CLI to print out default graphs to local

For debugging and diff purposes it would be cool to have the local CLI be able to use the pluralith graph command headlessly to output a graph of the current state or plan. It appears that this command only works with the SAAS server right now unfortunately.

Add filter for resource types and/or providers

Description

We are often working with null_resources or archive_files. For developers it makes sense that they are shown in the graph. However for presentations/reports it would be great if we could filter out certain resource types, data blocks and/or providers. Having them in the graph leads to confusion when talking to customers and other stakeholders.

Examples

  • null_resource
  • archive_file
  • aws_caller_identity
  • aws_partition
  • external
  • local_file
  • time_sleep

Wrong graph generation when using element and count

Hi, first of all, very great tool! Love it!

What i discovered in a test set-up is that graph visualisation, shows the infra the wrong number of instances. The following resource will be spread the instances across the AZs evenly.

When i do this:

resource "aws_instance" "api" {
    count = 3
  
    // networking
    availability_zone = element(var.availability_zones, count.index)
    //subnet_id         = element(var.subnets_private, count.index).id
  
    // image
    ami           = "ami-0d203747b007677da"
    instance_type = "m5.large"
}

The graph show the 3 instances spread across the 2 availability_zones like expected.

When i try:

resource "aws_instance" "api" {
    count = 3

    // networking
    //availability_zone = element(var.availability_zones, count.index)
    subnet_id         = element(var.subnets_private, count.index).id

    // image
    ami           = "ami-0d203747b007677da"
    instance_type = "m5.large"
}

It will create 2 in one subnet and in the other 3.

I expect the same behaviour as the availability zone example. Is this a bug?

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.