获取ClientError:调用发布操作时发生错误(ForbiddenException):Forbidden?

时间:2017-09-22 12:39:58

标签: amazon-web-services boto3

我很担心AWS boto3和访问密钥是如何工作的。

我已经设置了一个具有poweruser和编程访问权限的IAM用户。我输入了访问密钥并将密钥访问到aws configure中。

在我的python脚本中,我: 导入boto3 iot = boto3.client('iot-data');

...过了一会儿,我的代码确实如此:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework"
  type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
  requirePermission="false"/>
</configSections>
<appSettings>
<add key="webpages:Version" value="3.0.0.0"/>
<add key="webpages:Enabled" value="false"/>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.6.1"/>
<httpRuntime targetFramework="4.6.1"/>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
  </dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
  <parameters>
      <parameter value="mssqllocaldb"/>
  </parameters>
</defaultConnectionFactory>
<providers>
  <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
</providers>
</entityFramework>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>

iot.publish导致错误:

ClientError:调用发布操作时发生错误(ForbiddenException):请求中包含的安全令牌无效。

我验证我在创建用户帐户时生成的aws配置文件中有访问密钥和密钥。

也许我错过了访问密钥如何与boto3绑定相关联?我猜boto3从配置文件中获取密钥信息。但那些不应该有效吗?

谢谢。

0 个答案:

没有答案