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
既存AWSリソースをTerraformで管理するのはつらいよ
Search
YouYou
August 25, 2022
Programming
1
420
既存AWSリソースをTerraformで管理するのはつらいよ
YouYou
August 25, 2022
Tweet
Share
More Decks by YouYou
See All by YouYou
AWSに詳しくない人でも始められるコスト最適化ガイド
yuhta28
2
490
Datadog外形監視基盤をEC2から ECSへ移行してみた
yuhta28
0
1.4k
アウトプット頑張ったら企業からLT登壇の依頼がきた話
yuhta28
1
910
小さなことから始めるAWSコスト最適入門
yuhta28
1
790
Datadogのコストも監視しよう
yuhta28
1
690
Rcloneを使った定期的なストレージ同期
yuhta28
0
440
Pulumiを触ってみよう
yuhta28
1
1.8k
ログストレージコスパ最強!?OpenObserveを試してみた
yuhta28
0
2.8k
Pulumiで始めるIaC
yuhta28
1
83
Other Decks in Programming
See All in Programming
From Spring Boot 2 to Spring Boot 3 with Java 22 and Jakarta EE
ivargrimstad
0
1.9k
実用的かつリーズナブルな 「Azure × Gemini × LINE」~キャラクターBot 実装ライブデモ~
tomodo_ysys
1
170
Async Await: Mastering Python's Time-Bending Tricks - EuroPython2024
yanbo
1
290
Rubyのパフォーマンスプロファイリングの改善 / Enhancing performance profiling for Ruby
osyoyu
1
410
入社1ヶ月でここまでやった!Findy Toolsインフラ支援の最適化
rvirus0817
6
1.4k
Activities at Cairo Library
cairolibrary720
0
1.2k
CSC307 Lecture 10
javiergs
PRO
0
310
SRE チーム立ち上げ前に考えたこと・取り組んだこと / Considerations and Preparations Before Establishing an SRE Team
mackey0225
3
320
AWS初心者ってどうやってAWSを学ぶ?〜アプリエンジニアがやってよかったアーキテクチャ学習方法〜
yamanashi_ren01
0
190
Rustのweb開発を助ける 便利なツール紹介
yuki0418
1
190
AWSでゲームサーバーを運用! Amazon GameLiftのお話
iriikeita
0
200
Temporalを取り巻く仕様を整理する
sajikix
0
110
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
124
16k
Learning to Love Humans: Emotional Interface Design
aarron
269
39k
The Straight Up "How To Draw Better" Workshop
denniskardys
229
130k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
GitHub's CSS Performance
jonrohan
1026
450k
Testing 201, or: Great Expectations
jmmastey
33
6.9k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
360
22k
Code Review Best Practice
trishagee
58
16k
A Tale of Four Properties
chriscoyier
155
22k
Stop Working from a Prison Cell
hatefulcrawdad
266
20k
Rails Girls Zürich Keynote
gr2m
93
13k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
105
6.8k
Transcript
既存AWSリソースをTerraformで管 理するのはつらいよ 1
Name:ユータ Occupation:SRE Twitter:@Y0u281 (オーでなくゼロです) ブログ:https://zenn.dev/yuta28 自己紹介 Twitter 2
目次 • 背景 • つらいよ ◦ インポート ◦ アカウント移行 •
まとめ 3
背景 • コンソールから作成したAWSリソースをIaC管理したい • terraform importで作成済みリソースをIaC管理できそう • 管理下に置いたら別のAWSアカウントにリソースを移管したい 4
つらいよ(インポート) 5 インポート後のtfファイルと実リソースとのパラメーター差分修正
つらいよ(インポート) 6
つらいよ(インポート) 7 resource "aws_security_group" "example" { name = "terraform-sg" #書かなくてもインポートはできる }
つらいよ(インポート) 8
つらいよ(インポート) 9 アウトバウンドルールの記述がないため削除してしま う。
つらいよ(アカウント移行) 10 Plan時に見落とすパラメーター差分
つらいよ(アカウント移行) 11
つらいよ(アカウント移行) 12
つらいよ(アカウント移行) 13 resource "aws_vpc" "example" { tags = { "Name"
= "Terraform" } }
つらいよ(アカウント移行) 14 resource "aws_vpc" "example" { cidr_block = "10.0.0.0/24" tags
= { "Name" = "Terraform" } }
まとめ 15
まとめ 16 既存リソースをIaC 管理はアカン
ありがとうございました 17 https://cuebic.hatenablog.com/