- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用适用于 React Native 的 AWS Amplify SDK 和 API Gateway 中的 IAM 授权方发出简单的获取请求。我总是收到以下错误消息:
Credential should be scoped to a valid region, not 'us-east-1'.
我做错了什么?这是我的代码(还没有做任何事情):
function getImageIdForUpload() {
let apiName = 'MyAPIGatewayAPI';
let path = '/upload-image/get-new-id';
let myInit = {
// replace this with attributes you need
};
API.get(apiName, path, myInit).then(response => {
console.log(response)
}).catch(error => {
console.error(error.response)
});
}
我的配置:
Auth: {
// REQUIRED - Amazon Cognito Identity Pool ID
identityPoolId: 'eu-central-1:xxxx',
// REQUIRED - Amazon Cognito Region
region: 'eu-central-1',
// OPTIONAL - Amazon Cognito User Pool ID
userPoolId: 'eu-central-1_xxxx',
// OPTIONAL - Amazon Cognito Web Client ID
userPoolWebClientId: 'xxxx',
},
任何帮助将不胜感激:)
最佳答案
我自己找到了解决方案:您必须在 API 配置中设置区域。
例子:
API: {
endpoints: [
{
name: "MyAPIGatewayAPI",
endpoint: "https://xxx.execute-api.eu-central-1.amazonaws.com/dev",
region: "eu-central-1"
}
]
},
如果 API 设置为“边缘优化”,这可能不是问题。
关于amazon-web-services - AWS Amplify with React Native : Credentials should be scoped to a valid region, 而不是 us-east-1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52473070/
我不小心删除了我的放大前端并创建了一个新前端。如何将现有的放大后端导入新创建的放大应用项目文件夹? 我按照后端标签上的步骤操作 amplify init --appId(“您的新AMPLIFY APP
尝试从CLI和Amplify studio UI控制台运行。从CLI中,它显示以下错误-。从它给出的以下用户界面错误-。。我已经检查了IAM的角色和权限,可以确认角色和权限都是按要求分配的,而且配额限
我有 4 个相关的 AWS 账户(服务、开发、QA、产品)。我希望服务包含 CI/CD 管道并部署到环境特定帐户。我在每个环境帐户中设置了一个 IAM 用户以用于部署。使用 AWS Amplify C
我的网站在 amplify 中托管了 2 年。我一切正常,但现在证书突然过期了。根据亚马逊的说法,它应该会自动续订,但它并没有发生...... 我试图联系亚马逊解决这个问题,但他们会向你收取费用,让你
我有一个使用 google federate 登录的 AWS Amplify 应用程序。这是我的数据模型。 type TriadeMetric @model @auth(rules: [{allow:
我正在为一个看起来像这样的博客创建一个 Amplify Schema: type Post @model { id: ID! caption: String! src: Strin
我有 AWS Amplify Apps,目前密码存储在 Amplify 环境变量中。我正在尝试使用 AWS secret 管理器来存储我的 secret 并将其用于我的 Amplify 项目 我查看了
我正在尝试通过 Amplify SDK 将 Pinpoint Analytics 实现到现有的 React Native 应用程序中。我们拥有自己的 authN 和 authZ 实现的现有用户群,因此
当我的应用用户使用他们的电话号码注册时,我想向他们的电话号码发送欢迎消息 (SMS)。我找不到有关此特定任务的官方文档。 最佳答案 Amazon 让您可以做到这一点。假设您使用 Cognito 进行注
我正在使用 AWS Amplify 构建一个 Web 应用程序。我正在使用 Appsync 和 DynamoDb,并且已经定义了我的 GraphQL 架构。现在,Amplify 提供了通过从命令行运行
我正在使用此 Amplify 指南 https://aws-amplify.github.io/docs/js/tutorials/building-react-native-apps/#connec
我可以在本地将我的应用程序发布到 S3 存储桶并且该应用程序可以运行。但是通过 AWS Amplify 控制台(Web)部署在后端的构建步骤失败。 由于缺少配置文件或目录,后端的构建步骤失败。 {
我正在关注本教程,当我这样做时 amplify pull --appId --envName staging 它会打开 Amplify Admin UI,但我不知道用什么登录? 有没有其他人有这个问
我开始使用 Amplify 项目 amplify init 我创建了一个环境并将其命名为 env并选择 AWS 配置文件 default . 好像env指向 default轮廓。 有什么办法可以让我e
我是使用 AWS Amplify 的新手,我刚刚发布了我自己的前端 WebApp,它是用 React 开发的。我刚刚压缩了我的构建文件夹并将生成的 zip 文件放到 AWS 控制台中。它工作正常。 但
我目前正在使用 AWS Amplify 来管理我的前端。我一直在整个控制台中手动注入(inject)环境变量。 虽然我已经看到(至少在这种情况下),但环境变量已得到正确保护,如 AWS docs 中所
我目前正在使用 AWS Amplify 来管理我的前端。我一直在整个控制台中手动注入(inject)环境变量。 虽然我已经看到(至少在这种情况下),但环境变量已得到正确保护,如 AWS docs 中所
我看到很多文档和地方说要使用 aws-amplify-react但是在文档中开始使用 react 我看到了这个包 @aws-amplify/ui-react使用模块withAuthentication
我正在使用 aws amplify 并尝试在我的根目录中运行命令“amplify configure”,但一直收到此错误响应 amplify : File C:\Users\munet\AppData
测试 我正在通过启动程序“Gatsby Default Starter”试用 gatsby gatsby new test 在没有进行任何定制的情况下,我在本地主机上对其进行了测试,图像显示正常。 2
我是一名优秀的程序员,十分优秀!