服务
关于
CloudProse博客

2017年7月14日,星期五

In case you’ve missed it, AWSume is a cross-platform AWS command-line tool that makes working with the AWS CLI under different profiles or roles super easy. You no longer have to manually set environment variables, or pass the --profile <profile_name> to the end of your AWS CLI calls. When you have your profiles correctly set up, you can simply run awsume <profile_name>, and AWSume will do the work for you!

在GitHub上查看!

AWSume通过设置您的AWS环境变量来工作。这样,您进行的任何其他AWS CLI调用都将在您AWSumed的配置文件下,直到配置文件凭证过期。

以前,我们必须为我们要支持的各种平台维护三个不同的代码库。更新和添加新功能花了很长时间。安装也涉及许多步骤。

解决方案-AWSumepy,但是为什么要使用Python?

We have moved the core of what AWSume is from the shell scripts into the Python script awsumepy. But why?

  • 跨平台
    • Python是一种语言,允许您构建可以跨平台运行的软件包(macOS,Linux,Windows)。
  • 一个代码库
    • 因为我们有一个用于AWSume核心的代码库,所以更新AWSume和添加新功能更加容易。
  • 易于维护
    • Because AWSume works through setting environment variables, we still need small awsume shell wrappers for each platform we support. However, since the work has been taken from the shell and put on Python, maintaining these shell scripts is much easier.
  • AWS CLI取决于Python
    • 由于AWS CLI依赖于Python,因此有必要在Python中创建一个AWS CLI工具。
  • 快点
    • AWSume being run in Python is incrementally faster than it’s 预先vious shell script counterparts.
  • 易于安装
    • AWSume现在非常易于安装,只需要一个命令:<pre><code>pip install awsume</code></pre>
    • 之后,您就可以使用AWSume了!

还介绍:autoAWSume!

AWS role credentials are only valid for a maximum of an hour. This means that you need to call AWSume once for every hour that you work under that role. Now, we have developed an AWSume auto-refresher! By simply passing the -a option to AWSume with the given role, you’ll spawn a background process that refreshes roles that are about to expire, for as long as the role’s source profile’s credentials are valid. Once there are no more roles to refresh, autoAWSume stops running.

在GitHub上查看!

作者
迈克尔·巴尼(Michael Barney)Trek10
迈克尔·巴尼

DevOps工程师

Michael的职业生涯始于无服务器世界,他刚从大学毕业就加入了Trek10团队-真正的无服务器本地人。