Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions day03/create_ec2.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/bin/bash
set -euo pipefail

#check if AWS CLI already installed or not

check_awscli() {
if ! command -v aws &> /dev/null; then
echo "AWS CLI is not installed. Please install it first." >&2
exit 1
fi
}

#install AWS CLI
install_awscli() {
echo "Installing AWS CLI v2 on Linux..."

Expand Down Expand Up @@ -37,7 +39,7 @@ wait_for_instance() {
sleep 10
done
}

# here these $ with 1,2,3,4,5,6 are arguments

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Clarify the positional-argument mapping.

This comment is grammatically unclear and does not explain what each argument represents. Document the mapping explicitly.

Suggested comment
-# here these $ with 1,2,3,4,5,6 are arguments
+# Positional arguments: $1=ami_id, $2=instance_type, $3=key_name,
+# $4=subnet_id, $5=security_group_ids, $6=instance_name.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# here these $ with 1,2,3,4,5,6 are arguments
# Positional arguments: $1=ami_id, $2=instance_type, $3=key_name,
# $4=subnet_id, $5=security_group_ids, $6=instance_name.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@day03/create_ec2.sh` at line 42, Update the comment near the positional
parameter references in create_ec2.sh to explicitly map $1 through $6 to the
values or options each argument represents, using clear grammatical wording and
preserving the script’s existing argument order.

create_ec2_instance() {
local ami_id="$1"
local instance_type="$2"
Expand Down