Full control
The following examples grant broad access to S3 resources. Use them when you need to give administrators, specific users, or all organization members full control over buckets and objects.Full control of all resources for admins
This policy contains one statement that grants full S3 API access (s3:*) to all SAML admins for all resources in the organization. The resources field is set to "*" to allow access to all S3 buckets and objects, and the principals field is set to ["role/Admin"] to allow access to all users in the SAML Admin group.
Full control of all buckets for admins
Full control of one specific bucket for all users
This policy contains one statement that grants full S3 API access (s3:*) to all users for a specific bucket. Replace [BUCKET-NAME] with the name of the bucket.
The resources field includes both the bucket itself and all objects within that bucket, which allows both bucket-level operations (like listing the bucket) and object-level operations (like getting or putting objects within that bucket). The principals field is set to "*" to allow access to all users.
Full control of one specific bucket for all users
Full S3 API access to all users
This policy contains one statement that grants full S3 API access (s3:*) to all principals and resources in the organization. The resources field is set to "*" to allow access to all S3 buckets and objects, and the principals field is also set to "*" to allow access to all users.
Use this approach when you want to grant full access by default, then restrict specific buckets with bucket access policies.
Full S3 API access to all users
Full control of all buckets for a specific user
This policy grants full S3 access (s3:*) to a specific Cloud Console user, identified by their UID. Replace [USER-UID] with the user’s UID, which you can find in the user’s settings within the Cloud Console.
The resources field uses the wildcard "*" to grant access across all buckets, but you can also narrow it to a specific bucket with the short-form resource names, as shown in Full control of one specific bucket for all users.
Full control of all buckets for a specific user
Read-only access
The following examples restrict access to read-only operations. Use them when you want users to view or download data without the ability to modify or delete it.Read-only access to all buckets
This policy provides read-only access to all S3 buckets for all principals. The actionss3:List*, s3:Get*, and s3:Head* commonly define read-only permissions.
Read-only access to all buckets
Read-only access to a specific bucket
This policy restricts everyone in the organization to read-only access for a specific bucket. Note the short-form bucket name used in the resources array, which is required in organization access policies. Two resources are listed:- The bucket itself (for example,
"[BUCKET-NAME]"). - All objects within that bucket (for example,
"[BUCKET-NAME]/*").
principals field is set to "*" to allow access to all users.
Replace [BUCKET-NAME] in the policy with the name of the bucket you want to restrict to read-only access.
Read-only access to a specific bucket
Allow non-admins limited AI Object Storage API access
This policy contains one statement for AI Object Storage API actions (cwobject:). It grants all non-admins the ability to create access keys and list access policies, but doesn’t grant any other cwobject: access. Remember that cwobject: actions are global and require "resources": ["*"].
Admins (as defined in Cloud Console) already have full cwobject: access, so this policy limits non-admin users to only these specified actions.
Allow non-admins limited AI Object Storage API access
AI Object Storage API and S3 API access for a SAML group
This policy contains two statements that, when combined, grant all S3 API and AI Object Storage API actions to a specific SAML group,role/Admin.
- The first statement (
cwobject-access-for-saml-group) grants all AI Object Storage API actions (cwobject:*). - The second statement (
s3-access-for-saml-group) grants all S3-compatible actions (s3:*).
AI Object Storage API and S3 API access for a SAML group
Advanced example
The following example shows how multiple statements can work together in a single policy to model a realistic access pattern. This example combines three statements similar to the earlier examples into a single policy.- The first statement,
s3-access, grants full S3 API access to all principals and buckets. - The second statement,
cwobject-access, grants limited AI Object Storage API access to all non-admins.- Admin users don’t need to be listed here, because they have a special internal policy that grants full access.
- The third statement,
read-only, makes a specific bucket read-only for a specific SAML group.
[BUCKET-NAME] in the policy with the name of the bucket you want to restrict to read-only access.
Advanced example