Measure AWS SES usage per domain / Per client / Sub-account - amazon-ses

I provide SES Services to many of my clients in different regions of the world. So their apps send out emails through my AWS SES account. It has become a problem to trace out how to measure their usage and stats, IAM wise or some other ways and then be able to bill them for what they have consumed. There must be a way to break stats into some kind of Sub Accounts or something
Can someone help regarding this ?

You have two options for such fine-grained monitoring, according to the official docs:
Feedback notifications
This option allows the most detailed reporting for your billing needs. However, it also requires more work on your part, because you need to build handlers (i.e. lambda functions) which will log sending/bounces/complaints in some persistence (i.e. DynamoDB table). More details here.
Event publishing
This option uses CloudWatch for persistence and you have the (probably) familiar CloudWatch UI for reporting. You will have to enforce (somehow) your clients to use a AWS specific SMTP header or SendEmail / SendRawEmail API calls. Less work on your part but you need to find a way to make your clients help you. More details here.

Related

Amazon SES persistent audit log

I am using Amazon SES to send transactional application emails. I want an audit log of every email sent by the system.
As an example, I might want to see a log of every email we sent to john.smith#example.com.
I followed the instructions for using Cloudwatch to log SES events. However, this only actually logs metrics, not data logs. So all I see in Cloudwatch is a graph of how many emails were sent at different times under the metrics tab. I can't search a log anywhere to find individual SES events.
I also looked into using Cloudtrail to log SES events, but Cloudtrail only logs management events. It does not log data events like emails being sent.
I have setup SNS notifications on all SES events (such as send or bounce). This is really useful, but does not achieve my aim of having a long term audit log.
As far as I can tell Amazon do not support the kind of logging I want to record. Maybe I could write events to our application database as we produce them, but it seems a shame to have to introduce my own custom logging system.
Does anyone know a way to have AWS store my SES data events?
Yes, Amazon doesn't have any easy to monitor you ask, an easier solution would be to add a Configuration set header and a unique message tag whenever any email is being sent to john.smith#example.com, In configuration set, you can enable Cloudwatch or preferred SNS Destination and create delivery dashboard using link below:
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/bouncecomplaintdashboard.html
This isn't the logs but It creates a nice excel file of email details which can be used for Audit purpose.
I opened a ticket with AWS about this, here is their response.
I understand that you wanted to know whether SES provides logs about events of an email that was accepted by SES for delivery in a searchable format. Please correct me if I’m wrong.
SES provides logs as notification[1] for each event(Delivery, Bounce, Complaint) to SNS and it doesn’t provide event logs in a consolidated manner which would be helpful for indexing according to email addresses and searching purpose. However, in SNS you can configure a variety of subscriber like(Email, SQS, Lambda, HTTP endpoint) where the logs in JSON format would be delivered. In the destination of SNS like Lambda and HTTP Endpoint or email, you can parse the JSON file and store in a suitable format which would be helpful for indexing and searching purpose.
If SQS is being used, each JSON log will be stored individually in the SQS queue for some time. You can periodically query the SQS endpoint and retrieve the logs and consolidate it to a single file and use it for analysis.
Apart from that, unfortunately SES doesn’t provide any other format of logs for an email it accepted for delivery.
Do let me know if you require any further assistance, I’ll be happy to help.
References:
[1]. https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-using-notifications.html

Permissions over an App

I'm new to Xero API's and I'm trying to understand a thing.
In my Company we currently have various different “organisations” within Xero, and this number will be growing in the near future.
We also have a 3rd party web application we use for technical and management data – to which we now would like to add financial data, mostly in the form of exported Xero reports.
We had been looking at the API functionality – however as I understand it Xero is unable to grant a subset of permissions to API calls – i.e. anyone with API access would have the same level of access a standard user – so aside from being able to pull the reports we require, they would also have access to all other data, such as transactional data, account numbers, creation and deletion of invoices etc. etc. Please can you confirm whether this would be the case?
In short terms: we need to restrict the API calls to the reports only, is this possible?
If not, does Xero have a functionality where reports can be automatically exported to an external location – such as a cloud service or an FTP site or similar?
Many thanks in advance
You're correct. Once you connect an app to the API it has access to all the accounting endpoints. Payroll endpoints are the only ones that require additional scopes.
And no, unfortunately there's no way to schedule report exports either. Sorry!

How to set up an Amazon advertising API?

We have a client account of Amazon seller central. We need to pull campaign performance data from this account. With Amazon Advertising API we can pull this report.
Here are the documentation links:
https://images-na.ssl-images-amazon.com/images/G/01/AdProductsWebsite/downloads/Amazon_Advertising_API_Getting_Started_Guide.TTH.pdf
https://images-na.ssl-images-amazon.com/images/G/01/AdProductsWebsite/downloads/Amazon_Advertising_API_Reference.TTH.pdf
I followed the procedure in Getting Started Guide
1) Created a developer account(Login with Amazon)
2) completed the sign up form as specified in second step.
I am not sure what to do next as I did not receive any reply from amazon regarding this. Does anyone faced similar issue before?
Thanks.
It takes two or three days from Amazon to reply in most case and as they are getting high volume of application it might be possible that they have rejected it so try more then once. And try to give some information to use in the comment section.
In addition, a business registration in either NA or EU is required before they can grant permission to the Advertising API.
After all this verification they can allow access.
Hope this help to you.
Thanks,
James
If you have already received the onboarding e-mail, and you are sure that you are sending the correct API communications yet you are getting bad scope errors, then you are not yet White Listed so your requests are all rejected.
For me and many others I found while googling for hours to find the answer, this problem was due to not yet signing a license agreement which is in a very easy to overlook link hidden in a paragraph of the e-mail which starts: "Before you can register your application, you need to agree to the Amazon Advertising API License Agreement" Hit that link and accept the agreement to become white listed.
As a last resort if the above doesn't work, Amazon support had given me a direct e-mail to LWA and you can contact their support: lwa-support at amazon com.

Is Amazon provide any scheduler Api for scheduling the email

I'm using Amazon SES/SNS API of Amazon for sending email and getting notification.
Is Amazon provide any scheduler Api for scheduling the email for future? As i want to schedule my email by using Amazon API.
No, SES does not provide this functionality. You would need to do that yourself using a task scheduler such as the built-in windows or perhaps quartz.net if you need something more sophisticated
While they may not offer it directly in SES or SNS, they do offer similar functionality with SQS or SWF.
I made the service, huhumails.com
With HuhuMails, you can schedule your transactional emails with ease. It also makes sure emails are sent within your rate-limits. The service accepts date and timezone parameters to schedule your email at a specific time in the future.
I couldn't find anything on the market that's according to what I'm looking for and easy to use, so I created the service. I'm currently using it on my other production websites. Hopefully, it will be useful to others too.

Is there a way to pull out AWS EC2 bill usage ? Does amazon provide us with any REST API to get this data

We would like to manage AWS users billing cycles. Does AWS provide an API to get this informtation programmatically ?
Using Cloudwatch, you can get Billing Alerts. You will be notified by SNS when your billing gets above your defined limits. Read more about this in this blog post or in the documentation. Of course you can also use the CloudWatch API to get custom reports using this data.