Using Oracle Cloud Infrastructure S3 API

Oracle Cloud Infrastructure (OCI) offer an S3 compatible Object Storage service. Although there is some documentation on how to use it, it’s always useful to have a working example for reference.

Here I’ll show you how to connect to Oracle’s Object Storage Service using the AWS Go SDK.

Oracle Cloud Infrastructure Storage UI

Credentials

In order to authenticate requests to the Oracle Cloud Infrastructure S3 compatible API we need to get hold of a accessKey and secretAccess key. These can be generated by visiting your user settings and looking for the “Amazon S3 Compatibility API Keys” section of the Oracle Cloud Infrastructure UI.

Constructing S3 HTTP endpoints

Oracle Cloud Infrastructure requires the S3 urls to be in a specific format. The tenancy is your Oracle Cloud Infrastructure tenancy, and region is your OCI region (i.e us-phoenix-1)

mytenancy.compat.objectstorage.us-phoenix-1.oraclecloud.com

Putting it all together

We will use the AWS Go SDK to connect to Oracle Cloud Infrastructure Object Storage. Here is a full working example using the AWS Go SDK.

If you have any questions, feel free to get in touch.

Like what you read? Give Owain Lewis a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.