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
Construct Hub に自作ライブラリを公開しよう with projen / Publ...
Search
hayao_k
June 01, 2022
Technology
1k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Construct Hub に自作ライブラリを公開しよう with projen / Publish your library to Construct Hub with projen
JAWS-UG CDK支部 #1 〜初回拡大版〜 の LT 資料です
hayao_k
June 01, 2022
More Decks by hayao_k
See All by hayao_k
SageMaker Lakehouse の紹介 / Introduction to SageMaker Lakehouse
hayaok3
0
600
ナレッジベースはどのようにSQLを生成するのか / Knowledge Bases supports structed data retrieval
hayaok3
2
590
クラウドネイティブなデータ連携の最新動向 / Latest trends in cloud-native data integration
hayaok3
2
1.3k
RAG Approach on AWS
hayaok3
4
2.1k
Amazon VPC Lattice を使い始める前におさえておきたいポイント n 選 / Introduction to VPC Lattice
hayaok3
6
3.8k
アウトプットを伴走するエンジニア育成のこれまでとこれから / Training engineers through the input and output learning cycle
hayaok3
0
310
AWS Verified Access で VPN-less な世界を体験してみた / The world of VPN-less with AWS Verified Access
hayaok3
0
1.2k
AWS Trusted Advisor Priority とはどんな機能か / What is AWS Trusted Advisor Priority?
hayaok3
0
880
SWAG 大好きマンな皆さまにおくる立ち回り方 / re:Invent 2022 Standby
hayaok3
0
2.2k
Other Decks in Technology
See All in Technology
CTO Night|NotionのAIエージェントとFDE
kzkhykw1991
0
310
freeeにおける AI を用いた ブラウザ動作確認の自動化の取り組み
freee
PRO
0
180
国際カードブランドルール変更に伴うクレジットカード決済取引仕様変更について
k1style
0
200
S3 Filesで挑む! 八戸せんべい汁の食べ頃問題
usanchuu
0
160
CloudWatch Logsのコスト最適化:どこまでAIに任せてどこから人間が承認すべきか
yama3133
0
180
AWS DevOps Agentはどこまで任せられるか 〜機能の現在地と、機能拡張の実践〜
nyankotaro
0
190
「Learning Outcome」を書きたくない私が、Learning Outcomeと折り合いをつけるまで
mhlyc
0
180
ポケモン対戦を自動で記録して振り返ろう
fufufukakaka
0
300
Codex を使った障害対応机上演習の実際
orgachem
PRO
0
330
顧客価値を追いかけたら、プライシングにたどり着いた
sansantech
PRO
2
920
撮るだけでは終わらない。ソニーが挑むB2Bカメラソリューション開発
sony
0
100
2026-10-24 JAWS JAWS-UG 茨城 #18 IAM Policy Autopilotってなにさ。terraform planからIAM Policyつくれるの? / What's IAM Policy Autopilot
masasuzu
0
130
Featured
See All Featured
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
270
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
490
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
590
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Product Roadmaps are Hard
iamctodd
55
13k
4 Signs Your Business is Dying
shpigford
187
23k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
790
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
59k
Transcript
Construct Hub に 自作ライブラリを公開しよう with projen JAWS-UG CDK 支部 #1
〜初回拡大版〜 June 1st, 2022 小杉 隼人 | Hayato Kosugi
About Me • Cloud Engineer @ セゾン情報システムズ • AWS Community
Builder (Fall of 2020) • 2019 - 2022 APN AWS Top Engineers • 11x AWS Certified • CDK は個人利用がメイン 2 @hayaok3 @hayao_k
Agenda • Construct Hub って何 • projen はいいぞ 3
What is Construct Hub? • コミュニティや AWS、AWS パートナーが公開する Construct Library
を 検出・共有するためのレジストリ • 昨年 12 月 AWS CDK v2 と同日に GA • 現在 1000 以上の Construct Library が掲載 • https://constructs.dev/ 4
Construct Hub に掲載される条件 • JSII-compatible であること • 多言語対応のため • オープンソースライセンスであること
• Apache, BSD, EPL, MPL-2.0, ISC, and CDDL or MIT • CDK Keyword を使用して npm Registry に公開されていること • cdk, awscdk, aws-cdk, cdk8s, or cdktf • これらを満たすと 約 30 分で自動で掲載 5
6
難しそう? projen を使った開発がおすすめ 7
CDK で TypeScript をやっているときの私 • プロジェクト構成の管理は近年複雑化している • TypeScript プロジェクトの場合 •
package.json, tsconfig.json, .gitignore, eslint, jest, etc •ぜんぜんわからない、俺 たち は雰囲気で TypeScript をやっている… 8
What is Projen? • A new generation of project generators
• Construct の考え方をプロジェクト構成に適用 • プロジェクト構成をコードで定義し、維持するためのツール • package.json, tsconfig.json 等、通常は自分で管理する必要のある 構成ファイルを自動で管理 • プロジェクトの雛形を作るだけではなく、継続管理する • https://github.com/projen/projen 9
• node - Node.js project. • project - Base project.
• python - Python project. • react - React project without TypeScript. • react-ts - React project with TypeScript. • typescript - TypeScript project. • typescript-app - TypeScript app. Built-in Project types • awscdk-app-java - AWS CDK app in Java. • awscdk-app-py - AWS CDK app in Python. • awscdk-app-ts - AWS CDK app in TypeScript. • awscdk-construct - AWS CDK construct library project. • cdk8s-app-ts - CDK8s app in TypeScript. • cdk8s-construct - CDK8s construct library project. • cdktf-construct - CDKTF construct library project. • java - Java project. • jsii - Multi-language jsii library project. • nextjs - Next.js project without TypeScript. • nextjs-ts - Next.js project with TypeScript. 10 $ mkdir awesome-project $ cd awesome-project $ git init $ npx projen new PROJECT-TYPE 🤖 Synthesizing project...
Construct Library プロジェクトの作成 • projen new awscdk-construct • 開発に必要なファイルが生成される •
package.json, jsii によるビルドスクリプト, GitHub Actions Workflow など • .projenrc.js に必要な設定を定義 • サポートする CDK の最小バージョン • 他のライブラリとの依存関係 • 各パッケージマネージャーでのライブラリ名など 12
.projenrc.js の例 13 • projen コマンドで変更を反映 • projen が管理するファイルの多くは手動で 編集しない
(できない) • 編集した場合はビルドが Fail する • e.g., publishToPypi • package.json の jsii 設定に python が 追加 • GitHub Actions の release.yml に PyPI へ publish する Step が追加 指定可能なオプションは多岐にわたるため、API リファレンスを参照 https://projen.io/api/API.html#projen-awscdk-awscdkconstructlibrary const { awscdk } = require('projen'); const cdkVersion = '2.25.0'; const project = new awscdk.AwsCdkConstructLibrary({ author: 'hayao-k', authorAddress: '
[email protected]
', cdkVersion, defaultReleaseBranch: 'main', name: 'cdk-sample-lib', repositoryUrl: 'https://github.com/hayao-k/cdk-sample-lib.git', description: 'Sample AWS CDK Construct Library by projen', keywords: ['sample'], license: 'Apache-2.0', deps: [ `@aws-cdk/aws-apigatewayv2-alpha@${cdkVersion}-alpha.0`, `@aws-cdk/aws-apigatewayv2-integrations-alpha@${cdkVersion}-alpha.0`, 'other-useful-lib' ], publishToPypi: { distName: 'cdk-sample-lib', module: 'cdk_sample_lib', }, }); project.synth();
Release も簡単自動化 • Build workflow (.github/workflows/build.yml) • pull request 作成時に起動
• ライブラリのビルド、改ざんチェック • Release workflow (.github/workflows/release.yml) • リリースブランチへの push 時に起動 • ライブラリのビルド、改ざんチェック • Conventional Commits による Semantic Versioning • GitHub Releases, 各言語のレジストリへの公開 (要 Secrets 登録) 14
Step by Step の手順はこちら • projen ではじめる快適 AWS CDK Construct
Library 開発生活 • https://qiita.com/hayao_k/items/194dfb051f18 a38b6dbd • A Beginner's Guide to Create AWS CDK Construct Library with projen • https://dev.to/aws-builders/a-beginner-s- guide-to-create-aws-cdk-construct-library- with-projen-5eh4 • Construct Hub の Contribute ページでも 紹介いただいてます 15
Summary • Construct Hub • コミュニティや AWS、AWS パートナーが公開する Construct Library
を 検出・共有するためのレジストリ • 時間の関係で紹介できなかったが便利なライブラリがたくさん • 自作ライブラリも公開できる • projen • プロジェクト構成の管理や CI が劇的に楽になる • Developer Experience に感動 • 特別な考慮不要で自作ライブラリを Construct Hub に掲載できる 16
AWESOME Book & Posts & Slide • The CDK Book
• https://thecdkbook.com/ • CDKの成り立ちとその可能性について (The CDK Bookより) • https://qiita.com/oktomoya/items/3cf66205b8c932d252ef • CDK Construct ライブラリを開発する際のTips • https://tmokmss.hatenablog.com/entry/20220517/1652755027 • AWSアカウントの共通設定をCDK ConstructHubで公開しました • https://docs.google.com/presentation/d/1X2r7LUuijiWISgL-P2SPyVFz6l2EqZ1DFzbaAjb9SKo • 【レポート+やってみた】projen – a CDK for software project configuration #CDK Day • https://dev.classmethod.jp/articles/cdk-day-projen-try/ 17
Happy Constructing! 18