Question 825 of 1,546
Deployment, Provisioning, and AutomationmediumMultiple ChoiceObjective-mapped

Quick Answer

The correct approach is to use SSM Run Command with the AWS-RunShellScript document, targeting all 150 instances and sending the output to an S3 bucket. This method satisfies the security policy by executing scripts without opening SSH port 22, because the AWS Systems Manager agent communicates over HTTPS (port 443) to receive commands and return results, eliminating the need for direct network access. On the AWS Certified SysOps Administrator Associate SOA-C02 exam, this scenario tests your understanding of agent-based management versus traditional SSH access, often appearing as a trap where candidates mistakenly consider AWS Systems Manager Session Manager (which provides interactive shell access but not script execution with captured output) or AWS Config. Remember the key distinction: Run Command is for script execution and output capture, while Session Manager is for interactive sessions. A helpful memory tip is "Run Command runs scripts, Session Manager sessions" — both use port 443, but only Run Command saves output to S3 for review.

SOA-C02 Practice Question: SSM Run Command for executing scripts across a…

This SOA-C02 practice question tests your understanding of deployment, provisioning, and automation. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. A key principle to apply: sSM Run Command. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A security policy prohibits opening SSH port 22 on any EC2 instance. The operations team needs to run a shell script on 150 Linux instances to collect configuration inventory data. The script output must be captured for review. How should the team execute the script?

Question 1mediummultiple choice
Full question →

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use SSM Run Command with the AWS-RunShellScript document targeting all 150 instances; send output to an S3 bucket

SSM Run Command with the AWS-RunShellScript document allows you to execute shell scripts on multiple EC2 instances without opening SSH port 22, as it operates over the AWS Systems Manager agent (SSM Agent) using HTTPS (port 443). The output can be directed to an S3 bucket for centralized review, satisfying both the security policy and the requirement to capture script output.

Key principle: SSM Run Command

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use SSM Run Command with the AWS-RunShellScript document targeting all 150 instances; send output to an S3 bucket

    Why this is correct

    Run Command invocations use the SSM Agent's existing outbound HTTPS connection (port 443) — no inbound rule changes are needed. The command output for each instance is stored separately in S3, allowing the team to review per-instance results. Commands can target instances by tag (e.g., Environment=production) to avoid listing all 150 instance IDs manually.

    Related concept

    SSM Run Command

  • Create a bastion host with SSH access and use a for loop to SSH into each instance and run the script

    Why it's wrong here

    The security policy explicitly prohibits SSH. A bastion host would require port 22 to be open on all 150 instances to the bastion's IP — this directly contradicts the policy.

  • Use EC2 Instance Connect to establish a temporary SSH session for each instance and run the script

    Why it's wrong here

    EC2 Instance Connect pushes a temporary SSH public key to the instance metadata and then opens an SSH connection. It still uses SSH and requires port 22 to be open in the security group — violating the policy.

  • Terminate all instances and re-launch them from a new AMI that includes the configuration inventory already baked in

    Why it's wrong here

    Terminating and replacing instances to collect inventory data is destructively disproportionate. Run Command collects the data from running instances with no disruption.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates may assume EC2 Instance Connect or a bastion host are acceptable workarounds, but both still rely on SSH (port 22), which is explicitly prohibited by the security policy, whereas SSM Run Command operates over HTTPS and fully complies.

Trap categories for this question

  • Command / output trap

    Terminating and replacing instances to collect inventory data is destructively disproportionate. Run Command collects the data from running instances with no disruption.

Detailed technical explanation

How to think about this question

AWS Systems Manager Run Command uses the SSM Agent, which communicates with the AWS Systems Manager service via HTTPS (port 443) and does not require inbound SSH ports. The AWS-RunShellScript document executes commands as the root user by default, and output can be streamed to CloudWatch Logs or S3 for persistence. This approach is ideal for fleet management at scale, as it supports targeting instances by tags or resource groups, and provides centralized logging and error handling.

KKey Concepts to Remember

  • SSM Run Command
  • AWS-RunShellScript
  • managed instances
  • no SSH required
  • command output to S3

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

SSM Run Command

Real-world example

How this comes up in practice

A media company stores terabytes of video archives that are accessed once a year for audit purposes. Moving these objects to a cold storage tier (Azure Archive, S3 Glacier, or Google Nearline) costs a fraction of hot storage. Questions like this test whether you understand storage tiers, access frequency tradeoffs, and retrieval latency requirements.

What to study next

Got this wrong? Here's your next step.

Review sSM Run Command, then practise related SOA-C02 questions on the same topic to reinforce the concept.

Related practice questions

Related SOA-C02 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free SOA-C02 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this SOA-C02 question test?

Deployment, Provisioning, and Automation — This question tests Deployment, Provisioning, and Automation — SSM Run Command.

What is the correct answer to this question?

The correct answer is: Use SSM Run Command with the AWS-RunShellScript document targeting all 150 instances; send output to an S3 bucket — SSM Run Command with the AWS-RunShellScript document allows you to execute shell scripts on multiple EC2 instances without opening SSH port 22, as it operates over the AWS Systems Manager agent (SSM Agent) using HTTPS (port 443). The output can be directed to an S3 bucket for centralized review, satisfying both the security policy and the requirement to capture script output.

What should I do if I get this SOA-C02 question wrong?

Review sSM Run Command, then practise related SOA-C02 questions on the same topic to reinforce the concept.

What is the key concept behind this question?

SSM Run Command

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Keep practising

More SOA-C02 practice questions

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This SOA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SOA-C02 exam.