An organization uses AWS CodeBuild to run integration tests. The tests require a large amount of memory and CPU, and they often timeout after the default 60 minutes. What is the MOST efficient way to increase the timeout and allocate more resources?
Correct. Selecting a larger compute type (e.g., BUILD_GENERAL1_LARGE) in the CodeBuild project configuration increases memory and CPU. The timeout can be adjusted in the same project settings or via AWS CLI. This directly addresses both requirements.
Why this answer
In AWS CodeBuild, the compute type (e.g., BUILD_GENERAL1_LARGE) is a project-level configuration, not a buildspec override. To increase memory and CPU, you must select a larger compute type in the CodeBuild project settings. Additionally, the timeout can be increased in the project configuration or via the AWS CLI/API, not in the buildspec.yml.
This approach is the most efficient and reliable way to allocate more resources and extend the timeout.
Exam trap
The trap is that candidates may think buildspec.yml can override compute type, but in reality compute type is a project-level setting. Many incorrectly believe the buildspec 'timeout-in-minutes' field exists for overall build timeout, but it only applies to individual phases. The correct approach is to modify the project configuration.
How to eliminate wrong answers
Option A is wrong because restarting a timed-out build via CloudWatch does not address the root cause of insufficient resources or timeout limits; it merely retries the same failing configuration. Option B is wrong because AWS Lambda has a maximum execution timeout of 15 minutes, which is far less than the default CodeBuild 60-minute timeout, making it unsuitable for long-running integration tests. Option C is wrong because selecting a larger instance type in the CodeBuild project configuration increases resources but does not change the default 60-minute timeout; the timeout must be explicitly increased via buildspec.yml or project settings.