atxtechbro / atxtechbro/dotfiles

Automate AWS CLI installation and updates in setup.sh

Open
#252 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
27
Forks
2
PR merge metrics
No merged PRs in 30d

Description

## Overview
Add automated installation and update functionality for AWS CLI in setup.sh, similar to how we currently handle GitHub CLI and the proposed Google Cloud CLI automation.

## Current Behavior
- AWS CLI must be manually installed and updated
- No consistent installation process across different machines
- Doesn't follow our "spilled coffee" principle for reproducibility
- Telemetry might be enabled by default, sending usage data to AWS

## Desired Behavior
- Detect if AWS CLI is installed, and install if missing
- Check for updates and apply them automatically during setup
- Follow the same pattern used for GitHub CLI in setup.sh
- Support multiple platforms (Debian/Ubuntu, Arch, macOS)
- Automatically disable telemetry/usage reporting

## Implementation Details
1. Add a function to detect AWS CLI installation
2. Add platform-specific installation commands
3. Add update mechanism for existing installations
4. Include proper error handling and user feedback
5. Disable telemetry collection after installation

### Example Implementation (for Debian/Ubuntu):
```bash
# Check for AWS CLI and install/update if needed
if ! command -v aws &> /dev/null; then
echo "Installing AWS CLI..."
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
rm -rf aws awscliv2.zip

# Disable telemetry
aws configure set cli_follow_urlparam false
else
echo "Checking for AWS CLI updates..."
# Get current version
CURRENT_VERSION=$(aws --version | cut -d ' ' -f1 | cut -d '/' -f2)

# Get latest version from AWS
LATEST_VERSION=$(curl -s https://raw.githubusercontent.com/aws/aws-cli/v2/CHANGELOG.rst | grep -m 1 -o '[0-9]\+\.[0-9]\+\.[0-9]\+' || echo "0.0.0")

# Compare versions and update if needed
if [ "$CURRENT_VERSION" != "$LATEST_VERSION" ] && [ "$LATEST_VERSION" != "0.0.0" ]; then
echo "Updating AWS CLI from $CURRENT_VERSION to $LATEST_VERSION..."
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install --update
rm -rf aws awscliv2.zip
else
echo "AWS CLI is already up to date ($CURRENT_VERSION)"
fi

# Ensure telemetry remains disabled
aws configure set cli_follow_urlparam false
fi
```

## Additional Considerations
- Create a `.bash_aliases.aws` file for common AWS CLI commands and shortcuts
- Consider adding basic configuration options during setup
- Document the AWS CLI installation in the README.md
- Add a note about telemetry being disabled by default in our setup
- Consider adding support for AWS CLI profiles setup

## Related to
- Follows the same pattern as GitHub CLI automation
- Complements the Google Cloud CLI automation (issue #250)
- Supports our modular shell configuration approach
- Aligns with the "spilled coffee" principle
- Respects privacy by disabling telemetry collection

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading setup.sh and the existing GitHub CLI automation, then compare the proposed Google Cloud CLI work in issue #250. Implement AWS CLI detection, installation and updates for Debian/Ubuntu, Arch and macOS with error handling and telemetry disabled; document the setup in README.md and verify each platform path.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, shell
Domain
cli, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.