Boto Config File
Boto是AWS SDK for Python,可以通过pip安装,也可以下载源码直接安装。直接安装挺方便的。
安装后参照AWS给出的Sample Project,连接S3,遍历一下buckets,获取指定的bucket,都挺简单的。
但是忘记了做一件事,没有“export access keys to environment variables”。模仿Sample只能把access key ID和secret access key作为参数写在代码里。
回过头看文档,再找到Boto Config的文档,然后就傻乎乎地试图去找到文档里提到的"boto.cfg"和".boto",折腾半天没找到。
浪费不少时间之后才明白,boto installer是不会自动创建这个config文件的。手动创建一个,放到该放的地方就可以了。
哪些地方是该放的地方呢?Unix/Linux系统里,boto按照这个顺序寻找config文件。
- /etc/boto.cfg - for site-wide settings that all users on this machine will use
- ~/.boto - for user-specific settings
- ~/.aws/credentials - for credentials shared between SDKs
当然,这也不是必须的,可以把config文件放到任何地方,然后在环境变量里配置BOTO_CONFIG。如果是Windows系统咋办?Stackoverflow上这个问题的回答可行。
- Create your file with the name you want(e.g boto_config.cfg) and place it in a location of your choice
- Create an environment variable with the Name='BOTO_CONFIG' and Value= file_location/file_name
- Boto is now ready to work with credentials automatically configured!
当然,最权威的是仔细看Boto Config文档,这里也介绍了在config文件里如何配置Credentials。
Boto Config File的更多相关文章
- [笔记]HAproxy reload config file with uninterrupt session
HAProxy is a high performance load balancer. It is very light-weight, and free, making it a great op ...
- error in config file "/etc/rabbitmq/rabbitmq.config"
记录一次RabbitMQ配置文件配置错误 error信息: dill@ubuntu-vm:/usr/share/doc/rabbitmq-server$ sudo /usr/lib/rabbitmq/ ...
- .NET错误The 'targetFramework' attribute in the <compilation> element of the Web.config file is used only to target version 4.0 and later of the .NET Framework
错误描述: The 'targetFramework' attribute in the <compilation> element of the Web.config file is u ...
- No connection string named '***' could be found in the application config file
Code-First时更新数据库遇到妖孽问题“No connection string named '***' could be found in the application config fil ...
- Camel routes in Spring config file
The normal spring bean definition configuration file, the xsi:schemaLocation only has two: beans and ...
- 为 vsftpd 启动 vsftpd:500 OOPS: bad bool value in config file for: pasv_enable
每行的值都不要有空格,否则启动时会出现错误,举个例子,假如我在listen=YES后多了个空格,那我启动时就出现.. 为 vsftpd 启动 vsftpd:500 OOPS: bad bool val ...
- Warning: World-writable config file '/etc/my.cnf' is ignored
1. 问题描述: 重启mysql服务时出现以下信息: Warning: World-writable config file '/etc/my.cnf' is ignored 出现这种情况的原因是:m ...
- MySQL无法重启问题解决Warning: World-writable config file ‘/etc/my.cnf’ is ignored
MySQL无法重启问题解决Warning: World-writable config file ‘/etc/my.cnf’ is ignored
- Create a custom configSection in web.config or app.config file
config file: <?xml version="1.0" encoding="utf-8" ?> <configuration> ...
随机推荐
- vue教程3-01 路由、组件、bower包管理器使用
vue教程3-01 路由.组件.包管理器 以下操作前提是 已经安装好node.js npm bower-> (前端)包管理器 下载: npm install bower -g 验证: bower ...
- Python中的 // 与 / 的区别
" / " 表示浮点数除法,返回浮点结果;" // " 表示整数除法,返回不大于结果的一个最大的整数 [code] print("6 // 4 = & ...
- 线程中的同步辅助类Exchanger
Exchanger 允许两个线程在 collection 点交换对象,它在多流水线设计中是有用的. 允许两条线程之间交换数据.Exchanger的exchange方法是阻塞的,当其他线程也调用了该方法 ...
- ADO.NET 4.5中的异步与流特性
.NET 4.5为仍在选择直接与DataReader系列类打交道的.NET开发人员带来了一些新的异步与流特性支持.SqlDataReader允许开发人员在减少一些便利性的基础上获得更好的性能.例如,该 ...
- StreamSets学习系列之StreamSets是什么?
不多说,直接上干货! StreamSets是一个侧重数据集成.数据加工流程构建的平台,也是一个开源的产品.通过StreamSets,用户可以方便的接入不同的数据源,并且完成数据加工流程的构建.Stea ...
- Python学习--02输入和输出、运算符
命令行输入 x = input("Please input x:") y = raw_input("Please input x:") 使用input和raw_ ...
- SSM事务——事务回滚如何拿到返回值
MySQL数据库一共向用户提供了包括BDB.HEAP.ISAM.MERGE.MyISAM.InnoDB以及Gemeni这7种Mysql表类型.其中BDB.InnoDB属于事务安全类表,而其他属于事务非 ...
- Linux下自动清理超过指定大小文件的方法
由于线上业务用的squid,根据经验值如果长时间运行则缓存目录下的swap.state会慢慢变大,一旦超过60M,squid的性能就会急剧下降,因此需要定时去清理大于60M的swap.state文件. ...
- QT QPushButton
#include<QApplication> #include<QWidget> #include<QPushButton> #include<QMenu&g ...
- 如何优雅的控制goroutine的数量
1,为什么要控制goroutine的数量? goroutine固然好,但是数量太多了,往往会带来很多麻烦,比如耗尽系统资源导致程序崩溃,或者CPU使用率过高导致系统忙不过来.比如: ; i < ...