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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
51
今年のre:inventから学ぶこと
yuki_kurono
0
110
re_invent 2023事前勉強会
yuki_kurono
0
100
CloudFormationの運用が 辛くならない方法を本気で考えてみた
yuki_kurono
0
380
CloudFormationで登場したForEachをちゃんと理解してみる
yuki_kurono
0
910
Turnstileのウィジェット モードとは何者か
yuki_kurono
0
730
CodeGuru Security ってなんだ?
yuki_kurono
0
1.2k
えるしってるか CloudFrontはWAFがあっても カスタムエラーレスポンスを返せる
yuki_kurono
0
450
Cloudflare初心者がIaCから基本構成を学んでみた
yuki_kurono
1
660
Other Decks in Technology
See All in Technology
Mastering Agentic Development: Harness Engineering for Effective Coding Agents
konippi
3
590
AgentCore Runtime上にAgentic Coding基盤を構築・展開する際の設計ポイントと限界点 / Design considerations and limitations when building an agentic coding platform on AgentCore Runtime
har1101
7
780
【技術的負債conf】事業成長に伴う技術的負債の説明責任とAIによるモニタリング、認知的負債について
i35_267
4
2.3k
なぜ「決定性」が 決定的に重要なのか? Durable Execution 基盤の数理的理解 #serverlessjp / ServerlessDays Tokyo 2026
ytaka23
4
1.3k
Oracle Cloud Infrastructure(OCI):Onboarding Session(はじめてのOCI/Oracle Supportご利⽤ガイド)
oracle4engineer
PRO
3
21k
spanner-autoscalerに学ぶ CRD設計パターン 〜自動化と緊急時対応を両立する Kubernetesコントローラーの作り方〜
tkuchiki
0
180
Hermes Agentで、AIが調べて記事を書くブログを作った話
blueb
0
110
Account Factory for Terraformによる 標準化されたアカウント発行の自動化
pensuke628
0
110
高負荷プロダクション環境におけるAWS Lambdaのリアル 〜スケールとコストを左右する実行ライフサイクルの技術仕様〜
maimyyym
2
700
【ゲームメーカーズスクランブル2026】『Shadowverse: Worlds Beyond』UIとアニメーションで実現する最高のユーザー体験を叶えるプロトタイピング
cygames
PRO
1
620
特殊変数大全
dak2
0
150
What the customer really needed
kawaguti
PRO
3
230
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
A Modern Web Designer's Workflow
chriscoyier
699
190k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Abbi's Birthday
coloredviolet
4
10k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
200
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
Facilitating Awesome Meetings
lara
57
7.1k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
2k
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.1k
Accessibility Awareness
sabderemane
1
220
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