Menu

1 / 4

Terraform Import: How the Command Works on One Orphaned Security Group

DEV Community: terraform·Tech code·about 20 hours ago
#l5hQ57La
#devtoterraform#devto#dev#import#resource
Reading 0:00
15s threshold

TL;DR

Terraform import brings a resource that already exists in the cloud into Terraform state without changing the resource itself. The classic command writes only state, so the matching configuration stays manual, and a mismatch can appear in the next plan as an unexpected change or even a replacement. Import blocks and generated configuration reduced that manual work, but import still needs a resource ID that someone already has. This guide walks through the classic command, import blocks, batch imports, common errors, and how SGCode handles discovery.

Cloud accounts rarely stay as tidy as the code written for them. Engineers open console tabs during incidents, acquired companies arrive with undocumented accounts, and one-off scripts leave resources behind long after the people who ran them have moved on.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.