Amazon S3 Compatibility API Hosted Style Support in Object Storage
Learn how the Object Storage Amazon S3 Compatibility API supports AWS virtual-hosted style URLs.
Oracle Cloud Infrastructure (OCI) now supports the following ways to address objects:
- Path style: URLs have the following format:
https://<namespace>.compat.objectstorage.<region>.oci.customer-oci.com/<bucket_name>/<object_name> - Virtual-hosted style: URLs have the following format:
https://<bucket_name>.vhcompat.objectstorage.<region>.oci.customer-oci.com/<object_name>Here, the bucket name is part of the domain name in the URL and only
<object_name>is part of the path.Note
Only buckets created with the virtual-hosted style endpoints can use virtual-hosted style URLs. You must create these buckets with S3 APIs and SDKs. You can't use the OCI CLI or Console to create virtual-hosted style buckets with the virtual-hosted style endpoints.
Previously, the Object Storage Amazon S3 Compatibility API only supported the path style using the following format:
https://<namespace>.compat.objectstorage.<region>.oci.customer-oci.com/<bucket_name>/<object_name>
where <namespace> represents the Object Storage namespace that serves as the top-level container for all buckets and objects.
When your OCI account is created, each OCI tenant is assigned one unique system-generated and immutable Object Storage namespace name. The namespace spans all compartments across all regions. Bucket names must be unique within a namespace. While the namespace is region-specific, the namespace name itself is the same in all regions.
OCI has added support for virtual-hosted style access, allowing you to include the bucket name as part of the subdomain in the URL. You can use virtual-hosted style URLs with the new endpoint when accessing Object Storage with the AWS SDK:
https://<bucket_name>.vhcompat.objectstorage.<region>.oci.customer-oci.com/<object_name>
When using virtual-hosted style URLs with OCI, the bucket name must be unique across all tenants within the same region.
Consider the following to understand the behavior of buckets:
- Buckets created with the virtual-hosted style URL are guaranteed to be unique across all tenants within the region.
- You can't create a bucket with a name that's already in use within the same region using the virtual-hosted style URL.
- If you have existing buckets created with the path-style URL, they won't be accessible through the virtual-hosted style URL.
- You can still use the path-style URL to access existing buckets, as support for path-style access will continue.
The following table shows the bucket access:
| Native API Access | S3 Path Style Access | S3 Virtual-hosted Style Access | |
|---|---|---|---|
| Buckets Created Using OCI Native API | ✓ | ✓ | |
| Buckets Created Using OCI S3 Path style API | ✓ | ✓ | |
| Buckets Created Using OCI S3 Virtual Style API | ✓ | ✓ | ✓ |
In this version, only new buckets created using the virtual-hosted style URL will support virtual-hosted style access.
Accessing Object Storage Resources Across Tenancies
When working with virtual-hosted style support with the Amazon S3 Compatibility API, to access and share resources with another organization that has its own tenancy, all object, multipart upload, and tagging APIs are supported for cross-tenancy access. Bucket APIs, however, are limited to the following operations:
- DeleteBucket
- GetLocation
- HeadBucket
- GetService (list all buckets)
- ListObjects
PutBucket, which creates a bucket, isn't supported for cross-tenancy operations with virtual-hosted style support with the OCI S3 API.For more information about accessing Object Storage resources across tenancies, see Accessing Object Storage Resources Across Tenancies.