简体   繁体   English

如何在 MAC 上为 Up 创建 ~/.aws/credentials 文件

[英]How do I create ~/.aws/credentials file for Up on MAC

I'm developing a bot for Telegram and I am using Up to create a Lambda function for AWS.我正在为 Telegram 开发一个机器人,我正在使用Up为 AWS 创建一个 Lambda 函数。 The problem is that when I want to create the function I get an error saying:问题是,当我想创建函数时,我收到一条错误消息:

Error: Cannot find credentials, visit https://up.docs.apex.sh/#aws_credentials for help.错误:找不到凭据,请访问https://up.docs.apex.sh/#aws_credentials寻求帮助。

How do I create the ".aws" folder and the "credentials" file?如何创建“.aws”文件夹和“凭据”文件? Under what folder will this be saved?这将保存在哪个文件夹中? Is it in the same folder I created my bot?它是否在我创建机器人的同一个文件夹中?

This is on MAC.这是在MAC上。

安装适用于 Mac 的 AWS CLI 后,首次键入aws configure以初始化凭证文件。

  1. First, you need to install AWS CLI for OSX using the following link.首先,您需要使用以下链接为 OSX 安装 AWS CLI。 Refer the documentation for Install the AWS Command Line Interface on macOS for more details.有关更多详细信息,请参阅有关在 macOS 上安装 AWS 命令​​行界面的文档。
  2. Then you need to create AWS Programmatic Access Credentials (After creating a AWS IAM User) and download the credentials.然后您需要创建 AWS 编程访问凭证(在创建 AWS IAM 用户之后)并下载凭证。 For this you need to go to the IAM section of AWS Web Console.为此,您需要转到 AWS Web 控制台的 IAM 部分。 Refer the documentation for Understanding and Getting Your Security Credentials for more details.有关更多详细信息,请参阅了解和获取您的安全凭证的文档。
  3. Then configure the credentials using the shell commands.然后使用 shell 命令配置凭据。 Refer the documentation Configuring the AWS CLI for more details.有关更多详细信息,请参阅文档配置 AWS CLI

If you have homebrew you can install awscli like this:如果你有自制软件,你可以像这样安装 awscli:

brew update
brew install awscli

And then use the following to configure your aws with you access id and token:然后使用以下内容来配置您的 aws 与您的访问 ID 和令牌:

aws configure
  1. Install AWS CLI in your mac OS from link below: [ https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux-mac.html#cliv2-linux-mac-install][1]通过以下链接在您的 Mac OS 中安装 AWS CLI:[ https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux-mac.html#cliv2-linux-mac-install][1 ]

  2. Verify installation.验证安装。 Change to aws instead of aws2 incase you are using version-1如果您使用的是 version-1,请更改为 aws 而不是 aws2

$ aws2 --version
  1. Configure配置
$ aws2 configure

You need to configure your CLI before you can use it.您需要先配置 CLI,然后才能使用它。

From https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html来自https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html

"Quick Configuration For general use, the 'aws configure' command is the fastest way to set up your AWS CLI installation." “快速配置对于一般用途,'aws configure' 命令是设置 AWS CLI 安装的最快方法。”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM