When to use programmatic billing access
Programmatic Billing Access advantages excising Amazon Simple Storage Service (Amazon S3) APIs so you can build applications that reference your billing data from a CSV (comma separated value) file stored in an Amazon S3 bucket.
Steps programmatic billing access as follows -
- Log in to Amazon Web portal http://aws.amazon.com/
- Then click on My Account/ Console Tab. Select My Account you will get Amazon Web Services Sign in window as follows - You may sign in using your existing Amazon.com account and password. (Put your username and password and click on Sign in using Our Server Security Tab)
- You will get Access to your AWS Manage Account.
- After login into AWS click on My Account/ Console Tab and Select Account Activity Tab. You will get following Window
- In Open Window Select Billing Preferences TAB As follows
- If you have access on Billing Preferences TAB then you will get following window, and if you have already enabled CSV report for your billing statement
- If you haven’t enabled CSV report then you need to enable CSV Report by Sign up for Programmatic Billing Access by providing a bucket location for the CSV files as follows.
Steps to enable CSV Report
- Sign into the AWS Management Console.
- Then click on My Account/ Console Tab. Select My Account you will get Amazon Web Services Sign in window as follows - You may sign in using your existing Amazon.com account and password. (Put your username and password and click on Sign in using Our Server Security Tab)
- You will get Access to your AWS Manage Account.
- After login into AWS click on My Account/ Console Tab. And Select Account Activity Tab
- In Open Window Select Billing Preferences TAB
- In the CSV Report section, click Sign up Now to enable CSV reporting.
- In the Programmatic Access section, sign up for Programmatic Billing Access by clicking Sign up Now.
- Enter the name of the bucket to contain the CSV file.
- Click Sample Policy link to display the policy for your bucket.
- AWS provides you with a policy for your bucket and account.
- Copy the policy from your Billing Preferences page so you can attach it to the bucket to contain the CSV file in a later step.
- Click Save Changes.
- Open the Amazon S3 console at https://console.aws.amazon.com/s3.
- Attach the sample policy to the bucket that will contain the CSV file.
- Verify your bucket is set up correctly on the Billing Preferences page. If correct, you will see Programmatic Access is Enabled.
- Set a policy on the bucket granting AWS access to publish your CSV files to the bucket at the specified location. (Note- The CSV files are stored in Amazon S3 at standard Amazon S3 pricing). Following is the screen shot for more info -
- Use an application, such as Microsoft Excel, to parse the billing data. Or, use the existing Amazon S3 API to write applications that access your billing data.
Steps to Create Bucket
Before you can upload data into Amazon S3, you must create a bucket to store the data in. Buckets have configuration properties, including their geographical region, which has access to the objects in the bucket, and other metadata, such as the storage class of the objects in the bucket.
Note - You are not charged for creating a bucket; you are only charged for storing objects in the bucket and for transferring objects in and out of the bucket.
To create a bucket -
- Sign into the AWS Management Console and open the Amazon S3 console.
- Click Create Bucket. The Create a Bucket dialog box appears.
- Enter a bucket name in the Bucket Name field.
- In the Region drop-down list box, select a region.
- Do one of the following.
- If you clicked Set Up Logging, the Create a Bucket - Set Up Logging dialog box appears so that you can set up logging:
- Select the Enabled check box.
This choice enables logging.
- In Target Bucket, select the bucket where you want the log files stored.
- In Target Prefix, you have the option of specifying a prefix for the name of the log files.
Amazon S3 adds the prefix to the log file names when storing them in your bucket. For example, if you specify the prefix "logs/," all logs stored in the target bucket are prefixed with logs/, so, all the logs will be stored in the logs folder.
- Click Create.
If Amazon S3 successfully creates your bucket, the console displays your bucket with Created name as follows.
Benefits of Programmatic Billing Access
- CSV file - you get a detailed report in a format that is readable by many common applications.
- Easy Viewing in Excel - you can open the file directly into Microsoft Excel, and use pivot tables to create different views.
- Leverage Amazon S3 API - the CSV file is stored in Amazon S3 as an object.
References:
http://docs.amazonwebservices.com/awsaccountbilling/latest/about/programaccess.html
http://docs.amazonwebservices.com/AmazonS3/latest/UG/EditingBucketPermissions.html