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

Terragrunt Support #43

Closed
Omqarrr opened this issue Dec 20, 2022 · 12 comments
Closed

Terragrunt Support #43

Omqarrr opened this issue Dec 20, 2022 · 12 comments

Comments

@Omqarrr
Copy link

Omqarrr commented Dec 20, 2022

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
Copy link
Collaborator

bobh66 commented Dec 20, 2022

@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
Copy link
Author

Omqarrr commented Dec 21, 2022

@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
Copy link
Member

ytsarev commented Dec 21, 2022

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

@Omqarrr
Copy link
Author

Omqarrr commented Dec 22, 2022

@ytsarev listing down the advantages below:

  • Terragrunt promotes DRY behavior. DRY - Dont Repeat Yourself
  • Terraform Configuration Files need not be modified each and every time. This can be achieved with Terragrunt. Pass the values with help of Terragrunt without modifying Terraform code
  • Managing state file for every environment with Terraform, same code will be required to be duplicated in each folder structure. But with Terragrunt, a common piece of code can be pulled in different folders / per environment.
  • Terraform CLI can be kept DRY by features from Terragrunt with extra_arguments.
  • Additional feature to run custom code before or after running Terraform

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

@bobh66
Copy link
Collaborator

bobh66 commented Dec 22, 2022

@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
Copy link
Author

Omqarrr commented Dec 23, 2022

@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

  • Terraform Modules/ Repo will not be modified for managing the infrastructure in different environments.
  • Different Environments are managed by Terragrunt with dev/staging/prod folder structure.
  • To create infrastructure in dev region, move to environment/dev/ and run terragrunt apply
  • s3-backend.tf file is generated by Terragrunt as configured in terragrunt.hcl present in root

Note

  • terragrunt.hcl in the root defines what the children should inherit.

@luebken
Copy link

luebken commented Jan 9, 2023

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

@ronaldmiranda
Copy link

i'm interested to help! looks promising!

@vjda
Copy link

vjda commented Feb 23, 2024

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
Copy link
Collaborator

bobh66 commented Feb 23, 2024

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: #43 (comment)

@DiegoLelis
Copy link

Also highly interested on this!

@bobh66
Copy link
Collaborator

bobh66 commented Nov 8, 2024

Please see #287 for the official position on this issue.

@bobh66 bobh66 closed this as completed Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants