Slide 1

Slide 1 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Serverless Service Update AWS Application Composer & AWS SAM Accelerate S E R V E R L E S S M E E T U P 2 0 2 3 . 0 1 . 1 8 Naoto Oiso Amazon Web Services Solutions Architect

Slide 2

Slide 2 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 自己紹介 • 名前 § オオイソ ナオト • 好きな食べもの § 肉・寿司・ラーメン • 好きなこと § お酒・サウナ・マンガ・テニス・投資 • 好きなAWSサービス § AWS Application Composer・AWS Step Functions ・ Amazon Event Bridge 2 Glue Code ※ を 減らしてくれる サービスが好き ※ Glue Codeとはコンピュータプログラミングにおいてプログラムの要求仕様の実現には一切寄与しないが、 もともと互換性がない部分同士を結合するためだけに働くコードである

Slide 3

Slide 3 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Agenda • AWS SAM Accelerateのおさらい • AWS Application Composerのご紹介

Slide 4

Slide 4 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS SAM Accelerateのおさらい

Slide 5

Slide 5 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS SAM Accelerate とは • キャッシュを使った高速なビルド • 関数の高速なデプロイ(sam buildも自動で実行) • コードのみ、またはリソースまで指定してデプロイ • ローカルのコードの修正を検知して自動デプロイ • ログとトレースの収集と表示

Slide 6

Slide 6 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. SAM Accelerateの機能 • インクリメンタルビルド(sam build) § --cachedパラメータを指定することで、最初のビルドで依存関係をダウンロードしてコード をビルドし、キャッシュを生成 § 次回ビルド時にコードや依存関係に変更がなければキャッシュを利用し、再ビルドしない $ sam build --cached

Slide 7

Slide 7 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. SAM Accelerateの機能 • 高速なデプロイ機能(sam sync) § sam sync は、 sam deployコマンドと同様にすべてのインフラストラクチャとコードをデプ ロイ – sam syncはAWS CloudFormationの変更セットプロセスをバイパス(そのため開発用アカウントに のみ利用を推奨) § --codeパラメータを使用することで、サービスのAPIを利用してコードを同期 (CloudFormationをバイパス) – AWS Lambda 関数コード – AWS Lambda layer リソース – Amazon States LanguageフォームのAWS Step Functions テンプレート – CodeUriパラメータで識別されるAmazon API Gateway OpenAPI ドキュメント

Slide 8

Slide 8 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. SAM Accelerateの機能 • リソースや関数を指定してデプロイ機能(sam sync) § --codeと--resource [リソースタイプ]を指定して、対象リソースタイプのみを更新 (変更対象外のリソースタイプをバイパス) – AWS::Serverless::Function、AWS::Serverless::Api、AWS::Serverless::HttpApi、 AWS::Serverless::StateMachineが指定可能 § --codeと—resource-id [リソースID]を指定して対象のリソースのみを更新(変更対 象外のリソースをバイパス) $ sam sync --stack-name [Stack name] --code ¥ --resource-id HelloFonction $ sam sync --stack-name [Stack name] --code ¥ --resource AWS::Serverless::Function

Slide 9

Slide 9 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. SAM Accelerateの機能 SAM管理リソース + 変更セット作成 SAM管理リソース AWS Lambda 関数コード AWS Lambda layer リソース AWS Step Functions のAmazon States Languageテンプレート Amazon API Gateway OpenAPI ドキュメント AWS::Serverless::Function Function A Code Function B Code AWS::Serverless::Api API A OpenAPI Docs API B OpenAPI Docs AWS::Serverless::HttpApi API A OpenAPI Docs API B OpenAPI Docs AWS::Serverless::StateMachine State Machine A Amazon States Language Template State Machine B Amazon States Language Template CFn管理 リソース 変更 セット sam sync sam sync –code sam sync -–code --resource sam sync –-code –-resource-id sam sync のオプション別 デプロイ対象とデプロイ単位 sam deploy

Slide 10

Slide 10 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. SAM Accelerateの機能 • コードや依存関係の変更を自動検知してデプロイ(sam sync) § --watchを指定、コードや依存関係の変更を自動検知 § 更新の高速化のために、AwsSamAutoDependencyLayerNestedStack を生成 – 依存関係を自動的に一時的なLambda Layerを作成し、依存関係が更新されるまで再利用 $ sam sync --stack-name [Stack name] --watch

Slide 11

Slide 11 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. SAM Accelerateの機能 § ログやトレースを収集し表示(sam log) § 開発全体の手順 $ sam logs --stack-name [Stack name] --include-traces --tail $ sam init $ sam sync --stack-name [Stack name] –watch $ sam logs --stack-name [Stack name] --include-traces --tail

Slide 12

Slide 12 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Application Composer のご紹介

Slide 13

Slide 13 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. サーバーレスのメリット • サーバーのプロビジョニングや管理が不要 • 利用に伴ってスケールする • 利用した分だけの支払い • アーキテクチャの設計でスケール、セキュリティー、運用がより容易

Slide 14

Slide 14 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. サーバーレス開発の成功に求められるもの Infrastructure-as-code (IaC)

Slide 15

Slide 15 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Infrastructure-as-code Resources: Bucket: Type: AWS::S3::Bucket Properties: BucketName: !Sub ${AWS::StackName}-bucket-${AWS::AccountId} BucketEncryption: ServerSideEncryptionConfiguration: - ServerSideEncryptionByDefault: SSEAlgorithm: aws:kms KMSMasterKeyID: alias/aws/s3 PublicAccessBlockConfiguration: IgnorePublicAcls: true RestrictPublicBuckets: truen BucketBucketPolicy: Type: AWS::S3::BucketPolicy Properties:

Slide 16

Slide 16 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 巨大なYAMLファイル...

Slide 17

Slide 17 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. サーバーレス開発の成功に求められるもの Infrastructure-as-code (IaC) サーバーレスアーキテクチャパターンの知識

Slide 18

Slide 18 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 19

Slide 19 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. サーバーレス開発の成功に求められるもの Infrastructure-as-Code (IaC) サーバーレスアーキテクチャパターンの知識 重要な設定の詳細についての知識

Slide 20

Slide 20 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 21

Slide 21 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. サーバーレス開発の成功に求められるもの Infrastructure-as-Code (IaC) サーバーレスアーキテクチャパターンの知識 重要な設定の詳細についての知識 アーキテクチャダイアグラムのアップデート

Slide 22

Slide 22 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 23

Slide 23 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Application Composer (Preview)

Slide 24

Slide 24 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Application Composer (Preview) Infrastructure-as-Code (IaC) =>グラフィカルでドラッグ&ドロップでIaCを作成 サーバーレスアーキテクチャパターンの知識 =>直感的にサーバレスアーキテクチャを構築可能 重要な設定の詳細についての知識 => デフォルトでWell-architectedな設定をGUIベースで可能 アーキテクチャダイアグラムのアップデート => アーキテクチャダイアグラムとプロビジョニングツールが一体化

Slide 25

Slide 25 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Application Composer (Preview) AWS Consoleですぐに試せます 使ってみて気になったところを呟いて ください #AWSAppComposerWishlist AWS Consoleから直接フィードバック もできます

Slide 26

Slide 26 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thank you! © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Please complete the session survey in the mobile app