83 lines
2.3 KiB
Markdown
83 lines
2.3 KiB
Markdown
---
|
||
title: "Availability-Zone-ID"
|
||
type: concept
|
||
tags: [AWS, VPC, Networking, Multi-Account]
|
||
sources:
|
||
- ctp-topic-45-automatic-ip-address-allocation-with-ipam
|
||
- ctp-topic-61-workload-vpc-provision-with-ipam-automation
|
||
last_updated: 2026-04-24
|
||
---
|
||
|
||
## Availability-Zone-ID
|
||
|
||
AWS 可用区标识符(如 `ap-southeast-1a`、`ap-southeast-1b`),用于在多账号 AWS 环境中精确定位物理可用区位置。相比 AZ 名称,AZ ID 能唯一标识跨账号的同一物理位置。
|
||
|
||
## Problem: AZ Name Inconsistency
|
||
|
||
不同 AWS 账号对同一物理可用区的**名称**可能不同:
|
||
|
||
| 账号 A | 账号 B | 物理位置(AZ ID) |
|
||
|--------|--------|-------------------|
|
||
| ap-southeast-1a | ap-southeast-1b | apse1-az1 |
|
||
| ap-southeast-1b | ap-southeast-1a | apse1-az2 |
|
||
|
||
**问题**:
|
||
- 账号 A 的 `ap-southeast-1a` = 账号 B 的 `ap-southeast-1b`(物理位置相同)
|
||
- 如果用 AZ 名称设计跨账号 VPC 对等连接或可用性架构,可能出现"看起来对称但物理不对称"的问题
|
||
|
||
## Solution: Use AZ ID
|
||
|
||
使用 AZ ID(如 `apse1-az1`)替代 AZ 名称:
|
||
|
||
```yaml
|
||
availability_zone_ids:
|
||
- apse1-az1 # 物理位置 apse1 的第一个 AZ
|
||
- apse1-az2 # 物理位置 apse1 的第二个 AZ
|
||
```
|
||
|
||
**优势**:
|
||
- 跨账号一致性:AZ ID 在所有账号中唯一标识同一物理位置
|
||
- 可靠性设计:确保高可用架构在物理层面真正对称
|
||
- VPC 对等连接:正确配置跨账号连接
|
||
|
||
## How to Find AZ IDs
|
||
|
||
```bash
|
||
# 使用 AWS CLI 查询当前账号的 AZ ID 映射
|
||
aws ec2 describe-availability-zones --output json
|
||
```
|
||
|
||
输出示例:
|
||
```json
|
||
{
|
||
"AvailabilityZones": [
|
||
{
|
||
"ZoneName": "ap-southeast-1a",
|
||
"ZoneId": "apse1-az1",
|
||
"RegionName": "ap-southeast-1"
|
||
},
|
||
{
|
||
"ZoneName": "ap-southeast-1b",
|
||
"ZoneId": "apse1-az2",
|
||
"RegionName": "ap-southeast-1"
|
||
}
|
||
]
|
||
}
|
||
```
|
||
|
||
## Key Concepts
|
||
|
||
- [[VPC-自动化供给]]:AZ ID 是 VPC YAML 配置的一部分
|
||
- [[IPAM]]:IPAM 与 VPC 供给集成时需考虑 AZ 映射
|
||
|
||
## Connections
|
||
|
||
- [[ctp-topic-45-automatic-ip-address-allocation-with-ipam]] ← YAML 支持指定 AZ ID
|
||
- [[ctp-topic-61-workload-vpc-provision-with-ipam-automation]] ← 强调 AZ ID 用于跨账号一致性
|
||
|
||
## Aliases
|
||
|
||
- AZ ID
|
||
- Availability Zone Identifier
|
||
- 物理可用区标识符
|