SDLC Automation

A pipeline must compile an AWS SAM application with native dependencies for the Lambda runtime, then produce a template that another account can deploy without access to the build workspace. Which approach meets these requirements?

Show the answer

Correct answerA. Run SAM build in a compatible container, then package the built template and upload its artifacts to Amazon S3.

AWhy this is right: The build produces compatible deployment content, and packaging replaces local artifact references with S3 locations.

BWhy not this: Template validation neither builds dependencies nor replaces local paths with remotely accessible artifact references.

CWhy not this: Uploading source does not produce runtime-compatible native dependencies or correctly package each function.

DWhy not this: Packaging uploads artifacts but does not compile dependencies; packaging first would capture unbuilt content.

A container-based SAM build creates runtime-compatible dependencies; packaging uploads local artifacts and produces a template with S3 references. Uploading source alone does not compile native dependencies or create the required deployment packages.