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
IAMロールでTerraformのCI/CDを構築してみた
Search
YouYou
October 14, 2021
Programming
5.5k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
IAMロールでTerraformのCI/CDを構築してみた
詳細ブログ↓
https://zenn.dev/yuta28/articles/terraform-gha
YouYou
October 14, 2021
More Decks by YouYou
See All by YouYou
AWSマネコンに複数のアカウントで入れるようになりました
yuhta28
2
320
今インフラ技術をイチから学び直すなら
yuhta28
1
320
AWSに詳しくない人でも始められるコスト最適化ガイド
yuhta28
3
700
Datadog外形監視基盤をEC2から ECSへ移行してみた
yuhta28
0
1.9k
アウトプット頑張ったら企業からLT登壇の依頼がきた話
yuhta28
1
1.9k
小さなことから始めるAWSコスト最適入門
yuhta28
1
1.5k
Datadogのコストも監視しよう
yuhta28
1
1.1k
Rcloneを使った定期的なストレージ同期
yuhta28
0
890
Pulumiを触ってみよう
yuhta28
1
2.8k
Other Decks in Programming
See All in Programming
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
160
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
1
440
AmebaブログはKMPから卒業します
kmars0605
0
200
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
140
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
110
Simple Storage Service(S3) is not simple
iwatsukayura
0
290
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
350
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
180
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8.5k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
Jetpack Compose Mechanisms
skydoves
3
820
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
180
Featured
See All Featured
How to Talk to Developers About Accessibility
jct
2
580
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
HDC tutorial
michielstock
2
960
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
300
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
600
It's Worth the Effort
3n
188
29k
What's in a price? How to price your products and services
michaelherold
247
13k
We Have a Design System, Now What?
morganepeng
55
8.4k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
440
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Transcript
IAMロールでTerraformの CI/CDを構築してみた クレデンシャル情報からさようなら
Name:ユータ Occupation:SRE Twitter:@Y0u281 (オーでなくゼロです) ブログ:https://zenn.dev/yuta28 自己紹介 Twitter
目次 • 従来のCI/CDの課題点 • GitHub Actionsの新機能 • 実装 • ワークフロー作成
• 実行結果 • まとめ
従来のCI/CDの課題点
従来のCI/CDの課題点 - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id:
${{ secrets.AWS_ACCESS_KEY_ID }} #アクセスキー aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} #シークレットキー
従来のCI/CDの課題点
GitHub Actionsの新機能 • OpenID Connect(OIDC)プロバイダーをGitHub Actions提供 • Assume RoleとしてOIDCにIAM権限を付与 OIDC経由でGitHubに
クレデンシャル提供が可能 !
実装 • sts:GetCallerIdentity • ec2:* • s3:*
実装 OIDC作成 IAMロールにOIDCを関連付ける
ワークフロー作成 - name: Setup Terraform uses: aws-actions/configure-aws-credentials@master with: role-to-assume: "${{
env.AWS_ROLE_ARN }}" web-identity-token-file: "curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=sigstore" | jq -r '.value'" aws-region: "${{ env.AWS_DEFAULT_REGION }}" role-duration-seconds: 900 role-session-name: GitHubActionsTerraformCICD
実行結果
実行結果
まとめ アクセスキーとシークレットキーは使わ ない! AWSでも使わないことを推奨 べスプラはこちら↓
ありがとうございました より詳しい内容は以下のブログで↓ GitHub ActionsにAWSクレデン シャル情報を渡さずに Terraformで CI/CDをやってみた