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

URL 正規化処理を Lambda@Edge から CloudFront Functions ...

URL 正規化処理を Lambda@Edge から CloudFront Functions に移行した話 /jawsug-asa-21-session

# JAWS UG 朝会 #21 の セッション資料です。
https://jawsug-asa.connpass.com/event/211381/

# スライドの詳細ブログ
CloudFront Functions を AWS CLI で触る ― ついでにブログの URL 正規化を Lambda@Edge から移行した - michimani.net
https://michimani.net/post/aws-normalize-url-using-cloudfront-functions/

CloudFront Functions でサポートされているランタイムについて調べてみた - michimani.net
https://michimani.net/post/aws-about-runtime-of-cloudfront-functions/

Yoshihiro ITO

May 27, 2021
Tweet

More Decks by Yoshihiro ITO

Other Decks in Technology

Transcript

  1. # # AWS AWS CLI AWS Certificate Manager # :

    https://michimani.net / Yoshihiro Ito @michimani210
  2. 0.

  3. 1. URL : / CloudFront + S3 / https://michimani.net/about/ https://michimani.net/about

    403 301 https://michimani.net/about/ HTTP/1.1 301 Found Location: https://michimani.net/about/ ( ) / http://michimani.net
  4. 2. CloudFront Functions Lambda@Edge (13 ) CloudFront Functions CloudFront (215

    ) Amazon CloudFront CloudFront Functions https://aws.amazon.com/jp/about-aws/whats-new/2021/05/cloudfront-functions/
  5. 2. CloudFront Functions Lambda@Edge ( ) () Origin CloudFront Functions

    Lambda@Edge JavaScript (ES 5.1 ) Node.js/Python 10 KB 1 MB (50 MB) 2 MB 128 MB (10 GB) 1ms 5 s (30 s)
  6. 2. CloudFront Functions Lambda@Edge ( ) () Origin SSR CloudFront

    Functions Lambda@Edge JavaScript (ES 5.1 ) Node.js/Python 10 KB 1 MB (50 MB) 2 MB 128 MB (10 GB) 1ms 5 s (30 s)
  7. 4. AWS CLI CloudFront aws cloudfront ・create-function ・delete-function ・describe-function ・get-function

    ・list-functions ・publish-function ・test-function ・update-function v1 1.19.64 v2 2.2.2 (2021/05/27 06:30 JST) 1.19.81 2.2.6
  8. 4. AWS CLI 1. Function を作成 2. 作成した Function を確認

    3. Function をテスト 4. Function を公開 5. Function を Distribution に紐付け 6. Function の状態を確認 ※このスライド内に記載しているコマンドは v1 での実行を想定しています
  9. 4. AWS CLI Function : Function (cf2.js) Origin (S3) /

    index.html / Viewer 301 HTTP Viewer URI index.html Origin (S3)
  10. 4. AWS CLI 5. Function Distribution : Function ARN aws

    cloudfront describe-function \ —name “${FN_NAME}” \ —query “FunctionSummary.FunctionMetadata.FunctionARN” \ —output text
  11. 5. URL CloudFront CloudFront Functions Lambda@Edge Lambda@Edge AWS CLI #

    CloudFront Functions AWS CLI URL Lambda@Edge https://michimani.net/post/aws-normalize-url-using-cloudfront-functions/ CloudFront Functions https://michimani.net/post/aws-about-runtime-of-cloudfront-functions/