Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Terraformのnull_resource ってなに?aws cli が実行できるらしい
Search
Yuki_Kurono
January 14, 2023
Technology
1
1.4k
Terraformのnull_resource ってなに?aws cli が実行できるらしい
「Step Functionsからサーバレスを始めよう!! / 2023年始めLT大会!! JAWS-UGおおいた」の資料
Yuki_Kurono
January 14, 2023
Tweet
Share
More Decks by Yuki_Kurono
See All by Yuki_Kurono
今年のre:inventから学ぶこと
yuki_kurono
0
71
re_invent 2023事前勉強会
yuki_kurono
0
80
CloudFormationの運用が 辛くならない方法を本気で考えてみた
yuki_kurono
0
260
CloudFormationで登場したForEachをちゃんと理解してみる
yuki_kurono
0
750
Turnstileのウィジェット モードとは何者か
yuki_kurono
0
610
CodeGuru Security ってなんだ?
yuki_kurono
0
1.1k
えるしってるか CloudFrontはWAFがあっても カスタムエラーレスポンスを返せる
yuki_kurono
0
400
Cloudflare初心者がIaCから基本構成を学んでみた
yuki_kurono
1
570
Hashicorp VaultでAWSクレデンシャルの管理を楽にしたい
yuki_kurono
0
640
Other Decks in Technology
See All in Technology
ハッカソンから社内プロダクトへ AIエージェント ko☆shi 開発で学んだ4つの重要要素
leveragestech
0
160
Oracle Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
2
200
AWS re:Invent 2025~初参加の成果と学び~
kubomasataka
0
190
Strands Agents × インタリーブ思考 で変わるAIエージェント設計 / Strands Agents x Interleaved Thinking AI Agents
takanorig
5
2.1k
ハッカソンから社内プロダクトへ AIエージェント「ko☆shi」開発で学んだ4つの重要要素
sonoda_mj
6
1.7k
Bedrock AgentCore Evaluationsで学ぶLLM as a judge入門
shichijoyuhi
2
250
20251219 OpenIDファウンデーション・ジャパン紹介 / OpenID Foundation Japan Intro
oidfj
0
500
Next.js 16の新機能 Cache Components について
sutetotanuki
0
180
マイクロサービスへの5年間 ぶっちゃけ何をしてどうなったか
joker1007
20
7.8k
日本の AI 開発と世界の潮流 / GenAI Development in Japan
hariby
1
450
ペアーズにおけるAIエージェント 基盤とText to SQLツールの紹介
hisamouna
2
1.7k
SREが取り組むデプロイ高速化 ─ Docker Buildを最適化した話
capytan
0
140
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
100
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
74
Designing for Timeless Needs
cassininazir
0
93
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
130
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
580
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
400
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
[SF Ruby Conf 2025] Rails X
palkan
0
600
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