S3

  • Do not forget about bucket policy whe troubleshooting access
  • Find something by partial name
    aws s3api list-objects-v2 --bucket bname --query "Contents[?contains(Key, 'searchstring')]"
  • S3 bucket policies
    aws --profile myprod s3api get-bucket-policy --bucket bname |jq '.Policy | fromjson'
  • S3 list sorted
    # All files sorted
    aws s3 ls --human-readable --recursive s3://bname/|sort|tee s3-files.sorted
  • Pulling all cloudWatch logs
    for g in $(awslogs groups |grep interest); do 
      echo '-------'
      echo $g
      awslogs get $g ALL -s6h
    
    done|tee 2019-04-02-my.logs