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.
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
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.
- Find the API url from the 'Output' tab of the "SungardAS-aws-services-billing" stack in the Cloudformation console
path: /billing
method : GET
headers: {
"Authorization": <refresh_token_from_SSO_server>
}
path: /billing?account=<<account_id>>
method : GET
headers: {
"Authorization": <refresh_token_from_SSO_server>
}
path: /sql
method : POST
headers: {
"Authorization": <refresh_token_from_SSO_server>
}
data:
{
"sql": "<<SQL>>"
}
- $ cd tests
- Export necessary environment variables and fill the necessary input values
- $ node test_xxx.js
This project is maintained by the Labs group at Sungard Availability Services
GitHub: https://sungardas.github.io