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
CLI skeletonのススメ / An Encouragement of CLI skel...
Search
miztch
June 12, 2025
Programming
120
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
CLI skeletonのススメ / An Encouragement of CLI skeleton
20250612 JAWS-UG CLI専門支部 #433 LT
miztch
June 12, 2025
Other Decks in Programming
See All in Programming
一参加者から『中の人』へ 〜全通PHPerがブースに立って学んだ、カンファレンスを100倍楽しむコツ〜
wp_daisuke
0
150
Security issues being discussed on Web Platforms
petamoriken
0
880
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
1
270
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
380
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
330
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
250
Deep dive into the select statement (GopherCon UK)
jespino
0
180
初心者DevRelとして参加者だった私が、DevRel Talks!#2に登壇するまでにしてきたこと
sokohirai
0
370
Foundry Localでエージェント開発
seosoft
0
190
A2UI for Android: Safely Rendering AI-Generated UI with Jetpack Compose - DroidKaigi 2026
itsmedreamwalker
0
110
kubernetes コンポーネント開発入門 / 新卒N年目の勉強会&交流会!〜〇〇への誘い〜 #n_study
mazrean
0
230
Can LLMs Replicate 4 Years of Compose Migration? Exploring the boundaries of automation with 279 XML files from a real product
makun
0
140
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Faster Mobile Websites
deanohume
310
32k
For a Future-Friendly Web
brad_frost
183
10k
Color Theory Basics | Prateek | Gurzu
gurzu
0
460
Crafting Experiences
bethany
1
330
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
320
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
490
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
570
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
690
We Are The Robots
honzajavorek
0
370
Transcript
CLI skeletons のススメ 2025/06/12 JAWS-UG CLI専門支部 #433 miztch
🏢 kaonavi, inc. 👷 Infrastructure Engineer 💕 Lambda, EventBridge (Input
Transformer) 🖼 Museum / 🎹 DTM / 📚 Tsundoku / 🐱 Cats miztch @miztch @m1ztch
🤯 aws autoscaling create-auto-scaling-group $ aws autoscaling create-auto-scaling-group \ --auto-scaling-group-name
"my-asg" \ --launch-template LaunchTemplateId="lt-12345678901234567",Version='$Latest' \ --min-size 2 --max-size 10 --desired-capacity 4 \ --default-cooldown 300 \ --health-check-type "ELB" --health-check-grace-period 300 \ --vpc-zone-identifier "subnet-12345678,subnet-87654321,subnet-11111111" \ --target-group-arns "arn:aws:elasticloadbalancing:us-east-1:123456789012:targetgroup/m y-targets/1234567890123456" \
• 指定可能なパラメータがこれでもかというぐらいに豊富 • 特に Create 系の Action は、必須のパラメータが多い ◦ 結果的にコマンドがとても長くなる
CLIあるある
• 宣言型な IaC tools でリソースを作成・管理することは今や一般的 ◦ Terraform, CDK, CloudFormation, Pulumi
• しかし、すべてを完全に管理しきれない状況は必ず起きる ◦ 宣言された状態と実リソースに Drift が発生する ▪ アプリケーションデプロイ → ECSのタスク定義変更 ▪ CodeDeploy の B/G deploy → AutoScaling グループ複製 ◦ Lifecycle が異なると Ignore するか別の仕組みで管理したい ▪ このリソースだけは CloudFormation で / CLI で 時は2025年
• Batch コンピューティング環境で利用する AMI を更新する ◦ ECS on EC2 /
ECS 最適化 AMIを利用 • Batch コンピューティング環境の配分戦略 (Allocation Strategy) ◦ オンデマンドインスタンスの場合、以下の2種類から選択 ▪ BEST_FIT ▪ BEST_FIT_PROGRESSIVE ◦ 更新対象環境の配分戦略はデフォルト値の BEST_FIT 事例 : Batch コンピューティング環境 Update
• 配分戦略によってコンピューティング環境の更新方法が異なる ◦ BEST_FIT : ▪ 起動テンプレートの新バージョンを作成 (AMI を変更) ▪
新規コンピューティング環境を作成 ▪ ジョブキューに登録して入れ替え ◦ BEST_FIT_PROGRESSIVE : ▪ 起動テンプレートの新バージョンを作成 (AMI を変更) ▪ 既存コンピューティング環境を更新 事例 : Batch コンピューティング環境 Update
• コンピューティング環境の入れ替えに create / delete が必要 ◦ 起動テンプレートの新バージョンを作成 ◦ 起動テンプレートを利用したコンピューティング環境を作成
◦ 作成したコンピューティング環境をジョブキューに関連付け ◦ 既存のコンピューティング環境をジョブキューから切り離し ◦ 切り離したコンピューティング環境を削除 • さらに、更新対象環境は諸事情で IaC で管理されていない 🤯 事例 : Batch コンピューティング環境 Update
• コンピューティング環境の入れ替えに create / delete が必要 ◦ aws ec2 create-launch-template-version
◦ aws batch create-compute-environment ◦ aws batch update-job-queue ◦ aws batch update-job-queue ◦ aws batch delete-compute-environment • IaC で管理されていないので、CLI でやるしかない 😰 ◦ create のアクションと向き合うことに 事例 : Batch コンピューティング環境 Update
• JSON 形式のファイルを生成するパラメータ ◦ 編集および入力できるすべてのパラメータが含まれている • 加工して --cli-input-json | --cli-input-yaml
の入力ファ イルとして利用する --generate-cli-skeleton https://awscli.amazonaws.com/v2/documentation/api/latest/reference/batch/create-compute-environment.html
--generate-cli-skeleton & --cli-input-json # skeleton を出力 $ aws batch create-compute-environment
--generate-cli-skeleton > input.json $ cat input.json { "computeEnvironmentName": "", "type": "MANAGED", "state": "ENABLED", "unmanagedvCpus": 0, "computeResources": { "type": "EC2", "allocationStrategy": "BEST_FIT", … } # skeletonに必要なパラメータを埋めて、--cli-input-json で入力値として利用する $ aws batch create-compute-environment --cli-input-json file://input_filled.json
• --generate-cli-skeleton yaml-input ◦ skeleton を yaml 形式で出力 ◦ 実行時には
--cli-input-yaml でファイルを指定する ◦ コメントにパラメータの説明があり、編集しやすい 😃 --cli-input-yaml がオススメ
• バージョン管理しておくことで再利用しやすい • レビューがしやすい • (YAMLなら)コメントも付けられ、パラメータの意図が分かりやすい チームにもオススメ
• AWS CLI の公式ドキュメント を読むと面白い ◦ https://docs.aws.amazon.com/cli/latest/userguide ◦ skeleton 以外の便利機能
/ 面白機能?もあるぞ ▪ alias • .gitconfig ライクにエイリアスを設定可能 ▪ wizard • 対話的にリソースを作成(一部リソースのみサポート) ◦ DynamoDB, Lambda, IAM Role, Events Rule appendix : Official Docs
Thank you!