Split View: AWS DevOps Engineer Professional (DOP-C02) 실전 모의고사 75문제
AWS DevOps Engineer Professional (DOP-C02) 실전 모의고사 75문제
시험 개요
| 항목 | 내용 |
|---|---|
| 시험 코드 | DOP-C02 |
| 시험 시간 | 180분 |
| 문제 수 | 75문제 |
| 합격 기준 | 750점 / 1000점 |
| 시험 형태 | 단일 선택, 복수 선택 |
도메인별 출제 비율
| 도메인 | 비율 |
|---|---|
| Domain 1: SDLC 자동화 | 22% |
| Domain 2: 구성 관리 및 IaC | 17% |
| Domain 3: 복원력 있는 클라우드 솔루션 | 15% |
| Domain 4: 모니터링 및 로깅 | 15% |
| Domain 5: 인시던트 및 이벤트 응답 | 18% |
| Domain 6: 보안 및 컴플라이언스 | 13% |
DevOps 핵심 개념 요약
CI/CD 파이프라인 패턴
- Blue/Green: 즉각적 롤백, 두 환경 동시 운영
- Canary: 트래픽 점진적 이동 (10% → 100%), 위험 최소화
- Linear: 일정 간격으로 트래픽 증가 (매 10분마다 10%)
- AllAtOnce: 모든 인스턴스 동시 배포, 가장 빠르지만 위험
CloudFormation 핵심
- StackSets: 여러 계정/리전에 동시 배포
- 중첩 스택: 큰 템플릿을 재사용 가능한 컴포넌트로 분리
- 변경 세트: 배포 전 변경 사항 미리 확인
- 드리프트 감지: 실제 리소스와 템플릿 차이 감지
Systems Manager 핵심
- Run Command: 에이전트 없이 EC2에서 명령 실행
- Patch Manager: 자동 패치 기준 정의 및 적용
- Parameter Store: 구성 데이터 및 암호화 가능한 비밀 저장
- Session Manager: SSH/RDP 없이 EC2 세션 관리
실전 연습 문제 75문제
Domain 1: SDLC 자동화
Q1. 회사가 프로덕션 환경에 Canary 배포를 구현하고 싶습니다. AWS CodeDeploy를 사용하여 처음 10분 동안 10%의 트래픽을 새 버전으로 전송하고 나머지 90%는 유지한 후 완전 전환하는 배포 구성은?
A) CodeDeployDefault.AllAtOnce B) CodeDeployDefault.LambdaCanary10Percent10Minutes C) CodeDeployDefault.LambdaLinear10PercentEvery10Minutes D) CodeDeployDefault.OneAtATime
정답: B
설명: CodeDeployDefault.LambdaCanary10Percent10Minutes는 처음 10분 동안 트래픽의 10%를 새 버전으로 전환하고, 이 기간 동안 모니터링 후 나머지 90%를 한 번에 전환하는 Canary 배포 방식입니다. Linear는 일정 간격으로 점진적으로 증가하는 방식입니다. ECS와 Lambda 배포에 모두 적용 가능합니다.
Q2. 멀티 계정 AWS 환경에서 개발(Dev) → 스테이징(Staging) → 프로덕션(Prod) 계정으로 자동 배포하는 CodePipeline을 구성하려 합니다. 교차 계정 배포를 가능하게 하는 핵심 구성 요소는?
A) 각 계정에 동일한 IAM 사용자를 생성한다 B) 소스 계정의 KMS 키로 아티팩트를 암호화하고, 대상 계정에 크로스 계정 역할을 생성한다 C) VPC Peering으로 계정을 연결한다 D) AWS Organizations를 활성화한다
정답: B
설명: CodePipeline 교차 계정 배포를 위해서는: (1) 소스 계정의 S3 아티팩트 버킷을 대상 계정이 접근할 수 있도록 버킷 정책 설정, (2) 아티팩트 암호화용 KMS 고객 관리형 키 설정 (AWS 관리형 키는 교차 계정 사용 불가), (3) 대상 계정에서 소스 계정의 CodePipeline 역할이 AssumeRole 할 수 있는 IAM 역할 생성이 필요합니다.
Q3. CloudFormation 스택 배포 중 롤백이 발생하면 스택이 이전 상태로 돌아갑니다. 하지만 특정 리소스의 문제를 조사하기 위해 롤백 없이 실패한 스택을 유지하고 싶을 때 사용하는 옵션은?
A) DisableRollback 플래그를 활성화한다 B) --on-failure DO_NOTHING 옵션을 사용한다 C) DeletionPolicy: Retain을 설정한다 D) 스택 보호(Stack Protection)를 활성화한다
정답: B
설명: aws cloudformation create-stack 명령에 --on-failure DO_NOTHING 옵션을 사용하면 스택 생성 실패 시 롤백 없이 실패한 상태로 유지됩니다. 이를 통해 실패한 리소스를 검사하고 디버깅할 수 있습니다. 기본값은 ROLLBACK이며, DELETE로 설정하면 실패 시 스택을 완전히 삭제합니다. DisableRollback은 스택 업데이트에 사용되는 옵션입니다.
Q4. AWS CDK(Cloud Development Kit)를 사용하여 인프라를 코드로 관리하는 주요 이점은?
A) CDK는 CloudFormation보다 배포가 빠르다 B) 친숙한 프로그래밍 언어(TypeScript, Python 등)로 인프라를 정의하고 재사용 가능한 컴포넌트(Construct)를 만들 수 있다 C) CDK는 서드파티 클라우드를 지원한다 D) CDK는 YAML/JSON 작성을 완전히 대체한다
정답: B
설명: AWS CDK는 TypeScript, Python, Java, C# 등 익숙한 프로그래밍 언어로 클라우드 인프라를 정의할 수 있습니다. 루프, 조건문, 객체지향 패턴을 사용하여 재사용 가능한 Construct를 만들고, cdk synth 명령으로 CloudFormation 템플릿을 생성합니다. CDK 최종적으로 CloudFormation을 통해 배포됩니다.
Q5. SAM(Serverless Application Model)으로 배포한 Lambda 함수에서 CodeDeploy를 통한 자동 Canary 배포를 구성하려면 SAM 템플릿에서 어떻게 설정합니까?
A) DeploymentPreference 속성을 설정한다 B) AutoDeploy: true를 설정한다 C) TrafficShifting 속성을 추가한다 D) CodeDeploy 리소스를 별도로 생성한다
정답: A
설명: SAM 템플릿의 AWS::Serverless::Function 리소스에 DeploymentPreference 속성을 추가하면 CodeDeploy가 자동으로 생성되어 트래픽 이동을 관리합니다. 예: Type: Canary10Percent10Minutes. Alarms 속성으로 CloudWatch 알람을 연결하면 알람 발생 시 자동 롤백이 가능합니다. Hooks 속성으로 Pre/PostTraffic Lambda 함수를 지정할 수 있습니다.
Q6. CloudFormation 사용자 정의 리소스(Custom Resource)의 주요 사용 사례는?
A) CloudFormation 배포 속도를 높이기 위해 B) CloudFormation이 네이티브 지원하지 않는 작업(타사 서비스 통합, 초기 데이터 로드 등)을 Lambda 함수로 수행하기 위해 C) 스택 롤백을 방지하기 위해 D) 비용을 최적화하기 위해
정답: B
설명: CloudFormation Custom Resource는 Lambda 함수를 통해 CloudFormation 생명주기(생성, 업데이트, 삭제) 이벤트를 처리합니다. 사용 사례: Cognito 사용자 풀 초기화, 타사 API 호출, RDS 데이터베이스 스키마 마이그레이션, S3 버킷 초기 데이터 업로드, 레거시 시스템 통합. CloudFormation 스택과 함께 생명주기가 관리됩니다.
Q7. CodePipeline에서 승인 없이 자동으로 프로덕션에 배포되어야 하지만, 테스트 실패 시에만 배포를 중지하려면?
A) 수동 승인 단계를 추가한다 B) CodeBuild 단계에서 테스트를 실행하고, 테스트 실패 시 빌드가 실패하도록 구성한다 C) Lambda 함수로 테스트 결과를 확인한다 D) CloudWatch 알람으로 파이프라인을 중지한다
정답: B
설명: CodeBuild 빌드 스펙에 자동화 테스트(단위 테스트, 통합 테스트)를 포함시키고, 테스트 실패 시 빌드가 실패(exit code != 0)하도록 구성합니다. CodePipeline은 CodeBuild 단계가 실패하면 다음 단계로 진행하지 않습니다. 수동 승인 없이도 자동화된 품질 게이트를 구현할 수 있습니다.
Q8. CloudFormation StackSets의 주요 사용 사례는?
A) 단일 리전에 여러 스택을 배포하는 경우 B) AWS Organizations의 여러 계정과 여러 리전에 동일한 CloudFormation 스택을 배포하는 경우 C) 스택 배포 속도를 높이는 경우 D) 비용을 절감하는 경우
정답: B
설명: CloudFormation StackSets를 사용하면 단일 CloudFormation 템플릿을 AWS Organizations의 여러 계정 또는 여러 리전에 동시에 배포할 수 있습니다. 사용 사례: IAM 역할 배포, AWS Config 규칙 설정, 보안 기준선 구성, GuardDuty/Security Hub 활성화. Organizations 통합으로 신규 계정에 자동 배포도 가능합니다.
Q9. 두 개의 병렬 CodeBuild 단계가 모두 성공해야 다음 CodeDeploy 단계로 진행하도록 CodePipeline을 구성하려면?
A) CodeBuild 단계를 순차적으로 배치한다 B) 두 CodeBuild 작업을 동일한 단계(Stage)에 병렬 Action으로 구성한다 C) Lambda 함수로 두 빌드 결과를 취합한다 D) 각 빌드에 SNS 알림을 추가한다
정답: B
설명: CodePipeline의 단계(Stage) 내에서 여러 Action을 병렬로 실행할 수 있습니다. 같은 단계에 두 CodeBuild 액션을 추가하면 동시에 실행되며, 두 액션이 모두 성공해야 다음 단계로 진행합니다. 하나라도 실패하면 해당 단계가 실패하고 파이프라인이 중단됩니다.
Q10. CloudFormation 드리프트 감지(Drift Detection)가 탐지하는 상황은?
A) CloudFormation 스택 배포 실패 B) CloudFormation 스택 외부에서(콘솔, CLI 등) 리소스가 직접 수정된 경우 C) 새 AWS 서비스 기능이 추가된 경우 D) 스택 비용이 임계값을 초과한 경우
정답: B
설명: CloudFormation 드리프트 감지는 CloudFormation 스택에 의해 관리되는 리소스의 현재 실제 구성이 스택 템플릿에 정의된 구성과 다른지 검사합니다. 예를 들어 누군가 콘솔에서 직접 보안 그룹 규칙을 수정하거나 S3 버킷 정책을 변경하면 드리프트가 감지됩니다. 정기적으로 드리프트 감지를 실행하여 구성 일관성을 유지하는 것이 중요합니다.
Q11. CodeDeploy에서 Lambda 함수 배포 시 PreTraffic 훅(Hook)의 역할은?
A) 배포 완료 후 통합 테스트를 실행한다 B) 새 Lambda 버전으로 트래픽이 전환되기 전에 검증 테스트를 실행한다 C) 이전 Lambda 버전을 삭제한다 D) Lambda 함수 코드를 업로드한다
정답: B
해설: CodeDeploy Lambda 배포의 훅 순서: BeforeAllowTraffic(PreTraffic) → 트래픽 이동 → AfterAllowTraffic(PostTraffic). PreTraffic 훅은 새 버전으로 실제 트래픽이 이동하기 전에 Lambda 함수를 호출합니다. 이 함수에서 새 버전의 기능을 테스트하고 실패하면 자동으로 롤백됩니다. PostTraffic은 트래픽 이동 완료 후 실행됩니다.
Q12. Terraform과 CloudFormation의 주요 차이점으로 올바른 것은?
A) Terraform은 AWS에서만 사용 가능하다 B) Terraform은 멀티 클라우드를 지원하고 상태 파일(state file)을 관리하며, CloudFormation은 AWS 네이티브이고 상태를 AWS가 관리한다 C) CloudFormation은 더 많은 프로그래밍 언어를 지원한다 D) 두 도구의 기능은 동일하다
정답: B
해설: Terraform은 HashiCorp의 오픈소스 도구로 AWS, Azure, GCP 등 멀티 클라우드를 지원합니다. Terraform 상태(state)는 S3 등 원격 백엔드에 저장하여 팀이 공유합니다. CloudFormation은 AWS 네이티브 서비스로 상태를 AWS가 직접 관리하며, AWS 서비스와 더 긴밀히 통합됩니다. AWS 환경에서는 두 도구를 함께 사용하기도 합니다.
Domain 2: 구성 관리 및 IaC
Q13. AWS Systems Manager Patch Manager를 사용하여 프로덕션 EC2 인스턴스를 자동으로 패치하는 워크플로우의 올바른 단계는?
A) 패치 기준선 정의 → 유지 관리 창 생성 → 태그로 인스턴스 그룹화 → 패치 작업 등록 B) 인스턴스 선택 → 패치 실행 → 보고서 생성 C) CloudWatch 알람 생성 → Lambda 트리거 → 패치 실행 D) AMI 생성 → 인스턴스 교체
정답: A
해설: SSM Patch Manager 워크플로우: (1) 패치 기준선(Patch Baseline) 정의 - 어떤 패치를 자동 승인할지, (2) 유지 관리 창(Maintenance Window) 생성 - 패치 실행 일정, (3) 인스턴스 그룹화 - 태그 또는 리소스 그룹 사용, (4) 패치 작업(Patch Task) 등록 - 유지 관리 창에 연결. Patch Manager는 SSM Agent가 설치된 모든 인스턴스에서 동작합니다.
Q14. AWS Config 규칙을 사용하여 모든 EC2 인스턴스가 승인된 AMI ID만 사용하는지 확인하는 규칙 유형은?
A) AWS 관리형 규칙: approved-amis-by-id B) Lambda 기반 사용자 정의 규칙 C) CloudTrail 이벤트 기반 규칙 D) Security Hub 표준
정답: A
해설: AWS Config는 approved-amis-by-id라는 AWS 관리형 규칙을 제공하여 EC2 인스턴스가 지정된 AMI ID 목록 중 하나를 사용하는지 확인합니다. 비준수 인스턴스를 식별하고 자동 수정(Auto Remediation)으로 SSM Run Command를 통해 조치를 취할 수 있습니다. 관리형 규칙이 없는 경우 Lambda 함수로 사용자 정의 규칙을 만들 수 있습니다.
Q15. AWS OpsWorks Stacks에서 Chef 레시피를 사용하는 주요 시나리오는?
A) Lambda 함수를 배포하는 경우 B) 복잡한 구성 관리가 필요하고 이미 Chef 인프라가 있는 경우 C) 컨테이너 오케스트레이션이 필요한 경우 D) 서버리스 아키텍처를 구현하는 경우
정답: B
해설: OpsWorks Stacks는 Chef(또는 Puppet)를 사용하여 EC2 인스턴스의 구성을 관리합니다. 기존에 Chef 레시피 인프라가 있는 팀이 AWS로 이전할 때 적합합니다. 현재는 많은 팀이 SSM 또는 Ansible을 선호하지만, 레거시 환경이나 복잡한 구성 관리에 여전히 사용됩니다.
Q16. AWS Systems Manager Session Manager를 사용하는 주요 보안 이점은?
A) 인스턴스 성능이 향상된다 B) SSH/RDP 포트를 열 필요 없이 EC2 인스턴스에 안전하게 접근하고 모든 세션이 로깅된다 C) 비용이 절감된다 D) 자동 패치가 가능해진다
정답: B
해설: Session Manager는 보안 그룹에서 인바운드 SSH(22) 또는 RDP(3389) 포트를 열 필요가 없습니다. IAM 정책으로 접근을 제어하고, 모든 세션 활동이 CloudWatch Logs 또는 S3에 기록됩니다. 배스천 호스트(Bastion Host)가 필요 없어 공격 표면을 줄입니다. VPC Endpoints를 통해 인터넷 없이도 사용 가능합니다.
Q17. CloudFormation 스택에서 RDS 인스턴스의 DeletionPolicy와 UpdateReplacePolicy를 모두 Snapshot으로 설정하는 이유는?
A) 비용을 절감하기 위해 B) 스택 삭제 시 스냅샷을 생성하고, 교체 업데이트 시에도 스냅샷을 생성하여 데이터 손실을 방지하기 위해 C) 성능을 향상시키기 위해 D) 자동 백업을 비활성화하기 위해
정답: B
해설: DeletionPolicy: Snapshot은 스택 삭제 시 RDS 스냅샷을 생성합니다. UpdateReplacePolicy: Snapshot은 리소스 교체(예: DB 엔진 변경)가 발생하는 업데이트 시 스냅샷을 먼저 생성하고 기존 리소스를 삭제합니다. 두 정책 모두 데이터 손실을 방지하는 안전장치입니다. 프로덕션 데이터베이스에 필수적인 설정입니다.
Q18. AWS Config 적합성 팩(Conformance Pack)의 주요 목적은?
A) 비용 최적화 규칙 모음 B) 여러 AWS Config 규칙과 자동 수정 작업을 패키지로 묶어 조직 전체에 일관된 컴플라이언스를 적용하기 위해 C) 네트워크 보안 규칙 D) 성능 최적화 규칙
정답: B
해설: Config 적합성 팩은 여러 Config 규칙과 자동 수정 액션을 단일 패키지로 묶은 것입니다. AWS가 제공하는 사전 구성된 팩(HIPAA, PCI DSS, CIS Benchmark 등)을 사용하거나 사용자 정의 팩을 만들 수 있습니다. AWS Organizations를 통해 여러 계정에 일관되게 배포할 수 있습니다.
Q19. SSM Parameter Store의 SecureString 파라미터 유형을 사용하는 이유는?
A) 빠른 조회를 위해 B) KMS를 사용하여 파라미터 값을 암호화하여 민감한 데이터(데이터베이스 비밀번호, API 키)를 안전하게 저장하기 위해 C) 파라미터 버전을 관리하기 위해 D) 대용량 데이터를 저장하기 위해
정답: B
해설: SSM Parameter Store의 SecureString 유형은 KMS를 사용하여 파라미터 값을 암호화합니다. 데이터베이스 비밀번호, API 키, OAuth 토큰 등 민감한 데이터를 안전하게 저장합니다. IAM 정책으로 특정 파라미터에 대한 접근을 세밀하게 제어할 수 있습니다. Secrets Manager와 달리 자동 교체 기능은 없지만 무료(Standard) 또는 저비용입니다.
Q20. CloudFormation 변경 세트(Change Set)를 프로덕션 배포에 활용하는 이유는?
A) 배포 속도를 높이기 위해 B) 배포 전에 어떤 리소스가 어떻게 변경(추가, 수정, 삭제)될지 미리 확인하여 의도하지 않은 변경을 방지하기 위해 C) 비용을 절감하기 위해 D) 자동 롤백을 활성화하기 위해
정답: B
해설: 변경 세트를 생성하면 CloudFormation이 현재 스택과 새 템플릿을 비교하여 변경될 리소스 목록, 변경 유형(추가/수정/교체/삭제)을 미리 보여줍니다. 프로덕션 환경에서 의도하지 않은 리소스 삭제나 교체를 방지할 수 있습니다. 변경 세트를 검토하고 승인한 후에만 실행하는 것이 모범 사례입니다.
Q21. AWS Systems Manager Automation을 사용하는 주요 사용 사례는?
A) Lambda 함수 배포 B) EC2 인스턴스 재시작, AMI 생성, 패치 등 반복적인 운영 작업을 안전하게 자동화하기 위해 C) 데이터베이스 마이그레이션 D) 네트워크 구성 변경
정답: B
해설: SSM Automation은 미리 정의된 Runbook(자동화 문서)을 사용하여 운영 작업을 자동화합니다. AWS 관리형 Runbook(예: AWS-RestartEC2Instance, AWS-CreateImage)을 사용하거나 사용자 정의 Runbook을 만들 수 있습니다. 수동 승인 단계를 포함할 수 있으며, CloudWatch Events로 트리거하거나 유지 관리 창에서 실행할 수 있습니다.
Domain 3: 복원력 있는 클라우드 솔루션
Q22. RTO(Recovery Time Objective)가 1시간, RPO(Recovery Point Objective)가 15분인 요구 사항에 가장 적합한 재해 복구 전략은?
A) 백업 및 복원(Backup and Restore) B) 파일럿 라이트(Pilot Light) C) 웜 스탠바이(Warm Standby) D) 멀티 사이트 액티브-액티브(Multi-Site Active-Active)
정답: C
해설: 재해 복구 전략별 특징:
- Backup and Restore: RTO 수 시간~일, RPO 수 시간, 비용 최저
- Pilot Light: RTO 수십 분
1시간, RPO 수 분15분, 비용 낮음 - Warm Standby: RTO 수 분~1시간, RPO 수 분, 비용 중간
- Multi-Site: RTO 거의 0, RPO 거의 0, 비용 최고
RTO 1시간, RPO 15분은 Warm Standby가 가장 적합합니다. Pilot Light도 가능하지만 데이터 동기화 주기에 따라 RPO가 달라집니다.
Q23. Aurora Global Database를 사용하는 주요 이점은?
A) 단일 리전의 읽기 성능을 향상시킨다 B) 여러 AWS 리전에 걸쳐 낮은 레이턴시 읽기와 재해 복구를 제공한다 C) Aurora 비용을 절감한다 D) Aurora를 다른 데이터베이스 엔진으로 마이그레이션한다
정답: B
해설: Aurora Global Database는 기본 리전(쓰기)과 최대 5개의 보조 리전(읽기)으로 구성됩니다. 보조 리전에서 1초 미만의 레이턴시로 데이터가 복제됩니다. 재해 발생 시 보조 리전을 기본 리전으로 승격하는 시간이 1분 미만입니다(RTO). 글로벌 사용자에게 낮은 읽기 레이턴시를 제공하고 재해 복구를 지원합니다.
Q24. DynamoDB Global Tables를 사용하는 시나리오로 가장 적합한 것은?
A) 단일 리전 내 고가용성이 필요한 경우 B) 여러 리전에서 사용자가 있고 모든 리전에서 낮은 읽기/쓰기 레이턴시가 필요한 경우 C) 데이터베이스 비용을 절감해야 하는 경우 D) DynamoDB에서 SQL 쿼리를 실행하는 경우
정답: B
해설: DynamoDB Global Tables는 선택한 모든 AWS 리전에서 완전히 관리되는 다중 활성(multi-active) 복제를 제공합니다. 각 리전에서 읽기와 쓰기 모두 수행할 수 있으며, 1초 미만의 레이턴시로 다른 리전에 전파됩니다. 글로벌 애플리케이션, 리전별 규정 준수, 재해 복구에 적합합니다.
Q25. Route 53 헬스 체크(Health Check)와 장애 조치(Failover) 라우팅을 조합하는 아키텍처의 목적은?
A) DNS 레이턴시를 줄이기 위해 B) 기본 리소스가 비정상이면 자동으로 보조 리소스로 트래픽을 전환하기 위해 C) 비용을 최적화하기 위해 D) SSL 인증서를 관리하기 위해
정답: B
해설: Route 53 Failover 라우팅 정책: 기본(Primary) 리소스에 헬스 체크를 연결합니다. 헬스 체크 실패 시 Route 53이 자동으로 보조(Secondary) 리소스로 DNS 응답을 변경합니다. 보조 리소스는 S3 정적 웹사이트, 다른 리전의 로드 밸런서 등이 될 수 있습니다. 재해 복구 시나리오에서 핵심 구성 요소입니다.
Q26. AWS Backup을 사용하여 여러 AWS 서비스의 백업을 중앙에서 관리하는 주요 이점은?
A) 백업이 더 빠르게 생성된다 B) 단일 서비스에서 여러 AWS 리소스(EC2, RDS, DynamoDB, EFS 등)의 백업 정책을 중앙 집중적으로 관리하고 컴플라이언스를 보장한다 C) 비용이 크게 절감된다 D) 백업 데이터가 자동으로 암호화된다
정답: B
해설: AWS Backup은 EC2, EBS, RDS, Aurora, DynamoDB, EFS, FSx, Storage Gateway의 백업을 단일 서비스에서 관리합니다. 백업 계획(Backup Plan)으로 일정, 보존 기간, 이동 규칙을 정의합니다. 교차 리전/교차 계정 백업 복사, 컴플라이언스 보고, Vault Lock(WORM 정책)을 지원합니다.
Q27. ELB(Elastic Load Balancer)의 Connection Draining(Deregistration Delay) 기능의 역할은?
A) 새 연결을 더 빠르게 수락한다 B) 인스턴스가 비정상이거나 제거될 때 기존 연결이 완료될 때까지 기다린다 C) 로드 밸런서 비용을 줄인다 D) SSL 인증서를 갱신한다
정답: B
해설: Connection Draining(ALB에서는 Deregistration Delay)은 인스턴스가 비정상으로 감지되거나 Auto Scaling 그룹에서 제거될 때, 이미 연결된 기존 요청이 완료될 때까지 기다리는 기능입니다. 기본값은 300초입니다. 이 시간 동안 새 연결은 건강한 인스턴스로 라우팅되고, 기존 연결은 정상 완료됩니다. 배포 및 스케일인 시 사용자 영향을 최소화합니다.
Domain 4: 모니터링 및 로깅
Q28. CloudWatch 복합 알람(Composite Alarm)의 주요 이점은?
A) 더 많은 메트릭을 모니터링한다 B) 여러 알람의 AND/OR 논리를 조합하여 알람 노이즈를 줄이고 의미 있는 경고만 발생시킨다 C) 비용을 절감한다 D) 더 빠른 알림을 제공한다
정답: B
해설: 복합 알람은 여러 CloudWatch 알람의 상태를 AND/OR 조건으로 결합합니다. 예: CPU 알람 AND 메모리 알람 AND 네트워크 알람이 모두 ALARM 상태일 때만 알림 발송. 이를 통해 단일 메트릭 임계값 초과로 인한 알람 폭풍(Alarm Storm)을 방지하고, 실제 문제 발생 시에만 알림을 받을 수 있습니다.
Q29. CloudWatch Logs Insights에서 p99 레이턴시를 계산하는 쿼리 예시는?
A) SELECT p99(latency) FROM logs B) stats pct(latency, 99) as p99 by bin(5m) C) PERCENTILE(latency, 99) D) avg(latency) where percentile=99
정답: B
해설: CloudWatch Logs Insights의 stats 함수로 퍼센타일을 계산합니다. pct(latency, 99)는 99번째 퍼센타일을 계산하고, by bin(5m)으로 5분 단위로 집계합니다. 다른 유용한 집계 함수: count(), avg(), min(), max(), sum(), stddev(). sort, limit 명령으로 결과를 정렬하고 제한할 수 있습니다.
Q30. X-Ray 서비스에서 샘플링 규칙(Sampling Rules)을 사용자 정의하는 이유는?
A) 더 많은 트레이스를 수집하여 비용을 높이기 위해 B) 중요한 요청은 100% 추적하고 일반 요청은 비율을 낮춰 비용과 성능의 균형을 맞추기 위해 C) 특정 서비스를 X-Ray에서 제외하기 위해 D) 트레이스 보존 기간을 연장하기 위해
정답: B
해설: X-Ray 샘플링 규칙은 어떤 요청을 추적할지 결정합니다. 기본 규칙은 초당 첫 번째 요청 + 5% 샘플링입니다. 사용자 정의 규칙으로 특정 URL, HTTP 메서드, 서비스 이름에 대해 다른 샘플링 비율을 적용할 수 있습니다. 예: /health 엔드포인트는 0%, 결제 API는 100%, 일반 요청은 10%. 비용을 제어하면서 중요한 요청은 모두 추적합니다.
Q31. CloudTrail Lake를 기존 CloudTrail S3 로그 저장 방식과 비교했을 때의 주요 이점은?
A) 비용이 더 저렴하다 B) SQL 쿼리로 이벤트를 즉시 분석하고 7년간 보존하며 구조화된 쿼리가 가능하다 C) 더 많은 이벤트를 수집한다 D) 실시간 알림이 가능하다
정답: B
해설: CloudTrail Lake는 CloudTrail 이벤트를 완전 관리형 데이터 레이크에 저장하고 SQL로 직접 쿼리할 수 있습니다. 기존 방식(S3 + Athena)보다 설정이 간단하며, 이벤트 데이터 스토어를 생성하면 최대 7년간 보존이 가능합니다. 보안 조사, 컴플라이언스 감사에 유용합니다.
Q32. EventBridge(CloudWatch Events) 규칙에서 CodePipeline 실패 이벤트를 캡처하는 이벤트 패턴은?
A) source가 aws.codepipeline이고, detail-type이 CodePipeline Pipeline Execution State Change이며, detail.state가 FAILED인 EventBridge 패턴 B) resource가 codepipeline이고 action이 FAILED인 잘못된 축약 패턴 C) service가 CodePipeline이고 status가 FAILED인 비표준 패턴 D) type이 pipeline-failure인 비표준 패턴
정답: A
해설: EventBridge 이벤트 패턴은 source(이벤트 소스), detail-type(이벤트 유형), detail(상세 내용)로 구성됩니다. CodePipeline 이벤트는 "aws.codepipeline"에서 발생하며 "CodePipeline Pipeline Execution State Change" 유형입니다. detail의 state 필드로 STARTED, SUCCEEDED, RESUMED, FAILED, CANCELED, SUPERSEDED를 필터링할 수 있습니다. 이벤트를 SNS로 전송하거나 Lambda를 트리거할 수 있습니다.
Q33. Container Insights를 ECS 또는 EKS에서 활성화하면 수집되는 메트릭은?
A) 애플리케이션 비즈니스 메트릭 B) CPU, 메모리, 네트워크, 디스크 등 컨테이너 수준의 인프라 메트릭 C) 데이터베이스 쿼리 성능 D) IAM 정책 변경 사항
정답: B
해설: CloudWatch Container Insights는 컨테이너 환경에서 CPU, 메모리 사용률, 네트워크 I/O, 디스크 I/O 등의 메트릭을 클러스터, 서비스, 태스크, 컨테이너 수준에서 수집합니다. ECS와 EKS 모두 지원합니다. EKS에서는 CloudWatch Agent DaemonSet을 설치해야 합니다. 컨테이너 환경의 성능 이상을 감지하는 데 유용합니다.
Q34. AWS X-Ray 그룹(Groups)을 사용하는 이유는?
A) 사용자를 그룹으로 관리하기 위해 B) 필터 표현식을 기반으로 트레이스를 필터링하고 그룹별로 CloudWatch 메트릭을 생성하기 위해 C) IAM 권한을 그룹화하기 위해 D) Lambda 함수를 그룹화하기 위해
정답: B
해설: X-Ray 그룹은 필터 표현식(예: service("payment-service") AND responsetime > 2)을 정의하여 특정 서비스나 조건에 맞는 트레이스를 필터링합니다. 각 그룹에 대해 별도의 CloudWatch 메트릭을 생성할 수 있어, 그룹별 오류율과 레이턴시를 모니터링하고 알람을 설정할 수 있습니다.
Q35. CloudWatch 이상 탐지(Anomaly Detection)를 사용하는 시나리오는?
A) 항상 동일한 임계값을 유지해야 하는 경우 B) 계절성이나 트렌드가 있는 메트릭에서 비정상적인 패턴을 자동으로 감지해야 하는 경우 C) 메트릭 비용을 절감하는 경우 D) 로그 분석에 사용하는 경우
정답: B
해설: CloudWatch 이상 탐지는 기계 학습으로 메트릭의 정상 범위(예측 밴드)를 학습합니다. 계절적 패턴(주말 트래픽 감소, 업무 시간 피크 등)을 자동으로 고려합니다. 고정된 임계값 설정이 어려운 메트릭에 적합합니다. 이상 탐지 알람은 예측 범위를 벗어나면 트리거됩니다.
Domain 5: 인시던트 및 이벤트 응답
Q36. Auto Scaling 그룹의 대상 추적(Target Tracking) 스케일링 정책에서 CPU 사용률 70%를 유지하도록 설정했습니다. 실제 CPU 사용률이 90%가 되면 무슨 일이 발생합니까?
A) 아무것도 발생하지 않는다 B) Auto Scaling이 목표 70%를 유지하기 위해 인스턴스를 자동으로 추가한다 C) 인스턴스가 자동으로 제거된다 D) CPU 알람이 발생한다
정답: B
해설: 대상 추적 스케일링 정책은 지정한 메트릭(여기서는 CPUUtilization)을 목표값(70%)에 가깝게 유지하도록 자동으로 인스턴스를 추가하거나 제거합니다. CPU 사용률이 70%를 초과하면 스케일 아웃(인스턴스 추가)하고, 70% 미만이면 스케일 인(인스턴스 제거)합니다. 사용자가 스케일링 조건을 직접 정의할 필요가 없습니다.
Q37. AWS Systems Manager Incident Manager를 사용하는 목적은?
A) 코드 배포를 자동화하기 위해 B) 인시던트 대응을 자동화하고, 대응 계획을 실행하며, 이해관계자에게 알림을 보내기 위해 C) 비용을 모니터링하기 위해 D) 보안 취약점을 스캔하기 위해
정답: B
해설: AWS Systems Manager Incident Manager는 IT 인시던트 관리를 위한 서비스입니다. 인시던트 발생 시 자동으로 대응 계획(Response Plan)을 실행하고, 담당자에게 PagerDuty, Slack, SNS로 알림을 보내며, 런북(Runbook)을 자동 실행합니다. 인시던트 타임라인을 추적하고 사후 분석(Post-mortem)을 지원합니다.
Q38. CloudWatch 알람이 ALARM 상태가 되었을 때 EC2 인스턴스를 자동으로 재시작하려면?
A) Lambda 함수를 트리거한다 B) EC2 Auto Recovery 알람 액션을 사용한다 C) SSM Run Command로 재시작한다 D) EventBridge 규칙을 생성한다
정답: B
해설: CloudWatch 알람의 EC2 액션으로 Recover, Stop, Terminate, Reboot를 설정할 수 있습니다. StatusCheckFailed_System 메트릭에 Recover 액션을 연결하면 AWS 인프라 문제로 인한 인스턴스 실패 시 동일한 인스턴스 ID, EIP, EBS 볼륨으로 자동 복구합니다. Reboot 액션은 StatusCheckFailed 메트릭에 연결하여 소프트 재부팅을 수행합니다.
Q39. EventBridge Pipes를 사용하는 주요 목적은?
A) Lambda 함수를 배포하기 위해 B) 이벤트 생산자(SQS, Kinesis, DynamoDB Streams 등)와 소비자(Lambda, Step Functions, SNS 등)를 필터링 및 변환과 함께 연결하기 위해 C) 비용을 최적화하기 위해 D) 데이터베이스를 연결하기 위해
정답: B
해설: EventBridge Pipes는 이벤트 소스(SQS, Kinesis, DynamoDB Streams, MSK, MQ)와 대상(Lambda, Step Functions, SNS, SQS, API Gateway, EventBridge 버스)을 직접 연결하는 포인트 투 포인트 통합입니다. 중간에 필터링과 변환(EventBridge Transformer 또는 Lambda Enrichment)을 적용할 수 있어 글루 코드를 줄일 수 있습니다.
Q40. AWS Auto Scaling 예측 스케일링(Predictive Scaling)이 반응형 스케일링보다 유리한 상황은?
A) 불규칙한 트래픽 패턴이 있는 경우 B) 주기적이고 예측 가능한 트래픽 패턴(업무 시간 증가, 야간 감소 등)이 있는 경우 C) 트래픽이 항상 동일한 경우 D) 단일 인스턴스를 사용하는 경우
정답: B
해설: 예측 스케일링은 과거 CloudWatch 데이터를 기계 학습으로 분석하여 미래 트래픽을 예측하고 미리 인스턴스를 준비합니다. 트래픽 급증 전에 이미 스케일 아웃이 완료되므로 콜드 스타트 문제를 방지합니다. 반응형 스케일링(Target Tracking, Step)은 트래픽 급증 후 반응하므로 일시적인 성능 저하가 발생할 수 있습니다. 주기적인 패턴(9시 출근 트래픽, 주말 증가 등)에 매우 효과적입니다.
Q41. GuardDuty 발견 사항(Finding)을 EventBridge로 처리하여 자동으로 침해된 EC2 인스턴스를 격리하는 자동화 아키텍처는?
A) GuardDuty → SNS → 이메일 알림 B) GuardDuty → EventBridge → Lambda → 보안 그룹 변경(인바운드/아웃바운드 차단) C) GuardDuty → CloudTrail → S3 D) GuardDuty → CloudWatch → 대시보드
정답: B
해설: GuardDuty 발견 사항은 EventBridge 이벤트로 자동 발행됩니다. EventBridge 규칙으로 특정 발견 사항 유형(예: UnauthorizedAccess:EC2/SSHBruteForce)을 필터링하고 Lambda 함수를 트리거합니다. Lambda는 해당 EC2 인스턴스의 보안 그룹을 격리 보안 그룹으로 교체하거나, 인스턴스를 중지하거나, WAF 규칙을 추가하는 등 자동 수정 작업을 수행합니다.
Q42. AWS Step Functions를 사용하여 복잡한 운영 자동화 워크플로우를 구현하는 이점은?
A) Lambda 함수보다 비용이 저렴하다 B) 상태 관리, 오류 처리, 재시도 로직, 병렬 실행을 시각적으로 관리할 수 있다 C) 더 빠른 실행 속도를 제공한다 D) 서버리스가 아닌 경우에만 사용한다
정답: B
해설: Step Functions는 여러 AWS 서비스 호출을 상태 머신으로 조율합니다. 복잡한 워크플로우(조건 분기, 병렬 실행, 재시도, 대기)를 코드 없이 시각적으로 정의합니다. 오류 처리(Catch/Retry), 인간 승인 단계(활동 작업), 타임아웃 관리가 내장되어 있습니다. 최대 1년간 실행되는 장기 실행 워크플로우를 지원합니다.
Q43. CloudWatch 대시보드를 여러 계정과 리전에서 데이터를 통합하여 보려면 어떻게 설정합니까?
A) 각 계정에 별도의 대시보드를 만든다 B) CloudWatch 크로스 계정 관찰성(Cross-Account Observability)을 설정하여 모니터링 계정에서 소스 계정의 메트릭을 통합한다 C) S3에 메트릭을 내보내고 Athena로 쿼리한다 D) 타사 모니터링 도구를 사용한다
정답: B
해설: CloudWatch 크로스 계정 관찰성은 모니터링 계정(Monitoring Account)에서 여러 소스 계정(Source Accounts)의 메트릭, 로그, 트레이스를 통합하여 볼 수 있습니다. 소스 계정에서 모니터링 계정에 데이터 공유를 허용하도록 구성합니다. AWS Organizations와 통합하여 대규모 다중 계정 환경을 중앙에서 모니터링할 수 있습니다.
Q44. EC2 Auto Scaling에서 스케일 인 보호(Scale-in Protection)를 인스턴스에 설정하는 이유는?
A) 스케일 아웃을 방지하기 위해 B) 중요한 작업을 처리 중인 인스턴스가 스케일 인 정책에 의해 자동으로 종료되는 것을 방지하기 위해 C) 비용을 최적화하기 위해 D) 인스턴스 성능을 높이기 위해
정답: B
해설: 스케일 인 보호는 특정 인스턴스가 Auto Scaling의 스케일 인(인스턴스 감소) 작업에 의해 종료되는 것을 방지합니다. 예를 들어 SQS 메시지를 처리 중인 워커 인스턴스나 배치 작업 실행 중인 인스턴스에 설정합니다. 작업 완료 후 애플리케이션 코드에서 프로그래밍 방식으로 보호를 해제하면 다음 스케일 인 이벤트에서 정상 종료됩니다.
Domain 6: 보안 및 컴플라이언스
Q45. SCP(Service Control Policy)와 IAM 정책의 차이점으로 올바른 것은?
A) SCP는 개별 사용자에게 적용되고, IAM은 계정에 적용된다 B) SCP는 AWS Organizations의 계정/OU 수준에서 최대 권한을 제한하고, IAM은 실제 권한을 부여한다 C) SCP는 루트 사용자에게는 적용되지 않는다 D) IAM이 SCP보다 우선순위가 높다
정답: B
해설: SCP는 AWS Organizations에서 사용하는 정책으로 특정 서비스나 작업을 조직의 계정 또는 OU에서 사용하지 못하도록 최대 권한 경계를 설정합니다. SCP로 허용된 범위 내에서만 IAM 정책이 효과가 있습니다. SCP는 허용 목록(Allow list) 또는 거부 목록(Deny list) 방식으로 사용하며, 루트 사용자에게도 적용됩니다.
Q46. IAM 권한 경계(Permission Boundary)의 주요 사용 사례는?
A) 루트 계정의 권한을 제한한다 B) 개발자가 직접 IAM 역할을 생성할 수 있되, 그 역할의 최대 권한을 제한하여 권한 상승 공격을 방지한다 C) 크로스 계정 접근을 허용한다 D) 서비스 연결 역할을 관리한다
정답: B
해설: 권한 경계는 IAM 엔티티(사용자/역할)가 가질 수 있는 최대 권한을 제한합니다. 개발자에게 IAM 역할 생성 권한을 부여하되, 권한 경계를 설정하면 개발자가 자신의 권한보다 더 높은 권한을 가진 역할을 생성할 수 없습니다. 이를 통해 권한 상승(Privilege Escalation) 공격을 방지합니다.
Q47. AWS Security Hub를 사용하는 주요 이점은?
A) 비용 최적화 권장사항을 제공한다 B) 여러 AWS 보안 서비스(GuardDuty, Inspector, Macie 등)의 발견 사항을 중앙에서 집계하고 보안 기준에 대한 컴플라이언스를 평가한다 C) EC2 인스턴스의 성능을 모니터링한다 D) 네트워크 트래픽을 분석한다
정답: B
해설: Security Hub는 GuardDuty, Inspector, Macie, IAM Access Analyzer, Firewall Manager 등 여러 AWS 보안 서비스와 서드파티 파트너의 발견 사항을 단일 대시보드에서 집계합니다. CIS AWS Foundations, AWS Foundational Security Best Practices, PCI DSS 등 보안 기준에 대한 자동 컴플라이언스 점수를 제공합니다.
Q48. 멀티 계정 환경에서 모든 계정의 CloudTrail 로그를 중앙 S3 버킷에 통합하여 수집하는 방법은?
A) 각 계정에서 S3 복제 규칙을 설정한다 B) AWS Organizations의 조직 단위 트레일(Organization Trail)을 생성하여 모든 계정의 로그를 중앙 S3에 저장한다 C) CloudWatch Logs로 로그를 전송한다 D) Lambda 함수로 로그를 집계한다
정답: B
해설: AWS Organizations의 관리 계정에서 조직 단위 트레일을 생성하면 조직의 모든 계정에 자동으로 CloudTrail이 활성화되고 지정된 중앙 S3 버킷에 모든 로그가 저장됩니다. 개별 계정은 이 트레일을 비활성화하거나 수정할 수 없어 로그 무결성이 보장됩니다. 보안 감사 및 컴플라이언스에 필수적인 설정입니다.
Q49. Amazon Inspector를 EC2 인스턴스와 ECR 컨테이너 이미지에 사용하는 목적은?
A) 비용 최적화 권장사항을 제공한다 B) 소프트웨어 취약점(CVE), 네트워크 노출, 보안 모범 사례 위반을 자동으로 스캔한다 C) IAM 정책을 검토한다 D) 네트워크 구성을 분석한다
정답: B
해설: Amazon Inspector v2는 EC2 인스턴스, ECR 컨테이너 이미지, Lambda 함수의 소프트웨어 취약점(CVE)과 의도하지 않은 네트워크 노출을 지속적으로 자동 스캔합니다. SSM Agent가 설치된 EC2에 에이전트 없이 동작합니다. 발견 사항의 심각도를 기준으로 우선순위를 정하고 Security Hub와 통합됩니다.
Q50. AWS Macie를 S3 버킷에서 활성화하는 이유는?
A) S3 버킷의 비용을 최적화하기 위해 B) S3 버킷에서 개인 식별 정보(PII) 및 민감한 데이터를 자동으로 검색하고 보호하기 위해 C) S3 버킷의 성능을 향상시키기 위해 D) S3 버킷을 암호화하기 위해
정답: B
해설: Amazon Macie는 기계 학습을 사용하여 S3 버킷에서 PII(이름, 주소, 신용카드 번호, 사회보장번호 등), 자격증명, 개인 키 등 민감한 데이터를 자동으로 검색하고 분류합니다. 공개적으로 접근 가능한 버킷, 비암호화 버킷, 버킷 간 데이터 공유 등 보안 위험도 평가합니다. GDPR, HIPAA 컴플라이언스에 유용합니다.
추가 복합 시나리오 문제
Q51. 마이크로서비스 아키텍처에서 특정 서비스의 오류율이 급증할 때 자동으로 관련 팀에 알림을 보내고, 오류가 특정 임계값을 초과하면 이전 버전으로 자동 롤백하는 시스템을 구축하려면?
A) CloudWatch 알람 → SNS → 이메일, 그리고 별도의 Lambda로 롤백 B) CloudWatch 알람 → SNS(팀 알림) + CodeDeploy 자동 롤백 알람으로 연결 C) X-Ray → EventBridge → Step Functions으로 오류 모니터링 및 롤백 D) CloudTrail → Lambda → 롤백
정답: B
해설: CodeDeploy의 배포 그룹에 CloudWatch 알람을 연결하면 알람이 ALARM 상태가 될 때 자동으로 이전 버전으로 롤백합니다. 동시에 해당 CloudWatch 알람을 SNS 토픽에 연결하여 관련 팀에 이메일/Slack 알림을 보낼 수 있습니다. 이는 Blue/Green, Canary, Linear 배포 모두에서 동작합니다.
Q52. 글로벌 서비스에서 특정 리전의 장애 시 다른 리전으로 자동 트래픽 전환(Active-Passive 장애 조치)을 구현하려면?
A) CloudFront 오리진 장애 조치를 사용한다 B) Route 53 헬스 체크 + Failover 라우팅 정책 + ALB를 각 리전에 배포한다 C) Global Accelerator만 사용한다 D) EC2 인스턴스를 여러 리전에 복제한다
정답: B
해설: Active-Passive 장애 조치: (1) 각 리전에 ALB + EC2/ECS 배포, (2) Route 53에서 기본(Primary) 리전 ALB에 헬스 체크 연결, (3) Failover 라우팅 정책으로 Secondary 레코드 등록. 기본 헬스 체크 실패 시 Route 53이 자동으로 보조 리전으로 DNS를 전환합니다. TTL을 낮게 설정하여 전환 시간을 단축합니다.
Q53. 데이터베이스 마이그레이션 없이 새 버전의 애플리케이션을 배포하고 트래픽을 점진적으로 이동시키면서 DB 스키마도 변경해야 하는 경우의 전략은?
A) 전체 서비스를 내리고 DB를 마이그레이션한 후 새 버전을 배포한다 B) 확장-수축 배포 패턴: DB를 하위 호환성 있게 확장 → 새 앱 버전 배포 → 이전 앱 종료 → DB 정리 C) Blue/Green 배포로 완전히 다른 DB를 사용한다 D) 스키마 변경 없이 새 버전을 배포한다
정답: B
해설: 확장-수축(Expand-Contract) 패턴은 제로 다운타임 스키마 마이그레이션의 표준 접근법입니다: (1) DB 확장 - 새 컬럼/테이블을 추가하되 기존 것은 유지(하위 호환성), (2) 새 앱 버전 배포 - 새 스키마와 이전 스키마 모두 지원, (3) 이전 앱 버전 완전 종료, (4) DB 수축 - 더 이상 사용하지 않는 컬럼/테이블 제거. 각 단계 사이에 충분한 검증 시간을 가집니다.
Q54. AWS Well-Architected Tool에서 DevOps 관점에서 가장 중요한 기반 중 하나인 "운영 우수성 기반(Operational Excellence Pillar)"의 핵심 원칙은?
A) 비용 최소화 B) 운영을 코드로 수행하고, 소규모 변경을 자주 배포하며, 실패에 대비하고, 운영 절차를 지속적으로 개선한다 C) 최고의 성능 달성 D) 최대 보안 적용
정답: B
해설: 운영 우수성 기반의 주요 원칙: (1) 운영을 코드로 수행(IaC, 자동화), (2) 자주 반복적이고 작은 크기의 변경 수행, (3) 운영 절차를 지속적으로 개선, (4) 실패 예측(Chaos Engineering, 게임 데이), (5) 운영 이벤트와 실패로부터 학습. DevOps 문화와 실천의 기술적 구현을 강조합니다.
Q55. 다음 CloudFormation 템플릿의 Output을 다른 스택에서 어떻게 참조합니까?
Outputs:
VpcId:
Value: !Ref MyVPC
Export:
Name: !Sub '${AWS::StackName}-VpcId'
A) !Ref VpcId를 사용한다 B) !ImportValue 를 사용하여 내보낸 이름으로 참조한다 C) Fn::GetAtt으로 참조한다 D) Parameter로 전달한다
정답: B
해설: 한 CloudFormation 스택에서 내보낸(Export) 값을 다른 스택에서 !ImportValue 함수로 가져옵니다. 예: !ImportValue "NetworkStack-VpcId". 참조하는 스택이 존재하는 한 내보낸 값을 삭제하거나 변경할 수 없습니다. 스택 간 의존성을 만들 때 사용하는 방법입니다.
Q56. AWS CodeArtifact를 사용하는 주요 이점은?
A) 코드 빌드를 가속화한다 B) npm, Maven, PyPI 등 프라이빗 패키지 저장소를 제공하고 업스트림 공개 저장소와 통합한다 C) 코드 리뷰를 자동화한다 D) 배포 파이프라인을 단순화한다
정답: B
해설: AWS CodeArtifact는 npm, Maven, PyPI, NuGet, Gradle 등 다양한 패키지 형식을 지원하는 완전 관리형 아티팩트 저장소입니다. 조직 내 프라이빗 패키지를 호스팅하고, 업스트림 공개 저장소(npmjs.com, PyPI 등)와 통합하여 보안 검증된 외부 패키지를 캐싱합니다. IAM으로 접근 제어하고 VPC Endpoint를 지원합니다.
Q57. AWS Fault Injection Simulator(FIS)를 사용하는 목적은?
A) 보안 취약점을 발견하기 위해 B) 실제 장애 시나리오를 시뮬레이션하여 시스템의 복원력을 테스트하고 개선하기 위해(카오스 엔지니어링) C) 비용을 절감하기 위해 D) 성능을 최적화하기 위해
정답: B
해설: AWS Fault Injection Simulator는 카오스 엔지니어링 원칙을 적용하여 EC2 인스턴스 종료, 네트워크 레이턴시 주입, 패킷 손실, CPU 스트레스, SSM 에이전트 중지 등 다양한 장애를 시뮬레이션합니다. 실제 AWS 서비스에 제어된 실험을 실행하여 장애 시 시스템이 어떻게 동작하는지 파악하고 복원력을 개선합니다.
Q58. CloudFormation 스택에서 Outputs 섹션이 필요한 주요 이유는?
A) 스택 비용을 추적하기 위해 B) 다른 스택이나 외부 시스템이 참조할 값(예: VPC ID, RDS 엔드포인트)을 내보내기 위해 C) 스택 배포 결과를 기록하기 위해 D) 리소스 태그를 자동화하기 위해
정답: B
해설: Outputs 섹션은 스택 배포 후 생성된 리소스의 값(LoadBalancer DNS, RDS 엔드포인트, S3 버킷 이름 등)을 노출합니다. Export 기능으로 크로스 스택 참조를 가능하게 하며, AWS 콘솔/CLI에서 값을 조회하거나 CI/CD 파이프라인에서 다음 단계에 값을 전달할 때 사용합니다.
Q59. AWS Config 자동 수정(Automatic Remediation)을 설정할 때 주의해야 할 사항은?
A) 자동 수정은 모든 규칙에 무조건 적용해야 한다 B) 비준수 리소스에 자동으로 변경을 가하므로, 수정 액션이 의도치 않은 영향을 미치지 않는지 철저히 검토하고 제한된 권한으로 실행해야 한다 C) 자동 수정은 프로덕션에 사용하면 안 된다 D) 자동 수정은 실시간으로 동작하지 않는다
정답: B
해설: Config 자동 수정은 SSM Automation Runbook을 사용하여 비준수 리소스를 자동으로 수정합니다. 주의사항: (1) 수정 액션이 프로덕션에 미치는 영향을 철저히 테스트, (2) 최소 권한 원칙으로 수정 역할 구성, (3) 무한 루프 방지(수정 후 다시 비준수가 되는 경우), (4) 자동 수정보다 알림 후 수동 검토가 적절한 경우도 있음. 재시도 횟수와 간격도 신중하게 설정해야 합니다.
Q60. 다음 중 DevSecOps 파이프라인에서 보안 검사를 통합하는 올바른 순서는?
A) 배포 → 빌드 → 테스트 → 보안 스캔 B) SAST(정적 분석) → 빌드 → DAST(동적 분석) → 컨테이너 이미지 스캔 → 배포 C) 배포 후에만 보안을 검사한다 D) 보안은 별도의 팀에서 담당한다
정답: B
해설: DevSecOps 파이프라인의 보안 통합 순서: (1) SAST(Static Application Security Testing) - 소스 코드 정적 분석(CodeGuru, SonarQube), (2) 빌드 단계에서 의존성 취약점 스캔(OWASP Dependency Check), (3) 컨테이너 이미지 스캔(ECR Scanning, Trivy), (4) DAST(Dynamic Application Security Testing) - 실행 중인 애플리케이션 동적 분석, (5) 프로덕션 환경의 지속적 모니터링(Inspector, GuardDuty). 보안을 왼쪽으로 이동(Shift Left)하여 초기에 발견하는 것이 핵심입니다.
Q61. Lambda@Edge와 CloudFront Functions의 차이점으로 올바른 것은?
A) CloudFront Functions는 응답 본문을 수정할 수 있다 B) Lambda@Edge는 더 많은 컴퓨팅 성능, 더 긴 실행 시간을 지원하고 응답 본문 수정이 가능하며, CloudFront Functions는 매우 낮은 레이턴시와 높은 처리량의 간단한 로직에 적합하다 C) 두 기능은 동일하다 D) CloudFront Functions는 오리진 요청/응답을 처리한다
정답: B
해설: Lambda@Edge는 뷰어/오리진 요청/응답 모두 처리하며, 실행 시간 최대 30초(오리진), 128MB~10GB 메모리, Node.js/Python 지원, 응답 본문 수정 가능합니다. CloudFront Functions는 뷰어 요청/응답만 처리하며, 실행 시간 1ms 미만, 2MB 메모리, JavaScript만 지원하지만 초당 수백만 요청 처리 가능합니다. 간단한 HTTP 헤더 조작, URL 리다이렉트 등은 CloudFront Functions, 복잡한 로직은 Lambda@Edge를 사용합니다.
Q62. AWS Amplify의 주요 사용 사례는?
A) EC2 인스턴스 관리 B) 프론트엔드 웹/모바일 애플리케이션의 개발, 배포, 호스팅을 단순화하고 AWS 백엔드 서비스(Auth, API, Storage 등)와 통합 C) 마이크로서비스 배포 D) 데이터베이스 관리
정답: B
해설: AWS Amplify는 프론트엔드(React, Next.js, Vue, 모바일 등) 개발자를 위한 풀스택 플랫폼입니다. Amplify Hosting으로 Git 기반 CI/CD 배포, Amplify Studio로 시각적 UI 개발, Amplify CLI로 백엔드(Cognito, AppSync, DynamoDB, S3, Lambda) 프로비저닝을 지원합니다. 서버리스 백엔드를 빠르게 구축하는 데 적합합니다.
Q63. AWS Well-Architected Review를 정기적으로 수행하는 이유는?
A) AWS 비용을 자동으로 줄이기 위해 B) 아키텍처가 AWS 모범 사례(보안, 신뢰성, 성능, 비용, 운영, 지속 가능성)를 준수하는지 지속적으로 평가하고 개선하기 위해 C) 규정 준수 인증을 받기 위해 D) 새 AWS 서비스를 자동으로 채택하기 위해
정답: B
해설: AWS Well-Architected Framework는 6개 기반(운영 우수성, 보안, 신뢰성, 성능 효율성, 비용 최적화, 지속 가능성)에 따라 아키텍처를 평가합니다. AWS Well-Architected Tool(콘솔에서 무료 제공)로 자가 평가를 진행하고 고위험 문제(HRI)를 식별합니다. 분기별 또는 주요 변경 후 수행하는 것이 좋습니다.
Q64. AWS Organizations에서 서비스 제어 정책(SCP)을 사용하여 특정 리전 이외의 리소스 생성을 방지하는 방법은?
A) IAM 정책에 리전 조건을 추가한다 B) SCP에 Deny 정책으로 aws:RequestedRegion 조건 키를 사용하여 특정 리전만 허용한다 C) CloudFormation으로 리전을 제한한다 D) VPC 설정으로 리전을 제한한다
정답: B
해설: SCP에서 aws:RequestedRegion 조건 키를 사용하여 허용된 리전 외의 API 호출을 Deny합니다. 예: eu-west-1과 us-east-1만 허용하는 SCP를 OU에 적용하면 해당 OU의 모든 계정에서 다른 리전에 리소스를 생성할 수 없습니다. 단, 글로벌 서비스(IAM, STS, Route 53, CloudFront, WAF)는 리전 제한에서 제외해야 합니다.
Q65. 다중 가용 영역(Multi-AZ)에 배포된 RDS 인스턴스에서 장애 조치(Failover)가 발생하는 경우는?
A) 읽기 부하가 증가할 때 B) 기본 인스턴스의 가용 영역 또는 DB 인스턴스 실패, OS 패치, 수동 장애 조치 요청 C) 백업이 완료된 후 D) 성능이 저하될 때
정답: B
해설: RDS Multi-AZ 장애 조치 트리거: (1) 가용 영역 실패, (2) 기본 DB 인스턴스 실패, (3) OS 소프트웨어 패치(자동), (4) DB 인스턴스 유형 변경, (5) 수동 장애 조치(재시작 with failover). 장애 조치 시 DNS가 자동으로 스탠바이 인스턴스로 전환됩니다(보통 1~2분 소요). 애플리케이션은 DNS 엔드포인트만 사용하면 자동으로 새 인스턴스에 연결됩니다.
Q66. Amazon EKS에서 Horizontal Pod Autoscaler(HPA)와 Cluster Autoscaler를 함께 사용하는 이유는?
A) 비용을 줄이기 위해서만 B) HPA는 파드 수를 자동으로 조정하고 Cluster Autoscaler는 노드 수를 자동으로 조정하여 워크로드 변화에 완전히 적응하기 위해 C) 보안을 강화하기 위해 D) 네트워크 성능을 향상시키기 위해
정답: B
해설: HPA는 CPU/메모리 사용률 또는 커스텀 메트릭을 기반으로 파드(Pod) 복제본 수를 자동 조정합니다. Cluster Autoscaler는 파드를 스케줄링할 노드가 부족하면 EC2 인스턴스(노드)를 추가하고, 노드가 오래 비어있으면 제거합니다. 두 컴포넌트가 함께 작동하면 트래픽 증가 시 파드와 노드가 모두 자동으로 스케일 아웃됩니다.
Q67. AWS Config의 주기적 평가(Periodic Evaluation)와 변경 트리거(Change-triggered Evaluation)의 차이는?
A) 주기적 평가는 더 비용이 많이 든다 B) 변경 트리거는 리소스 변경 시 즉시 평가하고, 주기적 평가는 일정 주기(1/3/6/12/24시간)마다 모든 리소스를 평가한다 C) 주기적 평가가 더 정확하다 D) 두 방식은 동일하다
정답: B
해설: 변경 트리거는 Config 리소스 변경 이벤트가 발생할 때 즉시 규칙을 평가합니다. 리소스 구성이 변경되는 시점에 실시간으로 컴플라이언스를 확인하는 데 적합합니다. 주기적 평가는 변경 이벤트와 관계없이 일정 시간마다 모든 리소스를 일괄 평가합니다. 외부 요인(시간 기반 정책, 만료된 인증서 등)을 확인하는 데 적합합니다.
Q68. Amazon Kinesis Data Analytics를 사용하여 실시간 스트리밍 데이터에서 이상 패턴을 탐지하는 아키텍처는?
A) S3 → Batch 처리 → 알림 B) Kinesis Data Streams → Kinesis Data Analytics(SQL/Apache Flink) → 이상 감지 → Kinesis Firehose/Lambda C) DynamoDB → Lambda → SNS D) SQS → EC2 → CloudWatch
정답: B
해설: 실시간 이상 탐지 아키텍처: (1) 데이터 소스 → Kinesis Data Streams, (2) Kinesis Data Analytics(Studio/Apache Flink)로 실시간 SQL 또는 Java/Python 스트리밍 애플리케이션에서 이동 평균, 표준 편차 등으로 이상 패턴 탐지, (3) 이상 감지 시 Kinesis Firehose로 S3에 저장하거나 Lambda를 트리거하여 알림 발송. AWS는 RANDOM_CUT_FOREST 알고리즘도 기본 제공합니다.
Q69. CodePipeline에서 Amazon S3를 아티팩트 저장소로 사용할 때 고려해야 할 암호화 설정은?
A) 암호화는 선택 사항이다 B) 교차 계정 배포 시 AWS 관리형 키를 사용해야 한다 C) 교차 계정 배포 시 고객 관리형 KMS CMK를 사용해야 한다(AWS 관리형 키는 교차 계정 사용 불가) D) S3 버킷 기본 암호화로 충분하다
정답: C
해설: CodePipeline 아티팩트 암호화: 단일 계정 파이프라인에서는 AWS 관리형 키(aws/s3) 또는 고객 관리형 CMK를 사용할 수 있습니다. 교차 계정(Cross-Account) 배포에서는 반드시 고객 관리형 KMS CMK를 사용해야 합니다. AWS 관리형 키는 해당 계정에서만 사용 가능하기 때문입니다. 대상 계정의 역할에 CMK 사용 권한을 부여해야 합니다.
Q70. 애플리케이션 로그를 CloudWatch Logs에서 실시간으로 ElasticSearch(OpenSearch)로 전송하는 방법은?
A) CloudWatch Logs → S3 → OpenSearch B) CloudWatch Logs 구독 필터 → Lambda → OpenSearch 또는 Kinesis Firehose → OpenSearch C) CloudTrail → OpenSearch D) 직접 통합이 지원된다
정답: B
해설: CloudWatch Logs 구독 필터(Subscription Filter)를 사용하여 로그 이벤트를 실시간으로 Lambda 함수나 Kinesis Data Firehose로 전송할 수 있습니다. Lambda에서 직접 OpenSearch에 인덱싱하거나, Kinesis Firehose의 OpenSearch 직접 통합을 사용합니다. Firehose를 사용하면 버퍼링과 재시도가 자동으로 처리되어 더 안정적입니다.
Q71. AWS Service Catalog를 사용하는 주요 이점은?
A) AWS 서비스 비용을 분석한다 B) IT 거버넌스를 유지하면서 승인된 CloudFormation 템플릿 포트폴리오를 사용자가 셀프서비스로 배포할 수 있게 한다 C) 코드를 자동으로 검토한다 D) 네트워크 보안을 관리한다
정답: B
해설: AWS Service Catalog를 통해 조직의 IT 관리자는 승인된 AWS 리소스 구성(포트폴리오)을 정의하고, 개발자는 사전 승인된 제품을 셀프서비스로 배포합니다. CloudFormation 템플릿 기반으로 일관된 환경을 제공하며, 제품 버전 관리, 태그 강제 적용, 비용 할당이 가능합니다. 개발자가 규격 외 리소스를 임의로 생성하는 것을 방지합니다.
Q72. AWS CodeGuru Reviewer의 기능은?
A) 코드 빌드를 자동화한다 B) 기계 학습으로 코드 검토를 자동화하여 버그, 보안 취약점, AWS 모범 사례 위반을 감지한다 C) 코드를 자동으로 배포한다 D) 코드 성능을 프로파일링한다
정답: B
해설: CodeGuru Reviewer는 Java와 Python 코드를 기계 학습으로 분석하여 자원 누수, 동시성 문제, 보안 취약점(하드코딩된 자격증명, SQL 인젝션 등), AWS 모범 사례(API 사용, 스로틀링 처리 등)를 감지합니다. CodeCommit 또는 GitHub에 Pull Request 생성 시 자동으로 코드 리뷰를 실행합니다. CodeGuru Profiler는 런타임 성능 최적화를 지원합니다.
Q73. Amazon EventBridge Scheduler를 사용하는 시나리오는?
A) 이벤트 기반 아키텍처를 구현할 때 B) 정해진 일정(cron 표현식 또는 rate 표현식)에 따라 AWS API를 직접 호출하거나 Lambda, Step Functions 등을 트리거할 때 C) 실시간 스트리밍 처리에 사용할 때 D) 메시지 큐를 구현할 때
정답: B
해설: EventBridge Scheduler는 일정 기반으로 AWS 서비스의 API를 직접 호출하거나 타겟(Lambda, Step Functions, ECS 태스크, SageMaker 파이프라인 등)을 트리거합니다. CloudWatch Events의 cron/rate 규칙보다 더 많은 타겟을 지원하고 유연한 시간대 설정, 원타임 스케줄 설정 기능이 있습니다. 배치 작업, 보고서 생성, 정기 데이터 처리에 적합합니다.
Q74. 프로덕션 환경에서 IaC 변경 사항을 안전하게 적용하기 위한 GitOps 워크플로우의 핵심 원칙은?
A) 직접 프로덕션에 변경 사항을 적용한다 B) 모든 인프라 변경은 Git 저장소를 통해 Pull Request → 코드 리뷰 → 승인 → 자동 파이프라인으로 적용한다 C) 테스트 환경에서만 IaC를 사용한다 D) 수동으로 변경 후 문서화한다
정답: B
해설: GitOps 원칙: (1) 인프라의 원하는 상태를 Git에 선언적으로 정의, (2) 모든 변경은 PR을 통해 코드 리뷰와 승인, (3) 승인된 변경만 자동 파이프라인(Flux, ArgoCD, CodePipeline + CloudFormation)을 통해 배포, (4) 실제 상태와 원하는 상태의 차이 자동 감지 및 수정. 변경 추적성, 감사 로그, 롤백 용이성이 핵심 이점입니다.
Q75. 여러 개의 마이크로서비스를 AWS에 배포할 때 서비스 메시(Service Mesh)로 AWS App Mesh를 사용하는 이점은?
A) 마이크로서비스 개발 속도가 빨라진다 B) 서비스 간 통신을 가시화하고 트래픽 라우팅, 회로 차단(Circuit Breaking), 상호 TLS, 관찰성(X-Ray 통합)을 코드 변경 없이 제공한다 C) 비용이 절감된다 D) 데이터베이스 성능이 향상된다
정답: B
해설: AWS App Mesh는 Envoy 프록시 사이드카를 각 서비스에 배포하여 서비스 메시를 구현합니다. 코드 변경 없이: (1) 서비스 간 트래픽 라우팅(가중치 기반 Blue/Green, Canary), (2) 상호 TLS(mTLS)로 서비스 간 보안 통신, (3) X-Ray와 통합된 분산 추적, (4) Circuit Breaker, Retry, Timeout 정책 적용이 가능합니다. ECS, EKS, EC2 인스턴스 모두에서 사용 가능합니다.
합격 전략
- 복합 시나리오 이해: DOP-C02는 여러 서비스를 조합하는 복잡한 시나리오가 많음
- 실무 경험: 실제 DevOps 파이프라인 구축 경험이 합격의 핵심
- 운영 관점: "가장 운영 효율적", "가장 자동화된", "최소 다운타임" 키워드 집중
- 보안 통합: 모든 아키텍처에서 보안을 기본값으로 고려(Security by Default)
- 화이트페이퍼: DevOps on AWS, Blue/Green Deployments, Practicing CI/CD on AWS 필독
- 재시험 전략: 합격선 750점에 집중하되 각 도메인을 균형 있게 준비
AWS DevOps Engineer Professional (DOP-C02) Practice Exam: 75 Questions
AWS DevOps Engineer Professional (DOP-C02) Practice Exam: 75 Questions
This practice exam covers the key domains of the AWS DevOps Engineer Professional DOP-C02 exam including SDLC Automation, Configuration Management, Monitoring, and High Availability.
Question 1
A company uses AWS CodePipeline for CI/CD. They want to automatically roll back a deployment if error rates exceed 5% in the 10 minutes after deployment. What is the MOST automated solution?
A) Set up CloudWatch alarms and manually trigger rollback B) Use CodeDeploy with automatic rollback triggered by CloudWatch alarms C) Use CodePipeline approval actions to pause for monitoring D) Use AWS Lambda to monitor and manually invoke rollback
Answer
Answer: B
Explanation: CodeDeploy supports automatic rollback that can be triggered by CloudWatch alarms. You configure the deployment group to monitor specific CloudWatch alarms (like error rate) and automatically roll back if the alarm enters the ALARM state within a defined period. This is the most automated and native solution without requiring manual intervention or custom Lambda functions.
Question 2
A team uses AWS CodeBuild for their CI pipeline. They notice build times have increased significantly because dependencies are downloaded on every build. How can they reduce build times?
A) Increase CodeBuild compute type B) Use CodeBuild local caching or S3 caching for dependencies C) Use a larger EC2 instance for builds D) Run builds in parallel
Answer
Answer: B
Explanation: CodeBuild supports caching to store reusable build artifacts (like npm modules, Maven dependencies) between builds. Caches can be stored locally in the build environment or in S3. This significantly reduces build times by avoiding re-downloading unchanged dependencies. Increasing compute type (A) speeds up the build itself but not the download time. EC2 (C) is not how CodeBuild works. Parallel builds (D) don't reduce individual build time.
Question 3
A company needs to deploy a CloudFormation stack to 50 AWS accounts across 5 regions simultaneously. Which service simplifies this?
A) CloudFormation Nested Stacks B) AWS CloudFormation StackSets C) AWS CDK D) AWS Service Catalog
Answer
Answer: B
Explanation: AWS CloudFormation StackSets allow you to create, update, or delete CloudFormation stacks across multiple accounts and regions with a single operation. It's specifically designed for multi-account, multi-region deployments. Nested Stacks (A) organize stacks hierarchically but within one account. CDK (C) generates CloudFormation templates but doesn't manage cross-account deployment. Service Catalog (D) manages product portfolios.
Question 4
A company wants to enforce that all EC2 instances have a specific tag before they can be launched. How should they implement this?
A) Use IAM policies with tag-based conditions
B) Use AWS Config rules to remediate missing tags
C) Use AWS Service Control Policies (SCPs) to require tags
D) Use a combination of IAM policies with aws:RequestTag condition and tag policies in AWS Organizations
Answer
Answer: D
Explanation: The most comprehensive approach uses IAM policies with the aws:RequestTag condition key to deny resource creation without required tags, combined with AWS Organizations tag policies to standardize tag values. IAM policies alone (A) require tagging on creation but don't standardize values. Config rules (B) are detective, not preventive. SCPs (C) can deny actions but require careful configuration.
Question 5
A company's CodePipeline deploys to production using CodeDeploy. They want a deployment strategy that deploys to 25% of instances at a time, waits for health checks, then proceeds. Which CodeDeploy deployment configuration should they use?
A) CodeDeployDefault.AllAtOnce B) CodeDeployDefault.HalfAtATime C) CodeDeployDefault.OneAtATime D) Custom deployment configuration with 25% batch size
Answer
Answer: D
Explanation: CodeDeploy allows creating custom deployment configurations specifying the percentage or number of instances to deploy to at a time. A custom configuration with a 25% minimum healthy hosts value would deploy to 25% of instances at a time. HalfAtATime (B) deploys to 50% at a time. OneAtATime (C) deploys to one instance at a time. AllAtOnce (A) deploys to all instances simultaneously.
Question 6
A team wants to implement GitOps for their Kubernetes workloads on EKS. Which AWS service or combination provides this capability?
A) AWS CodePipeline with CodeDeploy B) AWS CodePipeline with Flux or ArgoCD C) AWS CodeCommit with Lambda D) AWS Elastic Beanstalk
Answer
Answer: B
Explanation: GitOps for Kubernetes uses tools like Flux or ArgoCD that continuously reconcile the desired state in Git with the actual state in Kubernetes. AWS CodePipeline can trigger these tools or they can work independently, continuously pulling from CodeCommit/GitHub. CodePipeline with CodeDeploy (A) is for traditional deployments. Lambda (C) is not a GitOps tool. Elastic Beanstalk (D) is for managed application deployments.
Question 7
A company needs to store sensitive configuration values used in CodeBuild build specs. The values should be encrypted and access-controlled. Where should they store these values?
A) In the CodeBuild environment variables (plaintext) B) In the buildspec.yml file in the repository C) In AWS Secrets Manager or SSM Parameter Store, referenced in the buildspec D) In an S3 bucket encrypted with SSE-S3
Answer
Answer: C
Explanation: AWS Secrets Manager or SSM Parameter Store SecureString parameters provide encrypted storage with IAM-based access control. CodeBuild can natively reference Secrets Manager secrets and SSM parameters in environment variables, retrieving them at build time. Storing plaintext in environment variables (A) exposes them in logs. Storing in the repository (B) is a security risk. S3 (D) requires additional code to retrieve and doesn't provide the same access control integration.
Question 8
A company uses AWS CodeArtifact to manage their npm packages. They want to ensure that CodeBuild uses CodeArtifact as the npm registry. What do they need to configure?
A) Set the npm registry URL in package.json B) Configure the npm registry using the CodeArtifact login command in the pre-build phase C) Create a VPC endpoint for CodeArtifact D) Use CodeBuild environment variables to set the registry
Answer
Answer: B
Explanation: AWS CodeArtifact provides a login command (aws codeartifact login --tool npm) that configures npm to use CodeArtifact as the registry and retrieves a temporary authorization token. This command should be run in the pre-build phase of the buildspec.yml. Simply setting the URL in package.json (A) doesn't handle authentication. VPC endpoints (C) are for network connectivity. Environment variables alone (D) don't configure the npm client.
Question 9
A company needs to implement a pipeline that can deploy infrastructure using CloudFormation with a manual approval stage before production deployment. They also need to notify the team via email when approval is needed. Which services should they combine?
A) CodePipeline + SNS + Manual Approval action B) CodePipeline + SQS + Lambda C) CodeCommit + CloudWatch Events + Email D) Systems Manager + SNS
Answer
Answer: A
Explanation: AWS CodePipeline natively supports Manual Approval actions. When the pipeline reaches the approval stage, it can send a notification via SNS (which can trigger email) and pauses until a reviewer approves or rejects. This is the native, purpose-built solution for pipeline approvals with notifications. SQS+Lambda (B) adds unnecessary complexity. The other options (C, D) don't provide native pipeline approval functionality.
Question 10
A company wants to ensure their AWS infrastructure always complies with their security policies. They need automatic remediation when drift is detected. Which service should they use?
A) AWS CloudTrail B) Amazon Inspector C) AWS Config with remediation actions D) AWS Security Hub
Answer
Answer: C
Explanation: AWS Config continuously monitors resource configurations and evaluates them against Config Rules. When rules are violated, Config can automatically trigger remediation actions (using Systems Manager Automation documents) to bring resources back into compliance. CloudTrail (A) logs API calls. Inspector (B) scans for vulnerabilities. Security Hub (D) aggregates findings but doesn't automatically remediate.
Question 11
A company runs a microservices application on ECS. They need to perform blue/green deployments with automatic rollback if the new version fails health checks. Which approach is BEST?
A) ECS with CodeDeploy blue/green deployment type B) CloudFormation with rolling updates C) ECS rolling update deployment D) Manual update with ECS task definition revision
Answer
Answer: A
Explanation: ECS integrates with CodeDeploy to provide blue/green deployments. CodeDeploy shifts traffic from the old (blue) to the new (green) task set gradually, monitors health checks, and automatically rolls back if health checks fail. CloudFormation rolling updates (B) are for EC2 Auto Scaling. ECS rolling updates (C) are less sophisticated and harder to roll back. Manual updates (D) are error-prone.
Question 12
A DevOps team needs to manage configuration of hundreds of EC2 instances including software installation and configuration changes. They want a fully managed solution that doesn't require agents. Which service is BEST?
A) Ansible on a control node B) AWS Systems Manager Run Command and State Manager C) AWS OpsWorks Chef/Puppet D) Custom scripts via EC2 user data
Answer
Answer: B
Explanation: AWS Systems Manager Run Command allows running commands across multiple EC2 instances without needing SSH access or managing an Ansible control node. State Manager provides desired state configuration to maintain instance configurations. The SSM Agent is pre-installed on Amazon Linux/Windows AMIs. Ansible (A) requires managing a control node. OpsWorks (C) requires Chef/Puppet expertise. EC2 user data (D) only runs at instance launch.
Question 13
A company's CodePipeline pipeline fails because a CloudFormation stack deployment fails. They want to investigate why the stack failed without losing the failed state. What should they do?
A) Check CloudTrail logs for the API calls B) Check the CloudFormation stack events in the console or CLI C) Re-run the pipeline and add debug logging D) Check CodeBuild logs
Answer
Answer: B
Explanation: CloudFormation stack events provide a detailed timeline of what happened during stack creation/update, including which resource failed, why it failed, and the error message. The stack remains in a failed state (ROLLBACK_COMPLETE or UPDATE_ROLLBACK_COMPLETE) until you take action, preserving the failure information. CloudTrail (A) shows the API calls but not resource-level failures. CodeBuild logs (D) are for build stage failures.
Question 14
A company needs to implement continuous compliance monitoring for their AWS resources. They want to be notified immediately when a resource violates a compliance policy. What should they set up?
A) CloudTrail with EventBridge rules B) AWS Config rules with SNS notifications C) Amazon Inspector with SNS D) AWS Security Hub with EventBridge
Answer
Answer: B
Explanation: AWS Config rules continuously evaluate resource configurations. Config can be configured to send notifications via SNS when the compliance status changes (e.g., from COMPLIANT to NON_COMPLIANT). This provides real-time notifications when policies are violated. CloudTrail with EventBridge (A) detects API calls, not configuration compliance. Inspector (C) is for vulnerability scanning. Security Hub (D) aggregates findings from multiple services.
Question 15
A company wants to implement Infrastructure as Code using AWS CDK. They want to reuse infrastructure components across multiple applications. How should they structure their CDK code?
A) Copy and paste CloudFormation templates B) Create CDK Constructs and publish them as libraries C) Use CDK Aspects for reuse D) Use CloudFormation nested stacks
Answer
Answer: B
Explanation: AWS CDK Constructs are reusable infrastructure components that can be packaged as libraries and shared via npm, PyPI, or Maven. Teams can create their own construct libraries that encapsulate best practices (e.g., a secure S3 bucket construct with encryption and versioning enabled). CDK Aspects (C) are for traversing and modifying CDK trees (like applying tags). CloudFormation templates (A, D) are not CDK.
Question 16
A company's Lambda function is deployed via CodePipeline. After deploying a new version, they want 10% of traffic to go to the new version, and increase it by 10% every 5 minutes if no errors occur. Which CodeDeploy deployment type should they use?
A) Linear10PercentEvery10Minutes B) Canary10Percent5Minutes C) AllAtOnce D) Linear10PercentEvery1Minute
Answer
Answer: B
Explanation: CodeDeploy for Lambda supports canary deployments. Canary10Percent5Minutes shifts 10% of traffic to the new Lambda version, waits 5 minutes, and if no CloudWatch alarms are triggered, shifts the remaining 90%. This matches the requirement. Linear deployments (A, D) shift traffic gradually in equal increments. AllAtOnce (C) shifts all traffic immediately.
Question 17
A company uses AWS CodeCommit. They want to enforce code review - no direct commits to the main branch, all changes must go through pull requests reviewed by at least 2 people. How do they enforce this?
A) Use IAM policies to deny codecommit:GitPush to main branch
B) Use CodeCommit approval rule templates
C) Use branch protection rules in CodeCommit
D) Both A and B
Answer
Answer: D
Explanation: Enforcing pull requests in CodeCommit requires two components: (1) IAM policies that deny direct push to the main branch for regular developers, and (2) CodeCommit approval rule templates that require a minimum number of approvals on pull requests before they can be merged. Approval rule templates alone don't prevent direct pushes. IAM policies alone don't enforce the approval count on PRs.
Question 18
A company wants to monitor the performance of their application and automatically scale based on custom metrics (like queue depth). Which combination of AWS services achieves this?
A) CloudWatch custom metrics + Application Auto Scaling + target tracking scaling policy B) X-Ray + EC2 Auto Scaling C) CloudWatch Logs + Lambda + DynamoDB D) EventBridge + Step Functions
Answer
Answer: A
Explanation: Publishing custom metrics to CloudWatch, then using Application Auto Scaling with target tracking scaling policies allows automatic scaling of various resources (ECS tasks, DynamoDB capacity, etc.) based on custom metrics like queue depth. This is the native AWS solution for custom metric-based scaling. X-Ray (B) is for distributed tracing. Lambda+DynamoDB (C) doesn't provide auto-scaling. EventBridge+Step Functions (D) is for event orchestration.
Question 19
A team needs to ensure that any changes to their production environment are tracked and can be audited. They use CloudFormation. What feature provides a history of all changes to their stacks?
A) CloudTrail API logging B) CloudFormation change sets C) CloudFormation drift detection D) AWS Config CloudFormation stack tracking
Answer
Answer: D
Explanation: AWS Config records the configuration history of CloudFormation stacks as a resource type. It tracks all changes to stack configurations over time, providing an audit trail. CloudTrail (A) logs the API calls but not the full stack configuration at each point. Change sets (B) show what will change before applying. Drift detection (C) shows the current difference between the template and actual resources.
Question 20
A company needs to deploy their application across multiple environments (dev, staging, prod) using separate AWS accounts. They want a single pipeline that promotes artifacts through environments. How should they design this?
A) Create three separate pipelines, one per environment B) Create one pipeline that cross-account deploys using IAM roles C) Use Elastic Beanstalk for multi-environment management D) Use AWS Organizations with separate CodePipeline in each account
Answer
Answer: B
Explanation: A single CodePipeline can deploy across multiple AWS accounts by assuming cross-account IAM roles. The pipeline in the tooling account uses roles in the target accounts (dev, staging, prod) to deploy. This provides a single source of truth for the pipeline while maintaining account isolation. Separate pipelines (A) duplicate configuration and make synchronization difficult. Elastic Beanstalk (C) doesn't address multi-account deployment. Separate pipelines in each account (D) are hard to maintain.
Question 21
A company needs to implement a self-healing mechanism for their EC2-based application. If an instance fails health checks, it should be automatically replaced. What should they implement?
A) CloudWatch alarms with SNS notifications B) EC2 Auto Scaling Group with ELB health checks C) AWS Lambda to monitor and restart instances D) AWS Systems Manager maintenance windows
Answer
Answer: B
Explanation: EC2 Auto Scaling Groups with ELB health checks automatically terminate and replace instances that fail health checks. This is the native self-healing mechanism for EC2. CloudWatch alarms with SNS (A) notify but don't automatically replace. Lambda (C) can monitor but adds custom complexity. Maintenance windows (D) are for scheduled maintenance, not self-healing.
Question 22
A company wants to detect and alert on unauthorized API calls in their AWS account. Which combination of services provides this capability?
A) VPC Flow Logs + CloudWatch B) AWS CloudTrail + Amazon EventBridge + SNS C) AWS Config + SNS D) Amazon GuardDuty + Security Hub
Answer
Answer: B
Explanation: AWS CloudTrail records all API calls. EventBridge can create rules that match specific CloudTrail events (like unauthorized API calls, root account usage, security group changes) and trigger SNS notifications. This is the standard pattern for API-level alerting. VPC Flow Logs (A) capture network traffic. Config (C) monitors resource configurations. GuardDuty (D) provides ML-based threat detection but uses a different model.
Question 23
A company's build pipeline needs to build Docker images and push them to Amazon ECR. What permissions does the CodeBuild service role need?
A) AmazonEC2ContainerRegistryFullAccess
B) AmazonEC2ContainerRegistryPowerUser
C) Custom policy allowing ecr:GetAuthorizationToken and relevant push permissions
D) AmazonECS-FullAccess
Answer
Answer: C
Explanation: Following least privilege, the CodeBuild service role needs specific ECR permissions: ecr:GetAuthorizationToken (for Docker login), ecr:BatchCheckLayerAvailability, ecr:PutImage, ecr:InitiateLayerUpload, ecr:UploadLayerPart, ecr:CompleteLayerUpload. AmazonEC2ContainerRegistryPowerUser (B) includes all needed permissions but also more than needed. FullAccess (A) includes delete permissions. AmazonECS-FullAccess (D) is for ECS management.
Question 24
A company uses CloudFormation to manage their infrastructure. They want to prevent accidental deletion of production databases. How can they implement this?
A) Use CloudFormation Retention policies on the database resource
B) Set the DeletionPolicy attribute to Retain on the RDS resource
C) Use IAM policies to deny cloudformation:DeleteStack
D) Use CloudFormation termination protection
Answer
Answer: B
Explanation: Setting DeletionPolicy: Retain on a CloudFormation resource (like an RDS instance) means that when the stack is deleted, the resource is retained (not deleted). This prevents accidental database deletion through CloudFormation stack operations. Termination protection (D) prevents the entire stack from being deleted but the question asks specifically about the database resource. Retention policies (A) are for specific behaviors. IAM policies (C) prevent all stack deletions.
Question 25
A company uses CodePipeline and wants to run integration tests after deployment to staging. The tests run in an external testing framework. How should they integrate this into the pipeline?
A) Use a CodeBuild stage to run the tests B) Use a Lambda invoke action to trigger the external framework C) Use a Jenkins action in CodePipeline D) Use a manual approval step after deployment
Answer
Answer: A
Explanation: A CodeBuild stage in CodePipeline can be used to run integration tests. The buildspec.yml in the test phase can invoke external testing frameworks, run test scripts, and report results. If tests fail, the CodeBuild stage fails and the pipeline stops. This is the most integrated approach within AWS. Lambda invocations (B) are for simple event-driven tasks. Jenkins (C) requires managing Jenkins infrastructure. Manual approval (D) is not automated.
Question 26
A company needs to manage thousands of EC2 instances and wants to run patching operations at scale without SSH access. Which service and approach should they use?
A) AWS Systems Manager Patch Manager with maintenance windows B) EC2 user data scripts for patching C) Ansible Tower for automated patching D) AWS OpsWorks with Chef recipes
Answer
Answer: A
Explanation: AWS Systems Manager Patch Manager can automatically patch EC2 instances based on patch baselines and patch groups. Maintenance windows schedule patching operations. The SSM Agent on instances receives patch instructions without needing SSH. Compliance reports show patching status. EC2 user data (B) only runs at launch. Ansible Tower (C) requires managing infrastructure. OpsWorks (D) requires Chef expertise.
Question 27
A company wants to implement canary testing for their application. They deploy to a small subset of users and monitor metrics before full rollout. What combination enables automatic rollback?
A) Route 53 weighted routing + CloudWatch + manual process B) AWS CodeDeploy canary deployment + CloudWatch alarms C) ALB weighted target groups + CloudWatch + Lambda D) CloudFront functions + CloudWatch
Answer
Answer: B
Explanation: AWS CodeDeploy canary deployments shift a percentage of traffic to the new version and monitor CloudWatch alarms. If alarms are triggered during the baking period, CodeDeploy automatically rolls back to the previous version. This provides fully automated canary deployment with rollback. Route 53 weighted routing (A) requires manual rollback. ALB weighted target groups (C) require custom automation. CloudFront functions (D) are for edge request manipulation.
Question 28
A team needs to ensure that their CodeBuild builds run in an isolated environment with no internet access. They need to access private repositories and ECR. What should they configure?
A) CodeBuild within a VPC with no internet access, using VPC endpoints for AWS services B) CodeBuild with security groups blocking outbound traffic C) CodeBuild with a NAT gateway that has restrictive egress rules D) Use private CodeBuild environments
Answer
Answer: A
Explanation: Running CodeBuild inside a VPC without a NAT gateway provides no internet access. VPC endpoints for CodeCommit, ECR, S3, and other AWS services allow the build to access private repositories and ECR through the AWS private network. Security groups (B) blocking all outbound would also block AWS service access. NAT gateway with restrictions (C) still provides internet access. There are no "private CodeBuild environments" (D).
Question 29
A company's application uses feature flags stored in SSM Parameter Store. They need to reload feature flags without restarting their application. Which approach is BEST?
A) Restart the application on SSM parameter changes B) Use AWS AppConfig with dynamic configuration delivery C) Poll SSM Parameter Store periodically from the application D) Use DynamoDB to store feature flags
Answer
Answer: B
Explanation: AWS AppConfig is designed specifically for dynamic configuration delivery to applications without restarts. It supports gradual rollouts of configuration changes, validation, and monitoring. Applications use the AppConfig Agent or SDK to receive configuration updates in real-time. Polling SSM periodically (C) works but is not as sophisticated as AppConfig. Restarting the application (A) causes downtime. DynamoDB (D) requires custom polling code.
Question 30
A company needs to implement log aggregation from multiple EC2 instances and Lambda functions for centralized analysis. Which service should they use?
A) Amazon S3 with Athena B) Amazon CloudWatch Logs with Log Insights C) Amazon Kinesis Data Streams D) ELK Stack on EC2
Answer
Answer: B
Explanation: Amazon CloudWatch Logs natively integrates with EC2 (via CloudWatch agent) and Lambda (automatic integration). CloudWatch Logs Insights provides powerful query capabilities for centralized log analysis. This is the most integrated AWS-native solution. S3 with Athena (A) works but requires exporting logs. Kinesis (C) is for streaming, not log storage/analysis. ELK on EC2 (D) requires managing infrastructure.
Question 31
A company uses AWS X-Ray for distributed tracing. They notice high latency in one service. How can they identify which downstream call is causing the latency?
A) Check CloudWatch metrics for the service B) Use the X-Ray Service Map and trace details to identify high-latency segments C) Enable enhanced monitoring on RDS D) Check EC2 instance CPU metrics
Answer
Answer: B
Explanation: AWS X-Ray Service Map provides a visual representation of the application components and their connections. Each segment and subsegment in a trace represents a unit of work, showing the time spent. By examining trace details, you can identify which specific downstream call (database, API, microservice) is causing high latency. CloudWatch metrics (A) provide aggregate data. Enhanced RDS monitoring (C) is for database internals. EC2 CPU metrics (D) don't show distributed call latency.
Question 32
A team needs to implement a GitFlow branching strategy with their CI/CD pipeline. Feature branches should trigger builds, pull requests should trigger integration tests, and merges to main should trigger production deployment. How should they configure CodePipeline?
A) Create one pipeline that triggers on all branch events B) Use CodePipeline for main branch deployment and CodeBuild triggers for feature branches via EventBridge rules C) Create separate pipelines for each branch D) Use a single Jenkins pipeline
Answer
Answer: B
Explanation: The best approach uses multiple mechanisms: (1) EventBridge rules that trigger CodeBuild projects for feature branch builds and PR checks when CodeCommit events occur, and (2) a CodePipeline that triggers only on the main branch for production deployment. Separate pipelines for each branch (C) are impractical at scale. A single pipeline on all branches (A) can lead to unintended deployments. Jenkins (D) requires managing infrastructure.
Question 33
A company needs to implement secrets rotation for an RDS database password. The rotation should happen automatically every 30 days without application downtime. Which service provides this capability?
A) AWS KMS key rotation B) AWS Secrets Manager with automatic rotation C) SSM Parameter Store with a Lambda rotator D) AWS Certificate Manager
Answer
Answer: B
Explanation: AWS Secrets Manager supports automatic rotation of database credentials. For RDS, it has built-in rotation Lambda functions that update the password in both Secrets Manager and the RDS instance. Applications retrieve the current secret from Secrets Manager, so rotation is transparent. KMS key rotation (A) is for encryption keys. SSM Parameter Store (C) can rotate with a custom Lambda but requires more custom code. ACM (D) is for SSL certificates.
Question 34
A company uses CodePipeline with CodeBuild. Their builds access resources in a private VPC. CodeBuild builds are failing with network timeout errors when trying to access external npm packages during builds. What is the issue and solution?
A) Add an internet gateway to the CodeBuild VPC B) Ensure the CodeBuild VPC has a NAT gateway and that the CodeBuild subnet routes through it C) Use CodeBuild outside the VPC D) Add an elastic IP to the CodeBuild instance
Answer
Answer: B
Explanation: When CodeBuild runs inside a VPC, it loses its default internet access. To access external internet resources (like npm packages), the VPC needs a NAT gateway in a public subnet, and the CodeBuild subnet's route table must route internet-bound traffic through the NAT gateway. Using CodeArtifact (proxy for npm) would also resolve this. Adding an internet gateway (A) alone doesn't route traffic from private subnets. Moving outside VPC (C) loses access to private resources.
Question 35
A company needs to implement chaos engineering to test their application's resilience. They want to inject failures into AWS services in a controlled way. Which AWS service supports this?
A) AWS Systems Manager Automation B) AWS Fault Injection Simulator (FIS) C) AWS CloudFormation drift detection D) Amazon DevOps Guru
Answer
Answer: B
Explanation: AWS Fault Injection Simulator (FIS) is a managed chaos engineering service that allows you to run controlled experiments by injecting faults into AWS infrastructure (like terminating EC2 instances, adding network latency, causing CPU stress, throttling API calls). Systems Manager Automation (A) runs operational tasks. CloudFormation drift detection (C) finds configuration drift. DevOps Guru (D) uses ML to detect operational anomalies.
Question 36
A company wants to implement an automated security scanning step in their CI/CD pipeline that checks for known vulnerabilities in their container images before deployment. Which service should they integrate?
A) Amazon Inspector with ECR integration B) AWS WAF C) Amazon GuardDuty D) AWS Security Hub
Answer
Answer: A
Explanation: Amazon Inspector integrates with Amazon ECR to automatically scan container images for software vulnerabilities (CVEs). When a new image is pushed to ECR, Inspector scans it and reports findings. The pipeline can check Inspector findings via an API call or EventBridge notification and fail the build if critical vulnerabilities are found. WAF (B) is for web app protection. GuardDuty (C) is for threat detection. Security Hub (D) aggregates findings.
Question 37
A company has a microservices application where different teams own different services. They want each team to be able to deploy their service independently without impacting other services. What deployment strategy supports this?
A) Deploy all services together in one pipeline B) Independent deployment pipelines per service with contract testing C) Use feature flags to control rollouts D) Manual deployments with change management
Answer
Answer: B
Explanation: Independent deployment pipelines per service, combined with contract testing (to ensure services still communicate correctly), enables teams to deploy independently without coordination. Contract tests verify that the service interfaces remain compatible. Deploying all together (A) creates tight coupling. Feature flags (C) control feature visibility but don't enable independent deployment pipelines. Manual deployments (D) eliminate the CI/CD benefit.
Question 38
A company needs to ensure that their CloudFormation templates always use the latest approved AMI IDs. They store approved AMI IDs in SSM Parameter Store. How can they reference the latest AMI in CloudFormation?
A) Hard-code the AMI ID in the template and update manually
B) Use AWS::SSM::Parameter resource to look up the AMI ID at deploy time
C) Use the resolve:ssm:/path/to/ami dynamic reference in the CloudFormation template
D) Use a Lambda-backed custom resource to retrieve the AMI
Answer
Answer: C
Explanation: CloudFormation dynamic references allow you to reference SSM Parameter Store values directly in templates using the syntax {{resolve:ssm:/path/to/parameter}}. When the stack is deployed or updated, CloudFormation retrieves the current value from SSM. This ensures the latest approved AMI is always used. AWS::SSM::Parameter (B) is for creating SSM parameters, not retrieving them. Lambda custom resources (D) add complexity. Hard-coding (A) requires manual updates.
Question 39
A DevOps team needs to implement progressive delivery with feature flags. They want to gradually expose a new feature to users based on user attributes. Which service is BEST suited for this?
A) Route 53 weighted routing B) AWS AppConfig with feature flag configuration C) ALB listener rules based on headers D) CloudFront Lambda@Edge
Answer
Answer: B
Explanation: AWS AppConfig supports feature flag configurations that can be deployed gradually using deployment strategies. Applications can evaluate feature flags at runtime to enable features for specific users or percentages. Route 53 weighted routing (A) routes at DNS level, not per-user. ALB rules (C) route based on request attributes but don't provide the feature flag management interface. Lambda@Edge (D) can implement feature flags but requires custom code.
Question 40
A company runs CodePipeline for their deployment. They want to receive a Slack notification when the pipeline fails. What is the MOST efficient solution?
A) Poll the CodePipeline API every minute from a Lambda function B) Create an EventBridge rule for CodePipeline state changes that triggers a Lambda function sending to Slack C) Use CloudWatch metrics alarms for pipeline failures D) Use SNS with email subscription and forward to Slack manually
Answer
Answer: B
Explanation: EventBridge (formerly CloudWatch Events) emits events for CodePipeline stage and pipeline state changes. An EventBridge rule can filter for FAILED state changes and trigger a Lambda function that sends a message to Slack (using the Slack webhook API). This is event-driven, efficient, and requires no polling. Polling (A) is inefficient. CloudWatch alarms (C) don't directly monitor pipeline state. SNS with manual Slack forwarding (D) is not automated.
Question 41
A company uses CloudFormation nested stacks. The parent stack update fails because a nested stack update failed. How do they identify which nested stack failed and why?
A) Check the parent stack events B) Check the Events tab for each nested stack individually C) Check the parent stack Events - it references the failed nested stack; then check that nested stack's events D) Check CloudTrail logs
Answer
Answer: C
Explanation: When a nested stack fails, the parent stack events show a failure referencing the nested stack (e.g., "Embedded stack failed to reach COMPLETE state"). By clicking on the nested stack name in the events or navigating to it directly, you can see its events which show the specific resource that failed and the error message. Checking parent stack events (A) gives a partial picture. Checking all nested stacks (B) is inefficient. CloudTrail (D) shows API calls, not stack-level resource failures.
Question 42
A company needs to implement a database migration as part of their CI/CD pipeline. The migration must be applied before deploying new application code. How should they structure this?
A) Include migration scripts in the application code and run at startup B) Add a dedicated migration step in the pipeline before the deployment step, using CodeBuild to run migrations C) Run migrations manually before each deployment D) Use RDS automated backup for migration management
Answer
Answer: B
Explanation: Adding a dedicated migration stage in CodePipeline before the deployment stage ensures migrations run first. A CodeBuild action can connect to the database and run migration scripts. If migrations fail, the pipeline stops and the new application code is not deployed, preventing version mismatches. Running at startup (A) can cause issues with multiple instances running simultaneously. Manual migrations (C) eliminate automation benefits. RDS backups (D) are for data recovery.
Question 43
A team wants to enforce that all CodeBuild projects use approved base images and that the buildspec.yml is stored in the CodeCommit repository (not inline). Which approach enforces this?
A) Code review process B) AWS Config rules and IAM policies for CodeBuild C) Amazon Inspector scanning D) Manual audits
Answer
Answer: B
Explanation: AWS Config can evaluate CodeBuild project configurations and flag non-compliant projects (e.g., projects using unapproved images or with inline buildspecs). IAM policies can restrict which images are allowed in CodeBuild project configurations. This provides both detection (Config) and prevention (IAM). Code reviews (A) and manual audits (D) are not automated. Inspector (C) scans for vulnerabilities, not configuration compliance.
Question 44
A company uses AWS CodeDeploy for EC2 deployments. They need to run a script to drain connections from a load balancer before the deployment starts. Where should this script be placed in the AppSpec?
A) BeforeInstall hook B) AfterInstall hook C) BeforeBlockTraffic hook D) AfterBlockTraffic hook
Answer
Answer: C
Explanation: The CodeDeploy AppSpec lifecycle events for load balancer deployments include: BeforeBlockTraffic (before the load balancer blocks traffic to instances), BlockTraffic (load balancer blocks traffic), AfterBlockTraffic (after traffic is blocked). To drain connections before traffic is blocked by the load balancer, use the BeforeBlockTraffic hook. BeforeInstall (A) runs after traffic is already blocked. AfterInstall (B) runs after application installation.
Question 45
A company wants to implement GitOps principles - the Git repository is the single source of truth for infrastructure. Any change to the repository should automatically be reflected in the infrastructure. How should they implement this for CloudFormation?
A) Use CodePipeline triggered by CodeCommit changes B) Manually apply CloudFormation changes C) Use CloudFormation StackSets D) Use AWS CDK Pipelines
Answer
Answer: A
Explanation: CodePipeline triggered by CodeCommit (or GitHub) changes implements GitOps for CloudFormation. Any commit to the repository triggers the pipeline which applies CloudFormation changes. This ensures the deployed infrastructure always matches the repository. CDK Pipelines (D) also implements this but specifically for CDK applications. Manual changes (B) violate GitOps principles. StackSets (C) manage cross-account deployments but need a trigger.
Question 46
A company's application deployed on ECS is experiencing intermittent issues. They need to correlate application logs with infrastructure metrics and distributed traces. Which combination provides this visibility?
A) CloudWatch Logs + CloudWatch Metrics + X-Ray B) S3 + Athena + X-Ray C) Elasticsearch + Kibana + X-Ray D) CloudTrail + CloudWatch + Inspector
Answer
Answer: A
Explanation: CloudWatch Logs (application logs), CloudWatch Metrics (infrastructure metrics), and X-Ray (distributed traces) form the observability trinity on AWS. CloudWatch Container Insights provides ECS-specific metrics and logs. X-Ray correlates traces with CloudWatch using trace IDs. S3+Athena (B) doesn't provide real-time correlation. Elasticsearch+Kibana (C) requires managing infrastructure. CloudTrail (D) is for API audit, not application observability.
Question 47
A company runs a multi-region application and needs to ensure deployments are coordinated across regions - first deploying to us-east-1 and then to eu-west-1 only if us-east-1 is healthy. What is the BEST approach?
A) Two separate pipelines with manual trigger for the second region B) A single CodePipeline with sequential regional deployment stages and health check gates C) Use CloudFormation StackSets for both regions simultaneously D) Manual deployments with change management
Answer
Answer: B
Explanation: A single CodePipeline with sequential stages for each region implements the required flow: deploy to us-east-1, run health checks (CodeBuild test stage), then deploy to eu-west-1 only if health checks pass. This provides automated, sequential deployment with gates. Two separate pipelines (A) require manual coordination. StackSets (C) deploy to multiple regions simultaneously, not sequentially with gates. Manual deployments (D) eliminate automation.
Question 48
A company uses EC2 Auto Scaling with a launch template. They want to use a new AMI but want to test it on a few instances before updating all instances. Which feature should they use?
A) Launch configuration update B) Instance refresh with a warm pool and phased replacement percentage C) Manual instance termination and relaunch D) Create a new Auto Scaling Group
Answer
Answer: B
Explanation: EC2 Auto Scaling Instance Refresh allows rolling updates of instances to use new launch templates. By setting the MinHealthyPercentage and configuring checkpoints, you can test on a percentage of instances before proceeding. Warm pools can pre-warm replacement instances. Launch configurations (A) are deprecated. Manual termination (C) is error-prone. Creating a new ASG (D) doesn't integrate with the existing deployment.
Question 49
A team needs to implement a robust rollback strategy for database schema changes in their CI/CD pipeline. What is the BEST practice?
A) Store a database dump before each migration B) Use reversible migrations (up/down) with automated rollback capability in the pipeline C) Use point-in-time recovery from RDS backups D) Snapshot the database before each deployment
Answer
Answer: B
Explanation: Reversible migrations with up/down scripts allow the application to apply (up) migrations when deploying and reverse (down) them when rolling back. The pipeline can automatically run the down migration if deployment fails. This is faster than restoring from snapshots. Database dumps (A) and snapshots (D) are slow to restore. PITR (C) is even slower and may lose data from the period after the snapshot.
Question 50
A company needs to ensure their Docker builds are reproducible and secure. They want to scan for secrets accidentally committed to the Docker image layers. Which approach should they use?
A) CodeBuild with manual image inspection B) Multi-stage Docker builds to minimize attack surface + Amazon Inspector for vulnerability scanning C) Use ECR image scanning with Inspector D) Manually review Dockerfiles before build
Answer
Answer: C
Explanation: Amazon Inspector integrates with ECR to scan container images for both vulnerabilities (CVEs in packages) and now secrets accidentally embedded in image layers (using the Secrets detection feature). ECR enhanced scanning with Inspector provides automated detection without manual review. Multi-stage builds (B) reduce image size but don't detect secrets. Manual review (A, D) is not scalable.
Question 51
A company uses CodePipeline and wants to implement a strategy where the deployment stops automatically if the error rate increases post-deployment, and notifies the team. What is the BEST approach?
A) Set up CloudWatch alarms that send emails B) Use CodeDeploy deployment group with CloudWatch alarm-based automatic rollback + SNS notification C) Write a Lambda function to monitor and stop the pipeline D) Use manual monitoring with a checklist
Answer
Answer: B
Explanation: CodeDeploy deployment groups can be configured with CloudWatch alarms for automatic rollback and with triggers that send SNS notifications when deployment events occur (including rollbacks). This is the fully integrated, native solution for automatic rollback with notification. CloudWatch email alarms (A) notify but don't stop/rollback deployments. Lambda (C) adds custom complexity. Manual monitoring (D) is not automated.
Question 52
A company manages hundreds of Lambda functions and needs to ensure all functions have appropriate reserved concurrency limits to prevent one function from consuming all concurrency. How can they enforce this at scale?
A) Manually set reserved concurrency for each function B) Use AWS Config rule to check Lambda functions without reserved concurrency C) Use Service Quotas to limit Lambda concurrency D) Use IAM policies to prevent function creation without reserved concurrency
Answer
Answer: B
Explanation: An AWS Config custom rule can evaluate all Lambda functions and report non-compliant ones that don't have reserved concurrency set. Config can also trigger remediation actions. This provides visibility at scale without manual checking. Manual configuration (A) doesn't scale. Service Quotas (C) limit total account concurrency but not per-function enforcement. IAM policies (D) can't require the presence of a configuration attribute during creation.
Question 53
A company uses AWS CloudFormation and needs to execute a custom script during stack creation to configure a third-party service. Which resource type should they use?
A) CloudFormation Init (cfn-init) B) AWS::CloudFormation::CustomResource with Lambda C) AWS::CloudFormation::WaitCondition D) AWS::CloudFormation::Stack
Answer
Answer: B
Explanation: CloudFormation Custom Resources backed by Lambda allow you to execute arbitrary code during stack create/update/delete operations. The Lambda function can call third-party APIs, configure external services, and return data back to the CloudFormation template. cfn-init (A) is for configuring EC2 instances. WaitCondition (C) is for waiting on signals from EC2 instances. AWS::CloudFormation::Stack (D) is for nested stacks.
Question 54
A DevOps team needs to implement health checks at the application level (not just instance level) for their Auto Scaling Group. They want the ASG to replace unhealthy instances based on application health. How should they implement this?
A) Use EC2 instance status checks B) Configure the ASG to use ELB health checks C) Use CloudWatch alarms to trigger instance termination D) Configure a custom health check endpoint and use EC2 health checks
Answer
Answer: B
Explanation: When an ASG is configured to use ELB health checks, it considers an instance unhealthy if the load balancer reports it as unhealthy (based on the ALB/NLB target group health check, which checks application-level endpoints like /health). The ASG then automatically terminates and replaces the unhealthy instance. EC2 status checks (A) only check EC2 infrastructure health. CloudWatch alarms (C) trigger scaling policies, not direct replacement. Custom health check with EC2 checks (D) doesn't leverage the application-level check properly.
Question 55
A company needs to implement a strategy for managing environment-specific configuration in their CI/CD pipeline. Each environment has different database endpoints, API keys, and feature flags. What is the BEST approach?
A) Store all configurations in the code repository B) Use environment-specific SSM Parameter Store paths per environment C) Hard-code environment-specific values in the build artifacts D) Use different CodeBuild projects for each environment
Answer
Answer: B
Explanation: Using SSM Parameter Store with environment-specific paths (e.g., /dev/database/endpoint, /prod/database/endpoint) allows applications and pipelines to retrieve environment-specific configurations at runtime. Access can be controlled via IAM policies per environment. Storing configs in the repository (A) risks exposing secrets. Hard-coding in build artifacts (C) creates different artifacts per environment. Different CodeBuild projects (D) don't address the config management problem.
Question 56
A company wants to implement immutable infrastructure - instead of updating existing servers, they replace them with new ones on each deployment. Which AWS service and pattern best supports this?
A) EC2 Auto Scaling with Instance Refresh using a golden AMI pipeline B) In-place CodeDeploy deployments on existing EC2 instances C) AWS Systems Manager patching on existing instances D) Manual instance updates via SSH
Answer
Answer: A
Explanation: Immutable infrastructure uses an AMI pipeline (CodeBuild to build and bake a golden AMI with the new code, then Instance Refresh the Auto Scaling Group with the new AMI). New instances are launched from the new AMI and old instances are terminated. In-place deployments (B) modify existing instances, violating immutable principles. SSM patching (C) modifies existing instances. Manual updates (D) are error-prone.
Question 57
A company has multiple CodePipeline pipelines. They want a centralized dashboard to view the status of all pipelines across their AWS organization. What should they implement?
A) AWS Management Console with multiple browser tabs B) Amazon CloudWatch custom dashboard with CodePipeline metrics C) AWS DevOps Guru D) AWS Organizations console
Answer
Answer: B
Explanation: Amazon CloudWatch dashboards can aggregate CodePipeline execution metrics and status across multiple pipelines. Combined with EventBridge events from pipelines, a Lambda function can update a DynamoDB table of pipeline statuses which a CloudWatch dashboard displays. CloudWatch also provides pipeline-level metrics. DevOps Guru (C) uses ML for anomaly detection, not a pipeline dashboard. Organizations console (D) manages accounts, not pipelines.
Question 58
A company needs to ensure their ECS task definitions always pull the latest image from ECR with digest verification (not using 'latest' tag). How should they implement this in their pipeline?
A) Use latest tag in the ECS task definition
B) In the CodeBuild post-build stage, output the image URI with digest and use it to update the task definition
C) Use ECR tag mutability to prevent overwriting
D) Manually update the task definition after each build
Answer
Answer: B
Explanation: After a CodeBuild build pushes an image to ECR, it can retrieve the full image URI with the digest (SHA256 hash) using docker inspect or ECR API. This digest URI is written to an artifact file (imagedefinitions.json) that the CodeDeploy action in CodePipeline uses to update the ECS task definition. Using digests ensures the exact image is deployed, not whatever 'latest' points to. ECR tag immutability (C) prevents overwriting tags but doesn't ensure digest-based deployment.
Question 59
A company needs to implement a compliance check that runs automatically after every CloudFormation deployment to verify the stack is compliant with security standards. What should they implement in their CodePipeline?
A) Manual review step B) CodeBuild action running AWS CLI to check Config rule compliance for the stack's resources C) Amazon Inspector scan D) GuardDuty findings review
Answer
Answer: B
Explanation: After a CloudFormation deployment, a CodeBuild action can run AWS CLI commands to check AWS Config rule compliance for the resources created by the stack (aws configservice get-compliance-details-by-resource). If any resources are NON_COMPLIANT, the CodeBuild stage fails and the pipeline stops. Manual review (A) is not automated. Inspector (C) scans for vulnerabilities. GuardDuty (D) is for threat detection.
Question 60
A company needs to implement a solution to prevent CloudFormation stack deployments that don't comply with their security standards (e.g., S3 buckets without encryption). What is the preventive control?
A) CloudFormation hooks (AWS CloudFormation Guard) B) AWS Config rules C) AWS Security Hub D) AWS Trusted Advisor
Answer
Answer: A
Explanation: AWS CloudFormation Guard is a policy-as-code tool that validates CloudFormation templates against custom rules before deployment. CloudFormation Hooks can invoke Guard or Lambda functions before resource creation to block non-compliant resources. Config rules (B) are detective (after deployment). Security Hub (C) aggregates findings. Trusted Advisor (D) provides recommendations but doesn't prevent deployments.
Question 61
A company needs to ensure that all EC2 instances in their Auto Scaling Group are replaced within 24 hours of a new AMI becoming available. They want this to happen automatically. What should they implement?
A) EventBridge rule for new AMI events triggering Instance Refresh B) Manual instance refresh when notified of new AMIs C) Use spot instances that get replaced frequently D) Set the maximum instance lifetime in the Auto Scaling Group
Answer
Answer: D
Explanation: EC2 Auto Scaling's Maximum Instance Lifetime feature automatically replaces instances after a specified duration. Setting it to 86400 seconds (24 hours) ensures all instances are replaced within 24 hours, picking up new AMIs if the launch template is updated. EventBridge triggering Instance Refresh (A) requires a custom automation. Manual refresh (B) is not automated. Spot instances (C) may be replaced but not guaranteed within 24 hours.
Question 62
A company needs to run a security scan on their application code in the CodeBuild pipeline. They want to detect hard-coded secrets and credentials in the source code. Which tool should they integrate?
A) Amazon Inspector B) AWS Secrets Manager C) git-secrets or truffleHog integrated in the CodeBuild buildspec D) Amazon Macie
Answer
Answer: C
Explanation: Tools like git-secrets, truffleHog, or Gitleaks are designed to scan source code for hard-coded secrets and credentials. These can be integrated into the CodeBuild buildspec as a build step. If secrets are found, the build fails. Amazon Inspector (A) scans container images and EC2 instances. Secrets Manager (B) stores secrets but doesn't scan code. Macie (D) scans S3 objects for sensitive data, not source code.
Question 63
A company uses CodePipeline to deploy to multiple ECS services. Each service has its own CodeDeploy deployment group. When one service deployment fails, they want only that service's deployment to roll back, not all services. How should they structure their pipeline?
A) Single CodeDeploy deployment group for all services B) Separate parallel deploy stages for each service using separate CodeDeploy deployment groups C) Sequential deployment with a single CloudFormation stack D) Deploy all services in a single CodeDeploy deployment
Answer
Answer: B
Explanation: Using separate parallel deploy actions (each with their own CodeDeploy deployment group) for each ECS service in CodePipeline allows individual service rollbacks when a deployment fails. If one service's deployment fails, only that deployment rolls back while other services continue. A single deployment group (A) or single deployment (D) for all services would roll back all services. Sequential CloudFormation (C) doesn't leverage CodeDeploy's rollback capabilities.
Question 64
A company needs to implement a solution to automatically detect and remediate EC2 instances that are not using IMDSv2 (Instance Metadata Service version 2). What should they implement?
A) AWS Config rule + SSM Automation remediation B) Amazon Inspector scan C) Manual audit and script execution D) CloudTrail monitoring
Answer
Answer: A
Explanation: An AWS Config rule can detect EC2 instances where MetadataOptions.HttpTokens is not set to required (IMDSv2). When non-compliant instances are found, an SSM Automation remediation document can automatically update the instance metadata options to require IMDSv2. This provides both detection and automatic remediation. Inspector (B) is for vulnerabilities. Manual audit (C) is not scalable. CloudTrail (D) logs API calls.
Question 65
A DevOps team uses Terraform for infrastructure management alongside CloudFormation. They need to store Terraform state files securely with versioning and locking. What should they use?
A) Local filesystem B) S3 bucket with versioning enabled + DynamoDB for state locking C) CodeCommit repository D) AWS CodeArtifact
Answer
Answer: B
Explanation: The recommended backend for Terraform on AWS is S3 (with versioning for state history and recovery) combined with DynamoDB for state locking (prevents concurrent state modifications). This is the standard, well-documented pattern for secure Terraform state management on AWS. Local filesystem (A) doesn't support team collaboration or DR. CodeCommit (C) would require committing state files which is not recommended. CodeArtifact (D) is a package manager.
Question 66
A company uses CodePipeline for deployment to EKS. They want to validate their Kubernetes manifests for security issues (like running as root, no resource limits) before deploying. Which approach should they take?
A) Manual review of manifests B) Use OPA (Open Policy Agent) or Kyverno policies integrated as a CodeBuild stage C) Use Amazon Inspector D) Use GuardDuty runtime monitoring
Answer
Answer: B
Explanation: OPA (Open Policy Agent) with conftest or Kyverno can validate Kubernetes manifests against policy rules (like requiring non-root users, resource limits, read-only filesystems) in a CodeBuild stage. If policies fail, the build fails and manifests are not deployed. This is shift-left security. Inspector (C) scans running workloads. GuardDuty (D) detects threats at runtime. Manual review (A) doesn't scale.
Question 67
A company needs to implement a "break glass" procedure for production access. Normally no one has direct production access, but in emergencies, specific individuals can gain temporary elevated access. How should this be implemented?
A) Share the root account credentials B) Use IAM roles with time-limited assume role permissions via AWS STS C) Create permanent admin users for break glass scenarios D) Use AWS Organizations with SCP bypass
Answer
Answer: B
Explanation: Break glass access uses IAM roles that can be assumed for a limited duration via AWS STS. Access is tightly controlled (specific users can assume the role), audited via CloudTrail, and time-limited (STS session duration). The role assumption can trigger SNS alerts. Sharing root credentials (A) is never acceptable. Permanent admin users (C) are always available, not "break glass". SCPs (D) can't be bypassed without Organization admin access.
Question 68
A company's CodeBuild project generates test reports. They want to view test results trend over time. Which CodeBuild feature provides this?
A) CloudWatch Logs B) CodeBuild Test Reports with report groups C) S3 artifact storage D) X-Ray tracing
Answer
Answer: B
Explanation: AWS CodeBuild Test Reports allow you to create report groups that aggregate test results from multiple builds over time. CodeBuild parses test result files (JUnit XML, Cucumber JSON, etc.) and displays pass/fail statistics, trends, and test durations in the CodeBuild console. CloudWatch Logs (A) store raw log output. S3 artifacts (C) store files but don't visualize test trends. X-Ray (D) is for distributed tracing.
Question 69
A company needs to implement Blue/Green deployments for their RDS database to test new schema changes before routing production traffic. Which service supports this for relational databases?
A) RDS Blue/Green Deployments B) RDS Multi-AZ failover C) RDS Read Replicas with DNS switching D) DMS for schema migration
Answer
Answer: A
Explanation: Amazon RDS Blue/Green Deployments is a feature that creates a staging environment (green) that is synchronized with the production database (blue). You can apply schema changes to the green environment, test them, and then perform a switchover with minimal downtime. RDS Multi-AZ (B) is for high availability failover. Read replicas (C) are read-only. DMS (D) is for migration between different database types.
Question 70
A team needs to implement a policy that prevents developers from deploying to production directly from their local machines. All deployments must go through the CI/CD pipeline. How should they enforce this?
A) Team policy and developer education B) IAM policies denying direct deployment actions + CodePipeline with IAM execution roles for deployments C) VPN-based access control D) Network ACLs
Answer
Answer: B
Explanation: IAM policies can deny developers the ability to directly invoke CodeDeploy, update ECS services, or push to ECR/EKS. The CodePipeline uses a dedicated service role that has the necessary permissions. This means deployments can only happen through the pipeline. Team policies (A) are not enforced technically. VPN (C) and NACLs (D) control network access, not deployment permissions.
Question 71
A company has a monorepo containing multiple services. They want their CI/CD pipeline to only build and deploy services that have changed files. How should they implement this?
A) Always build and deploy all services B) Use CodeBuild with a pre-build step that checks git diff to identify changed services C) Use separate repositories for each service D) Use Lambda functions to detect changes
Answer
Answer: B
Explanation: In a CodeBuild pre-build step, a script can run git diff to identify which directories (services) have changed since the last successful build. The script can then set environment variables or output files that control which subsequent build/deploy steps are executed. This is a common pattern for monorepo CI/CD optimization. Always building all services (A) wastes time and resources. Separate repos (C) changes the architecture significantly. Lambda detection (D) adds complexity.
Question 72
A company needs to implement automated load testing as part of their deployment pipeline. After deploying to staging, they want to run load tests and only promote to production if latency stays below 200ms at P99. What should they implement?
A) Manual load testing before each deployment B) CodeBuild stage running a load testing tool (like Locust or k6) that fails if P99 latency exceeds 200ms C) CloudWatch alarms monitoring production metrics D) AWS Trusted Advisor checks
Answer
Answer: B
Explanation: A CodeBuild stage after staging deployment can run load testing tools like Locust, k6, or JMeter. The test script defines the load profile and assertions (P99 latency < 200ms). If assertions fail, CodeBuild returns a non-zero exit code, failing the pipeline stage and preventing promotion to production. Manual testing (A) is not automated. CloudWatch alarms (C) monitor production, not staging pre-deployment tests. Trusted Advisor (D) provides cost/performance recommendations.
Question 73
A company needs to implement drift detection for their CloudFormation stacks and automatically remediate when drift is detected. What is the BEST approach?
A) Manually check for drift weekly B) CloudWatch Events (EventBridge) rule that triggers a Lambda to detect drift and initiate remediation via CodePipeline C) AWS Config rules for CloudFormation resources D) Enable CloudFormation termination protection
Answer
Answer: B
Explanation: An automated solution: EventBridge scheduled rule triggers a Lambda function that initiates CloudFormation drift detection for all stacks. If drift is detected, the Lambda triggers CodePipeline to re-deploy the CloudFormation stack (bringing it back to desired state). This is fully automated. Manual checks (A) are not continuous. Config rules (C) can detect drift but aren't specifically designed for CloudFormation stack drift. Termination protection (D) prevents deletion, not drift.
Question 74
A company needs to implement feature flags that can be changed in production without redeployment. The flags should take effect within 60 seconds of being changed. Which is the BEST solution?
A) Environment variables in ECS task definitions (requires redeployment) B) AWS AppConfig with an agent that polls for changes every 45 seconds C) SSM Parameter Store polled every 60 seconds D) DynamoDB with a Lambda function checking every minute
Answer
Answer: B
Explanation: AWS AppConfig is specifically designed for dynamic configuration delivery. The AppConfig agent (or SDK) polls for configuration changes and can be configured to check every 45 seconds, ensuring changes take effect within 60 seconds. AppConfig also supports deployment strategies and validation. ECS environment variables (A) require task restarts. SSM polling (C) works but lacks AppConfig's validation and deployment strategy features. DynamoDB+Lambda (D) requires custom code and has scheduling lag.
Question 75
A DevOps team needs to implement a solution that automatically tags all AWS resources created by their CI/CD pipeline with the pipeline name, commit ID, and deployment timestamp. Which approach is MOST comprehensive?
A) Manually add tags to each resource B) Use CloudFormation tagging at the stack level and propagate to resources C) Use a combination of CloudFormation stack tags + CodePipeline environment variables passed to CloudFormation parameters + Tag policies in AWS Organizations D) Use Lambda to apply tags after resource creation via CloudTrail events
Answer
Answer: C
Explanation: The most comprehensive approach: (1) CloudFormation stack tags automatically propagate to resources created by the stack, (2) CodePipeline passes commit ID and pipeline name as CloudFormation parameters used as tags, (3) AWS Organizations tag policies enforce tag standards. This handles tagging at the pipeline source, propagation through CloudFormation, and governance through Organizations. Manual tagging (A) doesn't scale. Lambda post-creation tagging (D) has race conditions and misses some resources.
Practice exam complete. Review all domains: SDLC Automation, Configuration Management and IaC, Monitoring and Logging, Policies and Standards Automation, Incident and Event Response, and High Availability and Fault Tolerance.