WindowsへのAWS SAM CLIのインストール

WindowsへのAWS SAM CLIのインストール

AWS SAM CLIインストール

MSIをダウンロードしてインストールします。

Release Release version: 1.108.0 · aws/aws-sam-cli
Changes: eabc686 - Add --add-host cli option to expose docker container option with the same name. (#6078) 0e87d84 - cho...
C:\>sam --version
SAM CLI, version 1.52.0

Dockerインストール(オプション)

ローカル実行する場合は、Dockerをインストールしておきます。

Install Docker Desktop on Windows
Get started with Docker for Windows. This guide covers system requirements, where to download, and instructions on how t...
C:\>docker --version
Docker version 20.10.16, build aa7e414

gitインストール

gitからcloneするのでgitのインストールも必要です。

C:\> git --version
git version 2.36.1.windows.1

gitにパスが通っていないと、sam initで以下のようなエラーが出ます。

Project name [sam-app]:
WARN: Could not clone repo https://github.com/aws/aws-sam-cli-app-templates
Traceback (most recent call last):
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\utils\git_repo.py", line 130, in clone
git_executable: str = GitRepo._git_executable()
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\utils\git_repo.py", line 88, in _git_executable
raise OSError("Cannot find git, was looking at executables: {}".format(executables))
OSError: Cannot find git, was looking at executables: ['git', 'git.cmd', 'git.exe', 'git.bat']
Git - Downloading Package

AWS SAM CLIアップグレード

Installing the AWS SAM CLI - AWS Serverless Application Model
This section describes how to install the AWS SAM CLI on macOS, Windows, and Linux.

こちらのサイトからmsiをダウンロードして再度インストールします。(アンインストール不要)

C:\>sam --version
SAM CLI, version 1.76.0

参考サイト

AWS SAM CLIのインストール - AWS Serverless Application Model
このセクションでは、macOS、Windows、および Linux に AWS SAM CLI をインストールする方法について説明します。
AWS SAM の前提条件 - AWS Serverless Application Model
AWS SAM CLI をインストールする前に満たすべき前提条件。
Managing AWS SAM CLI versions - AWS Serverless Application Model
This section describes how to upgrade and uninstall the AWS SAM CLI on macOS, Windows, and Linux.

コメント

株式会社CONFRAGE ITソリューション事業部をもっと見る

今すぐ購読し、続きを読んで、すべてのアーカイブにアクセスしましょう。

続きを読む

タイトルとURLをコピーしました