「AWS サーバーレスアプリケーションモデル」のサンプルアプリ稼働時に「Error: Failed to create managed resources: Unable to locate credentials」

AWS サーバーレスアプリケーションモデル」のサンプルアプリ「チュートリアル: Hello World アプリケーションのデプロイ」を実施する際に、Credentialが設定されていなかった。
ついでに、AWS CLIもインストールしていなかったので、下記流れで設定。

1.AWS CLIをインストール
2.「aws configure list」コマンドでCredentialの確認
3.設定がされていなかったら「aws configure」で設定。

まず、「AWS サーバーレスアプリケーションモデル」のサンプルアプリ「チュートリアル: Hello World アプリケーションのデプロイ」を実施する際に、Credentialが設定されていなかったのでエラー「Error: Failed to create managed resources: Unable to locate credentials」

user@host:~/workspace$ cd sam-app/

user@host:~/workspace/sam-app$ ls
README.md events hello_world template.yaml tests

user@host:~/workspace/sam-app$ sam build
Building resource 'HelloWorldFunction'
Running PythonPipBuilder:ResolveDependencies
Running PythonPipBuilder:CopySource

Build Succeeded
Built Artifacts : .aws-sam/build
Built Template : .aws-sam/build/template.yaml

Commands you can use next
=========================
[*] Invoke Function: sam local invoke
[*] Deploy: sam deploy --guided


user@host:~/workspace/sam-app$ sam deploy --guided
Configuring SAM deploy
======================

Looking for samconfig.toml : Not found

Setting default arguments for 'sam deploy'
=========================================
Stack Name [sam-app]:
AWS Region [us-east-1]:
#Shows you resources changes to be deployed and require a 'Y' to initiate deploy
Confirm changes before deploy [y/N]:
#SAM needs permission to be able to create roles to connect to the resources in your template
Allow SAM CLI IAM role creation [Y/n]:
Save arguments to samconfig.toml [Y/n]:
Error: Failed to create managed resources: Unable to locate credentials

AWS CLIをインストール
インストールしたら、credentialを確認。

user@host:~/workspace$ aws configure list
Name Value Type Location
---- ----- ---- --------
profile None None
access_key None None
secret_key None None
region None None

たしかに何も設定されていないので、「aws configure」で設定。

user@host:~/workspace$aws configure