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
AWS Transform Customによる Spring Boot 2.xから4.xへの...
Search
Satoshi Kaneyasu
August 07, 2026
Programming
170
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
AWS Transform Custom による Spring Boot 2.xから4.xへのVerUp
Satoshi Kaneyasu
August 07, 2026
More Decks by Satoshi Kaneyasu
See All by Satoshi Kaneyasu
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
320
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
330
【業務アプリのモダナイズ】このまま保守・改修し続けて大丈夫ですか?
satoshi256kbyte
1
66
今から学ぶベクトルデータベース基礎知識からAmazon Bedrock Knowledge Basesまで
satoshi256kbyte
2
16
Amazon Managed Grafana で Amazon DynamoDB のデータを可視化する Infinity Plugin + プライベート API 構成
satoshi256kbyte
1
32
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
840
運用ダッシュボードの設計を誰も教えてくれないのだけどみなさんどうしてるんですか? - チームに監視するという文化を根付かせるための第一歩を踏みたい -
satoshi256kbyte
1
230
AWS CDK ExpressモードとCI/CDの組み合わせ
satoshi256kbyte
1
70
AWS re:Invent 2025の少し振り返り + DevOps AgentとBacklogを連携させてみた
satoshi256kbyte
3
250
Other Decks in Programming
See All in Programming
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
290
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
120
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
8
5.4k
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
190
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
33
14k
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
520
Security issues being discussed on Web Platforms
petamoriken
0
1.4k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
410
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
440
Agents on Rails - Rails at Scale 2026
irinanazarova
0
310
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
300
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
310
Featured
See All Featured
Crafting Experiences
bethany
1
370
Code Reviewing Like a Champion
maltzj
528
40k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
900
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Product Roadmaps are Hard
iamctodd
55
13k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
600
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
How to Ace a Technical Interview
jacobian
280
24k
How to make the Groovebox
asonas
2
2.5k
Transcript
AWS Transform Custom による Spring Boot 2.xから4.xへのVerUp 2026/08/08 Satoshi Kaneyasu
Speaker Introduction 氏名:兼安 聡 所属:株式会社サーバーワークス アプリケーションサービス本部 在住:広島 担当: PM、SM、DevOps、仕様駆動開発 SNS(X):@satoshi256kbyte
• • • • • • 2026 Japan AWS Ambassadors 2024-26 Japan AWS Top Engineers 2024-26 Japan AWS All Certifications Engineers 2025-26 AWS Community Builders 認定スクラムマスター PMP 2
このLTの題材 ⚫ フレームワークに破壊的な変更が入っているアプリを、AWS Transform Custom で自動バージョンアップできるのか?を検証してみました。 ⚫ LTでは小さいサンプルコードを用いた検証を紹介していますが、 実際に移行案件を行なった経験をもとにしています ⚫
サンプルはSpring Boot 2.xです。これを4.xにします ⚫ サンプルは社員のデータを扱うWebアプリケーションで、SPA ⚫ 写真のアップロード機能を有します クライアント Appサーバー Spring Boot 2.7 DBサーバー MySQL5.7 3
現環境(As-Is)の技術スタック 項目 内容 言語 Java 11 フレームワーク Spring Boot 2.7系、Spring
Data JPA(Hibernate)、Thymeleaf データベース MySQL 5.7 APサーバー Embedded Tomcat(Spring Boot標準) 認証方式 フォーム認証+インメモリ管理 ログ出力方式 Logback(Spring Boot標準) ファイルストレージ ローカルストレージ 4
目指す姿(To-Be)の技術スタック 項目 内容 言語 Java 25 フレームワーク Spring Boot 4.x系、Spring
Data JPA(Hibernate 7)、Thymeleaf 5
AWS Transform CustomでVerUp自体はやり切れる ⚫ 結論から先に述べるとAWS Transform CustomでVerUp自体はやり切れました ⚫ ただし、プロンプト>Verup>検証>プロンプト見直してやり直しを3回やっています ⚫
サンプルコードは約1,800行で、3回のループで費用は$15、時間は約半日でした ⚫ このコスト・所要時間から考えると、いきなり実案件で回すのは危険と思います ⚫ 小規模の検証コードでプロンプトを磨いてから実際のリポジトリに適用するといいと思います 6
AWS Transform Custom の設定ファイル(config.yaml) codeRepositoryPath: ./step1-legacy transformationName: AWS/spring-boot-version-upgrade buildCommand: mvn
clean install validationCommands: | mvn checkstyle:check mvn verify additionalPlanContext: | 途中省略 ## 実施してほしい変更(優先度順) 1. pom.xml の spring-boot-starter-parent のバージョンを 4.1.x に更新し、 java.version プロパティを 25 に変更する 2. ソースコード全体で javax.* パッケージを jakarta.* に置換する (persistence, validation, servlet の各名前空間) 3. WebSecurityConfigurerAdapter を継承するクラスを廃止し、 SecurityFilterChain を返す @Bean メソッドへ書き換える 4. antMatchers() を requestMatchers() に、authorizeRequests() を authorizeHttpRequests() に置換し、and() チェーンをラムダDSLへ書き換える 5. Jackson の ObjectMapper 利用箇所(本体コードおよびテストコード)の import を tools.jackson.databind.ObjectMapper に更新する (アノテーションの import は変更しない) 6. MySQL Connectorの依存関係を mysql:mysql-connector-java から com.mysql:mysql-connector-j へ切り替える 7. thymeleaf-extras-springsecurity5 の依存関係を thymeleaf-extras-springsecurity6 へ 切り替え、Thymeleafテンプレート内のnamespace宣言も合わせて更新する 8. Flyway の依存関係を、flyway-core の直接依存のままにせず spring-boot-starter-flyway 経由に切り替える。 Spring Boot 4.1では flyway-core を直接依存させるだけではFlyway自体が起動せず、 アプリ起動時にテーブルが1つも作成されない(Schema validation: missing table エラーになる)ため、これは必須の変更です 9. Dockerfile のビルドステージ・実行ステージのベースイメージを、pom.xmlの java.version(25)に合わせて更新する (maven:3.9-eclipse-temurin-25 / eclipse-temurin:25-jre)。 pom.xmlだけJava 25にしてDockerfileをJava 11のまま放置すると、 コンテナビルド時に「release version 25 not supported」で失敗します 右側に続く 途中省略 ## 検証について - buildCommand・validationCommands(mvn checkstyle:check, mvn verify)を 実際に実行し、全て成功する状態まで修正を繰り返してから完了としてください。 ビルド・テストを一度も実行せずに「完了」と報告することは禁止します - checkstyle違反を消すためだけに、使っていないimport文を追加したまま 残す、あるいはテストコードを無効化・削除・skipすることで検証を 通すことは禁止します。原因そのものを修正してください (パス・リクエスト/レスポンス形式) validationCommandsと テキストで検証方法を 定めているのがポイントです 7
AWS Transform Custom の変換結果の例 @Configuration @EnableWebSecurity public class SecurityConfig extends
WebSecurityConfigurerAdapter { 変換前 @Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/css/**", "/js/**").permitAll() .anyRequest().authenticated() .and() .formLogin() .loginPage("/login") .defaultSuccessUrl("/employees", true) .permitAll() .and() .httpBasic() .and() .logout() .logoutSuccessUrl("/login?logout") .permitAll() .and() .csrf() .ignoringAntMatchers("/api/**"); } } 変換後 @Configuration @EnableWebSecurity public class SecurityConfig { @Bean public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { http .authorizeHttpRequests(authorize -> authorize .requestMatchers("/css/**", "/js/**").permitAll() .anyRequest().authenticated() ) .formLogin(form -> form .loginPage("/login") .defaultSuccessUrl("/employees", true) .permitAll() ) .httpBasic(httpBasic -> { }) .logout(logout -> logout .logoutSuccessUrl("/login?logout") .permitAll() ) .csrf(csrf -> csrf .ignoringRequestMatchers("/api/**") ); return http.build(); } @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { PasswordEncoder encoder = PasswordEncoderFactories .createDelegatingPasswordEncoder(); auth.inMemoryAuthentication() .withUser("admin") .password(encoder.encode("admin123")) .roles("ADMIN"); } } @Bean public UserDetailsService userDetailsService() { PasswordEncoder encoder = PasswordEncoderFactories .createDelegatingPasswordEncoder(); var user = User.withUsername("admin") .password(encoder.encode("admin123")) .roles("ADMIN") .build(); return new InMemoryUserDetailsManager(user); } 非推奨となった WebSecurityConfigurerAdapterの 移行もできています 8
AWS TransformCustom で対応しきれなかったもの 項目 内容 指示見直し後再実行 で解消 Dockerfile Dockerfile のベースイメージが
Java 11 のままで、pom.xml の java.version: 25 と矛盾し、コンテナビルドが失敗する ◦ 未使用のインポート SecurityConfig.java に未使用の import が残り、Checkstyleが失敗す る ◦ flyway-core の直接依存 flyway-core の直接依存のままで spring-boot-starter-flyway に切り 替わっておらず、Flyway自体が起動せずテーブルが作成されない ◦ プラグインのバージョン maven-checkstyle-pluginが3.3.1のままで、includeTestSourceRoots パラメータが認識されず警告が出ていた (テストソースがCheckstyle対象から漏れる可能性があった) ⚫ 対応できなかったものは指示を具体化して再実行かけることで成功するパターンもあります ⚫ とはいえ、細かい部分でカバーしきれないものは存在するので100%にはなり得ません ⚫ Transform customで綺麗に移行することに拘るのも効率的ではないので、 初回で対応できなかったものについて指示を具体化するか、 直接修正かけるかはコスト・スケジュールとの相談となります 9
AWS Transform Customでデグレ検証はできる? ⚫ AWS Transform Customに限らず、AIにデグレ検証させるのはかなり怖いですね・・・ ⚫ 仮に移行前が自動テストがなかったとしたら、自動テストを入れるということはテストできるよ うに少なからずコードの方を寄せることになるので既存ロジックを壊す可能性が高いはず
⚫ AWS Transform Customで浮いた工数をテスト工数に当てるのが妥当ではないでしょうか? 10
まとめ ⚫ AWS Transform CustomはSpring Boot 2.xから4.xのような破壊的変更を含んだVerUpも やり切れます ⚫ ただしコストと時間もそれなりにかかるので、
まずは小さめの検証コードでプロンプト磨いてから実際のリポジトリに適用するのがお勧め ⚫ AIにデグレ検証させるのは無理があるのでは・・・。現状AWS Transform Customで浮いた工 数をテスト工数に充てるぐらいがベターかと ⚫ 次のページからはおまけです 11
目指す姿(To-Be)の技術スタック(全容) ⚫ 実際にはアーキテクチャ・インフラ構成の見直しも同時進行することも多いでしょうから、 それらも考えてみます 項目 内容 言語 Java 25 フレームワーク
Spring Boot 4.x系、Spring Data JPA(Hibernate 7)、Thymeleaf データベース Amazon Aurora MySQL 8.x系 APサーバー Embedded Tomcat(Spring Boot標準) 認証方式 フォーム認証+Spring Session + Redis(Amazon ElastiCache) ログ出力方式 Logback(Spring Boot標準)+Amazon CloudWatch Logs ファイルストレージ Amazon S3 12
目指す姿(To-Be)の構成図 13
AWS Transform CustomとSDDを使い分ける ⚫ バージョンアップそのものではなくアーキテクチャ見直しの方は、 SDD(仕様駆動開発)を用いた方がいいと思います(バイブコーディングもあり) ⚫ AWS Transform Customでもプロンプト次第でできなくはないとは思いますが、
いかんせんアーキテクチャ見直しの方がやり取りが多いので不向きでしょう 14
AWS Transform customとSDDを組み合わせたWBS WBS 開発手法・アプローチ 役割分担 SDD(仕様駆動開発) • • •
人間が既存情報を収集 AIがコード生成 人間がレビュー ローカル実行基盤の作成 (Docker Compose等) SDD(仕様駆動開発) • • • 人間が既存情報を収集 AIがコード生成 人間がレビュー Java 11→25 アップグレード AWS Transform Custom • • AIが自動変換 人間がレビュー Spring Boot 2.x→4.x アップグレード AWS Transform Custom • • AIが自動変換 人間がレビュー Transform customで変換しきれない 箇所の修正 SDD(仕様駆動開発) • • AIがコード生成 人間がレビュー 新アーキテクチャのIaC作成 (ユニットテスト込み) SDD(仕様駆動開発) • • AIがコード生成 人間がレビュー ファイルストレージのS3化 SDD(仕様駆動開発) • • AIがコード生成 人間がレビュー セッション・キャッシュの外部化 SDD(仕様駆動開発) • • AIがコード生成 人間がレビュー DB接続情報の取得方法の変更 SDD(仕様駆動開発) • • AIがコード生成 人間がレビュー 画面側のファイルパス・画像パス生成の変更 SDD(仕様駆動開発) • • AIがコード生成 人間がレビュー 既存アプリのコンテナ化 15
None