Update a registered location
You can update the Amazon Identity and Access Management (IAM) role of a location that's registered in your Amazon
S3 Access Grants instance. For each new IAM role that you use to register a location in S3 Access Grants, be
sure to give the S3 Access Grants service principal (access-grants.s3.amazonaws.com
)
access to this role. To do this, add an entry for the new IAM role in the same trust
policy JSON file that you used when you first registered the
location.
You can update a location in your S3 Access Grants instance by using the Amazon S3 console, the Amazon Command Line Interface (Amazon CLI), the Amazon S3 REST API, and the Amazon SDKs.
To update the IAM role of a location registered with your S3 Access Grants instance
Sign in to the Amazon Web Services Management Console and open the Amazon S3 console at https://console.amazonaws.cn/s3/
. -
In the left navigation pane, choose Access Grants.
-
On the S3 Access Grants page, choose the Region that contains the S3 Access Grants instance that you want to work with.
-
Choose View details for the instance.
-
On the details page for the instance, choose the Locations tab.
-
Find the location that you want to update. To filter the list of locations, use the search box.
-
Choose the options button next to the registered location that you want to update.
-
Update the IAM role, and then choose Save changes.
To install the Amazon CLI, see Installing the Amazon CLI in the Amazon Command Line Interface User Guide.
To use the following example command, replace the
with your own information.user input
placeholders
Example – Update the IAM role of a registered location
aws s3control update-access-grants-location \ --account-id
111122223333
\ --access-grants-location-id635f1139-1af2-4e43-8131-a4de006eb999
\ --iam-role-arn arn:aws-cn:iam::777788889999
:role/accessGrantsTestRole
Response:
{ "CreatedAt": "
2023-05-31T18:23:48.107000+00:00
", "AccessGrantsLocationId": "635f1139-1af2-4e43-8131-a4de006eb999
", "AccessGrantsLocationArn": "arn:aws-cn:s3:us-east-2
:777788889999
:access-grants/default/location/635f1139-1af2-4e43-8131-a4de006eb888
", "LocationScope": "s3://amzn-s3-demo-bucket/prefixB*
", "IAMRoleArn": "arn:aws-cn:iam::777788889999
:role/accessGrantsTestRole
" }
For information on the Amazon S3 REST API support for updating a location in an S3 Access Grants instance, see UpdateAccessGrantsLocation in the Amazon Simple Storage Service API Reference.
This section provides examples of how to update the IAM role of a registered location by using the Amazon SDKs.
To use the following example, replace the
with your own information.user input
placeholders