Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Organizations と Identity Center を Terraform で管理しよう
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
a2-ito
February 25, 2025
130
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
670
AIエンジニア Devin と歩む、自律型運用プロセスの構築
a2ito
0
1.1k
ECSにおけるBGデプロイの実現
a2ito
0
110
App Runner 実践
a2ito
0
550
Bigtable
a2ito
0
88
Chord
a2ito
0
81
Chubby
a2ito
0
100
Dynamo
a2ito
0
120
Megastore
a2ito
0
83
Featured
See All Featured
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
2
260
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
210
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
200
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
210
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
370
A designer walks into a library…
pauljervisheath
211
24k
エンジニアに許された特別な時間の終わり
watany
107
250k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
400
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.6k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
The Invisible Side of Design
smashingmag
301
52k
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