← GlobeSec.ai
GlobeSec SAP-C02 Deployment & Instance Management

AWS Solutions Architect Professional — Deployment & Instance Management

60 refresher questions — Elastic Beanstalk, CodeDeploy, CloudFormation, Service Catalog, SAM, CDK, Systems Manager & Cloud Map

0/60
Correct Answers
0 / 60 answered

Pick an answer to see the explanation. Fundamental questions refresh the basics; Advanced questions are short SAP-style scenarios.

BeanstalkFundamental
Q1.How is AWS Elastic Beanstalk itself charged?
AA fixed monthly fee per environment
BPer deployment, plus the resources it creates
CA per-hour fee for each managed platform version
DNo charge for Beanstalk; you pay for the resources it creates
✓ Correct: D. No charge for Beanstalk; you pay for the resources it creates

How to think about it: Beanstalk = free orchestration; you pay for the EC2, ELB, RDS etc. it creates.

Why D is correct: Beanstalk is free to use, and billing comes from the EC2 instances, load balancers and other resources in the environment.

Why the others are wrong:
A) A fixed monthly fee per environment — There is no per-environment fee for Elastic Beanstalk.
B) Per deployment, plus the resources it creates — Deployments are not billed; only the underlying resources are.
C) A per-hour fee for each managed platform version — Platform versions are provided at no extra charge.
BeanstalkFundamental
Q2.In an Elastic Beanstalk environment, what remains the developer's responsibility?
APatching the operating system by hand
BWriting the deployment orchestration logic
CThe application code
DBuilding the Auto Scaling group manually
✓ Correct: C. The application code

How to think about it: Beanstalk runs the OS, instances and deploys; you own the application code.

Why C is correct: Beanstalk handles instance configuration, the OS platform and the deployment process, leaving the code to the developer.

Why the others are wrong:
A) Patching the operating system by hand — Beanstalk manages the platform and can apply managed platform updates.
B) Writing the deployment orchestration logic — Beanstalk performs deployments using the policy you choose.
D) Building the Auto Scaling group manually — Beanstalk creates and configures the Auto Scaling group for you.
BeanstalkFundamental
Q3.Which Elastic Beanstalk environment type is the cheapest choice for a developer's test environment?
ASingle instance environment
BLoad-balanced environment with RDS Multi-AZ
CWorker environment with an SQS queue
DLoad-balanced environment with Auto Scaling
✓ Correct: A. Single instance environment

How to think about it: Dev = single instance (one EC2 + Elastic IP). Prod web = LB + ASG.

Why A is correct: A single instance with an Elastic IP and no load balancer is the low-cost option for development.

Why the others are wrong:
B) Load-balanced environment with RDS Multi-AZ — A Multi-AZ database adds a standby and is built for production availability.
C) Worker environment with an SQS queue — A worker tier processes background jobs; it is not the minimal web test setup.
D) Load-balanced environment with Auto Scaling — Load balancing and multiple instances cost more and suit production.
BeanstalkFundamental
Q4.A web app needs to hand off long-running jobs such as video encoding so web requests return quickly. What does Elastic Beanstalk provide?
AA second web environment behind the same load balancer
BA larger instance type in the web environment
CA single instance environment with an Elastic IP
DA worker environment that pulls jobs from an SQS queue
✓ Correct: D. A worker environment that pulls jobs from an SQS queue

How to think about it: Long tasks off the web tier = worker environment (SQS queue + EC2).

Why D is correct: The web tier puts messages on the queue, and the worker tier's instances process them in the background.

Why the others are wrong:
A) A second web environment behind the same load balancer — Another web tier still serves requests and does not decouple long jobs.
B) A larger instance type in the web environment — Bigger instances do not stop long jobs from blocking web requests.
C) A single instance environment with an Elastic IP — That is a low-cost dev setup and does not add a background job tier.
BeanstalkFundamental
Q5.A Beanstalk worker environment must run a cleanup job every night. Where is the schedule defined?
AIn a CloudFormation DeletionPolicy
BIn the appspec.yml file
CIn the Dockerrun.aws.json file
DIn a cron.yaml file in the application bundle
✓ Correct: D. In a cron.yaml file in the application bundle

How to think about it: Periodic tasks in a worker tier = cron.yaml.

Why D is correct: The worker environment reads cron.yaml and posts scheduled messages to trigger the task.

Why the others are wrong:
A) In a CloudFormation DeletionPolicy — DeletionPolicy controls what happens to resources when a stack is deleted.
B) In the appspec.yml file — appspec.yml is the CodeDeploy deployment specification, not a Beanstalk scheduler.
C) In the Dockerrun.aws.json file — Dockerrun describes container settings, not scheduled jobs.
BeanstalkFundamental
Q6.Moving an on-premises Java app onto Elastic Beanstalk without changing its architecture is which migration strategy?
ARepurchase
BReplatform
CRefactor
DRetain
✓ Correct: B. Replatform

How to think about it: Managed platform, same architecture = Replatform.

Why B is correct: Beanstalk takes over servers and deployments while the application stays the same, which is replatforming.

Why the others are wrong:
A) Repurchase — Repurchase would replace the app with a commercial product.
C) Refactor — Refactor would redesign the app, for example into microservices.
D) Retain — Retain would leave the app on premises.
BeanstalkAdvanced
Q7.A team deploys v2 to a separate Beanstalk environment, tests it, and then wants all users moved to it instantly with an easy way back. What should it do?
ADelete the old environment and rename the new one
BRun an in-place all-at-once deployment on the old environment
CSwap the environment URLs between the two environments
DChange the Auto Scaling group's launch template
✓ Correct: C. Swap the environment URLs between the two environments

How to think about it: Beanstalk blue/green = new environment + swap environment URLs (CNAME swap).

Why C is correct: The CNAME swap points the production URL at the new environment, and swapping back is the rollback.

Why the others are wrong:
A) Delete the old environment and rename the new one — Deleting the old environment removes the quick rollback path.
B) Run an in-place all-at-once deployment on the old environment — All at once updates the original instances and causes downtime.
D) Change the Auto Scaling group's launch template — That updates instances in place rather than switching between environments.
BeanstalkAdvanced
Q8.Before swapping Beanstalk environments, a team wants about 10% of users on the green environment to watch for errors. How?
AA swap of environment URLs at 10%
BRoute 53 weighted records pointing at both environment URLs
CRoute 53 failover records on both environment URLs
DAn immutable deployment with a 10% batch
✓ Correct: B. Route 53 weighted records pointing at both environment URLs

How to think about it: Send a slice of traffic to green = Route 53 weighted records on both environment URLs.

Why B is correct: Weights such as 90/10 send a small share of users to green while blue keeps most traffic.

Why the others are wrong:
A) A swap of environment URLs at 10% — The URL swap is all or nothing; it has no percentage setting.
C) Route 53 failover records on both environment URLs — Failover routing sends traffic to the secondary only when the primary is unhealthy.
D) An immutable deployment with a 10% batch — Immutable deployments replace instances in one environment, not split traffic across two.
CodeDeployFundamental
Q9.Which targets can AWS CodeDeploy deploy to?
AOnly EC2 instances managed by Elastic Beanstalk
BOnly Lambda functions and API Gateway stages
COnly on-premises servers registered in Systems Manager
DEC2 and on-premises servers, Lambda functions and ECS services
✓ Correct: D. EC2 and on-premises servers, Lambda functions and ECS services

How to think about it: CodeDeploy targets = EC2/on-premises, Lambda and ECS.

Why D is correct: CodeDeploy has three compute platforms: EC2/on-premises (including ASGs), Lambda and ECS.

Why the others are wrong:
A) Only EC2 instances managed by Elastic Beanstalk — CodeDeploy works with instances that Beanstalk does not manage, and with more than EC2.
B) Only Lambda functions and API Gateway stages — API Gateway is not a CodeDeploy target, and EC2 and ECS are.
C) Only on-premises servers registered in Systems Manager — CodeDeploy deploys to AWS compute too, not just on-premises servers.
CodeDeployFundamental
Q10.Which file tells CodeDeploy what to install on an EC2 instance and which scripts to run at each deployment stage?
Acron.yaml
Bbuildspec.yml
Cappspec.yml
Dtemplate.yaml
✓ Correct: C. appspec.yml

How to think about it: CodeDeploy instructions = appspec.yml (files + lifecycle hooks).

Why C is correct: The AppSpec file maps files to destinations and lists the lifecycle event hooks to run.

Why the others are wrong:
A) cron.yaml — cron.yaml schedules periodic jobs in a Beanstalk worker environment.
B) buildspec.yml — buildspec.yml drives CodeBuild build and test steps, not deployments.
D) template.yaml — template.yaml is the usual name of a SAM template, not a CodeDeploy spec.
CodeDeployFundamental
Q11.What must be running on an EC2 instance or on-premises server before CodeDeploy can deploy to it?
AAn SSH server reachable from CodeDeploy
BThe CloudWatch agent
CThe CodeDeploy agent
DThe Elastic Beanstalk host manager
✓ Correct: C. The CodeDeploy agent

How to think about it: EC2/on-prem deploys need the CodeDeploy agent on each host.

Why C is correct: The agent polls CodeDeploy for work and runs the steps from the AppSpec file on the host.

Why the others are wrong:
A) An SSH server reachable from CodeDeploy — CodeDeploy does not connect over SSH; the agent pulls instructions.
B) The CloudWatch agent — The CloudWatch agent publishes metrics and logs; it does not perform deployments.
D) The Elastic Beanstalk host manager — That component is part of Beanstalk environments, not CodeDeploy.
CodeDeployFundamental
Q12.An in-place EC2 deployment must keep at least half the fleet serving traffic while the other half updates. Which deployment configuration fits?
ACodeDeployDefault.LambdaCanary10Percent5Minutes
BCodeDeployDefault.HalfAtATime
CCodeDeployDefault.ECSLinear10PercentEvery1Minutes
DCodeDeployDefault.AllAtOnce
✓ Correct: B. CodeDeployDefault.HalfAtATime

How to think about it: In-place, half the fleet at a time = CodeDeployDefault.HalfAtATime.

Why B is correct: This configuration updates up to half the instances at once, so the rest keep serving.

Why the others are wrong:
A) CodeDeployDefault.LambdaCanary10Percent5Minutes — That configuration shifts Lambda alias traffic, not EC2 instances.
C) CodeDeployDefault.ECSLinear10PercentEvery1Minutes — That configuration shifts ECS traffic, not an EC2 fleet.
D) CodeDeployDefault.AllAtOnce — All at once updates every instance together, so nothing is left serving the old version.
CodeDeployFundamental
Q13.How can a team run its own checks on EC2 instances at specific stages of a CodeDeploy deployment, such as after the app starts?
AConfigure a Beanstalk worker environment
BAdd scripts to lifecycle event hooks in the AppSpec file
CTurn on S3 event notifications for the bundle
DEnable CloudFormation drift detection
✓ Correct: B. Add scripts to lifecycle event hooks in the AppSpec file

How to think about it: Custom checks per stage = AppSpec lifecycle event hooks (e.g. ValidateService).

Why B is correct: Hooks such as ApplicationStart and ValidateService run your scripts and can fail the deployment.

Why the others are wrong:
A) Configure a Beanstalk worker environment — A worker tier processes queued jobs and is unrelated to CodeDeploy checks.
C) Turn on S3 event notifications for the bundle — Bundle upload events do not run validation on the instances.
D) Enable CloudFormation drift detection — Drift detection compares stack resources with templates, not deployment health.
CodeDeployFundamental
Q14.What does a CodeDeploy blue/green deployment to an Auto Scaling group require?
AA Beanstalk environment wrapping the ASG
BA load balancer to move traffic to the new instances
CA Route 53 weighted record for each instance
DA Spot Fleet to supply replacement capacity
✓ Correct: B. A load balancer to move traffic to the new instances

How to think about it: ASG blue/green = new ASG copied from the old + an ELB to switch traffic.

Why B is correct: CodeDeploy copies the ASG, registers the new instances with the ELB, then deregisters the old ones.

Why the others are wrong:
A) A Beanstalk environment wrapping the ASG — CodeDeploy blue/green does not need Elastic Beanstalk.
C) A Route 53 weighted record for each instance — Traffic moves through the load balancer, not per-instance DNS records.
D) A Spot Fleet to supply replacement capacity — The replacement group is a copy of the ASG; Spot Fleet is not required.
CodeDeployAdvanced
Q15.A new Lambda version should take 10% of traffic for five minutes, then all of it, and roll back automatically if errors rise. How?
ARoute 53 weighted records for each Lambda version
BRaise reserved concurrency on the new function version
CPublish the version and point $LATEST at it
DCodeDeploy canary shifting on an alias, with alarm rollback
✓ Correct: D. CodeDeploy canary shifting on an alias, with alarm rollback

How to think about it: Lambda + gradual shift + auto rollback = CodeDeploy on an alias with CloudWatch alarms.

Why D is correct: CodeDeploy shifts alias weights by canary or linear steps and rolls back when an alarm fires.

Why the others are wrong:
A) Route 53 weighted records for each Lambda version — Lambda versions are not DNS targets; alias weights do the split.
B) Raise reserved concurrency on the new function version — Concurrency limits scaling and does not shift or roll back traffic.
C) Publish the version and point $LATEST at it — $LATEST is unversioned code, and repointing it gives no gradual shift or rollback.
CodeDeployAdvanced
Q16.During a CodeDeploy blue/green deployment to ECS, what happens to traffic and the original tasks?
ATraffic moves to a new task set; the old set waits, then stops
BEach running task container is patched in place
CA new ECS cluster is created in another Region
DOld tasks are stopped first, then new tasks start
✓ Correct: A. Traffic moves to a new task set; the old set waits, then stops

How to think about it: ECS blue/green: new task set, traffic shifted at the ALB, old set kept for a wait period.

Why A is correct: The wait gives time to spot problems and roll back before the original tasks are stopped.

Why the others are wrong:
B) Each running task container is patched in place — Blue/green replaces task sets; it does not patch containers in place.
C) A new ECS cluster is created in another Region — The deployment happens inside the same ECS service, not a new Regional cluster.
D) Old tasks are stopped first, then new tasks start — Stopping first causes downtime, which blue/green avoids.
CodeDeployAdvanced
Q17.Before any traffic shifts to a new Lambda version, integration tests must run and be able to stop the deployment. Where do they go?
AA pre-traffic hook Lambda function (BeforeAllowTraffic)
BA CloudFormation custom resource
CA CloudWatch Synthetics canary on the API
DA post-traffic hook Lambda function (AfterAllowTraffic)
✓ Correct: A. A pre-traffic hook Lambda function (BeforeAllowTraffic)

How to think about it: Tests before the shift = BeforeAllowTraffic (pre-traffic) hook; after = AfterAllowTraffic.

Why A is correct: The pre-traffic hook runs before the shift starts and reports success or failure to CodeDeploy.

Why the others are wrong:
B) A CloudFormation custom resource — Custom resources run during stack operations, not during the traffic shift.
C) A CloudWatch Synthetics canary on the API — A canary probes the live endpoint, but it is not a CodeDeploy deployment hook.
D) A post-traffic hook Lambda function (AfterAllowTraffic) — The post-traffic hook runs after traffic has already moved.
CloudFormationFundamental
Q18.Which AWS services use CloudFormation underneath to provision resources?
AAWS Config, CloudTrail and GuardDuty
BElastic Beanstalk, Service Catalog and SAM
CRoute 53, CloudFront and Global Accelerator
DAmazon S3, DynamoDB and SQS
✓ Correct: B. Elastic Beanstalk, Service Catalog and SAM

How to think about it: CloudFormation is the backbone of Beanstalk, Service Catalog, SAM (and CDK).

Why B is correct: All three build their resources through CloudFormation stacks.

Why the others are wrong:
A) AWS Config, CloudTrail and GuardDuty — These monitor and audit accounts; they do not provision with CloudFormation.
C) Route 53, CloudFront and Global Accelerator — These are networking services, not CloudFormation-based provisioning tools.
D) Amazon S3, DynamoDB and SQS — These are resources a stack can create, not services built on CloudFormation.
CloudFormationFundamental
Q19.An S3 bucket of audit logs must survive when its CloudFormation stack is deleted. What should you set on the resource?
AA stack policy denying updates
BDeletionPolicy: Delete
CDeletionPolicy: Retain
DUpdateReplacePolicy: Snapshot
✓ Correct: C. DeletionPolicy: Retain

How to think about it: Keep a resource after stack delete = DeletionPolicy: Retain.

Why C is correct: Retain leaves the resource in place when the stack is deleted, and it works for any resource type.

Why the others are wrong:
A) A stack policy denying updates — A stack policy guards against updates, not against deleting the whole stack.
B) DeletionPolicy: Delete — Delete is the general default and removes the resource with the stack.
D) UpdateReplacePolicy: Snapshot — UpdateReplacePolicy applies when a resource is replaced during an update, and S3 has no snapshots.
CloudFormationFundamental
Q20.Which resource type supports DeletionPolicy: Snapshot?
AAn RDS DB instance
BAn S3 bucket
CA Lambda function
DAn SQS queue
✓ Correct: A. An RDS DB instance

How to think about it: Snapshot works for snapshot-able data: EBS volumes, RDS, ElastiCache, Redshift, Neptune, DocumentDB.

Why A is correct: RDS supports Snapshot, so a final snapshot is taken before the instance is deleted.

Why the others are wrong:
B) An S3 bucket — S3 has no snapshot feature; use Retain to keep a bucket.
C) A Lambda function — Lambda functions cannot be snapshotted by CloudFormation.
D) An SQS queue — SQS queues have no snapshot capability.
CloudFormationFundamental
Q21.If you set no DeletionPolicy on an AWS::RDS::DBCluster, what happens when the stack is deleted?
AThe cluster is retained and detached from the stack
BThe cluster is deleted with no snapshot
CStack deletion fails until a policy is added
DA snapshot of the cluster is taken before it is deleted
✓ Correct: D. A snapshot of the cluster is taken before it is deleted

How to think about it: Most resources default to Delete, but RDS DB clusters default to Snapshot.

Why D is correct: For DB clusters CloudFormation defaults to Snapshot to protect the data.

Why the others are wrong:
A) The cluster is retained and detached from the stack — Retain only happens when you set it explicitly.
B) The cluster is deleted with no snapshot — Delete is the default for most resources, but not for DB clusters.
C) Stack deletion fails until a policy is added — No policy is required; the default behaviour applies.
CloudFormationFundamental
Q22.Deleting a stack fails on its S3 bucket resource. What is the most likely cause?
AThe bucket is in a different Region from the stack
BThe bucket has default encryption enabled
CThe bucket has a lifecycle rule
DThe bucket still contains objects
✓ Correct: D. The bucket still contains objects

How to think about it: CloudFormation cannot delete a non-empty bucket; empty it first.

Why D is correct: CloudFormation only deletes empty buckets, so objects must be removed first.

Why the others are wrong:
A) The bucket is in a different Region from the stack — A stack's bucket lives in the stack's Region.
B) The bucket has default encryption enabled — Encryption settings do not block bucket deletion.
C) The bucket has a lifecycle rule — Lifecycle rules do not stop CloudFormation from deleting a bucket.
CloudFormationFundamental
Q23.A stack must manage something CloudFormation has no resource type for, such as an on-premises resource. What should you use?
AA stack policy
BA Lambda-backed custom resource
CA WaitCondition with no handler
DA nested stack
✓ Correct: B. A Lambda-backed custom resource

How to think about it: Anything not supported natively = custom resource backed by Lambda.

Why B is correct: CloudFormation sends create, update and delete events to your function, which makes whatever calls are needed.

Why the others are wrong:
A) A stack policy — Stack policies restrict updates; they do not add new resource types.
C) A WaitCondition with no handler — A wait condition pauses the stack for a signal but performs no work itself.
D) A nested stack — Nested stacks reuse templates but can only contain supported resource types.
CloudFormationFundamental
Q24.A security baseline stack must be deployed to many accounts and Regions with one operation. Which feature fits?
AChange sets
BCloudFormation StackSets
CStack termination protection
DNested stacks
✓ Correct: B. CloudFormation StackSets

How to think about it: Many accounts + many Regions, one operation = StackSets.

Why B is correct: StackSets create, update or delete stack instances across accounts and Regions from one administrator account.

Why the others are wrong:
A) Change sets — Change sets preview changes to a single stack.
C) Stack termination protection — Termination protection prevents deleting a stack; it does not deploy anywhere.
D) Nested stacks — Nested stacks split one stack into parts in one account and Region.
CloudFormationFundamental
Q25.Someone changed a security group managed by CloudFormation from the EC2 console. How can you find out?
ARun drift detection on the stack or resource
BCheck the stack's Outputs section
CCreate a change set
DEnable termination protection
✓ Correct: A. Run drift detection on the stack or resource

How to think about it: Manual changes outside the template = drift detection.

Why A is correct: Drift detection compares the actual configuration with the template and reports differences.

Why the others are wrong:
B) Check the stack's Outputs section — Outputs show values declared in the template, not live configuration differences.
C) Create a change set — A change set previews template changes; it does not find manual edits.
D) Enable termination protection — Termination protection stops deletion and does not detect changes.
CloudFormationFundamental
Q26.A team has an existing S3 bucket created by hand and wants CloudFormation to manage it without recreating it. What should they use?
ADrift detection
BA custom resource that copies the bucket
CStackSets automatic deployment
DCloudFormation resource import
✓ Correct: D. CloudFormation resource import

How to think about it: Bring existing resources under a stack = resource import.

Why D is correct: Import adds existing resources to a new or existing stack without deleting and recreating them.

Why the others are wrong:
A) Drift detection — Drift detection reports differences but does not bring resources into a stack.
B) A custom resource that copies the bucket — Copying creates a new bucket instead of managing the existing one.
C) StackSets automatic deployment — Automatic deployment targets new accounts; it does not adopt existing resources.
CloudFormationAdvanced
Q27.Every new account added to an OU must automatically get a baseline stack, and stacks should be removed if the account leaves. What should you use?
AStackSets, service-managed, with automatic deployment
BAWS Config conformance packs alone
CStackSets with self-managed permissions
DA nested stack deployed in the management account
✓ Correct: A. StackSets, service-managed, with automatic deployment

How to think about it: New accounts in an OU get the stack automatically = StackSets with service-managed permissions + automatic deployment.

Why A is correct: With Organizations integration, StackSets deploy to accounts joining the target OU and can remove stacks when they leave.

Why the others are wrong:
B) AWS Config conformance packs alone — Conformance packs deploy Config rules, not general infrastructure stacks.
C) StackSets with self-managed permissions — Self-managed StackSets need roles set up by hand and do not deploy to new accounts automatically.
D) A nested stack deployed in the management account — A nested stack lives in one account and does not reach member accounts.
CloudFormationAdvanced
Q28.Without AWS Organizations, what IAM setup do self-managed StackSets need?
AAn admin role plus an execution role in each target
BA resource-based policy attached to each stack
CAn IAM user with access keys in every target account
DA service control policy allowing CloudFormation
✓ Correct: A. An admin role plus an execution role in each target

How to think about it: Self-managed StackSets = administration role in admin account + execution role in each target.

Why A is correct: The admin role assumes the execution role in each target account to create the stack instances.

Why the others are wrong:
B) A resource-based policy attached to each stack — CloudFormation stacks do not use resource-based policies for StackSets.
C) An IAM user with access keys in every target account — StackSets use cross-account roles, not stored user keys.
D) A service control policy allowing CloudFormation — SCPs need Organizations and only limit permissions; they grant nothing.
CloudFormationAdvanced
Q29.A resource import into a stack keeps failing. Which requirement is most likely missing from the template?
AA Lambda custom resource to adopt the resource
BAn Outputs entry for each imported resource
CA stack policy covering the imported resources
DA DeletionPolicy attribute on each resource being imported
✓ Correct: D. A DeletionPolicy attribute on each resource being imported

How to think about it: Import needs the full template, a resource identifier, and a DeletionPolicy on each imported resource.

Why D is correct: Each imported resource needs a DeletionPolicy (any value) plus its unique identifier.

Why the others are wrong:
A) A Lambda custom resource to adopt the resource — Import is native and does not need a custom resource.
B) An Outputs entry for each imported resource — Outputs are optional and not required for import.
C) A stack policy covering the imported resources — Stack policies are optional and not part of import requirements.
CloudFormationAdvanced
Q30.A template creates an RDS database and must not contain the master password in plain text. What is the best approach?
AA generated Secrets Manager secret via dynamic reference
BPut the password in a stack tag for the database
CStore the password in the stack Outputs section
DPass the password as a parameter default
✓ Correct: A. A generated Secrets Manager secret via dynamic reference

How to think about it: No passwords in templates = generate a Secrets Manager secret and use a dynamic reference.

Why A is correct: The stack creates a random secret, the database resolves it at deploy time, and the value never appears in the template.

Why the others are wrong:
B) Put the password in a stack tag for the database — Tags are plain metadata and are widely visible.
C) Store the password in the stack Outputs section — Outputs are visible to anyone who can describe the stack.
D) Pass the password as a parameter default — A parameter default stores the password in the template itself.
CloudFormationAdvanced
Q31.Deleting a stack should first empty its S3 bucket automatically so the delete succeeds. How?
AA Lambda-backed custom resource that empties the bucket on Delete
BTermination protection on the stack
CDeletionPolicy: Snapshot on the bucket
DAn S3 Lifecycle rule that expires objects after one day
✓ Correct: A. A Lambda-backed custom resource that empties the bucket on Delete

How to think about it: Run cleanup on delete = custom resource whose Lambda empties the bucket on the Delete event.

Why A is correct: On the Delete event the function removes the objects, so CloudFormation can then delete the bucket.

Why the others are wrong:
B) Termination protection on the stack — Termination protection blocks deletion instead of making it succeed.
C) DeletionPolicy: Snapshot on the bucket — S3 buckets do not support the Snapshot policy.
D) An S3 Lifecycle rule that expires objects after one day — Lifecycle expiry is asynchronous and does not run when the stack deletes.
CloudFormationAdvanced
Q32.A template should always launch EC2 from the latest Amazon Linux AMI in each Region without code. What is the native way?
AAn SSM parameter type reading the public AMI parameter
BLook up the AMI ID in the stack Outputs section
CHard-code AMI IDs in a Mappings section
DPass the latest AMI ID through a stack tag
✓ Correct: A. An SSM parameter type reading the public AMI parameter

How to think about it: Latest AMI ID = parameter type AWS::SSM::Parameter::Value pointing at the public SSM parameter.

Why A is correct: CloudFormation resolves the public Systems Manager parameter at deploy time, giving the current AMI per Region.

Why the others are wrong:
B) Look up the AMI ID in the stack Outputs section — Outputs return values after deployment; they do not look up AMIs.
C) Hard-code AMI IDs in a Mappings section — Mappings are static and go stale when new AMIs are released.
D) Pass the latest AMI ID through a stack tag — Tags do not resolve AMI IDs.
Service CatalogFundamental
Q33.New AWS users need a self-service portal to launch only admin-approved, compliant stacks such as standard VMs and databases. Which service fits?
AAWS Control Tower
BAWS Resource Access Manager
CAWS Marketplace
DAWS Service Catalog
✓ Correct: D. AWS Service Catalog

How to think about it: Self-service portal of approved products = Service Catalog.

Why D is correct: Service Catalog lets admins publish approved products that users launch through a self-service portal.

Why the others are wrong:
A) AWS Control Tower — Control Tower sets up and governs a multi-account landing zone, not a product portal.
B) AWS Resource Access Manager — RAM shares resources between accounts; it does not offer launchable products.
C) AWS Marketplace — Marketplace sells third-party software rather than an internal approved catalog.
Service CatalogFundamental
Q34.In AWS Service Catalog, what defines a product?
AA CloudFormation (IaC) template
BAn AWS Organizations SCP
CAn IAM permission set
DAn AMI shared to the account
✓ Correct: A. A CloudFormation (IaC) template

How to think about it: Service Catalog product = an IaC template, typically CloudFormation.

Why A is correct: Each product version is a template that provisions the resources when a user launches it.

Why the others are wrong:
B) An AWS Organizations SCP — SCPs limit permissions; they are not launchable products.
C) An IAM permission set — Permission sets come from IAM Identity Center and define access, not products.
D) An AMI shared to the account — An AMI can be used inside a product, but the product itself is a template.
Service CatalogFundamental
Q35.In Service Catalog, how are products grouped and given to teams?
AInto stack sets, one per member account
BInto portfolios, which IAM principals are granted
CInto resource groups built from tags
DInto organizational units in Organizations
✓ Correct: B. Into portfolios, which IAM principals are granted

How to think about it: Products go into portfolios; IAM principals are granted access to a portfolio.

Why B is correct: A portfolio is a collection of products, and access to it decides who can launch them.

Why the others are wrong:
A) Into stack sets, one per member account — StackSets are CloudFormation's multi-account feature, not the catalog grouping.
C) Into resource groups built from tags — Resource groups organize existing resources, not catalog offerings.
D) Into organizational units in Organizations — OUs group accounts, not catalog products.
Service CatalogAdvanced
Q36.Developers should launch a product that creates EC2 and RDS without holding IAM permissions to create those resources directly. What enables this?
AA launch constraint that names an IAM role
BA tag option on the portfolio
CAn SCP allowing ec2:RunInstances
DA template constraint on parameter values
✓ Correct: A. A launch constraint that names an IAM role

How to think about it: Users launch with the launch constraint role's permissions, not their own.

Why A is correct: Service Catalog provisions the product with the launch role, so users need only catalog permissions.

Why the others are wrong:
B) A tag option on the portfolio — Tag options control tags on launched products, not launch permissions.
C) An SCP allowing ec2:RunInstances — SCPs never grant permissions; they only limit them.
D) A template constraint on parameter values — Template constraints limit parameter choices; they do not supply permissions.
Service CatalogAdvanced
Q37.Admins want users of a Service Catalog product to choose only t3.micro or t3.small. How?
AAdd a template constraint to the product in the portfolio
BEnable termination protection on each provisioned product
CAdd a launch constraint with a smaller role
DCreate a separate AWS account per instance type
✓ Correct: A. Add a template constraint to the product in the portfolio

How to think about it: Restrict parameter choices at launch = template constraint.

Why A is correct: Template constraints narrow allowed parameter values without editing the product template.

Why the others are wrong:
B) Enable termination protection on each provisioned product — Termination protection does not limit instance types.
C) Add a launch constraint with a smaller role — A launch constraint sets the role used to provision, not allowed parameter values.
D) Create a separate AWS account per instance type — Separate accounts do not limit choices inside a product.
SAM & CDKFundamental
Q38.What is the AWS Serverless Application Model (SAM)?
AA managed runtime that replaces AWS Lambda functions
BA container orchestrator for serverless jobs
CA YAML serverless framework that compiles to CloudFormation
DA programming-language library compiled to Terraform
✓ Correct: C. A YAML serverless framework that compiles to CloudFormation

How to think about it: SAM = YAML shorthand for serverless apps, transformed into CloudFormation.

Why C is correct: SAM templates use a short syntax for functions, APIs and tables and deploy through CloudFormation.

Why the others are wrong:
A) A managed runtime that replaces AWS Lambda functions — SAM deploys Lambda functions; it is not a separate runtime.
B) A container orchestrator for serverless jobs — SAM is a deployment framework, not an orchestrator.
D) A programming-language library compiled to Terraform — SAM is YAML for CloudFormation, not a library for Terraform.
SAM & CDKFundamental
Q39.Which SAM resource type defines a Lambda function?
AAWS::Serverless::SimpleTable
BAWS::Serverless::Function
CAWS::Lambda::Alias
DAWS::Serverless::StateMachine
✓ Correct: B. AWS::Serverless::Function

How to think about it: SAM types start with AWS::Serverless:: (Function, Api, SimpleTable, StateMachine).

Why B is correct: This SAM type defines a function plus its event sources in a few lines.

Why the others are wrong:
A) AWS::Serverless::SimpleTable — SimpleTable defines a DynamoDB table, not a function.
C) AWS::Lambda::Alias — This is a plain CloudFormation type for an alias, not the SAM function type.
D) AWS::Serverless::StateMachine — StateMachine defines a Step Functions workflow, not a function.
SAM & CDKFundamental
Q40.A developer wants to run and debug Lambda functions behind an API on a laptop before deploying. Which tool helps?
ASystems Manager Run Command
BCodeDeploy pre-traffic hooks
CThe SAM CLI local commands
DCloudFormation drift detection
✓ Correct: C. The SAM CLI local commands

How to think about it: Run Lambda + API Gateway on your laptop = SAM CLI local.

Why C is correct: SAM can invoke functions and start a local API emulator so code is tested before deployment.

Why the others are wrong:
A) Systems Manager Run Command — Run Command executes commands on managed instances, not local Lambda tests.
B) CodeDeploy pre-traffic hooks — Hooks run during deployments in AWS, not on a laptop.
D) CloudFormation drift detection — Drift detection compares deployed resources with templates, not local runs.
SAM & CDKFundamental
Q41.What does the AWS Cloud Development Kit (CDK) let teams do?
AReplace CloudFormation with a separate engine
BWrite CloudFormation templates in XML syntax
CDeploy infrastructure only to Kubernetes clusters
DWrite infrastructure in code that becomes CloudFormation
✓ Correct: D. Write infrastructure in code that becomes CloudFormation

How to think about it: CDK = infrastructure in TypeScript, Python, Java, .NET, Go, synthesized to CloudFormation.

Why D is correct: CDK code produces CloudFormation templates that are then deployed as stacks.

Why the others are wrong:
A) Replace CloudFormation with a separate engine — CDK deploys through CloudFormation rather than replacing it.
B) Write CloudFormation templates in XML syntax — CloudFormation templates are JSON or YAML; CDK uses general programming languages.
C) Deploy infrastructure only to Kubernetes clusters — CDK targets CloudFormation and many AWS services, not just Kubernetes.
SAM & CDKFundamental
Q42.Which CDK command turns the CDK app into a CloudFormation template without deploying it?
Acdk destroy
Bcdk bootstrap
Ccdk synth
Dsam local invoke
✓ Correct: C. cdk synth

How to think about it: CDK code to template = cdk synth; deploy = cdk deploy.

Why C is correct: Synthesis runs the app and writes the CloudFormation template and assets.

Why the others are wrong:
A) cdk destroy — Destroy deletes deployed stacks.
B) cdk bootstrap — Bootstrap prepares an account and Region with resources CDK needs for deployment.
D) sam local invoke — That runs a function locally with the SAM CLI.
SAM & CDKAdvanced
Q43.A SAM function should be released gradually, with traffic shifted in steps and rolled back on alarms. What does SAM use?
AA Beanstalk rolling deployment
BDeploymentPreference with CodeDeploy shifting
CRoute 53 weighted records for each version
DA CloudFormation stack policy on the function
✓ Correct: B. DeploymentPreference with CodeDeploy shifting

How to think about it: SAM DeploymentPreference = CodeDeploy traffic shifting on an alias.

Why B is correct: SAM creates a CodeDeploy application and shifts alias traffic by canary or linear steps, with alarm rollback.

Why the others are wrong:
A) A Beanstalk rolling deployment — Beanstalk deploys to EC2 environments, not Lambda versions.
C) Route 53 weighted records for each version — Lambda versions are not DNS targets; alias weights do the split.
D) A CloudFormation stack policy on the function — Stack policies protect resources from updates; they do not shift traffic.
SAM & CDKAdvanced
Q44.A team wants one CDK app that builds a Docker image for ECS and its Lambda code and deploys them with the infrastructure. Is this supported?
ANo, application code must always go through CodeDeploy
BYes, but only by converting the app to SAM first
CYes, CDK assets ship code and images with the stack
DNo, CDK can only define networking resources
✓ Correct: C. Yes, CDK assets ship code and images with the stack

How to think about it: CDK assets package Lambda code and Docker images with the stack.

Why C is correct: CDK uploads code to S3 and images to ECR as part of deployment, so app and infrastructure ship together.

Why the others are wrong:
A) No, application code must always go through CodeDeploy — CodeDeploy is optional; CDK can deploy the code itself.
B) Yes, but only by converting the app to SAM first — CDK handles assets natively without SAM.
D) No, CDK can only define networking resources — CDK supports most AWS services, including Lambda and ECS.
SAM & CDKAdvanced
Q45.Engineers want loops, classes and reusable typed constructs to define large amounts of infrastructure rather than long YAML files. Which fits best?
AAWS SAM
BService Catalog portfolios
CRaw CloudFormation JSON
DAWS CDK
✓ Correct: D. AWS CDK

How to think about it: Need real code (loops, classes, reuse) = CDK; concise serverless YAML = SAM.

Why D is correct: CDK uses general programming languages, so constructs can be reused, looped and tested like code.

Why the others are wrong:
A) AWS SAM — SAM is concise YAML for serverless apps but has no loops or classes.
B) Service Catalog portfolios — Portfolios distribute approved products; they are not a way to write infrastructure.
C) Raw CloudFormation JSON — Raw templates are even more verbose and lack programming constructs.
Systems ManagerFundamental
Q46.An EC2 instance does not appear as a managed node in Systems Manager. Which two things should you check first?
AThe instance has an Elastic IP and detailed monitoring
BSSM Agent running and an instance profile with SSM rights
CThe instance runs in a default VPC with a public subnet
DPort 22 is open and an SSH key pair is attached
✓ Correct: B. SSM Agent running and an instance profile with SSM rights

How to think about it: SSM needs the SSM Agent running + an IAM instance profile with SSM permissions.

Why B is correct: Both are needed: the agent talks to Systems Manager, and the role authorizes it.

Why the others are wrong:
A) The instance has an Elastic IP and detailed monitoring — Neither is required for an instance to be managed.
C) The instance runs in a default VPC with a public subnet — Managed nodes can be in private subnets with endpoints or NAT.
D) Port 22 is open and an SSH key pair is attached — Systems Manager does not use SSH, so key pairs and port 22 are irrelevant.
Systems ManagerFundamental
Q47.Can Systems Manager manage on-premises servers as well as EC2?
AYes, but only for Windows Server machines
BOnly when they run on an AWS Outposts rack
CYes, with the SSM Agent and a hybrid activation
DNo, it works only with Amazon EC2 instances
✓ Correct: C. Yes, with the SSM Agent and a hybrid activation

How to think about it: Hybrid: install the agent + register with a hybrid activation.

Why C is correct: On-premises servers and VMs become managed nodes and support Run Command, patching and sessions.

Why the others are wrong:
A) Yes, but only for Windows Server machines — The agent runs on Linux, Windows and macOS.
B) Only when they run on an AWS Outposts rack — Outposts is not required to manage on-premises servers.
D) No, it works only with Amazon EC2 instances — Systems Manager supports on-premises and other-cloud servers too.
Systems ManagerFundamental
Q48.An admin must run a shell script on 500 instances without SSH, with results visible in the console and calls logged in CloudTrail. Which feature fits?
AEC2 user data
BAWS Config remediation
CEC2 Instance Connect
DSystems Manager Run Command
✓ Correct: D. Systems Manager Run Command

How to think about it: Run a script across the fleet, no SSH = Run Command.

Why D is correct: Run Command runs documents or commands on many managed nodes, integrates with IAM and logs to CloudTrail.

Why the others are wrong:
A) EC2 user data — User data runs at launch, not on demand across a running fleet.
B) AWS Config remediation — Config remediation fixes rule violations, not ad hoc scripts.
C) EC2 Instance Connect — Instance Connect opens SSH sessions to one instance at a time.
Systems ManagerFundamental
Q49.Run Command should update 10 instances at a time and stop if more than 5 fail. Which settings control this?
AInstance profile permissions
BPatch baseline approval rules
CConcurrency and error threshold
DMaintenance window duration
✓ Correct: C. Concurrency and error threshold

How to think about it: Run Command rate control = concurrency + error threshold.

Why C is correct: Concurrency limits how many targets run at once, and the error threshold stops the command after too many failures.

Why the others are wrong:
A) Instance profile permissions — IAM permissions authorize the command but do not set its pace.
B) Patch baseline approval rules — Approval rules decide which patches are approved.
D) Maintenance window duration — Duration limits when tasks may run, not how many run at once.
Systems ManagerFundamental
Q50.Admins need shell access to EC2 instances in private subnets with no inbound ports, bastion hosts or SSH keys. What should they use?
AA Site-to-Site VPN with SSH keys
BEC2 Instance Connect with public IPs
CSystems Manager Session Manager
DA bastion host in a public subnet
✓ Correct: C. Systems Manager Session Manager

How to think about it: Shell with no SSH, no bastion, no keys = Session Manager.

Why C is correct: Session Manager opens shells through the SSM Agent, controlled by IAM and with no inbound ports needed.

Why the others are wrong:
A) A Site-to-Site VPN with SSH keys — A VPN still relies on SSH and key management.
B) EC2 Instance Connect with public IPs — Instance Connect still uses SSH and needs network access to port 22.
D) A bastion host in a public subnet — A bastion is the extra host and open port this design avoids.
Systems ManagerFundamental
Q51.Auditors want a record of every command typed during Session Manager sessions. Where can session logs be sent?
AAWS Config configuration history
BAmazon S3 or CloudWatch Logs
CAWS Trusted Advisor
DVPC Flow Logs
✓ Correct: B. Amazon S3 or CloudWatch Logs

How to think about it: Session logs = S3 and/or CloudWatch Logs.

Why B is correct: Session Manager can stream or upload session output to S3 and CloudWatch Logs.

Why the others are wrong:
A) AWS Config configuration history — Config records resource configuration, not commands typed in sessions.
C) AWS Trusted Advisor — Trusted Advisor gives best-practice checks, not session logs.
D) VPC Flow Logs — Flow Logs capture network metadata, not session commands.
Systems ManagerFundamental
Q52.In Patch Manager, what defines which patches are approved for installation, such as critical security updates after seven days?
AA patch baseline
BAn SSM parameter
CA resource group
DA maintenance window
✓ Correct: A. A patch baseline

How to think about it: Which patches are approved = patch baseline.

Why A is correct: A patch baseline holds approval rules and lists of approved or rejected patches.

Why the others are wrong:
B) An SSM parameter — Parameters store configuration values, not patch approval rules.
C) A resource group — Resource groups collect targets but do not approve patches.
D) A maintenance window — A maintenance window sets when tasks run, not which patches are approved.
Systems ManagerFundamental
Q53.Patching must happen only on Sundays from 2 to 4 AM for production servers. Which feature schedules this?
AA CloudFormation StackSet
BAn EC2 Auto Scaling scheduled scaling action
CA maintenance window running AWS-RunPatchBaseline
DAn S3 Lifecycle rule on the patch bucket
✓ Correct: C. A maintenance window running AWS-RunPatchBaseline

How to think about it: Schedule + targets + tasks = Maintenance Window running AWS-RunPatchBaseline.

Why C is correct: The window sets the schedule and duration, and the registered task applies the baseline on the targets.

Why the others are wrong:
A) A CloudFormation StackSet — StackSets deploy stacks; they do not schedule OS patching.
B) An EC2 Auto Scaling scheduled scaling action — Scheduled actions change capacity, not patch instances.
D) An S3 Lifecycle rule on the patch bucket — Lifecycle rules manage object storage classes.
Systems ManagerFundamental
Q54.How can dev, test and prod servers each get a different patch baseline?
AUse separate IAM instance profiles per environment
BA Patch Group tag per environment, each mapped to a baseline
CRun each environment in a different Region
DGive each environment its own SSM Agent version
✓ Correct: B. A Patch Group tag per environment, each mapped to a baseline

How to think about it: Group servers for patching with the Patch Group tag, one baseline per group.

Why B is correct: Each patch group is tied to one baseline, so environments follow different approval rules.

Why the others are wrong:
A) Use separate IAM instance profiles per environment — Instance profiles grant permissions; they do not pick baselines.
C) Run each environment in a different Region — Regions do not decide which baseline applies.
D) Give each environment its own SSM Agent version — The agent version does not select a patch baseline.
Systems ManagerAdvanced
Q55.Before an Auto Scaling group terminates an instance, its logs must be copied to S3. How can this be automated?
AInstance scale-in protection on every instance
BA termination lifecycle hook, EventBridge and SSM Automation
CAn S3 Lifecycle rule on the log bucket
DAn EC2 user data script that runs at shutdown
✓ Correct: B. A termination lifecycle hook, EventBridge and SSM Automation

How to think about it: Act before ASG termination = lifecycle hook (Terminating:Wait) + EventBridge + SSM command.

Why B is correct: The hook pauses the instance in Terminating:Wait, EventBridge catches it, and SSM runs the copy before completing the action.

Why the others are wrong:
A) Instance scale-in protection on every instance — Scale-in protection stops termination altogether rather than allowing cleanup first.
C) An S3 Lifecycle rule on the log bucket — Lifecycle rules manage objects already in S3; they cannot pull logs from instances.
D) An EC2 user data script that runs at shutdown — User data runs at launch, and termination may not wait for scripts.
Systems ManagerAdvanced
Q56.Instances in private subnets with no NAT gateway or internet route must still use Session Manager. What do they need?
AA gateway VPC endpoint for DynamoDB
BAn internet gateway on the private route table
CInterface VPC endpoints for the Systems Manager services
DSecurity group rules allowing inbound port 22
✓ Correct: C. Interface VPC endpoints for the Systems Manager services

How to think about it: Private subnets, no internet = interface VPC endpoints for the Systems Manager services.

Why C is correct: PrivateLink endpoints such as ssm and ssmmessages let the agent reach Systems Manager without internet access.

Why the others are wrong:
A) A gateway VPC endpoint for DynamoDB — Gateway endpoints exist only for S3 and DynamoDB, and neither carries SSM traffic.
B) An internet gateway on the private route table — That makes the subnet public, which goes against the design.
D) Security group rules allowing inbound port 22 — Session Manager needs no inbound ports at all.
Systems ManagerAdvanced
Q57.Security wants to know who started each Session Manager session and when. Which service records this?
AAmazon Inspector findings
BVPC Flow Logs for the subnet
CAWS CloudTrail StartSession events
DAmazon GuardDuty findings
✓ Correct: C. AWS CloudTrail StartSession events

How to think about it: Who started a session = CloudTrail StartSession events.

Why C is correct: CloudTrail records the IAM identity, time and target of each session started.

Why the others are wrong:
A) Amazon Inspector findings — Inspector reports vulnerabilities, not session starts.
B) VPC Flow Logs for the subnet — Flow Logs show network flows, not the identity that opened a session.
D) Amazon GuardDuty findings — GuardDuty detects threats but is not the record of who opened each session.
Cloud MapFundamental
Q58.Microservices need a registry where backends register their locations and health, so callers can look them up dynamically. Which service fits?
AAmazon CloudFront
BAWS Systems Manager Inventory
CAWS Service Catalog
DAWS Cloud Map
✓ Correct: D. AWS Cloud Map

How to think about it: Service discovery registry = AWS Cloud Map.

Why D is correct: Cloud Map stores service names, locations, attributes and health so apps can discover backends.

Why the others are wrong:
A) Amazon CloudFront — CloudFront is a CDN, not a service registry.
B) AWS Systems Manager Inventory — Inventory collects software and configuration data from managed nodes.
C) AWS Service Catalog — Service Catalog offers approved products to launch, not runtime discovery.
Cloud MapFundamental
Q59.How can applications query AWS Cloud Map to find healthy endpoints?
AThrough the AWS SDK or API, or through DNS queries
BOnly through CloudFormation stack outputs
COnly through SSH into a registry host
DOnly by reading an S3 manifest file
✓ Correct: A. Through the AWS SDK or API, or through DNS queries

How to think about it: Cloud Map lookup = API/SDK or DNS, with health checks filtering endpoints.

Why A is correct: Cloud Map supports API-based discovery and DNS records, and returns only healthy endpoints when health checks are used.

Why the others are wrong:
B) Only through CloudFormation stack outputs — Stack outputs are static values, not live discovery.
C) Only through SSH into a registry host — Cloud Map is a managed service with no hosts to log in to.
D) Only by reading an S3 manifest file — Cloud Map is queried by API or DNS, not through S3 files.
Cloud MapAdvanced
Q60.A frontend must move from backend v1 to v2 without a code change or redeploy of the frontend. How does Cloud Map help?
AUse a Service Catalog launch constraint
BCreate a CloudFormation drift report on the stack
CHard-code both endpoints and use a feature flag
DUpdate the Cloud Map registration so lookups return v2
✓ Correct: D. Update the Cloud Map registration so lookups return v2

How to think about it: Swap backends without frontend changes = update the Cloud Map registration; callers look up dynamically.

Why D is correct: The frontend resolves the service name at runtime, so changing the registration redirects it to v2.

Why the others are wrong:
A) Use a Service Catalog launch constraint — Launch constraints control provisioning permissions, not service lookups.
B) Create a CloudFormation drift report on the stack — Drift reports show configuration differences; they do not route traffic.
C) Hard-code both endpoints and use a feature flag — That needs frontend code changes, which this design avoids.