Purchase on Amazon via API - amazon-web-services

Is there some way to purchase a product on Amazon via the API?
Currently I'm buying several products on daily base, where each product can be delivered to differnet addresses, and each time I have to go over the checkout phase on Amazon (many clicks).
According to my searches (for example Programmatically make Amazon purchase?) it seems that there is no way to purchase a product via the API and I understand the reasons for that.
However, I wonder if there is some other way to automate the process of ordering multiple products on Amazon.

Another way at it would be to automate the browser with Selenium. Of course this would require updating the code every time the Amazon website changed.

Related

Transfer/Replicate Data periodically from AWS Documentdb to Google Cloud Big Query

We are building a customer facing App. For this app, data is being captured by IoT devices owned by a 3rd party, and is transferred to us from their server via API calls. We store this data in our AWS Documentdb cluster. We have the user App connected to this cluster with real time data feed requirements. Note: The data is time series data.
The thing is, for long term data storage and for creating analytic dashboards to be shared with stakeholders, our data governance folks are requesting us to replicate/copy the data daily from the AWS Documentdb cluster to their Google cloud platform -> Big Query. And then we can directly run queries on BigQuery to perform analysis and send data to maybe explorer or tableau to create dashboards.
I couldn't find any straightforward solutions for this. Any ideas, comments or suggestions are welcome. How do I achieve or plan the above replication? And how do I make sure the data is copied efficiently - memory and pricing? Also, don't want to disturb the performance of AWS Documentdb since it supports our user facing App.
This solution would need some custom implementation. You can utilize Change Streams and process the data changes in intervals to send to Big Query, so there is a data replication mechanism in place for you to run analytics. One of the use cases of using Change Streams is for analytics with Redshift, so Big Query should serve a similar purpose.
Using Change Streams with Amazon DocumentDB:
https://docs.aws.amazon.com/documentdb/latest/developerguide/change_streams.html
This document also contains a sample Python code for consuming change streams events.

Best Way to Monitor Customer Usage of AWS Lambda

I have newly created an API service that is going to be deployed as a pilot to a customer. It has been built with AWS API Gateway, AWS Lambda, and AWS S3. With a SaaS pricing model, what's the best way for me to monitor this customer's usage and cost? At the moment, I have made a unique API Gateway, Lambda function, and S3 bucket specific to this customer. Is there a good way to create a dashboard that allows me (and perhaps the customer) to detail this monitoring?
Additional question, what's the best way to streamline this process when expanding to multiple different customers? Each customer would have a unique API token — what's the better approach than the naive way of making unique AWS resources per customer?
I am new (a college student), but any insights/resources would help me a long way. Thanks.
Full disclosure: I work for Lumigo, a company that does exactly that.
Regarding your question,
As #gusto2 said, there are many tools that you can use, and the best tool depends on your specific requirements.
The main difference between the tools is the level of configuration that you need to apply.
cloudwatch default metrics - The first tool that you should use. This is an out-of-the-box solution that provides you many metrics on the services, such as: duration, number of invocations and errors, memory. You can configure metrics over different timeslots and aggregators (P99, average, max, etc.)
This tool is great for basic monitoring.
Its limitation is its greatest strength - it provides monitoring which is common to all the services, thus nothing tailored-fit to serverless applications. https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/working_with_metrics.html
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html
cloudwatch custom metrics - The other side of the scale - getting much more precise metrics, which allows you to upload any metric data and monitor it: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html
This is a great tool if you know exactly what you want to monitor, and you already familiar with your architecture limitations and pain points.
And, of course, you can configure alarms over this data:
Lumigo - 3rd party company (again, as a disclosure, this is my workplace). Provides out-of-the-box monitoring, specifically created for serverless applications, such as an abnormal number of invocations, costs, etc.. This tool also provides troubleshooting capabilities to enable deeper observability.
Of course, there are more 3rd party tools that you can find online. All are great- just find the one that suits your requirement the best.
Is there a good way to create a dashboard
There a are multiple ways and options depending in your scaling, amount of data and requirements. So you could start small and simple, but check if any option is feasible or not.
You can start with the CloudWatch. You can monitor basic metrics, create dashboards and even share with other accounts.
naive way of making unique AWS resources per customer
For the start I would consider creating custom cloudwatch metrics with the customer id as a metric and put the metrics from the Lambda functions.
Looks simple, but you should do the math and a PoC about the number of requested datapoints and the dashboards to prevent a nasty surprise on the billing.
Another option is sending metrics/events to DynamoDB, using atomic functions you could directly build some basic aggregations (kind of naïve stream processing).
When scaling to a lot of events, clients, maybe you will need some serious api analytics, but that may be a different topic.

what aws services should i use in this scenario?

A company's data warehouse receives orders from multiple ordering systems. This data needs to be stored and sales commission needs to be paid based on the state's sales made. A mapping table is present which associates state to Sales manager. How would you implement such a solution? Which AWS services would you use? What are the major design decisions you will take to ensure that a payment is accurately tracked?
You would need a database to store the information, such as Amazon RDS for MySQL. It doesn't sound like the data volume or usage justifies a Data Warehouse solution like Amazon Redshift.
You'll also need to run some application logic somewhere, presumably on an Amazon EC2 instance.
The design of the application, including ensuring that the "payment is accurately tracked", is totally your responsibility. AWS provides the infrastructure for such a system, but not the software application.

AWS Costing API?

I am currently trying to identify the API that handles the reporting for AWS Instances.
I am looking for how the total hours and cost can be identified for all of the instances or just one instance ?
I looked at the XHR Tab and identified 2 API's that get it
But i think there should be some way to get this data from AWS-SDK.
Any help would be appreciated . Thanks
You will need to turn on the Detailed Billing Report. This will then send billing information to Amazon S3.
The billing files show every specific charge incurred by your account, broken down by resource, tag (needs configuration), region, etc.
Please note that this level of detail is only available after you have activated Detailed Billing Reports. You can only obtain high-level information prior to this time.
Most features in the AWS console are directly or indirectly accessing the same documented, exposed APIs that are accessed by the SDKs and CLI.
Most, but not all.
Some features, particularly reporting and graphing-type features -- like these billing/cost reports -- are console-only features. CloudWatch graphs and CloudFront graphs and reports are other examples that come to mind. There is no access provided to these other than what's provided in the console.
In each case, the raw underlying data is generally accessible through the documented APIs, but not necessarily the data in its aggregated form as presented on the screen or for download -- you'd need to do your own analysis/aggregation/summary, etc.

Can I monitor the usage of individual directories with AWS CloudWatch?

I'm developing a platform where users will in effect have their own site within a directory of my own. Each user site will consist of a package of php scripts and the template/image files for their sites custom layout. Each user site will be connected to their own Amazon RDS. I need to be able to track the resource usage of each directory so that I can bill each user for the resources they have used. Would it be possible to setup custom metrics with CloudWatch so that I can calculate costs?
You should be able to use cloudwatch to do this, however, it might not be the most efficient place to put this information if you are going to bill or report on it. I think you are better off computing the data and then storing it in a database of your own. This way you have easy access to the data and you can do things with data that may not work well in the context of cloudwatch.