A SysOps administrator is troubleshooting an AWS CloudFormation template whereby multiple Amazon EC2 instances are being created. The template is working in us-east-1, but it is failing in us-west-2 with the error code:
AMI [ami-12345678] does not exist
How should the Administrator ensure that the AWS CloudFormation template is working in every region?
- A. Copy the source region's Amazon Machine Image (AMI) to the destination region and assign it the same ID.
- B. Edit the AWS CloudFormation template to specify the region code as part of the fully qualified AMI ID.
- C. Edit the AWS CloudFormation template to offer a drop-down list of all AMIs to the user by using the AWS::EC2::AMI::ImageID control.
- D. Modify the AWS CloudFormation template by including the AMI IDs in the ג€Mappingsג€ section. Refer to the proper mapping within the template for the proper AMI ID.
EC2 인스턴스를 여러개 생성하는 CloudFormation 템플릿 디버깅 문제.
- 이 템플릿은 us-east-1 리전에서는 잘 작동하지만, us-west-2 리전에서는 에러 발생
에러: AMI [ami-12345678] does not exist (AMI가 존재하지 않습니다)
AMI 는 리전별로 존재.
즉, 어떤 AMI가 A 리전에서는 유효하더라도, 같은 AMI ID를 가진 AMI가 B 리전에는 없음
따라서 CloudFront 템플릿에서 AMI ID를 하드코딩하는 경우에는 다른 리전에서 해당 CloudFromation 을 돌리는 경우 오류가 발생하게 됨. 따라서 모든 리전에서 이런류의 템플릿이 작동되도록 하려면 CloudFormation 템플릿에 Mappings 섹션을 추가해서 리전별 AMI ID를 정의하고 해당 리전에 맞는 값을 참조하도록 설정해야 함.
Mapping 섹션을 사용하면, 리전별로 다른 값을 지정할 수 있고, !FindInMap 함수로 현재 리전에 맞는 AMI ID를 동적으로 참조할 수 있음.
그래서 정답은 D 가 됨.
'IT 자격증 > [AWS] SysOps Administrator' 카테고리의 다른 글
StackSets 이용 시, Cloudformation 스택 인스턴스 상태가 Outdated 되는 원인 (0) | 2025.05.19 |
---|---|
EFS와 마운트에 대해서 (0) | 2025.05.18 |
CloudFront-ALB 구조에서의 세션 유실 현상 (0) | 2025.05.18 |
AWS 대규모 트래픽 대비를 위한 방법 (0) | 2025.05.05 |
Amazon EC2 인스턴스에서 S3로 데이터를 업로드 시, 네트워크 처리량이 병목인 상황 해결 방법 (0) | 2025.05.05 |