upbound / provider-terraform

A @crossplane provider for Terraform
Apache License 2.0
136 stars 56 forks source link

Terragrunt Support #43

Open Omqarrr opened 1 year ago

Omqarrr commented 1 year ago

We see that Crossplane Terraform Provider can be used to implement GitOps methodology. We have Terraform Modules which will be invoked by Terragrunt and the way Crossplane maintains the state of infrastructure created by Terraform, in the same way can it support the infrastructure created by Terragrunt?

If no, Is there any plan in near future to support this?

bobh66 commented 1 year ago

@Omqarrr can you elaborate on this scenario? What functionality are you looking for from provider-terraform? Would it need to execute a terragrunt CLI in place of the terraform CLI? It would be helpful to have some detail on what the use case is and what the expected behavior of the provider would be. Thanks!

Omqarrr commented 1 year ago

@bobh66 thanks for the quick reply.

Yes, your understanding is correct. We have a folder structure with Terragrunt scripts per environment and would like to call these scripts with Terragrunt CLI in place of Terraform CLI.

ytsarev commented 1 year ago

@Omqarrr could you describe what kind of advantages it will bring to this provider?

Omqarrr commented 1 year ago

@ytsarev listing down the advantages below:

Some more advantages: https://terragrunt.gruntwork.io/docs/#features

bobh66 commented 1 year ago

@Omqarrr - thanks. Can you provide a sample of what a terragrunt "workspace" might look like? I'm wondering if this is better implemented as a separate provider, or as a separate resource under the existing provider. It would be helpful to understand what the experience would look like for the user (what does the Managed Resource spec look like) and what needs to happen inside the provider to implement the spec.

Omqarrr commented 1 year ago

@bobh66 @ytsarev. sure, thanks.

We have a sample setup that involves Terraform Modules which are invoked by Terragrunt.

Terraform Modules are maintained in: https://github.com/Omqarrr/aws-vpc-network-terraform.git

Terragrunt Scripts are maintained in: https://github.com/Omqarrr/terragrunt-multi-env-management.git

Usage

Note

luebken commented 1 year ago

@Omqarrr 👋 I'd love to learn more. Would you be up for a call on this?

ronaldmiranda commented 1 year ago

i'm interested to help! looks promising!

vjda commented 6 months ago

Hey guys!!! any news on this?, it would be awesome to be able to use Terragrunt with Crossplane 🚀.

Is anyone working on this?, I don't have much experience in Go, but I think I could eventually help move forward with this if that helps!

bobh66 commented 6 months ago

Hi @vjda - there is no work happening on this that we know of. I think it would be a good idea to have a one-pager design document that describes what the API would look like and how it fits with the existing provider, as discussed in this comment: https://github.com/upbound/provider-terraform/issues/43#issuecomment-1362934272