Course contentsShow
← Cloud and Infrastructure
Lesson 708 of 2,98913. Infrastructure as Code FoundationsFree lesson

Targeted Operations

Learn how to apply changes to specific resources rather than the entire infrastructure.

Targeted Operations

What You'll Learn

You'll learn how to apply infrastructure changes to specific resources instead of always running changes across your entire infrastructure—saving time, reducing risk, and giving you surgical precision.

The Core Idea

When managing infrastructure as code, you don't always want to apply changes to everything at once. Targeted operations let you focus on specific resources—like updating just one server, modifying a single database, or destroying only a particular storage bucket—without touching the rest of your infrastructure.

Think of it like home renovation: sometimes you want to repaint the entire house, but other times you only need to fix one broken door. Targeted operations are your way of saying "only work on this specific thing."

Why Target Specific Resources?

When your infrastructure grows, full-scale operations become slower and riskier. Maybe you have 50 resources managed by IaC, but you only changed configuration for 2 of them. A targeted operation lets you:

  • Reduce blast radius: Only the targeted resources can be affected
  • Speed up operations: Skip planning and applying unchanged resources
  • Test carefully: Try changes on one instance before rolling out to others
  • Troubleshoot precisely: Destroy and recreate a problematic resource without disrupting everything else

How It Works

In practice, you specify which resource(s) you want to target using identifiers from your configuration files. The IaC tool then limits its planning, applying, or destroying actions to only those resources, ignoring everything else—even if other changes exist.

This works seamlessly with state files because the tool can isolate specific resources within the state and operate only on those portions.

Key Takeaway: Targeted operations give you surgical control over infrastructure changes, allowing you to work on specific resources without affecting your entire environment—faster, safer, and more efficient.