Bucket policies are a type of access policy that grant other AWS accounts or IAM users access to the bucket and the objects within it. They define what actions are allowed or denied on the bucket and its objects.
Example of a bucket policy allowing public read access:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::example-bucket/*"
}
]
}