OCI Object Storage
The OCI Object Storage Binary Store stores each file as an object in the configured bucket. The component is alpha.
Component format
The following example authenticates using an OCI configuration file:
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: oci-files
spec:
type: binarystore.oci.objectstorage
version: v1
metadata:
- name: configFileAuthentication
value: "true"
- name: configFilePath
value: "/home/app/.oci/config"
- name: configFileProfile
value: "DEFAULT"
- name: bucketName
value: "binary-files"
- name: compartmentOCID
value: "<COMPARTMENT_OCID>"
- name: namespace
value: "<OBJECT_STORAGE_NAMESPACE>"
The configuration file must be available at the specified path inside the sidecar’s environment. Protect credentials in the file using your deployment’s secret-management practices.
Authentication
The component supports three authentication methods:
- API key: provide
region,userOCID,fingerPrint,privateKey, andtenancyOCID. - Instance principal: set
instancePrincipalAuthenticationto"true"and grant the compute instance’s dynamic group the required Object Storage permissions. - Configuration file: set
configFileAuthenticationto"true"and provideconfigFilePath. Optionally select a profile withconfigFileProfile.
Only configure one authentication method for a component. For details, see the OCI documentation for instance principals and SDK configuration files.
Spec metadata fields
| Field | Required | Details | Example |
|---|---|---|---|
bucketName | Y | Name of the OCI Object Storage bucket. | "binary-files" |
compartmentOCID | Y | OCID of the compartment containing the bucket. | "ocid1.compartment.oc1..example" |
namespace | N | OCI Object Storage namespace. If omitted, the component resolves it from the tenancy. | "my-namespace" |
prefix | N | Prefix prepended to each file name. If configured, it must not start with /. | "uploads" |
partSize | N | Multipart upload part size, specified as a byte count or byte-size string. Defaults to 16Mi; must be between 10 MiB and 50 GiB. OCI limits uploads to 10,000 parts; larger parts can increase the maximum upload size (up to 10 TiB) but use more memory per in-flight upload. | "64Mi" |
region | Y for API key authentication | OCI region where the bucket is located. | "us-ashburn-1" |
userOCID | Y for API key authentication | OCID of the OCI user. | "ocid1.user.oc1..example" |
fingerPrint | Y for API key authentication | Fingerprint of the API key. | "xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" |
privateKey | Y for API key authentication | Private key for API authentication. Treat this value as a secret. | "<PRIVATE_KEY>" |
tenancyOCID | Y for API key authentication | OCID of the tenancy. | "ocid1.tenancy.oc1..example" |
instancePrincipalAuthentication | Y when using instance principal | Set to "true" to use instance principal authentication. Defaults to "false". | "true" |
configFileAuthentication | Y when using a configuration file | Set to "true" to use configuration file authentication. Defaults to "false". | "true" |
configFilePath | Y when using a configuration file | Absolute path to the OCI configuration file. | "/home/app/.oci/config" |
configFileProfile | N | Optional profile name in the configuration file. The metadata default is empty; use "DEFAULT" to select that profile explicitly. | "DEFAULT" |
Size values can be provided as a string containing the number of bytes (for example, "16777216") or as a size with a unit such as "16Mi".