Git Product home page Git Product logo

aws-services-billing's Introduction

Billing Dashboard & Alert System

Billing Dashboard Service to Provide Billing API Interfaces and Generate Billing Alert For Over Charges.

This creates a Redshift cluster where Billing report data is exported whenever the report is created.

aws-services

How To Setup a CodePipeline

Launch Stack

Input Parameter Values

  • CloudformationLambdaExecutionRoleArn:

    Enter ARN of IAM Role for Cloudformation to create changesets and target stack. If you already created one or more CodePipeline that uses Cloudformation, this role should have been created already, so you can use the same role, 'cloudformation-lambda-execution-role'. If not, please create a role with the same name with Trust Relationships and Policy Document defined here.

  • CodePipelineServiceRoleArn:

    Enter ARN of IAM Role for CodePipeline to be executed. If you already created one or more CodePipeline, this role should have been created already, so you can use the same role, 'AWS-CodePipeline-Service'. If not, please create a role with the same name with Trust Relationships and Policy Document defined here.

  • CustomAuthorizerIAMRoleName:

    Enter the NAME (not ARN) of IAM Role that has the permission for API Gateway to invoke custom authorizer Lambda Function. (See here for Trust Relationships and Policy Document).

  • CustomAuthorizerLambdaName:

    Enter the NAME (not ARN) of custom authorizer Lambda Function. (See here for the Lambda Function Project for Custom Authorizer using SSO Server).

  • EncryptionLambdaName:

    Enter the NAME (not ARN) of the encryption Lambda Function. If you didn't already deployed the Encryption Lambda Function, see here to deploy the Lambda Function to Encrypt Environment Variables.

  • GitHubPersonalAccessToken:

    Access Token for CodeBuild to access to the this Github repository. (See here to find how to generate the access token).

  • GitHubSourceRepositoryBranch: master

  • GitHubSourceRepositoryName: aws-services-billing

  • GitHubSourceRepositoryOwner: SungardAS

  • ParameterOverrides: { "VPCCidrBlock": "ip_range", "SubnetCidrBlock1": "ip_range", "SubnetCidrBlock2": "ip_range", "NameTag": "redshift", "RedshiftUser": "redshift_user", "RedshiftPass": "redshift_pass", "RedshiftDatabase": "redshift_db", "RedshiftSnapshotIdentifier": "snapshot_id_to_restore_from", "RedshiftSnapshotClusterIdentifier": "cluster_of_source_snapshot", "AlarmThresholdNumber": "10", "AllowedAverageCost": "2", "PlotlyUsername": "plotly_user_name", "PlotlyAPIKey": "plotly_api_key", "SlackWebHookUrl": "slack_web_hook_url", "SlackChannel": "slack_channel" }

  • ProjectImage: aws/codebuild/nodejs:4.3.2

How to Setup a Billing Report to Upload Billing Data to S3 Bucket & Redshift

The creation of this project stack will be started automatically once its Codepipline is successfully setup.

Follow steps in here.

  • Specify 'BillingDataUploadBucketName' value in the Output of the newly created this project stack for the S3 Bucket Name
  • Choose 'BucketServiceIAMRoleNameForRedshift' value in the Output of the newly created this project stack during "Manage IAM Roles"

Once the billing report is created in the S3 bucket, the billing data will be automatically imported to the Redshift.

How To Send Requests To API

  • Find the API url from the 'Output' tab of the "SungardAS-aws-services-billing" stack in the Cloudformation console

To get the charge differences for all accounts

path: /billing
method : GET
headers: {
  "Authorization": <refresh_token_from_SSO_server>
}

To get the charge differences for all services in a specific account

path: /billing?account=<<account_id>>
method : GET
headers: {
  "Authorization": <refresh_token_from_SSO_server>
}

To run a specific SQL against the Redshift database

path: /sql
method : POST
headers: {
  "Authorization": <refresh_token_from_SSO_server>
}
data:
{
  "sql": "<<SQL>>"
}

How To Test Lambda Functions

  • $ cd tests
  • Export necessary environment variables and fill the necessary input values
  • $ node test_xxx.js

Sungard Availability Services | Labs

This project is maintained by the Labs group at Sungard Availability Services

GitHub: https://sungardas.github.io

Blog: http://blog.sungardas.com/CTOLabs/

aws-services-billing's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.