Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Serverless_meetup_AWS Application Composer_and_devtoops_update_JP

naotoiso
January 20, 2023

Serverless_meetup_AWS Application Composer_and_devtoops_update_JP

naotoiso

January 20, 2023
Tweet

More Decks by naotoiso

Other Decks in Programming

Transcript

  1. © 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
  2. © 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とはコンピュータプログラミングにおいてプログラムの要求仕様の実現には一切寄与しないが、 もともと互換性がない部分同士を結合するためだけに働くコードである
  3. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Agenda • AWS SAM Accelerateのおさらい • AWS Application Composerのご紹介
  4. © 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のおさらい
  5. © 2023, Amazon Web Services, Inc. or its affiliates. All

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

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

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

    rights reserved. サーバーレス開発の成功に求められるもの Infrastructure-as-code (IaC)
  15. © 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:
  16. © 2023, Amazon Web Services, Inc. or its affiliates. All

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

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

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

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

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

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

    rights reserved. AWS Application Composer (Preview) AWS Consoleですぐに試せます 使ってみて気になったところを呟いて ください #AWSAppComposerWishlist AWS Consoleから直接フィードバック もできます
  23. © 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