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
580
クラウドネイティブなデータ連携の最新動向 / 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.7k
アウトプットを伴走するエンジニア育成のこれまでとこれから / 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
870
SWAG 大好きマンな皆さまにおくる立ち回り方 / re:Invent 2022 Standby
hayaok3
0
2.2k
Other Decks in Technology
See All in Technology
BedrockとLambdaで作る リアルタイム進行型推理ゲーム
kawametho
0
190
組み立てて楽しむ AWS Blocks 入門
kmiya84377
0
220
事業活動を AI Ready にする攻めと守りのデータエンジニアリング / data-engineering-for-ai-ready-business
pei0804
3
330
LLM機能を自作して分かるSnowflake Cortex AIの強み
nayuts
0
300
自律型 AI をセキュアに実装!Gemini と MIG で作る動的コード実行環境
recruitengineers
PRO
1
210
サーバーフルコンピューティング?AWS Lambda
iwatatomoya
1
260
Snapshot Testing in Practice: Predictable and Reliable SwiftUI Views
fespinoza
0
120
MCPゲートウェイを作って運用してわかったこと — Agent時代の権限管理の現在地
mtpooh
10
3.1k
オンラインゲームのシステム全体像 - コロプラ 2026年度 新卒研修
colopl
0
720
オブザーバビリティを高める AI エージェント体験を考える / Designing AI Agent Experiences That Enhance Observability
aoto
PRO
2
310
AIは爆速なのに、私が詰まっていた話 ― 音声入力と鳴くマスコットでボトルネックを削る
yama3133
0
520
ビジネスを止めない技術的負債の返済のための戦略とその手法 - 技術的負債と向き合う / Complexity and Simplicity
soudai
PRO
3
630
Featured
See All Featured
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
320
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
260
The Invisible Side of Design
smashingmag
301
52k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
390
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Designing for Performance
lara
611
70k
Exploring anti-patterns in Rails
aemeredith
4
520
Raft: Consensus for Rubyists
vanstee
142
7.7k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
390
Building an army of robots
kneath
307
47k
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