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
990
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
580
ナレッジベースはどのように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
データ界隈LT祭 第1回LT登壇
taromatsui_cccmkhd
2
1.4k
アプリをもっと"iOSアプリっぽく"する小さな工夫 / Small Touches That Make Your App Feel More Like an iOS App
matsuji
2
930
生成AIエージェントを用いた、 手動テスト手順書から自動テストへの 変換手法の検討
magicpod
0
160
Screen Lens - 今見てる画面を翻訳する
komagata
0
320
TinyGo 開発サイクルを高速化する:Go で作るエミュレータ入門
zozotech
PRO
1
740
AI 時代のスタートアップエコシステ厶から考究する技術的負債との向き合い方
m3m0r7
PRO
3
2.1k
事業課題から技術的負債に向き合う
sansantech
PRO
2
1.9k
HHKBエバンジェリストになる方法
941
0
110
30座EKS, 180次升級淬煉的EKS Upgrade Skill 的歷程
eric8230
0
170
「守り」で活用するオンデバイスLLM 〜写ってはいけないを総力戦で防ぐ〜 / iOSDC Japan 2026
nakamuuu
0
170
AIに任せた品質は、誰が見立てるのか - AI時代のテストマネジメント
nakanao
2
1.9k
Railsのように考える: See through the Master
snoozer05
PRO
4
970
Featured
See All Featured
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
280
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
390
30 Presentation Tips
portentint
PRO
1
400
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
330
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
240
Between Models and Reality
mayunak
4
460
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
430
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
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