$30 off During Our Annual Pro Sale. View Details »

痒いところに手が届くAmplify

yuukiyo
July 31, 2020

 痒いところに手が届くAmplify

Amplify Meetup #01で発表した資料です
https://aws-amplify-jp.connpass.com/event/182471/

デモで利用した動画は以下にあります
■IAM Role + MFA
https://youtu.be/d8K2ed9HpHk

■Lambda Layer
https://youtu.be/FyebKxAUbGg

yuukiyo

July 31, 2020
Tweet

More Decks by yuukiyo

Other Decks in Programming

Transcript

  1. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Yuki Yoshida
    アマゾンウェブサービスジャパン株式会社
    プロフェッショナルサービス本部
    2020/7/31
    痒いところに⼿が届くAmplify
    AWS Amplify Meetup#01

    View Slide

  2. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    アジェンダ
    #0 AWS Amplifyとは
    #1 Amplify CLIをよりセキュアに利⽤するTips
    #2 最近の機能アップデート紹介
    ※今後のロードマップに関するご質問はお答え出来ませんのでご了承下さい

    View Slide

  3. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    #0 AWS Amplifyとは

    View Slide

  4. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    AWS Amplify
    Amplify Framework
    静的ウェブホスティングサービスであり、静的ウェブアプ
    リケーションを構築およびデプロイするためのシンプルな
    CI/CD ワークフローを提供することにより、アプリケー
    ションのリリースサイクルを加速
    AWS Amplify Console
    ü Amplify CLI
    ü Amplify ライブラリ
    ü UIコンポーネント

    View Slide

  5. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Amplify Framework
    Amplify CLI
    Amplifyライブラリ
    UIコンポーネント

    View Slide

  6. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    #1 Amplify CLIをよりセキュア
    に利⽤するTips

    View Slide

  7. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Amplify CLIの使い⽅
    $ npm install -g @aws-amplify/cli
    $ (amplify configure)
    $ amplify init
    $ amplify add xxx
    $ amplify push
    https://docs.amplify.aws/cli/start/install
    amplify configure?

    View Slide

  8. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    amplify configure
    IAM user(AdministratorAccess Policy)を
    作成するフローに乗せてくれる

    View Slide

  9. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Q︓Amplify CLIはAdministratorAccessポリシーを付与
    するしかないの︖
    A:
    権限は必要最小限で

    View Slide

  10. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Amplifyで扱えるサービスが追加されたら都度ポリシー
    を更新する必要があります
    Amplify CLIに必要なポリシーは以下に記載されている
    https://docs.amplify.aws/cli/usage/iam
    「Cognitoの作成をさせない」などポリシーで調整
    ※AWS Amplify ConsoleのIAMロールにつけるポリシーは別

    View Slide

  11. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Q︓Amplify CLIをセキュアに使うにはどうすれば良いの︖
    A:
    IAMロール(+MFA)
    AWS CLIと考え方は同じ

    View Slide

  12. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    絵で書くと
    IAM Role amplify
    Policy
    信頼関係
    aws:MultiFactorAuthPresent: true
    IAM User STS Only
    Policy
    temporary
    credentials
    credential
    MFA Token +
    Amplify CLI
    IAM
    {
    "Version": "2012-10-17",
    "Statement": [
    {
    "Effect": "Allow",
    "Action": "sts:AssumeRole",
    "Resource": ""
    }
    ]
    }
    ~/.amplify/awscloudformation/cache.json
    amplify init
    https://docs.amplify.aws/cli/usage/iam-roles-mfa
    ~/.aws/config

    View Slide

  13. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    デモ
    https://youtu.be/d8K2ed9HpHk

    View Slide

  14. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    #2 最近の機能アップデート紹介

    View Slide

  15. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    最近のアップデート
    7/8 Amplify CLIは、Lambdaレイヤーをサポートしました
    6/24
    Amplify Consoleは、ブランチのカスタムサブドメインを⾃動的に作成&削除す
    る機能をサポートしました
    6/16 Amplify Consoleは、Monorepoをサポートしました
    5/27 Amplifyライブラリ iOS & Androidが⼀般提供開始(GA)
    4/9 Amplify ライブラリ 新設計されたJavaScriptのUIコンポーネント
    4/6
    Amplify CLIは、追加のLambdaランタイム(Java、Go、.NET、Python)およ
    びLambda cronジョブのサポート

    View Slide

  16. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Amplify CLIは、Lambdaレイヤーをサポートしました
    Lambdaレイヤーの作成、デプロイ、細かな設定が可能

    View Slide

  17. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    デモ
    https://youtu.be/FyebKxAUbGg

    View Slide

  18. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Amplify Consoleは、ブランチのカスタムサブドメイン
    を⾃動的に作成&削除する機能をサポート
    master
    B
    feature-xxx
    C
    www.yshd.xyz
    feature-xxx.yshd.xyz
    A(200) C(200)
    B(200) ☓
    ※Basic認証可
    A

    View Slide

  19. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Amplify Consoleは、Monorepoをサポートしました
    monorepo で管理されるプロジェクトを簡単にデプロイ
    monorepo =
    amplify.ymlにappRootを指定する
    共通のアセット含む複数のアプリで構成された
    単⼀のリポジトリ

    View Slide

  20. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Thank you!!

    View Slide