#terragrunt (2023-03)

terragrunt

Terragrunt discussions

Archive: https://archive.sweetops.com/terragrunt/

2023-03-15

Joey Espinosa avatar
Joey Espinosa

I have a root github/ directory with a terragrunt.hcl that requires the provider integrations/github. I have a child module in a github/teams/ directory however, and it’s not inheriting that provider. instead, it’s pulling an “implicit” provider of hashicorp/github.

I can write my own github/teams/provider.tf file and require it, but that sort of defeats the purpose of terragrunt. does anyone know at a glance what I might be doing wrong here?

loren avatar

I think there’s too much internal/private context in the question for anyone to be able to answer well

Joey Espinosa avatar
Joey Espinosa

ok if not that question: why would an import say it was successful, but then state list doesn’t show it in there?

loren avatar

We ran into that recently. I think it’s more a terraform issue than terragrunt. In our case, we were conditionally creating resources based on inputs, and weren’t setting the input correctly during the import. Terraform wasn’t exiting with an error code for some reason

Joey Espinosa avatar
Joey Espinosa

that’s likely my case as well. did you ever solve this? I’m curious, because yes, I have a module that is doing a for_each for github teams

Joey Espinosa avatar
Joey Espinosa

however, I have another module doing a for_each for github repositories, and that one imported just fine

loren avatar

We just setup the inputs so the conditions all lined up, and import worked fine

loren avatar

Basically check that the plan is trying to create the resource, then import should work fine for that resource address

    keyboard_arrow_up