Essayer gratuitement
4 min lecture Guide 409 of 877

How to Manage Infrastructure as Code (IaC) Tasks?

How to manage Infrastructure as Code (IaC) tasks?

Manage IaC tasks by treating infrastructure changes like code: version controlled, code reviewed, tested in staging, and deployed with rollback plans. Create tasks with clear change scope, require plan review before apply, document in NoteVault, and use labels to identify infrastructure-affecting work.

IaC labels

LabelPurpose
infraInfrastructure task
iac:terraformTerraform change
iac:pulumiPulumi change
iac:cloudformationCloudFormation change
risk:highHigh-risk change
risk:lowLow-risk change
needs-plan-reviewPlan output needs review
deployed:stagingTested in staging

IaC board columns

ColumnPurpose
BacklogPlanned infra work
DevelopmentWriting IaC code
Plan Reviewterraform plan reviewed
StagingDeployed to staging
ProductionDeployed to production
VerifiedMonitoring confirmed

IaC task template

## Infra: [Change Description]

### Resources Affected
- [ ] AWS RDS instance (resize)
- [ ] Security group rules (update)
- [ ] IAM roles (no change)

### Blast Radius
- Database: 5 second failover
- Application: Brief connection reset
- Users: Minimal impact during off-hours

### Terraform Plan

Resources to change

~ awsdbinstance.main instance_class: "db.t3.medium" -> "db.t3.large"

Plan: 0 to add, 1 to change, 0 to destroy


### Deployment Steps
1. [ ] Run plan, verify output
2. [ ] Deploy to staging
3. [ ] Verify staging healthy
4. [ ] Schedule production window
5. [ ] Deploy to production
6. [ ] Verify production healthy
7. [ ] Update documentation

### Rollback Plan
1. Run `terraform apply -target=aws_db_instance.main`
2. Revert instance_class to "db.t3.medium"
3. Apply and verify

### Monitoring
- [ ] Database connections normal
- [ ] Application latency normal
- [ ] No error rate increase

IaC workflow:

  1. Create task - Document change scope
  2. Write code - Terraform/Pulumi changes
  3. Run plan - Generate change preview
  4. Code review - Review IaC + plan output
  5. Deploy staging - Test in non-prod
  6. Verify staging - Confirm working
  7. Schedule production - Maintenance window if needed
  8. Deploy production - Apply changes
  9. Monitor - Watch for issues
  10. Document - Update NoteVault

Risk assessment matrix

Change TypeRiskApproach
New resourceLowStandard deploy
Resource modificationMediumPlan review required
Resource deletionHighMaintenance window
Network changesHighMaintenance window
IAM changesMediumSecurity review
Database changesHighBackup first

NoteVault infrastructure documentation

# Infrastructure Documentation

## Architecture
[Diagram or description]

## Environments
| Environment | Account | Region |
|-------------|---------|--------|
| Development | dev-123 | us-east-1 |
| Staging | stg-456 | us-east-1 |
| Production | prd-789 | us-east-1, eu-west-1 |

## Terraform Workspaces
| Workspace | Environment | State |
|-----------|-------------|-------|
| dev | Development | S3 |
| stg | Staging | S3 |
| prd | Production | S3 |

## Change Log
### 2025-01-27 - RDS Resize
- Changed db.t3.medium → db.t3.large
- Reason: CPU constraints
- Impact: 5s failover during change