# Get buckets ACLsawss3apiget-bucket-acl--bucket<bucket-name>awss3apiget-object-acl--bucket<bucket-name>--keyflag# Get policyawss3apiget-bucket-policy--bucket<bucket-name>awss3apiget-bucket-policy-status--bucket<bucket-name>#if it's public# list S3 buckets associated with a profileawss3lsawss3apilist-buckets# list content of bucket (no creds)awss3lss3://bucket-name--no-sign-requestawss3lss3://bucket-name--recursive# list content of bucket (with creds)awss3lss3://bucket-nameawss3apilist-objects-v2--bucket<bucket-name>awss3apilist-objects--bucket<bucket-name>awss3apilist-object-versions--bucket<bucket-name># copy local folder to S3awss3cpMyFolders3://bucket-name--recursive# deleteawss3rbs3://bucket-name–-force# download a whole S3 bucketawss3syncs3://<bucket>/.# move S3 bucket to different locationawss3syncs3://oldbuckets3://newbucket--source-regionus-west-1# list the sizes of an S3 bucket and its contentsawss3apilist-objects--bucketBUCKETNAME--outputjson--query"[sum(Contents[].Size), length(Contents[])]"# Update Bucket policyawss3apiput-bucket-policy--policyfile:///root/policy.json--bucket<bucket-name>##JSON policy example{"Id":"Policy1568185116930","Version":"2012-10-17","Statement": [{"Sid":"Stmt1568184932403","Action": ["s3:ListBucket"],"Effect":"Allow","Resource":"arn:aws:s3:::welcome","Principal":"*"},{"Sid":"Stmt1568185007451","Action": ["s3:GetObject"],"Effect":"Allow","Resource":"arn:aws:s3:::welcome/*","Principal":"*"}]}# Update bucket ACLawss3apiget-bucket-acl--bucket<bucket-name># Way 1 to get the ACLawss3apiput-bucket-acl--bucket<bucket-name>--access-control-policyfile://acl.jsonawss3apiget-object-acl--bucket<bucket-name>--keyflag#Way 2 to get the ACLawss3apiput-object-acl--bucket<bucket-name>--keyflag--access-control-policyfile://objacl.json##JSON ACL example## Make sure to modify the Owner’s displayName and ID according to the Object ACL you retrieved.{"Owner":{"DisplayName":"<DisplayName>","ID":"<ID>"},"Grants": [{"Grantee":{"Type":"Group","URI":"http://acs.amazonaws.com/groups/global/AuthenticatedUsers"},"Permission":"FULL_CONTROL"}]}## An ACL should give you the permission WRITE_ACP to be able to put a new ACL
# Get catalogsawsathenalist-data-catalogs# Get databases inside catalogawsathenalist-databases--catalog-name<catalog-name>awsathenalist-table-metadata--catalog-name<catalog-name>--database-name<db-name># Get query executions, queries and resultsawsathenalist-query-executionsawsathenaget-query-execution--query-execution-id<id># Get query and meta of resultsawsathenaget-query-results--query-execution-id<id># This will rerun the query and get the results# Get workgroups & Prepared statementsawsathenalist-work-groupsawsathenalist-prepared-statements--work-group<wg-name>awsathenaget-prepared-statement--statement-name<name>--work-group<wg-name># Run queryawsathenastart-query-execution--query-string<query>