<p>AWS的python库(boto)有两种不同类型的接口,一种是低级的<code>client</code>,另一种是更高级的python <code>resource</code>。在</p>
<p>我的代码部分使用一个,而其他部分使用另一个。在</p>
<p>从<code>resource</code>获取<code>client</code>可以从文档中找到。在</p>
<pre><code># Create the resource
sqs_resource = boto3.resource('sqs')
# Get the client from the resource
sqs = sqs_resource.meta.client
</code></pre>
<p>我的问题是如果有客户<code>sqs</code>,我如何从中得到<code>boto3.resource</code>?在</p>
<p>(我不能简单地调用<code>boto3.resource('sqs')</code>因为客户机有其他东西,比如已经附加了凭证,出于某种设计原因,资源试图从一堆我不希望它获取的地方获取AWS凭证,我希望它使用在客户机上设置的任何凭证/帐户)</p>