Lithops with IBM COS as storage backend.
-
Create an IBM Cloud Object Storage account.
-
Crate a bucket in your desired region. Remember to update the corresponding Lithops config field with this bucket name.
- Create the credentials to access to your COS account (Choose one option):
-
In the side navigation, click
Service Credentials
. -
Click
New credential +
and provide the necessary information. -
Click
Add
to generate service credential. -
Click
View credentials
and copy the apikey value. -
Edit your lithops config file and add the following keys:
lithops: storage: ibm_cos ibm_cos: storage_bucket: <BUCKET_NAME> region : <REGION> api_key : <API_KEY>
-
In the side navigation, click
Service Credentials
. -
Click
New credential +
. -
Click on advanced options and enable
Include HMAC Credential
button. -
Click
Add
to generate service credential. -
Click
View credentials
and copy the access_key_id and secret_access_key values. -
Edit your lithops config file and add the following keys:
lithops: storage: ibm_cos ibm_cos: storage_bucket: <BUCKET_NAME> region : <REGION> access_key : <ACCESS_KEY_ID> secret_key : <SECRET_KEY_ID>
-
If you don't have an IAM API key created, navigate to the IBM IAM dashboard
-
Click
Create an IBM Cloud API Key
and provide the necessary information. -
Copy the generated IAM API key (You can only see the key the first time you create it, so make sure to copy it).
-
Edit your lithops config file and add the following keys:
lithops: storage_backend: ibm_cos ibm: iam_api_key: <IAM_API_KEY> ibm_cos: storage_bucket: <BUCKET_NAME> region : <REGION>
The easiest apporach is to let Lithops to choose the right endpoint by itself. To enable this, just configure Lithops with the region name of your storage_bucket
, as follows:
ibm_cos:
region : <REGION>
Valid region names are: us-east, us-south, eu-gb, eu-de, etc..
Alternative to using region, you can configure the public and private endpoints as follows:
-
Login to IBM Cloud and open up your dashboard. Then navigate to your instance of Object Storage.
-
In the side navigation, click
Endpoints
to find your COS endpoints. You must copy bothpublic
andprivate
endpoints of the region where you created your bucket.
ibm_cos:
endpoint: https://s3.<region>.cloud-object-storage.appdomain.cloud
private_endpoint: https://s3.private.<region>.cloud-object-storage.appdomain.cloud
Group | Key | Default | Mandatory | Additional info |
---|---|---|---|---|
ibm | iam_api_key | no | IBM Cloud IAM API key to authenticate against IBM COS and IBM Cloud Functions. Obtain the key here |
Group | Key | Default | Mandatory | Additional info |
---|---|---|---|---|
ibm_cos | storage_bucket | yes | The name of a bucket that exists in you account. This will be used by Lithops for intermediate data. If set, this will overwrite the storage_bucket set in lithops section |
|
ibm_cos | region | no | Region of your bucket. Mandatory if no endpoint. For example: us-east, us-south, eu-gb, eu-de, etc.. | |
ibm_cos | endpoint | no | Endpoint to your COS account. Mandatory if no region. Make sure to use the full path with 'https://' as prefix. | |
ibm_cos | private_endpoint | no | Private endpoint to your COS account. Mandatory if no region. Make sure to use the full path with 'https://' or http:// as prefix. | |
ibm_cos | api_key | no | API Key to your COS account. Mandatory if no access_key and secret_key. Not needed if using IAM API Key | |
ibm_cos | access_key | no | HMAC Credentials. Mandatory if no api_key. Not needed if using IAM API Key | |
ibm_cos | secret_key | no | HMAC Credentials. Mandatory if no api_key. Not needed if using IAM API Key |