S3 Connection Testing
In order to test connection to an S3 bucket you need to execute
connect test s3
followed by two mandatory parameters:
--bucket
then the S3 bucket name--region
then the region where the bucket is located
Depending on the type of authentication you need to either use --access-key
and --secret-access-key
for key based authentication
or use the IAM Role Assigned to the Instance (if the server is running on AWS).
Access Key and Secret Access Key
Section titled “Access Key and Secret Access Key”To use the Access Key and Secret Access Key authentication you need to provide:
--access-key
then the Access Key--secret-access-key
then the Secret Access Key
For example:
$ connect test s3 --bucket my-s3-bucket --region eu-central-1 --access-key AKIA4YINCR26KRN42IDA --secret-access-key PHQlr4HsdFijIRCxMqFXDRS8lSh+WBABqFjIQWM42025/05/19 20:56:56 INFO Testing connection to s3://my-s3-bucket/2025/05/19 20:56:56 INFO Connection successful
Access Key and Secret Access Key with AWS CONFIGURE
Section titled “Access Key and Secret Access Key with AWS CONFIGURE”You can use aws configure
.
This command prompts you to enter the Access Key ID and Secret Access Key, which are then stored in your AWS CLI configuration file ~/.aws/credentials
.
For example:
$ aws configureAWS Access Key ID [None]: AKIA4YINCR26KRN42IDAAWS Secret Access Key [None]: PHQlr4HsdFijIRCxMqFXDRS8lSh+WBABqFjIQWM4Default region name [None]: eu-central-1Default output format [None]:
Then you can omit providing the credentials as they will be obtained from the configuration.
$ connect test s3 --bucket my-s3-bucket --region eu-central-12025/05/19 20:57:23 INFO Testing connection to s3://my-s3-bucket/2025/05/19 20:57:24 INFO Connection successful
IAM Role Assigned to the Instance
Section titled “IAM Role Assigned to the Instance”If your instance is running in AWS the temporary credentials will be automatically retrieved from the instance metadata (unless you have overridden it with aws configure). You don’t have to specify the credentials then.
For example:
$ connect test s3 --bucket my-s3-bucket --region eu-central-12025/05/19 21:08:22 INFO Testing connection to s3://my-s3-bucket/2025/05/19 21:08:23 INFO Connection successful
Connecting to S3-compatible service
Section titled “Connecting to S3-compatible service”To connect to an S3-compatible service like Minio you need to provide the URL using:
--custom-url
and then the S3 instance URL
For example:
$ connect test s3 --bucket my-s3-bucket --region auto --custom-url https://my-s3-host.com --access-key AKIA4YINCR26KRN42IDA --secret-access-key PHQlr4HsdFijIRCxMqFXDRS8lSh+WBABqFjIQWM42025/05/19 21:09:11 INFO Testing connection to s3://my-s3-bucket/2025/05/19 21:09:11 INFO Connection successful
All S3 Connection Test Options
Section titled “All S3 Connection Test Options”Usage: connect test s3 [command] [flags]
Flags: --access-key string S3 access key --bucket string S3 bucket --custom-url string S3 custom URL --region string S3 region --secret-access-key string S3 secret access key
Global Flags: --godebug Turns on debug mode --help Prints help for the command --log-format string Log output format: text|json (default "text") --no-color Do not use colors in logs --quiet Makes no output
Errors
Section titled “Errors”Please check here for information on the possible errors.