How to Isolate SAM Deployments to Avoid Impacting Pre-Production?
A developer works for a company that only has a single pre-production AWS account with an AWS CloudFormation AWS Serverless Application Model (AWS SAM) stack. The developer made changes to an existing AWS Lambda function specified in the AWS SAM template and additional Amazon Simple Notification service (Amazon SNS) topics. The developer wants to do a one-time deploy of the changes to test if the changes are working. The developer does not want to impact the existing pre-production application that is currently being used by other team members as part of the release pipeline. Which solution will meet these requirements?
Community Votes
100% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
The question tests understanding of environment isolation in AWS SAM; the trap is choosing a change set or stack update in the same account, which still risks impacting shared resources.
This question tests how to safely test AWS SAM template changes without impacting an existing pre-production stack. The community strongly agrees that deploying to a separate, dedicated development AWS account is the correct isolation strategy.
Candidates often choose Option B (creating a change set in a new account) because it sounds cautious, but change sets still operate against the original stack in the pre-production account, risking unintended impact.
Community Discussion (6 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Understanding the Requirement
The developer needs to test changes to an AWS SAM template (Lambda function + SNS topics) without impacting the existing pre-production stack used by other team members. The company only has one pre-production account, so the key is to find a deployment method that provides complete isolation.
Why Option C is Correct
Option C — using the AWS SAM CLI to package and deploy the SAM application to a new AWS account designated for a development environment — is the correct answer. By deploying to an entirely separate AWS account, the developer guarantees:
- Zero impact on the pre-production stack, its Lambda functions, SNS topics, or any other resources.
- Complete isolation of the test environment, allowing free experimentation.
- Compliance with the requirement of a one-time deploy for testing.
sam package and sam deploy commands, when pointed at a different account (via AWS CLI profiles or credentials), create an independent CloudFormation stack in that account.Why the Other Options Fail
- Option A: Using the
--debugparameter during deployment does not provide isolation. It only outputs verbose logging. The deployment still targets the pre-production stack and will impact other team members. - Option B: Creating a change set against the pre-production account still modifies the existing CloudFormation stack in that account. Even if you later "execute" it elsewhere, the change set itself is tied to the original stack. This risks impacting the shared pre-production environment.
- Option D: Updating the CloudFormation stack in the pre-production account and adding a "separate stage" is not a valid SAM/CloudFormation concept for cross-account isolation. It still modifies the existing stack and does not meet the requirement.
Community Consensus
The community overwhelmingly supports Option C (92% vote share). Commenters emphasize that deploying to a dedicated development account is the AWS best practice for safe, isolated testing without affecting shared environments.
Official Reference
Exam Strategy
When a question emphasizes 'not impacting' a shared environment, always look for the option that provides complete resource isolation (separate account, separate stack name with full isolation). Avoid options that modify the existing stack, even partially.
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →