How to give an IAM identity temporary access to a specific S3 prefix, verify the permission boundary, and confirm that revocation works.

Giving someone access to an Amazon S3 bucket sounds straightforward—until that bucket contains data they shouldn't all be able to read.

Imagine a shared bucket containing reports for multiple teams:

project-data/ ├── allowed/ │ └── allowed.txt └── restricted/ └── restricted.txt 

A collaborator needs to read the file under allowed/, but must not access anything under restricted/.

One approach is to create and maintain IAM policies for each collaborator. But as the number of users, applications, and prefixes grows, that becomes harder to manage.

Amazon S3 Access Grants provides another approach: define who can access which S3 location, then issue temporary credentials for authorized requests.

In this walkthrough, we'll use Buckets by Serverless Creed to configure and test an Access Grant, then use AWS CLI and CloudTrail to verify what AWS actually permits.

By the end, we'll have demonstrated the complete lifecycle:

Register a location → Create a READ grant → Request temporary access → Verify allowed and denied operations → Delete the grant → Verify revocation.

1. Understanding the Access Grants model

Before configuring anything, it's useful to understand three components.

Access Grants instance: The regional resource used to manage grants in an AWS account.

Registered location: An S3 location associated with an IAM role that Access Grants can assume to provide access.

Access grant: A permission that associates a grantee, an S3 scope, and an access level such as READ.

When an identity requests access, AWS evaluates whether an applicable grant authorizes the request. If it does, the GetDataAccess API can return temporary credentials scoped to the permitted data.

This distinction matters:

  • Buckets provides the interface for configuring grants, inspecting their scopes, testing sessions, and deleting grants.
  • AWS evaluates IAM permissions, authorizes GetDataAccess, issues temporary credentials, enforces S3 object access, and records API activity.

A successful message in an application is useful, but it isn't a substitute for verifying the actual S3 permission boundary.

2. Prepare a small, isolated test environment

For this example, we'll use a disposable S3 bucket in us-east-1 with two small text files.

Resource Example
S3 bucket example-access-grants-demo
Authorized object allowed/allowed.txt
Unauthorized object restricted/restricted.txt
Registered location s3://example-access-grants-demo/allowed/
Intended grant scope s3://example-access-grants-demo/allowed/*
Permission READ
Grantee A dedicated, restricted IAM user
Session duration 15 minutes

Replace the example bucket name with a globally unique name in your own account.

You'll need an authorized AWS identity to create the S3 resources, IAM role, Access Grants instance, location, and grant. Use a separate restricted identity to test the resulting access.

The location role must trust the S3 Access Grants service and have the required S3 permissions for the registered location. In this example, those permissions include s3:ListBucket constrained to the allowed prefix and s3:GetObject for objects under allowed/*.

The restricted grantee should not receive broad, direct S3 read permissions. Otherwise, a successful download might be caused by an unrelated IAM permission rather than the Access Grant you're testing.

A note about cost

S3 storage, object requests, Access Grants API requests, and related AWS activity may incur charges depending on your account and usage. Check current AWS pricing and your available credits before starting.

This walkthrough uses two tiny text files, one grant, and short-lived sessions to keep the test footprint small. It does not require Bedrock, embeddings, vector indexes, or Multi-Region Access Point creation.

3. Register an S3 location in Buckets

Open Buckets using the authorized AWS profile and navigate to the S3 Access Grants interface.

If the regional Access Grants instance doesn't exist yet, create it first. Then register the location:

s3://example-access-grants-demo/allowed/ 

Associate the location with the IAM role configured for S3 Access Grants.

The registered location defines the S3 area that grants can reference. It is not, by itself, a permission assigned to the restricted user.

Once registration succeeds, confirm that the location appears with the expected S3 path and IAM role.

What Buckets does: Presents the location registration workflow and displays the resulting configuration.

What AWS does: Stores the regional Access Grants location registration and uses the associated role when issuing authorized data access.


The registered S3 location establishes the scope available for subsequent access grants.

4. Create a prefix-scoped READ grant

Next, create a grant for the restricted IAM identity.

Select the registered location, enter the grantee's IAM ARN, choose READ, and select the prefix scope.

The most important detail here is the effective S3 path.

Our registered location is:

s3://example-access-grants-demo/allowed/ 

But the intended grant scope is:

s3://example-access-grants-demo/allowed/* 

Why allowed/ and allowed/* matter

S3 object keys are strings, and the slash character is part of the key naming convention—not a real directory boundary.

For a prefix-based grant, the trailing wildcard communicates that the permission applies to objects under that prefix.

In the tested configuration, Buckets displayed the effective scope with allowed/* even though the registered location ended with allowed/.

That preview is worth checking before confirmation. A path that looks visually similar can represent a different scope or be rejected by AWS's Access Grants validation.

Because the registered location already pointed to allowed/, the optional location-relative subprefix was left blank.

After confirming the grantee, permission, and effective scope, the READ grant was created successfully.


Review the effective prefix scope before creating the grant; the wildcard is significant.

We then opened AWS Console and independently confirmed that the grant existed with the expected grantee, permission, and S3 scope.

This is an important verification step: the configuration shown in the desktop application should match the resource recorded in AWS.

5. Test the grant as the restricted identity

Creating a grant is only half the job. The real question is whether the intended identity can use it—and whether other paths remain inaccessible.

Switch Buckets to the restricted grantee profile and open the grant's session test.

In our test, the Test 15-min session action successfully matched the READ grant and reported temporary credentials with a 15-minute expiry.


Buckets confirms that the restricted identity can request a temporary session for the authorized prefix.

The permissions needed before testing

One of the less obvious findings was that the restricted identity needed certain discovery permissions before the application workflow could function.

For the tested Buckets workflow, these included:

  • s3:ListAllMyBuckets, needed when loading the AWS profile and bucket list.
  • Appropriate S3 Access Grants listing permissions, so the application could discover the relevant resources.
  • s3:GetDataAccess, so the identity could request temporary credentials for its grant.

The exact IAM resources and allowed actions should be limited to what the workflow requires.

Crucially, these are not the same as granting the identity unrestricted s3:GetObject access to the bucket.

A user may have a valid Access Grant but still be unable to navigate the application if the required discovery calls fail. That is a configuration issue worth diagnosing separately from the grant itself.

6. Verify actual access with AWS

A successful temporary-session test tells us that a matching grant was found and AWS authorized the session request.

To verify the data boundary, we also tested S3 reads using temporary credentials obtained through GetDataAccess.

The results were:

Operation Observed result
Read allowed/allowed.txt Success
Read restricted/restricted.txt AccessDenied

The allowed object was retrieved successfully. The restricted object was denied because the temporary session did not authorize that object path.


The same restricted test session can read the intended object but cannot read outside the granted prefix.

This is stronger evidence than merely seeing a grant in a list.

The grant exists, the correct identity can obtain a session, and AWS enforces the expected boundary when S3 is accessed.

Why independent verification matters

A grant's displayed scope is a configuration claim. An actual S3 request demonstrates the effective permission.

Testing both the positive and negative paths helps detect problems such as an overly broad IAM role, an incorrectly scoped grant, or an identity that already has direct S3 permissions.

7. Confirm GetDataAccess in CloudTrail

For additional verification, open AWS CloudTrail → Event history in the test Region and look for the relevant GetDataAccess event.

In our test, the event showed:

Field Observed
Event name GetDataAccess
Event source s3.amazonaws.com
Identity Restricted IAM grantee
Error code None
Read-only true


CloudTrail provides an independent record that AWS processed the restricted identity's access request.

CloudTrail is especially useful when troubleshooting because it helps answer a different question from the application UI:

Did AWS receive and authorize the access request, and which identity made it?

For this test, the successful event corroborated the temporary-session result.

CloudTrail event history for the Access Grants API should not be confused with complete S3 object-level auditing. To investigate individual object reads, configure the appropriate S3 data-event logging where required.

8. Delete the grant and verify revocation

Temporary access must also be removable.

First, we attempted to delete the grant while using the restricted grantee identity. AWS returned AccessDenied for s3:DeleteAccessGrant.

That was the expected result: the identity authorized to read data should not automatically be authorized to administer grants.

We then switched to the authorized administrator profile and deleted the READ grant in Buckets.

The application confirmed deletion and showed no remaining grants.

But an empty grant list is not sufficient proof of revocation.

We made a new GetDataAccess request as the restricted identity for the previously authorized path:

s3://example-access-grants-demo/allowed/allowed.txt 

This time AWS returned AccessDenied.



After deletion, a new access-session request for the previously authorized object is denied.

An important revocation detail

Deleting an Access Grant prevents new access requests from being authorized through that grant. It does not necessarily invalidate temporary credentials that were already issued.

Those credentials may remain usable until they expire.

That is why our post-deletion check requested a new session, rather than treating an already-issued session as proof that revocation failed.

Short-lived credentials and appropriate session durations are important parts of the access-control design.

9. A related lesson: Empty results are not permission errors

The same distinction between application state and AWS authorization appeared when inspecting S3 Multi-Region Access Points.

Using an authorized profile, Buckets displayed:

No Multi-Region Access Points were found. 

AWS Console independently confirmed that the account had no Multi-Region Access Points.

We then tested a restricted profile with an explicit deny on s3:ListMultiRegionAccessPoints.

Instead of presenting the authorization failure as an empty list, Buckets surfaced the AWS permission error.


An empty resource list and an authorization failure are different outcomes, and the interface should make that distinction visible.

This is a small but important usability detail.

When an application says there are no resources, users may assume the account is empty. When the real issue is a missing permission, the next action is completely different.

The lesson applies beyond Multi-Region Access Points: a resource that doesn't exist and a resource that cannot be listed should not look like the same result.

No Multi-Region Access Points were created for this comparison.

10. Cleanup and operational considerations

After testing, we removed the disposable resources:

  • The READ grant and registered location.
  • The regional Access Grants instance used for testing.
  • The temporary IAM grantee and location role.
  • The test objects and disposable S3 bucket.

For an existing production environment, do not delete shared instances, locations, IAM roles, or buckets simply because a test is complete.

A few practical considerations are worth carrying into real deployments.

Least privilege: Keep the grantee's discovery and session-request permissions separate from the location role's S3 data permissions.

Scope review: Confirm the effective object or prefix scope before creating a grant. Pay attention to wildcard behavior and location-relative subprefixes.

Positive and negative testing: Verify both an authorized object and an object outside the permitted scope.

Auditability: Use CloudTrail to investigate the identity, API call, and authorization result, and configure object-level logging separately when needed.

Cost and limits: Review current AWS S3 Access Grants pricing, S3 request/storage charges, service quotas, and temporary-session limits for your Region and account. This small test is not a production cost estimate.

Final thoughts

The most useful part of testing S3 Access Grants wasn't simply creating a READ grant. It was proving the boundaries around that grant.

The authorized identity obtained temporary credentials and read the intended object. A request outside the prefix was denied. A restricted identity couldn't delete the grant. After the administrator removed it, a new session request was denied.

And CloudTrail gave us an AWS-side record of the access request.

That combination—clear scope, restricted identities, independent verification, and tested revocation—is what turns an access configuration into a permission model you can trust.

Tested with Buckets by Serverless Creed v2.9.7 in AWS us-east-1. All example names are illustrative, and test resources were removed after verification.