Auto-sync: 2026-04-28 20:03

This commit is contained in:
2026-04-28 20:03:11 +08:00
parent c51cc4c58b
commit f71229f0c3
94 changed files with 2752 additions and 1295 deletions

View File

@@ -1,57 +1,57 @@
---
title: "CTP Topic 58 AWS EC2 Image Builder"
type: source
tags:
- AWS
- EC2
- Image-Builder
- CTP
- AMI
tags: [AWS, EC2, Image-Builder, CTP, DevOps]
date: 2026-04-14
sources: []
last_updated: 2026-04-28
---
## Source File
- [[raw/Cloud & DevOps/Public-Cloud-Learning-Sessions/01_AWS-Landing-Zone/ctp-topic-58-aws-ec2-image-builder.md]]
## Summary用中文描述
- 核心主题AWS EC2 Image Builder 替代 Packer/Jenkins 实现企业级 AMI 生命周期自动化管理
- 问题域:当前 AMI 发布流程依赖 GitLab 加固脚本 + Jenkins + Packer存在修改周期长、跨 Landing Zone 兼容性差、手动 Bakery 自动化不足等问题
- 方法/机制Image Builder 通过 Pipeline流水线/Recipe配方/Component组件/Infrastructure Config 四层抽象,将 CCOE 加固脚本模块化为可复用组件,产品团队通过服务模块向 Golden AMI 添加组件
- 结论/价值:提升生产力(自动化)、构建时内建测试、合规加固标准、跨账跨区域分发与 AWS Organizations/RAM 集成;支持 AWS Inspector Lambda 工作流做 AMI 安全扫描
- 核心主题AWS EC2 Image Builder 服务 — 自动化创建、管理和分发 AMIs 及 Docker 镜像的托管服务
- 问题域:企业 AWS Landing Zone 环境中的标准化镜像构建与分发流程
- 方法/机制:通过 Image Pipeline、Image Recipe、Infrastructure Configuration、Distribution Settings 等组件协同工作;使用 YAML 定义镜像配方CCOE 提供 Golden AMI产品团队可在此基础上追加自定义组件
- 结论/价值:提升镜像构建效率、整合安全加固标准、跨账号/跨区域自动化分发与 AWS Organizations 和 AWS RAM 深度集成
## Key Claims用中文描述
- Image Builder 通过 Pipeline/Recipe/Component/Infrastructure Config 四层组件实现 AMI 构建全生命周期自动化
- 当前 AMI 发布流程GitLab + Jenkins + Packer存在修改周期长、跨 LZ 兼容性差、手动 Bakery 自动化不足等缺陷
- POC 已实现 CentOS 7 和 Ubuntu 18 端到端流水线CCOE 加固脚本转换为独立组件
- Lambda 工作流触发 AWS Inspector 扫描、邮件通知、S3 报告归档,维护历史 AMI 数据
- Qualys 扫描集成正在评估中
- Image Builder 通过组件化设计Component实现模块化镜像定制每个组件是源 AMI 内执行的一个步骤
- 当前 AMI 发布流程依赖 GitLab 仓库中的 OS 加固脚本 + Jenkins + Packer存在交付周期长、跨 Landing Zone 兼容性差等问题
- Image Builder 与 AWS Organizations 和 AWS RAM 集成,支持跨托管账户的 AMI 分发
- POC 已实现 CentOS 7 和 Ubuntu 18 的端到端 PipelineCCOE 加固脚本已转换为独立组件
- AWS Inspector 集成用于 AMI 安全扫描Lambda 工作流触发扫描并通过邮件通知上传报告至 S3
## Key Quotes
> "A component is basically just a particular step that you want to execute in order to achieve the output AMI." — Image Builder 组件定义
> "Due to these limitations, eventually the product teams try to cater to their requirements by developing some kind of workflow or CI CD pipelines wherein they consume that CCOE AMI and they try to update or install whatever packages they require." — 当前流程的局限性驱动产品团队自建 CI/CD
> "Product groups can use a service module to add components to the golden AMI. A component is a script, and components should be added in alphabetical order." — 产品团队通过服务模块添加组件的机制
> "A component is basically just a particular step that you want to execute in order to achieve the output AMI." — 组件定义
> "Due to these limitations, the product teams try to cater to their requirements by developing some kind of workflow or CI CD pipelines wherein they consume that CCOE AMI and they try to update or install whatever packages they require." — 当前痛点与团队应对方式
## Key Concepts
- [[Golden-AMI]]:由 CCOE 维护的标准化基础镜像,产品团队在其上添加自定义组件
- [[CCOE]]Cloud Center of Excellence云卓越中心负责维护 Golden AMI 和加固脚本
- [[Image-Pipeline]]定义 AMI 发布时间线、安装步骤、安全加固和分发策略
- [[Image-Recipe]]YAML 格式定义源 AMI 到输出 AMI 的转换规则
- [[Image-Component]]:在源 AMI 内执行的具体步骤(安装包、运行脚本)
- [[Infrastructure-Configuration]]:定义构建 AMI 所需的 EC2 实例属性(类型/VPC/子网/安全组)
- [[Distribution-Settings]]:管理 AMI 跨区域跨账户的分发配置
- [[AWS-Inspector]]AWS 原生 AMI 安全扫描工具
- [[AMI-Image-Builder]]AWS 托管服务,用于自动化 AMIs 和 Docker 镜像的创建、管理和分发
- [[Image-Pipeline]]:定义 AMI 发布时间线,包含安装、安全加固和分发计划
- [[Image-Recipe]]YAML 编写的配方,定义 AMI 与输出 AMI 的关系Container Recipe 支持 Docker 镜像
- [[Golden-AMI]]CCOE 构建的基础镜像Golden AMI产品团队在其上追加组件
- [[AWS-Organizations]] 与 [[AWS-RAM]]:跨账号分发 AMIs 的机制
- [[AWS-Inspector]]:集成用于 AMI 安全扫描,发现安全漏洞和合规问题
- [[AWS-Landing-Zone]]:背景上下文 — Image Builder 服务于 Landing Zone 环境的标准化需求
## Key Entities
- [[AWS]]Image Builder 服务的云提供商
- [[AWS]]服务提供商
- [[AWS-Inspector]]:安全扫描集成
- [[AWS-Organizations]]:跨账号管理
- [[AWS-RAM]]:资源访问管理
- [[AWS-CloudWatch]]:日志发布目标
- [[AWS-Lambda]]:触发扫描和通知的工作流引擎
- [[Qualys]]:安全扫描集成(评估中)
- [[Packer]]:当前 AMI 构建工具(将被 Image Builder 替代)
- [[Jenkins]]:当前 CI/CD 流程(将被 Image Builder 替代)
- [[Terraform]]:用于创建 Image Builder 资源的 IaC 工具
## Connections
- [[ctp-topic-26-standard-ami-build-publish-share-processes]] ← builds_on ← [[ctp-topic-58-aws-ec2-image-builder]]Image Builder 是对 Packer/Jenkins AMI 流程的升级)
- [[ctp-topic-58-aws-ec2-image-builder]] ← depends_on ← [[learning-sessions-standard-amis-updates]]CCOE 加固脚本和标准 AMI 生命周期管理是 Image Builder 的输入)
- [[ctp-topic-50-ami-roadmap-for-aws-amis]] ← related_to ← [[ctp-topic-58-aws-ec2-image-builder]]AMI 路线图与 Image Builder 自动化策略相关)
- [[CTP-Topic-50-AMI-Roadmap]] ← relates_to ← [[CTP-Topic-58-AWS-EC2-Image-Builder]]
- [[CTP-Topic-26-Standard-AMI-Process]] ← extends ← [[CTP-Topic-58-AWS-EC2-Image-Builder]]
- [[CTP-Topic-35-AWS-Landing-Zone]] ← belongs_to ← [[CTP-Topic-58-AWS-EC2-Image-Builder]]
## Contradictions
- 与 [[ctp-topic-26-standard-ami-build-publish-share-processes]]
- 冲突点:当前 AMI 流程GitLab + Jenkins + Packervs Image Builder 自动化流程
- 当前观点Packer/Jenkins 流程是现状,存在修改周期长、跨 LZ 兼容性差等问题
- 对方观点Jenkins 多分支流水线 + 机器人框架验证已将验证周期从 3-4 天缩短至 60 分钟
- 说明两者并非完全矛盾——Image Builder 替代 Packer 作为镜像构建工具,而 Jenkins 流水线可能继续用于 Terraform 部署触发
- (暂无发现与其他 Wiki 页面的冲突)