#!/usr/bin/env bash
# Prints the AWS CLI version. Does not call AWS unless AWS_LAB_CALLER=1.
set -euo pipefail

if ! command -v aws >/dev/null 2>&1; then
  echo "aws=absent"
  echo "lab=ok"
  exit 0
fi

aws --version
echo "caller_check=skipped"

if [[ "${AWS_LAB_CALLER:-}" == "1" ]]; then
  aws sts get-caller-identity --output json --no-cli-pager
  echo "caller_check=ran"
fi

echo "lab=ok"
