LoginSignup
5
6

More than 1 year has passed since last update.

LocalStack 環境構築 メモ

Last updated at Posted at 2021-10-09

LocalStackとは?

  • AWSのサービスを擬似的に利用できるフレームワーク
  • 対応AWSサービスは、公式ページを参照のこと

AWS CLIインストール・設定

インストール

  • 筆者環境はWindowsのため、こちらからインストーラーをダウンロードし、実行する。

  • インストール結果確認

  aws --version
  aws-cli/2.2.44 Python/3.8.8 Windows/10 exe/AMD64 prompt/off

設定

  • クレデンシャル設定
  aws configure --profile localstack
  AWS Access Key ID [None]: dummy
  AWS Secret Access Key [None]: dummy
  Default region name [None]: ap-northeast-1
  Default output format [None]: json
  • 設定値確認
  cat ~/.aws/credentials
  [localstack]
  aws_access_key_id = dummy
  aws_secret_access_key = dummy
  cat ~/.aws/config
  [profile localstack]
  region = ap-northeast-1
  output = json

Docker 環境構築

  • Gitからプロジェクトクローン
  git clone https://github.com/atlassian/localstack.git
  Cloning into 'localstack'...
  remote: Enumerating objects: 2199, done.
  remote: Counting objects: 100% (6/6), done.
  remote: Compressing objects: 100% (4/4), done.
  Receiving objects: 100% (2199/2199), 618.62 KiB | 2.07 MiB/s, done.

  Resolving deltas: 100% (1435/1435), done.
  • Docker起動
  cd localstack
  docker-compose up

動作確認

S3

  • バケット作成
  aws s3 mb s3://sample-bucket --endpoint-url=http://localhost:4572 --profile=localstack
  make_bucket: sample-bucket
  • バケット確認
  aws s3 ls --endpoint-url=http://localhost:4572 --profile=localstack
  2006-02-04 01:45:09 sample-bucket

※作成時刻がおかしい...?

参考情報

5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6