Can I specify IAM user credentials for use in authenticating an AppSync API?
See original GitHub issueI am using Amplify to connect to an existing AppSync API from an automated device running node. This is not a front-end client, so I want to be able to connect using an IAM user’s security credentials.
I’m using the following code to confiture Amplify and make a GraphQL query, however I can’t find any documentation on how to pass the access key ID and secret access key to Amplify.configure()
.
const Amplify = require('aws-amplify').default
const { graphql } = require('aws-amplify')
const gql = require('aws-amplify').graphqlOperation
const queries = require('./queries')
const config = {
aws_appsync_graphqlEndpoint: process.env.GRAPHQL_ENDPOINT,
aws_appsync_region: process.env.AWS_REGION,
aws_appsync_authenticationType: 'AWS_IAM',
// What properties go here?
}
Amplify.configure(config)
graphql(gql(queries.testQuery, { key: 'value' }))
.then((data) => {
// Do something with result
})
I’m currently getting the following messages:
Warning: 05:12:45 API - ensure credentials error: No Cognito Federated Identity pool provided Error: No credentials
Is it possible to connect with IAM security credentials directly, rather than a Cognito Identity Pool? What properties can be passed to Amplify.configure()
in my config
object to achieve this?
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (3 by maintainers)
Top Results From Across the Web
Authorization and authentication - AWS AppSync
Sign in to the AWS Management Console and open the AppSync console . In the APIs dashboard, choose your GraphQL API. In the...
Read more >How IAM permissions work with AppSync
AppSync gets permissions via data sources. Here, you need to define an IAM Role that AppSync will use and gets the permissions from...
Read more >API (GraphQL) - Configure authorization modes - Android
You can configure auth modes for an API using the Amplify CLI or manual ... This allows you to have both User Pools'...
Read more >AWS AppSync without Authentication - DEV Community
AWS AppSync supports AWS_IAM. With the Cognito Identity Pool you can associate the IAM policy. Code, Code and Code. In the following two...
Read more >Create AWS AppSync IAM Authentication With AWS CDK
Authentication will be achieved by creating of AWS user being assigned to the group which has a policy set to allow interaction with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks you for your suggestion! After update AWS config, I need to use AWSAppSyncClient to initialize. Here is my config:
I’ll take a look, however I may not get an opportunity for a little while. Bear with me