Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported block type; Blocks of type "moved" are not expected here. #212

Open
egor-sorokin opened this issue Feb 6, 2023 · 1 comment

Comments

@egor-sorokin
Copy link

It seems Inframap doesn't work with terraform moved blocks for the refactoring: https://developer.hashicorp.com/terraform/language/modules/develop/refactoring#moved-block-syntax

I am currently refactoring a huge monolith code base that describes the whole infra of the project. I moved several things to a separate module and once I started moving some other stuff to another module I got a cycle error. I tried to use inframap but unfortunately, moved blocks are not supported by it. Not sure if it is a bug or expected behavior.
Once I remove those blocks inframap gets generated.

Error:

Error: <infra_repo>/moved_kubernetes.tf:19,1-6: Unsupported block type; Blocks of type "moved" are not expected here., and 56 other diagnostic(s)
Usage:
  inframap generate [FILE] [flags]

Examples:
inframap generate state.tfstate
cat state.tfstate | inframap generate

Flags:
      --clean            Clean will the generated graph will not have any Node that does not have a connection/edge (default true)
      --connections      Connections will apply the logic of the provider to remove resources that are not nodes (default true)
      --external-nodes   Toggle the addition of external nodes like 'im_out' (used to show ingress connections) (default true)
  -h, --help             help for generate
      --printer string   Type of printer to use for the output. Supported ones are: dot (default "dot")
      --raw              Raw will not use any specific logic from the provider, will just display the connections between elements. It's used by default if none of the Providers is known
      --show-icons       Toggle the icons on the printed graph (default true)

Global Flags:
      --hcl       Forces to use HCL parser
      --tfstate   Forces to use TFState parser

@Ivaylo-Korakov
Copy link

+1 for this - would help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants