Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 8f61fa4

Browse files
committed
add updates to cos
1 parent cf19b10 commit 8f61fa4

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

workshop/fuse/README.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Select an account:
4141
Then, set an environment variable with the bucket name, and upload a document to your bucket in the IBM Cloud Object Storage instance.
4242

4343
```
44+
COS_NAME=<cos-instance-name>
4445
COS_BUCKET_NAME=<cos-bucket-name>
4546
```
4647

@@ -69,7 +70,19 @@ Install `s3fs`,
6970
brew install s3fs
7071
```
7172

72-
Create an IBM Cloud Object Storage instance with HMAC keys,
73+
If you already have credentials with HMAC keys created for your Object Storage instance, you can retrieve credentials using,
74+
75+
```
76+
ibmcloud resource service-keys --output json
77+
```
78+
79+
Set an environment variable `COS_CREDENTIALS` with the name of the credentials,
80+
81+
```
82+
COS_CREDENTIALS=$(ibmcloud resource service-keys --output json | jq -r '.[0].credentials.iam_apikey_name')
83+
```
84+
85+
If you do not have credentials yet, create credentials for your IBM Cloud Object Storage instance with HMAC keys,
7386

7487
```
7588
ibmcloud resource service-key-create $COS_CREDENTIALS Writer --instance-name $COS_NAME --parameters '{"HMAC":true}'
@@ -84,7 +97,7 @@ Will create credentials including among other HMAC keys,
8497
},
8598
```
8699

87-
Create environment variables with the HMAC keys, and create an S3FS password file,
100+
Create environment variables with the HMAC keys from the first credentials listed in your `service-keys` list. Change the index value if you have multiple `service-keys` or credentials. Create an S3FS password file,
88101

89102
```
90103
COS_ACCESS_KEY=$(ibmcloud resource service-key $COS_CREDENTIALS --output json | jq -r '.[0].credentials.cos_hmac_keys.access_key_id')
@@ -109,12 +122,14 @@ s3fs $COS_BUCKET_NAME -o passwd_file=$(pwd)/$COS_S3FS_PASSWORD_FILE -o url=https
109122

110123
You should see the content of your IBM Cloud Object Storage, e.g using the Finder on macos
111124

112-
![S3FS mounted IBM Cloud Object Storage bucket](../.gitbook/images/s3fs/s3fs-mount-cos-bucket.png)
125+
![S3FS mounted IBM Cloud Object Storage bucket](images/s3fs/s3fs-mount-cos-bucket.png)
113126

114127
or using the cli on macos,
115128

116-
![S3FS mounted IBM Cloud Object Storage bucket CLI](../.gitbook/images/s3fs/s3fs-mount-cos-bucket-cli.png)
129+
![S3FS mounted IBM Cloud Object Storage bucket CLI](images/s3fs/s3fs-mount-cos-bucket-cli.png)
130+
131+
If you are using a bucket mounted to a MongoDB instance using `s3fs-fuse`, you will also see a directory `data/db` with all the MongoDB database files mounted to your local filesystem.
117132

118133
### References
119134

120-
* https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-s3fs
135+
* [Mounting a bucket using s3fs](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-s3fs)
33.3 KB
Loading
17.9 KB
Loading

0 commit comments

Comments
 (0)