AWS Certified SysOps Administrator – Associate (legacy) — Question 23
A SysOps Administrator has written an AWS Lambda function to launch new Amazon EC2 instances and deployed it in the us-east-1 region. The Administrator tested it by launching a new t2.nano instance in the us-east-1 region and it performed as expected. However, when the region name was updated in the Lambda function to launch an EC2 instance in the us-west-1 region, it failed.
What is causing this error?
Answer options
- A. The AMI ID must be updated for the us-west-1 region in the Lambda function as well
- B. The Lambda function can only launch EC2 instances in the same region where it is deployed
- C. The Lambda function does not have the necessary IAM permission to launch more than one EC2 instance
- D. The instance type defined in the Lambda function is not available in the us-west-1 region
Correct answer: A
Explanation
The correct answer is A because AMI IDs are region-specific, and the function must reference an appropriate AMI for us-west-1. Option B is incorrect since a Lambda function can launch instances in different regions if configured properly. Option C is not relevant to this failure as there is no indication of IAM permission issues, and option D is incorrect because t2.nano is generally available in multiple regions, including us-west-1.