aws-s3api
Call low-level Amazon S3 API operations
TLDR
Create bucket in a specific region
Delete a bucket
List buckets
List the objects inside of a bucket and only show each object's key and size
Add an object to a bucket
Download object from a bucket (The output file is always the last argument)
Apply an Amazon S3 bucket policy to a specified bucket
Download the Amazon S3 bucket policy from a specified bucket
SYNOPSIS
aws s3api operation [operation-parameters] [--generate-cli-skeleton (0|1|2)] [--cli-input-json file] [--cli-binary-format (raw-in-base64-out|raw-in-raw-out|base64-in-base64-out)]
PARAMETERS
--cli-input-json
Perform operation using JSON string from file or stdin.
--generate-cli-skeleton
Print JSON skeleton (0=empty, 1=basic, 2=full) for operation parameters.
--cli-binary-format
Specify binary input/output format for blobs (raw-in-base64-out, etc.).
--debug (-d)
Enable debug logging.
--endpoint-url
Override default endpoint URL.
--no-verify-ssl
Disable SSL certificate verification.
--cli-read-timeout
Max seconds to wait for response read.
--cli-connect-timeout
Max seconds to wait for connection.
--profile
Use specific profile from credentials file.
--region
AWS region (e.g., us-east-1).
--output (json|text|table)
Output format.
--query
JMESPath query to filter output.
--no-cli-pager
Disable cli pager for output.
--help (-h)
Show help for command.
DESCRIPTION
aws s3api is a subcommand of the AWS Command Line Interface (CLI) that provides direct, low-level access to Amazon Simple Storage Service (S3) APIs. Unlike the high-level aws s3 commands designed for simplified file transfers and management, aws s3api maps one-to-one with S3 REST API operations, offering precise control over features like multipart uploads, object tagging, ACLs, versioning, encryption, replication, and inventory configurations.
Users invoke specific operations such as put-object, get-object, list-objects-v2, or create-bucket, supplying parameters like --bucket, --key, and others required by the API. It supports JSON input via --cli-input-json for complex payloads and --generate-cli-skeleton for generating parameter templates, making it ideal for scripting and automation.
Requires AWS CLI v1 or v2 installed, valid credentials configured (via aws configure), and appropriate IAM permissions. Outputs in JSON by default but customizable. Best for advanced users familiar with S3 APIs; beginners should start with aws s3.
CAVEATS
Parameters vary by operation; use aws s3api
COMMON SUBCOMMANDS
put-object, get-object, delete-object, list-objects-v2, create-bucket, head-object, copy-object, complete-multipart-upload, list-buckets (full list via aws s3api help).
EXAMPLE
aws s3api put-object --bucket mybucket --key file.txt --body ./local.txt
aws s3api list-objects-v2 --bucket mybucket --query 'Contents[].{Key:Key,Size:Size}'
HISTORY
Introduced in AWS CLI v1.7.0 (2014) for direct S3 API access. Improved in v2 (2020+) with faster performance, better binary handling, and enhanced JSON support. Widely used in DevOps for custom S3 integrations.


