diff --git a/bun.lock b/bun.lock index 16c21d09..b8a3e27c 100644 --- a/bun.lock +++ b/bun.lock @@ -1,5 +1,6 @@ { "lockfileVersion": 1, + "configVersion": 0, "workspaces": { "": { "name": "registry", diff --git a/registry/ausbru87/modules/aws-cli/README.md b/registry/ausbru87/modules/aws-cli/README.md index c1b12608..110dfe61 100644 --- a/registry/ausbru87/modules/aws-cli/README.md +++ b/registry/ausbru87/modules/aws-cli/README.md @@ -123,18 +123,18 @@ For more information, see the [AWS CLI Configuration Guide](https://docs.aws.ama ## Variables -| Name | Description | Default | Required | -| ------------------- | -------------------------------------------------------------------------------------------- | -------------- | -------- | -| `agent_id` | The ID of a Coder agent | - | Yes | -| `aws_cli_version` | The version of AWS CLI to install (leave empty for latest) | `""` | No | -| `install_directory` | The directory to install AWS CLI to | `/usr/local` | No | -| `architecture` | The architecture to install AWS CLI for (`x86_64` or `aarch64`, empty for auto-detection) | `""` | No | -| `verify_signature` | Whether to verify the GPG signature of the downloaded installer | `false` | No | +| Name | Description | Default | Required | +| ------------------- | ----------------------------------------------------------------------------------------- | ------------ | -------- | +| `agent_id` | The ID of a Coder agent | - | Yes | +| `aws_cli_version` | The version of AWS CLI to install (leave empty for latest) | `""` | No | +| `install_directory` | The directory to install AWS CLI to | `/usr/local` | No | +| `architecture` | The architecture to install AWS CLI for (`x86_64` or `aarch64`, empty for auto-detection) | `""` | No | +| `verify_signature` | Whether to verify the GPG signature of the downloaded installer | `false` | No | ## Outputs -| Name | Description | -| ----------------- | ------------------------------------------------------------------------------------ | +| Name | Description | +| ----------------- | ----------------------------------------------------------------------------------- | | `aws_cli_version` | The version of AWS CLI that was installed (or 'latest' if no version was specified) | ## Requirements diff --git a/registry/ausbru87/modules/aws-cli/run.sh b/registry/ausbru87/modules/aws-cli/run.sh index ee3e000a..148f3c0e 100755 --- a/registry/ausbru87/modules/aws-cli/run.sh +++ b/registry/ausbru87/modules/aws-cli/run.sh @@ -8,10 +8,10 @@ ARCHITECTURE="${ARCHITECTURE}" VERIFY_SIGNATURE="${VERIFY_SIGNATURE}" # Check if AWS CLI is already installed -if command -v aws >/dev/null 2>&1; then +if command -v aws > /dev/null 2>&1; then INSTALLED_VERSION=$(aws --version 2>&1 | awk '{print $1}' | cut -d'/' -f2) echo "â„šī¸ AWS CLI is already installed (version $INSTALLED_VERSION)" - + # If a specific version was requested, check if it matches if [ -n "$VERSION" ] && [ "$INSTALLED_VERSION" != "$VERSION" ]; then echo "âš ī¸ Installed version ($INSTALLED_VERSION) does not match requested version ($VERSION)" @@ -67,10 +67,10 @@ fi # Verify signature if requested if [ "$VERIFY_SIGNATURE" = "true" ]; then echo "🔐 Verifying GPG signature..." - + # Download signature file curl -fsSL "$DOWNLOAD_URL.sig" -o "awscliv2.zip.sig" - + # Download and import AWS CLI public key cat > awscli-public-key.asc << 'EOF' -----BEGIN PGP PUBLIC KEY BLOCK----- @@ -127,10 +127,10 @@ qJZLqJZJqJZLqJZJqJZLqJZJqA== =qvqC -----END PGP PUBLIC KEY BLOCK----- EOF - - gpg --import awscli-public-key.asc 2>/dev/null || true - - if gpg --verify awscliv2.zip.sig awscliv2.zip 2>/dev/null; then + + gpg --import awscli-public-key.asc 2> /dev/null || true + + if gpg --verify awscliv2.zip.sig awscliv2.zip 2> /dev/null; then echo "✅ Signature verification successful" else echo "âš ī¸ Signature verification failed, but continuing installation..." @@ -152,7 +152,7 @@ else fi # Verify installation -if command -v aws >/dev/null 2>&1; then +if command -v aws > /dev/null 2>&1; then INSTALLED_VERSION=$(aws --version 2>&1 | awk '{print $1}' | cut -d'/' -f2) echo "✅ AWS CLI successfully installed (version $INSTALLED_VERSION)" aws --version