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
740
AIエンジニア Devin と歩む、自律型運用プロセスの構築
a2ito
0
1.3k
ECSにおけるBGデプロイの実現
a2ito
0
120
App Runner 実践
a2ito
0
570
Bigtable
a2ito
0
99
Chord
a2ito
0
91
Chubby
a2ito
0
110
Dynamo
a2ito
0
120
Megastore
a2ito
0
95
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
43k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
460
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
Building the Perfect Custom Keyboard
takai
2
910
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
310
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
KATA
mclloyd
PRO
35
16k
Speed Design
sergeychernyshev
33
2.2k
Building Adaptive Systems
keathley
44
3.3k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
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