Files
nexus/wiki/concepts/Infrastructure-as-Code.md
2026-04-21 04:02:47 +08:00

27 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Infrastructure as Code (IaC)"
type: concept
tags: [infrastructure, devops, automation]
last_updated: 2026-04-21
---
## Definition
Infrastructure as Code基础设施即代码是一种通过代码实现基础设施管理的方法论替代传统手动配置实现一致性、版本控制和自动化部署。
## Core Principles
- **声明式配置**:定义期望状态而非步骤
- **版本控制**:所有基础设施变更通过 Git 管理
- **自动化部署**:通过 CI/CD 流水线实现一键部署
- **幂等性**:重复执行结果一致
## Key Tools
- [[Terraform]]HashiCorp 开发的跨平台 IaC 工具
- TerragruntTerraform 包装工具,提供模块化和变量共享
- CloudFormationAWS 原生 IaC 服务
## Related Concepts
- [[CI/CD 流水线]]:自动化测试、集成和部署的持续交付管道
- [[Infrastructure Maintainer]]:使用 IaC 进行基础设施管理的智能体角色
## Application
The Agency 项目中的 [[Support Infrastructure Maintainer]] 使用 Terraform 实现 AWS 基础设施声明式管理,包括 VPC、子网、Auto Scaling Group、RDS 等资源。