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
Terraformのnull_resource ってなに?aws cli が実行できるらしい
Search
Yuki_Kurono
January 14, 2023
Technology
1.6k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Terraformのnull_resource ってなに?aws cli が実行できるらしい
「Step Functionsからサーバレスを始めよう!! / 2023年始めLT大会!! JAWS-UGおおいた」の資料
Yuki_Kurono
January 14, 2023
More Decks by Yuki_Kurono
See All by Yuki_Kurono
Terraform(IaC)と実環境の乖離どうしていますか?
yuki_kurono
0
62
今年のre:inventから学ぶこと
yuki_kurono
0
120
re_invent 2023事前勉強会
yuki_kurono
0
110
CloudFormationの運用が 辛くならない方法を本気で考えてみた
yuki_kurono
0
390
CloudFormationで登場したForEachをちゃんと理解してみる
yuki_kurono
0
930
Turnstileのウィジェット モードとは何者か
yuki_kurono
0
750
CodeGuru Security ってなんだ?
yuki_kurono
0
1.2k
えるしってるか CloudFrontはWAFがあっても カスタムエラーレスポンスを返せる
yuki_kurono
0
470
Cloudflare初心者がIaCから基本構成を学んでみた
yuki_kurono
1
680
Other Decks in Technology
See All in Technology
kaonavi Tech Night#2
kaonavi
0
110
試験勉強はGrokBotでやれ
maigo999
0
110
アクセラレーターで実現するServiceNow活用の高速化 / ServiceNow World Forum 2026
visional_engineering_and_design
0
130
`go get`したらELFが降ってきた件
taiyow
0
170
Don't write the architecture only in the prompt.
neohsu
0
310
レガシーコードに対する loop engineering的なAI開発プロセス導入について
kubell_hr
0
190
IBC 2026 動画技術関連レポート / IBC 2026 Report
cyberagentdevelopers
PRO
2
180
cdkd (CDK Direct)
gotok365
3
200
OneLakeをデータソースにした AI Search(Foundry IQ)の ライフサイクル管理
ryuseiiida
0
220
AIエージェント時代、Kaggleにどう取り組むか
takanao
2
500
Content Mapper APIの応用例~CSS Modules、言語ファイル~
uhyo
2
570
デザインレビューは自動化できるのか?─ Flutter × Figma で UI 品質保証を考える
techiro
2
790
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
エンジニアに許された特別な時間の終わり
watany
109
250k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
510
Building AI with AI
inesmontani
PRO
1
1.4k
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
Statistics for Hackers
jakevdp
799
230k
Embracing the Ebb and Flow
colly
88
5.2k
A better future with KSS
kneath
240
18k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.7k
Transcript
Terraformのnull_resourceってなに? aws cliが実行できるらしい 黒野 雄稀 | 2023/1/14 1 Step Functionsからサーバレスを始めよう!!
2023年始めLT大会!! JAWS-UGおおいた
自己紹介 黒野 雄稀 Yuki Kurono kurono_98 kurono アイレット株式会社 所属 普段はインフラ設計・構築や運用構築に従事
2022 APN ALL AWS Certifications Engineers 2
3 Terraformってなに?
4 null_resourceってなに? resource "aws_vpc" "main" { cidr_block = "10.0.0.0/16" }
resource "null_resource" "main" { } null_resource、その名の通り何も作らないリソースのこと。
5 これ作ってて意味あるの?? 何に使うの??無を生みだして楽しい? resource "null_resource" "main" { }
6 Google先生に聞いてみる
7 なるほど。 じゃあ、AWS CLI実行すれば リソース全部作れるじゃん! ちょっと前の僕
8 やってみた
9 だいたいこんな感じになる resource "null_resource" "vpc" { provisioner "local-exec" { interpreter
= ["/bin/bash", "-c"] command = <<EOT aws ec2 create-vpc \ --cidr-block 10.20.0.0/16 \ --tag-specifications "ResourceType=vpc, \ Tags=[{Key=Name,Value=vpc_from_null_resource}]" EOT } }
10 記述量を比較してみる リソース 記述量(普通) 記述量(null) 倍率 VPC 4行 28行 7倍
Subnet 7行 36行 約5倍 RouteTable 4行 32行 8倍 SecurityGroup 6行 36行 6倍 EC2 8行 46行 約6倍
11 辛いポイント① provisioner "local-exec" { when = destroy interpreter =
["/bin/bash", "-c"] command = <<EOT aws ec2 delete-vpc \ --vpc-id $(cat ./state/VPC_ID.txt) EOT on_failure = fail } destroy時の処理(コマンド)も記載しないとリソースが削除されない。
12 辛いポイント② リソースのId(VPCのIdとか)を保持したり取得できないので、 describeコマンドを打って、ファイル保存しておかないといけない。。
13 辛いポイント③ デプロイしてみても何作ってんのか全然わからん。。。
14 何が言いたいかというと... やれる と できるは違うよね ※本スライドの内容は完全にネタですので悪しからず。
15