Larry Wright
  • About
  • Blog
  • Photos
  • Now
  • TIL

How to Use Terraform with Existing Infrastructure

Aug 29, 2023

Using Terraform with existing infrastructure.

Add the existing resource to your Terraform file:

resource "aws_route53_zone" "primary_zone" {
    name = var.root_domain
}

Then run aws cli command to get the ID:

terraform import aws_route53_zone.primary_zone <resource id>

This adds the resource to your state file, as if it had been managed by Terraform all along.

References

Import: Usage | Terraform | HashiCorp Developer


About

Words and pictures by Larry Wright. A little bit of everything, mostly nerdy.

Learn more

Recent Posts
  • Adding a Today I Learned Section to the Site
  • Some Useful COVID-19 Resources
  • The Week In Links - Feb 8, 2019
  • A Collection of Links About Github Actions
  • The Week In Links - Jan 19, 2019
Categories
  • Apple
  • Best of
  • Books
  • Business
  • Career
  • Cloud
  • Coffee
  • Design
  • Funny
  • Interviews
  • Links
  • Management
  • Meta
  • Monday question
  • Photography
  • Postgresql
  • Productivity
  • Programming
  • Python
  • Rails
  • Random
  • Ruby
  • Stuff i like
  • Technology
  • Web
Elsewhere
  • Github
  • Twitter

Copyright © Larry Wright 2023