New Skills

New Training: Monitor AWS Account Billing Data with PowerShell

by Team Nuggets
New Training: Hands-on With AWS Systems Manager Run Command, State Manager, and Session Manager picture: A
Published on March 1, 2021

In this 6-video skill, CBT Nuggets trainer Trevor Sullivan shows you how to interact with cost management APIs so you can monitor billing data. You can set up alerts to get notified when your bill exceeds a pre-defined threshold. Watch this new AWS training.

Watch the full course: AWS Cloud Automation

This training includes:

  • 6 videos

  • 1 hour of training

You’ll learn these topics in this skill:

  • Setting Up Dev Tools for AWS Cost Management and PowerShell

  • Configure IAM Permissions and Find AWS Cost Management Commands

  • Understanding the Get-CECostAndUsage PowerShell Command

  • Retrieve AWS Cost and Usage Data with PowerShell

  • Obtain AWS Cost Forecast Data with PowerShell

  • Managing AWS Account Budgets with PowerShell

How to Pull AWS Cost Reports with PowerShell

Using PowerShell to pull cost reports for AWS is a straightforward task. We'll discuss that below, but before you can utilize PowerShell to pull AWS cost reports you need to make sure the AWS Tools for PowerShell for Windows is installed first. This tool allows PowerShell to use the AWS SDK with PowerShell cmdlets.

After the AWS Tools for PowerShell package is installed, you'll need to configure it to work with your AWS account. This may involve creating an IAM user for your development environment and configuring those tools with that IAM permissions profile, though that is beyond the scope of this article.

After AWS Tools for PowerShell is installed and configured, you'll use the Get-CURReportDefinition cmdlet to pull cost reports. That cmdlet has four optional flags in addition to common credential and regional parameters:

  • MaxResult

  • NextToken

  • Select

  • NoAutoIteration

All four flags are optional and not required. Visit the documentation for this cmdlet for more details regarding each of those flags.

Another useful command that can be used with the AWS Tools for PowerShell is the Get-CECostAndUsage command. Instead of pulling cost reports, this command retrieves cost and usage metrics instead. Like the command listed above, this one includes 8 optional flags:

  • TimePeriod

  • Filter

  • Granularity

  • GroupBy <GroupDefinition[]>

  • Metric <String[]>

  • NextPageToken

  • Select

  • PassThru

The full documentation for this cmdlet can be found on the documentation page for it as well.

Recommended Articles