開 S3 bucket 與 IAM 帳號的工具

看到 Simon Willison 的「s3-credentials: a tool for creating credentials for S3 buckets」這篇,裡面講到了幾件事情。

AWS 上比較好的安全設計是,不同專案之間都有自己的 S3 bucket,然後建立對應的 IAM user,每個 IAM user 只能存取自己的 S3 bucket。

但這個建立過程很煩:

Creating those credentials is surprisingly difficult!

整個建立的過程包括了四個步驟:

  1. 建立 S3 bucket。
  2. 建立 IAM user。
  3. 將 IAM user 掛上對應的 S3 權限。
  4. 建立 IAM user 的 access key。

讓人煩的主要是第三個,那個 JSON format 每次都要翻資料 XD

所以他寫了 s3-credentials 這個套件讓大家用,可以透過 pip 直接安裝起來用。

不過我是偏好用 awscli 的,直接把指令放在 wiki page 上面:「awscli」,需要的時候就 copy & paste 過來執行就可以了。在公司的 wiki 上還有直接把 EC2 instance 生到對應的 subnet 指令可以用...

這東西大概不會簡化,只能大家自己找出路 XD

Leave a Reply

Your email address will not be published. Required fields are marked *