Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Use GetDashboard with an AWS SDK or CLI

Focus mode
Use GetDashboard with an AWS SDK or CLI - Amazon CloudWatch

The following code examples show how to use GetDashboard.

.NET
AWS SDK for .NET
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

/// <summary> /// Get information on a dashboard. /// </summary> /// <param name="dashboardName">The name of the dashboard.</param> /// <returns>A JSON object with dashboard information.</returns> public async Task<string> GetDashboard(string dashboardName) { var dashboardResponse = await _amazonCloudWatch.GetDashboardAsync( new GetDashboardRequest() { DashboardName = dashboardName }); return dashboardResponse.DashboardBody; }
  • For API details, see GetDashboard in AWS SDK for .NET API Reference.

CLI
AWS CLI

To retrieve information about a Dashboard

The following get-dashboard example displays information about the dashboard named Dashboard-A in the specified account.

aws cloudwatch get-dashboard \ --dashboard-name Dashboard-A

Output:

{ "DashboardArn": "arn:aws:cloudwatch::123456789012:dashboard/Dashboard-A", "DashboardBody": "{\"widgets\":[{\"type\":\"metric\",\"x\":0,\"y\":0,\"width\":6,\"height\":6,\"properties\":{\"view\":\"timeSeries\",\"stacked\":false,\"metrics\":[[\"AWS/EC2\",\"NetworkIn\",\"InstanceId\",\"i-0131f062232ade043\"],[\".\",\"NetworkOut\",\".\",\".\"]],\"region\":\"us-east-1\"}}]}", "DashboardName": "Dashboard-A" }

For more information, see Amazon CloudWatch dashboards in the Amazon CloudWatch User Guide.

  • For API details, see GetDashboard in AWS CLI Command Reference.

PowerShell
Tools for PowerShell

Example 1: Returns the arn the body of the specified dashboard.

Get-CWDashboard -DashboardName Dashboard1

Output:

DashboardArn DashboardBody ------------ ------------- arn:aws:cloudwatch::123456789012:dashboard/Dashboard1 {...
  • For API details, see GetDashboard in AWS Tools for PowerShell Cmdlet Reference.

AWS SDK for .NET
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

/// <summary> /// Get information on a dashboard. /// </summary> /// <param name="dashboardName">The name of the dashboard.</param> /// <returns>A JSON object with dashboard information.</returns> public async Task<string> GetDashboard(string dashboardName) { var dashboardResponse = await _amazonCloudWatch.GetDashboardAsync( new GetDashboardRequest() { DashboardName = dashboardName }); return dashboardResponse.DashboardBody; }
  • For API details, see GetDashboard in AWS SDK for .NET API Reference.

For a complete list of AWS SDK developer guides and code examples, see Using CloudWatch with an AWS SDK. This topic also includes information about getting started and details about previous SDK versions.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.