Managing table policies
You can add, delete, update, and view table policies for tables by using the Amazon S3 console, Amazon S3 REST API, AWS SDK and the AWS CLI. For more information, see the following topics. For more information about supported AWS Identity and Access Management (IAM) actions and condition keys for Amazon S3 Tables, see Access management for S3 Tables. For example table policies, see Resource-based policies for S3 Tables.
Adding a table policy
To add a table policy to a table, you can use the Amazon S3 REST API, AWS SDK and the AWS CLI.
This example shows how to view the policy attached to a table by using the AWS CLI. To use the
command replace the user input placeholders with your own
information.
aws s3tables get-table-policy \ --table-bucket-arn arn:aws:s3tables:us-east-1:111122223333:bucket/amzn-s3-demo-bucket1/table/tableID\ --namespacemy-namespace\ --namemy-table
Open the Amazon S3 console at https://console.aws.amazon.com/s3/
. -
In the left navigation pane, choose Amazon S3.
-
Choose Table buckets and select the table bucket name that contains your table, then select your table from that bucket.
-
Choose the Permissions tab.
-
Under Table policy, Choose Edit.
-
In the policy editor, enter your policy JSON.
-
(Optional) Choose Policy examples to see sample policies that you can adapt to your needs.
-
After entering your policy, choose Save changes.
Viewing a table policy
To view the bucket policy attached to a table, you can use the Amazon S3 REST API, AWS SDK and the AWS CLI.
This example shows how to view the policy attached to a table by using the AWS CLI. To use the
command replace the user input placeholders with your own
information.
aws s3tables get-table-policy \ --table-bucket-arn arn:aws:s3tables:us-east-1:111122223333:bucket/amzn-s3-demo-table-bucket \ --namespacemy-namespace\ --namemy-table
Open the Amazon S3 console at https://console.aws.amazon.com/s3/
. -
In the left navigation pane, choose Amazon S3.
-
Choose Table buckets and select the table bucket name that contains your table, then select your table from that bucket.
-
Choose the Permissions tab.
Deleting a table policy
To delete a policy attached to a table, you can use the Amazon S3 REST API, AWS SDK and the AWS CLI.
This example shows how to delete a table policy by using the AWS CLI. To use the
command replace the user input placeholders with your own
information.
aws s3tables delete-table-policy \ --table-ARN arn:aws:s3tables:us-east-1:111122223333:bucket/amzn-s3-demo-table-bucket \ --namespaceyour-namespace\ --nameyour-table
Open the Amazon S3 console at https://console.aws.amazon.com/s3/
. -
In the left navigation pane, choose Amazon S3.
-
Choose Table buckets and select the table bucket name that contains your table, then select your table from that bucket.
-
Choose the Permissions tab.
-
Under Table bucket policy, choose Delete.