I don't need to set up the DAX cluster which already provides an endpoint to connect to. I only need to connect to this dynamodb table from an internal service. But the table doesn't expose a URL to connect to. Can someone help?
You just use AWS SDK's dynamodb interface, e.g. client in boto3. All the endpoints for the dynamodb are already provided by default in the SDKs, so you don't have to explicitly specify it.
The endpoints for dynamodb are listed here.
Related
I'm trying to create an external API using AWS API Gateway that will give users access to data stored in multiple databases. The APIs will mostly be accessed through scripts rather than through a web UI.
Are there any AWS services I can use to manage user access to my API?
I've read a little bit about Amazon Cognito and OAuth 2 but at a glance it seems like those might be more targeted towards cases with a UI for users to interact with. Is there a way to create and manage API keys with AWS?
Thanks in advance for your help!
You can use API Gateway Lambda Authorizer to write your custom login integration. For example a lambda that check in one Database if the user:password (passed as authorization header) exists in table in DynamoDB or SQL.
So I am relatively new to AWS and AWS Amplify helped me write my backend app a lot. I know AWS Amplify does offer a NoSQL database direct connection, but that's connected to DynamoDB, which is also a NoSQL database, but it's not the type of NoSQL database I want. I want document type BSON NoSQL database. I was wondering is there any easy way to connect to AWS DocumentDB or MongoDB using AWS Amplify or do I need to use aws-sdk or something else for that? Thanks
You can create a GraphQL API for Amazon DocumentDB and use this API as your amplify backend application as explained in this documentation.
To create a GraphQL API for Amazon DocumentDB, you can use Lambda resolvers. Please refer to tutorial on using Lambda Resolvers here.
Amazon DocumentDB connection and related queries will be defined in the lambda function.
I have trained a credit-fraud data set on AWS Sagemaker and created an endpoint of the model. Suppose I want to provide it as a service to my friend. He has some credit data and wanted to know whether the transaction is fraud or not. He wishes to use my endpoint. How do I share it?
Should I share my ARN for endpoint? I don't think its the right way. without a common account he won't be able to use it.
Or is there another way
To share your model as an endpoint, you should use lambda and API Gateway to create your API.
Create an API gateway that triggers a Lambda with the HTTP POST method;
your lambda should instantiate the SageMaker endpoint, get the requested parameter in the event, call the SageMaker endpoint and return the predicted value. you can also create a DynamoDB to store commonly requested parameters with their answers;
Send the API Gateway Endpoint to your friend.
I have an Amazon AWS RDS (PostgreSQL) database. I am trying to connect it to Amazon API Gateway as simply as possible (AWS Service WITHOUT Lambda).
I am trying to perform a simple get request. To get all "animals" (table name "animals") from the db.
The question is which Action to select. All actions in the documentation change the db. And I need only to perform a simple GET request.
Also we need to setup the policy and specify the actions for it.
Api Gateway request:
https://i.ibb.co/2hkdVqZ/AWS.png
Api Gateway Policy:
https://i.ibb.co/vk8pLzd/AWS2.png
The AWS API is for creating/changing the DB server itself, as you have mentioned. You can't query the RDS database directly from the AWS API. You have to create a DB connection to the PostgreSQL database using traditional database drivers in order to run queries against the database.
You will need to use a Lambda function to accomplish what you are trying to achieve.
Is it possible to have business logic on my AppSync's mutation when the datasource is dynamoDB?
I'm fairly new to GraphQL and Appsync. My understanding is when you're using plain GraphQL you can have business logic inside your resolver to validate before updating. How would you achieve the same thing with AWS AppSync when you pass it the GraphQL schema with DynamoDB as the datasource?
In AWS AppSync, you would attach a resolver to the field that is mapped to the DynamoDB DataSource. You can then use the Velocity template to have your custom business logic inside the resolver for any validations.
Please refer to the following documentation on the Resolver Mapping Template programming guide from AWS.
Here is the mapping template reference for DynamoDB resolvers.
According to AWS AppSync's Website: With AppSync, your app can access data in Amazon DynamoDB, trigger AWS Lambda functions, or run Amazon Elasticsearch queries.
You can think of it as a gateway for clients to access different backends (data sources), defined by mapping templates attached to GraphQL fields (resolvers).
AppSync supports DynamoDB and ElasitcSearch queries natively, but if you want to perform business logic you will have to add a AWS Lambda data source and then use AWS SDKs to R/W DynamoDB or anything else such as another API or maybe even an excel file!
Additionally, you can use Apache VTL along with AppSync's available helpers such as $context to help you perform authorization or field data access based on permissions. Keep in mind that your DynamoDB or ES resolver can only perform 1 operation at the end, Apache VTL only helps you build the resolver that will be run by AppSync.
Here are two diagrams that compare a traditional approach vs appsync