Skip to main content

AWS CLI

Overview​

AWS CLI is a powerful command-line tool for managing AWS services, including S3. You can use AWS CLI to interact with Vietnix Cloud S3 Storage by configuring custom endpoints and credentials.

How to Connect AWS CLI to Vietnix Cloud S3 Storage​

Follow these steps to configure AWS CLI for Vietnix Cloud S3:

1. Install AWS CLI​

2. Get Your Vietnix S3 Credentials​

You will need:

  • Access Key
  • Secret Key
  • Endpoint URL (e.g. https://s3.vn-hcm-1.vietnix.cloud)
  • Bucket Name

Find these details in your Vietnix Cloud Portal.

3. Configure AWS CLI Credentials​

Run the following command and enter your credentials:

aws configure
  • AWS Access Key ID: Your Vietnix S3 Access Key
  • AWS Secret Access Key: Your Vietnix S3 Secret Key
  • Default region name: vn-hcm-1 (or leave blank)
  • Default output format: json (or your preference)

4. Use Custom Endpoint with AWS CLI​

For each S3 command, specify the custom endpoint using the --endpoint-url flag.

Example: List Buckets​
aws s3 ls --endpoint-url https://s3.vn-hcm-1.vietnix.cloud
Example: List Objects in a Bucket​
aws s3 ls s3://your-bucket-name --endpoint-url https://s3.vn-hcm-1.vietnix.cloud
Example: Upload a File​
aws s3 cp ./local-file.txt s3://your-bucket-name/local-file.txt --endpoint-url https://s3.vn-hcm-1.vietnix.cloud
Example: Download a File​
aws s3 cp s3://your-bucket-name/remote-file.txt ./remote-file.txt --endpoint-url https://s3.vn-hcm-1.vietnix.cloud

5. Advanced Usage​

You can use all standard AWS CLI S3 commands with the custom endpoint. For automation, scripting, and more options, refer to the AWS CLI S3 documentation.


note
  • Always keep your credentials secure and rotate them regularly.
  • If you encounter issues, double-check your endpoint URL and credentials.
  • For advanced features and troubleshooting, see the AWS CLI User Guide.