Managing table policies - Amazon Simple Storage Service

Managing table policies

You can add, delete, update, and view table policies for tables by using the 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 create a table policy by using the AWS CLI. To use the command replace the user input placeholders with your own information.

aws s3tables put-table-policy \ --table-bucket-arn arn:aws:s3tables:us-east-1:111122223333:bucket/amzn-s3-demo-bucket1 \ --namespace my-namespace \ --name my-table \ --resource-policy your-policy-JSON

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-bucket1/table/tableID \ --namespace my-namespace \ --name my-table

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-bucket1/table/tableID \ --namespace your-namespace \ --name your-table