diff --git a/docs/discussions/knowledge-base/709.mdx b/docs/discussions/knowledge-base/709.mdx new file mode 100644 index 0000000000..42f753abb0 --- /dev/null +++ b/docs/discussions/knowledge-base/709.mdx @@ -0,0 +1,27 @@ +--- +hide_table_of_contents: true +hide_title: true +custom_edit_url: null +--- + +import CenterLayout from "/src/components/CenterLayout" +import GitHub from "/src/components/GitHub" + + + + + + +Knowledge Base +

Terragrunt Github Pipeline with multiple environments and dependencies

+\r\n

Tracked in ticket #110155

\r\n\r\n","bodyHTML":"

Hi all 👋

\n

I'm setting up a new Terragrunt repository and have few questions specially regarding the best practices around the pipeline. I'll be using Github Actions.

\n

My current Terragrunt structure looks like this:

\n
.\n├── config\n│   ├── _envcommon\n│   │   ├── README.md\n│   │   ├── s3.hcl\n│   │   └── s3-logging-bucket.hcl\n│   ├── Makefile\n├── environments\n│   ├── dev\n│   │   ├── ap-southeast-2\n│   │   │   ├── region.hcl\n│   │   │   ├── s3\n│   │   │   │   ├── Makefile\n│   │   │   │   └── terragrunt.hcl\n│   │   │   └── s3-logging-bucket\n│   │   │       ├── Makefile\n│   │   │       └── terragrunt.hcl\n│   │   ├── env.hcl\n│   │   └── Makefile\n│   ├── prod\n│   │   └── env.hcl\n│   └── staging\n│       └── env.hcl\n├── modules\n├── README.md\n└── terragrunt.hcl\n
\n

The main reason I'm using Terragrunt, is because after few years mainly using Terraform I ended up learning the hard way that Terraform sucks when there are multiple modules, state files and dependencies between them.

\n

Looks like I cannot use run-all with Terragrunt when there are dependencies between modules. In that case, I'll have to make my CI to enter in each environment/**/ap-southeast-2/**/ folder and run the commands there.

\n

However by doing that, I'll be creating lots and lots of duplicated files in the .github/workflow directory for each of the resources. Github Actions will need to perform the following:

\n
[...]\ncd environment/dev/ap-southeast-2/s3\nterragrunt plan\n[...]\n\n[...]\ncd environment/dev/ap-southeast-2/s3-logging-bucket\nterragrunt plan\n[...]\n\n[...]\ncd environment/dev/ap-southeast-2/vpc\nterragrunt plan\n[...]\n\netc\n
\n

Wondering if there are better ways to achieve the same result? Any suggestions are more than welcome.

\n

Cheers! 😄

\n
\n\n

Tracked in ticket #110155

\n
","answer":{"body":"> @lpossamai we have a similar issue when trying to run `terragrunt run-all init` and `terragrunt run-all plan` against all of our terragrunt directories. We're using terragrunt in a CICD pipeline via GitHub Actions and after a few iterations, we got around the output dependency issue by introducing the mock outputs, but now we get something like `terragrunt Underlying error: invalid character ':' after top-level value` when trying to do a `run-all plan`. Have you managed to find a workaround? In the interim, we've created a Makefile and are now running the int, plan and apply against the first directory then moving onto the second directory. But this is not ideal. Ideally, we want a separate task in GitHub Actions to run a `terragrunt run-all init` then a separate task to run a `terragrunt run-all plan` and then finally a separate task to run a `terragrunt run-all apply`. Any advice?\r\n\r\nHey! The only solution I found was to use [Atlantis](https://www.runatlantis.io/) or [Terrateam](https://terrateam.io/). I've been using Terrateam and the community there is great and really help you out! I strongly suggest you try them :) It's been working great for me!\r\n\r\nI even got in touch with [antonbabenko](https://github.com/antonbabenko) to ask for some advise but he also mentioned the two solutions above.\r\n\r\nGood luck!","bodyHTML":"
\n

@lpossamai we have a similar issue when trying to run terragrunt run-all init and terragrunt run-all plan against all of our terragrunt directories. We're using terragrunt in a CICD pipeline via GitHub Actions and after a few iterations, we got around the output dependency issue by introducing the mock outputs, but now we get something like terragrunt Underlying error: invalid character ':' after top-level value when trying to do a run-all plan. Have you managed to find a workaround? In the interim, we've created a Makefile and are now running the int, plan and apply against the first directory then moving onto the second directory. But this is not ideal. Ideally, we want a separate task in GitHub Actions to run a terragrunt run-all init then a separate task to run a terragrunt run-all plan and then finally a separate task to run a terragrunt run-all apply. Any advice?

\n
\n

Hey! The only solution I found was to use Atlantis or Terrateam. I've been using Terrateam and the community there is great and really help you out! I strongly suggest you try them :) It's been working great for me!

\n

I even got in touch with antonbabenko to ask for some advise but he also mentioned the two solutions above.

\n

Good luck!

"}}} /> + +
+ + + diff --git a/docs/discussions/knowledge-base/97.mdx b/docs/discussions/knowledge-base/97.mdx index 416d1bd4b2..479effe034 100644 --- a/docs/discussions/knowledge-base/97.mdx +++ b/docs/discussions/knowledge-base/97.mdx @@ -14,7 +14,7 @@ import GitHub from "/src/components/GitHub" Knowledge Base

Repo copier: 404 failed to parse unknown error format with Gitlab URL

- I'm encountering an error where the repo-copier fails to parse a destination URL: \r\n\r\nThe example target is\r\n\r\n```\r\ngitlab https://domain.com/gitlab/project/repo\r\n```\r\n\r\nThe failure is \r\n```\r\nERROR: GET https://domain/api/v4/namespaces/gitlab/project/repo: 404 failed to parse unknown error format\r\n```\r\n\r\n","bodyHTML":"

A customer asked:

\n
\n

I'm encountering an error where the repo-copier fails to parse a destination URL:

\n
\n

The example target is

\n
gitlab https://domain.com/gitlab/project/repo\n
\n

The failure is

\n
ERROR:  GET https://domain/api/v4/namespaces/gitlab/project/repo: 404 failed to parse unknown error format\n
","answer":{"body":"The path should contain the full path to [a GitLab group](https://docs.gitlab.com/ee/user/group/). GitLab group is a kind of GitHub organization. Please make sure you specify the exact group, not a repository or user.\r\n\r\ncredit for this answer goes to @levkoburburas","bodyHTML":"

The path should contain the full path to a GitLab group. GitLab group is a kind of GitHub organization. Please make sure you specify the exact group, not a repository or user.

\n

credit for this answer goes to @levkoburburas

"}}} /> + I'm encountering an error where the repo-copier fails to parse a destination URL: \r\n\r\nThe example target is\r\n\r\n```\r\ngitlab https://domain.com/gitlab/project/repo\r\n```\r\n\r\nThe failure is \r\n```\r\nERROR: GET https://domain/api/v4/namespaces/gitlab/project/repo: 404 failed to parse unknown error format\r\n```\r\n\r\n","bodyHTML":"

A customer asked:

\n
\n

I'm encountering an error where the repo-copier fails to parse a destination URL:

\n
\n

The example target is

\n
gitlab https://domain.com/gitlab/project/repo\n
\n

The failure is

\n
ERROR:  GET https://domain/api/v4/namespaces/gitlab/project/repo: 404 failed to parse unknown error format\n
","answer":{"body":"The path should contain the full path to [a GitLab group](https://docs.gitlab.com/ee/user/group/). GitLab group is a kind of GitHub organization. Please make sure you specify the exact group, not a repository or user.\r\n\r\ncredit for this answer goes to @levkoburburas","bodyHTML":"

The path should contain the full path to a GitLab group. GitLab group is a kind of GitHub organization. Please make sure you specify the exact group, not a repository or user.

\n

credit for this answer goes to @levkoburburas

"}}} />
@@ -22,6 +22,6 @@ import GitHub from "/src/components/GitHub"