Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Organizations と Identity Center を Terraform で管理しよう
Search
a2-ito
February 25, 2025
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Organizations と Identity Center を Terraform で管理しよう
a2-ito
February 25, 2025
More Decks by a2-ito
See All by a2-ito
Devin の Org-level Skills
a2ito
0
720
AIエンジニア Devin と歩む、自律型運用プロセスの構築
a2ito
0
1.2k
ECSにおけるBGデプロイの実現
a2ito
0
120
App Runner 実践
a2ito
0
560
Bigtable
a2ito
0
97
Chord
a2ito
0
90
Chubby
a2ito
0
110
Dynamo
a2ito
0
120
Megastore
a2ito
0
93
Featured
See All Featured
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
290
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
3
4.3k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
470
Darren the Foodie - Storyboard
khoart
PRO
4
4k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Designing Powerful Visuals for Engaging Learning
tmiket
1
580
Bash Introduction
62gerente
615
220k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
330
30 Presentation Tips
portentint
PRO
1
410
Designing for Timeless Needs
cassininazir
1
510
Transcript
Organizations と Identity Center を Terraform で管理しよう e-dash株式会社 伊藤 明彦 2025年2月25日
@a2-ito @piyohiko110
伊藤 明彦 Ito Akihiko @a2-ito @piyohiko110 所属:e-dash株式会社 役割:SRE 出⾝:⼭⼝県 趣味:ジム ⾃⼰紹介
2
会社について 3 • 企業のCO2排出量可視化‧削減のSaaSを開発 • 三井物産出資のスタートアップ • 2022年設⽴‧本社は東京⾚坂 • ソフトウェアエンジニア絶賛募集中です
• AWS Organizations を利⽤して AWS アカウントを管理している • Entra ID +
AWS Identity Center を利⽤して利⽤者のアカウントを払い出している • Terraform を利⽤して AWSインフラ のメンテナンスをしている 背景 4
• Entra ID + AWS Identity Center になって多少は楽になったものの、ポチポチやるのが⾟い • メンバ‧グループのメンテナンスが⾯倒
• Terraform‧開発メンバ向けIAMロールの最⼩権限の維持が⼤変 課題認識 5
• Organizations/Identity Center の設定 ◦ AWSアカウントの作成 ◦ ワークフォースユーザ ◦ 所属グループ
◦ Permission Sets ◦ グループの割当 • 各アカウントの初期設定 ◦ リソース管理⽤ロール ◦ state 格納⽤バケット ◦ etc Terraform にまかせてみよう 6
ワークフォースユーザ‧グループを作って、Permission Set を割り当てる 7 permission_sets = { "read_only_user" = {
name = "ReadOnlyAccess" policy_arn = "arn:aws:iam::aws:policy/ReadOnlyAccess" is_managed = true session_duration = "PT8H" } "work_user" = { name = "WorkUserPolicy" is_managed = false session_duration = "PT8H" } } assignments = [ { account_id = local.accounts.hogehoge.account_id group = "workusers" permission_set = " read_only_user" }, { account_id = local.accounts.hogehoge.account_id group = "workusers" permission_set = " work_user" }, ]
• AWS Organizations でアカウントを作成した場合、OrganizationAccountAccessRole とい うロールがあるので何もしなくてもスイッチできる • 最も強い権限なので注意 AWSアカウントを作成し、そのままセットアップをする 8
provider "aws" { alias = "hogehoge" region = data.aws_region.current.name assume_role { role_arn = "arn:aws:iam::${local.accounts.hogehoge.account_id}:role/OrganizationAccountAccessRole" } }
• Terraform Cloud を利⽤すると、実⾏環境 や state 置き場を任せられる • PR 作成時に
plan が実⾏され、merge 時に apply が実⾏される • AWS や Terraform の権限や知識を必要とせずID管理ができるようになる HCP Terraform (Terraform Cloud) から plan/apply を実⾏する 9
• ⾃動プロビジョニングを使えば、ワークフォースユーザも⾃動作成されるようになる • ただし、ユーザの所属グループも Entra ID 側で管理する必要がある • グループはAWS側で(SRE側で)管理したいため、⾃動プロビジョニングは使わないとい う判断になった
余談) Entra ID の⾃動プロビジョニング 10
• Terraform のコードを⼊⼒すると最⼩権限の IAM Policy を出⼒してくれるツール pike* を 試してみた(2024年10⽉頃) •
都度⼿動でのメンテナンスが必要ということで、結局採⽤に⾄らず ◦ App Runner などの⽐較的新しいサービスに未対応 ◦ 出⼒されたポリシの⼿動分割が必要 余談) pike を使った最⼩権限運⽤ 11 *https://github.com/JamesWoolfenden/pike
• Organizations と Identity Center を Terraform (Cloud) で管理するようにしました •
作業ミスの低減、⾯倒なポチポチ作業のストレス開放になるはず • 情シスメンバへの運⽤移管やさらなる⾃動化を⽬指します サマリ 12
THANK YOU! e-dash株式会社 伊藤 明彦 2025年2月25日 @a2-ito @piyohiko110