Skip to content

Efficiently integrate manual resources into your Terraform-Terragrunt management system with this comprehensive guide. Follow step-by-step instructions to seamlessly incorporate existing infrastructure under Terraform-Terragrunt's control, streamlining your infrastructure management process

Notifications You must be signed in to change notification settings

kiranbakale/terraform-terragrunt-resource-import-guide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

terraform-terragrunt-resource-import-guide

Are you struggling to integrate manually created resources into your Terraform-Terragrunt management system? While importing resources into Terraform is a well-documented process, it becomes quite tricky when incorporating pre-existing resources under Terragrunt’s umbrella. Fear not! In this comprehensive guide, I'll walk you through the step-by-step process of seamlessly integrating your manually provisioned infrastructure into Terraform-Terragrunt’s fold.


Steps to Integrate Manual Resources:

Begin by listing all resources currently managed by Terraform-Terragrunt:

# Step 1: Assess Your Managed Resources
terragrunt state list
  • Similar to importing resources in Terraform, add the following snippet to any file to initiate the import process. Replace placeholders with your resource specifics:
import {
 to = resourcetype.resourcename
 id = "your resource id"
}
  • Next, generate a code snippet to facilitate efficient management of the imported resource:
terragrunt plan -generate-config-out=yourdesiredfilename.tf
  • Note that the generated configuration file won’t be found in the usual tf-files section. Navigate to the Terragrunt cache files to locate it:
.terragrunt-cache/files-located-here
  • Copy the generated configuration file from the cache and paste it into the original tf-files location.
  • Apply the changes to ensure that your infrastructure aligns with the Terraform-Terragrunt code:
terragrunt apply
  • Confirm that your manually provisioned infrastructure now seamlessly matches the Terraform-Terragrunt code:
terragrunt state list
  • By following these steps, you can efficiently integrate manual resources into Terraform-Terragrunt management, streamlining your infrastructure control process.

About

Efficiently integrate manual resources into your Terraform-Terragrunt management system with this comprehensive guide. Follow step-by-step instructions to seamlessly incorporate existing infrastructure under Terraform-Terragrunt's control, streamlining your infrastructure management process

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published