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

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.

Related

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

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.

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

How do I trigger an action on my application users' data sync on Amazon Cognito

I need to trigger a check on the user data sync event of Amazon Cognito. How can I hook to the sync event?
I'd like to also enhance that data in some cases for the mobile application to fetch on next sync. Is the data editable from the server (not the mobile device)?
Currently Cognito does not support triggers on sync data. If you would like to see this feature added, please request in our forums, that helps us to prioritize our roadmap.
Yes, you can edit the data using your AWS credentials (not one received from Cognito). Please refer to our blog for more details.
Thanks,
Rachit
Amazon Cognito Streams is now available to all and is the best way to trigger an action on CognitoSync. This requires creating a Kinesis Stream and then edit the Cognito Identity Pool to link the stream to it. This stream can be consumed by Lambda or a any other Kinesis consumer, like RedShift or KCL application.

How To Setup a DAG and Link to a Cobrand?

We were given an Rest API as a client of Yodlee.
And we want to test using DAG.
We wanted to test the API and we are successful at calling coblogin.
How does one link the DAG to our assigned Cobrand credential?
Thanks in advance.
You will need to register a user on Yodlee platform and then use DAG to add an account. Then you can call the dataservice APIs to get the data.
Please go through the below documentations -
Quick Start Guide
API reference
API flow
Also you can a dag account using Yodlee's provided UI called FastLink and then use API to extract data. You can request Yodlee for providing access to that.

Google Analytics - Service Account and Segments

I've created an app for Google Analytics in the API console. I am trying to list out custom segments that have been created, but have noticed that I cannot view existing Segments that have been created.
I followed this example: Service Applications and Google Analytics API V3: Server-to-server OAuth2 authentication?
For instance, I log in to my google analytics account, grant access to a profile, then in the google analytics profile, I create a sample segment.
Calling this:
$service->management_segments->listManagementSegments();
I would expect to see my "test segment" but don't see it.
Is there an additional step that I would need to grant my service account the ability to see the custom segments setup?
This example here shows the custom segments:
https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/management/segments/list
I am hoping someone can clarify the workflow. Thanks!
Since segments are tied to google accounts, not service accounts, they aren't available. It's best to grab segment definitions using the web server workflow, or use dynamic filters instead of segments.