Download the Amazon S3 bucket policy from a specified bucket

aws s3api

  • Create and delete Amazon S3 buckets and edit bucket properties.
    More information: <https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/index.html>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

aws s3api get-bucket-policy --bucket {{bucket_name}} --query Policy --output {{json|table|text|yaml|yaml-stream}} > {{path/to/bucket_policy}}

click the source code to copy install aws s3api on any operating system with command-not-found.com