How to get a direct URL to a file on IBM Cloud Object Storage that has access key id and secret access key

608 Views Asked by At

I am trying to access a file in a bucket on s3.us.cloud-object-storage and it has an access point id and secret access key and I cant find a way to type a url that gives me access. Can some one help? Thanks.

1

There are 1 best solutions below

2
On

COS is s3 compatible so you can use the aws cli with the HMAC credentials, see https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-aws-cli

Alternatively can use the ibmcloud cli using your IBM IAM credentials after installing the cos plugin into the ibmcloud cli. See https://cloud.ibm.com/docs/cloud-object-storage-cli-plugin?topic=cloud-object-storage-cli-plugin-ic-cos-cli

I just opened an ibm cloud shell to verify the instructions below. On cloud.ibm.com see the shell in the upper left corner.

While the browser is open navigate to your COS instance, then the bucket. On the left choose the Configuration for your bucket and copy the Bucket instance CRN The CRN for the COS instance does not include the final :bucket:bucket-name but does include the ::

In the shell:

ibmcloud cos config crn --crn crn:v1:bluemix:public:cloud-object-storage:global:a/713c783d9a507a53135fe6793c37cc74:bd19a0fa-74a0-4962-bfae-f1f4f8b9eea6::
ibmcloud cos buckets
ibmcloud cos objects --bucket tmp-s3fs-aafa2e74-89da-40d6-8a3a-bd33477901e9