Giter Club home page Giter Club logo

sample-cloudfront-s3-api-waf's Introduction

CloudFront & S3 & API Gateway & WAF サンプル

構成

[構成図]

初期設定

  • ルートディレクトリでnpm ciを実行する
  • cdkディレクトリでnpm ciを実行する
  • frontendディレクトリでnpm ciを実行する

ローカル実行

  • front/.env.templateをコピーしてfront/.envを作成する
    • VITE_API_ENDPOINThttp://localhost:3000を設定する
  • ルートディレクトリで npm run start-front:local でフロントエンドを起動する
  • ルートディレクトリで npm run start-api:local でAPIを起動する
    • ※Lambdaを修正した場合は、再度実行する必要がある、CDKの場合にsam buildコマンドなどでの自動反映方法が不明のため
  • 動作確認
    • http://localhost:5173でアクセスする
    • 取得ボタンをクリックする

デプロイ

  • ルートディレクトリで npm run deploy-all:dev でデプロイ
  • 動作確認
    • CloudFrontのURLでアクセスする
    • 取得ボタンをクリックする

削除

  • S3のログバケットを空にする
    • cloudfront-s3-api-waf-dev-cloudfront-log-bucket
  • ルートディレクトリで npm run destroy-all:dev で削除
  • CloudWatch Logsにロググループが残っているので手動で削除する
    • cloudfront-s3-api-waf で検索して削除する
    • 作成時刻を確認し対象と判断できる /aws/codebuild/FrontDeployDeployToSourceBu-xxxxx を削除する
    • 作成時刻を確認し対象と判断できる API-Gateway-Execution-Logs_xxxxxxx/api を削除する
  • IAMロールが残っているので手動で削除する
    • cloudfront-s3-api-waf で検索して削除する

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.