Sim*_*rro 3 amazon-web-services aws-appsync aws-amplify
为了更新我的 API 密钥,我曾经使用 AWS AppSync \xe2\x86\x92 设置并生成一个新密钥。
\n之后,在我的本地应用程序中,找到旧的 API 密钥并将其替换为新的 API 密钥...直到昨天,这都工作正常,但现在,无论我做什么,当我运行时,amplify status它都会输出我的旧 API 密钥。
我也尝试过amplify update api但没有运气。后来我尝试amplify pull看看它是否使用网络应用程序(AppSync)中的新密钥更新我的本地 API 密钥,但仍然没有成功。
我已经在线生成了有效的 API 密钥,为什么我无法使用相同的密钥更新本地 API 密钥?
\nNin*_*les 12
尝试这个解决方案:
\n在项目中打开此文件夹amplify/backend/<api>/parameters.json
添加这些行:
\n"APIKeyExpirationEpoch": -1,\n"CreateAPIKey": -1
\n从终端运行amplify push.
这应该从堆栈中删除 API 密钥。现在,从 中删除APIKeyExpirationEpoch和,并使用 CLI 创建一个新密钥:CreateAPIKeyparameters.json
amplify update api\nRun Code Online (Sandbox Code Playgroud)\n在这里,大多数情况下,您必须选择:
\n? Select from one of the below mentioned services: -> GraphQL (or rest API, it depends on your needs)\n? Select a setting to edit -> Authorization modes\n? Choose the default authorization type for the API -> API key\n\xe2\x9c\x94 After how many days from now the API key should expire (1-365): ->365\n? Configure additional auth types? ->No\nRun Code Online (Sandbox Code Playgroud)\n最后运行:
\namplify push\nRun Code Online (Sandbox Code Playgroud)\n通过此解决方案,您可以将 API 密钥续订 1 年。
\n| 归档时间: |
|
| 查看次数: |
4134 次 |
| 最近记录: |