create_dashboard
¶
create_dashboard(
name: DashboardName,
widgets: WidgetList,
*,
config_overrides: Optional[BCMDashboardsClientConfig] = None,
description: Optional[Description] = None,
resource_tags: Optional[ResourceTagList] = None,
) -> CreateDashboardResponse
Creates a new dashboard that can contain multiple widgets displaying cost and usage data. You can add custom widgets or use predefined widgets, arranging them in your preferred layout.
Parameters:
-
name(DashboardName) –The name of the dashboard. The name must be unique within your account.
-
description(Optional[Description], default:None) –A description of the dashboard's purpose or contents.
-
widgets(WidgetList) –An array of widget configurations that define the visualizations to be displayed in the dashboard. Each dashboard can contain up to 20 widgets.
-
resource_tags(Optional[ResourceTagList], default:None) –The tags to apply to the dashboard resource for organization and management.
Raises:
-
AccessDeniedException–You do not have sufficient permissions to perform this action. Verify your IAM permissions and any resource policies.
-
InternalServerException–An internal error occurred while processing the request. Retry your request. If the problem persists, contact Amazon Web Services Support.
-
ServiceQuotaExceededException–The request would exceed a service quota. Review the service quotas for Amazon Web Services Billing and Cost Management Dashboards and retry your request.
-
ThrottlingException–The request was denied due to request throttling. Reduce the frequency of requests and use exponential backoff.
-
ValidationException–The input parameters do not satisfy the requirements. Check the error message for specific validation details.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Creating a dashboard
>>> client.create_dashboard(name='cost-dashboards', description='Dashboard for tracking costs', widgets=[{'title': 'Monthly Cost Trend', 'width': 4, 'height': 7, 'horizontalOffset': 0, 'configs': [{'displayConfig': {'graph': {'costTrend': {'visualType': 'LINE'}}}, 'queryParameters': {'costAndUsage': {'granularity': 'MONTHLY', 'groupBy': [{'key': 'SERVICE', 'type': 'DIMENSION'}], 'metrics': ['UnblendedCost'], 'timeRange': {'endTime': {'type': 'RELATIVE', 'value': 'now'}, 'startTime': {'type': 'RELATIVE', 'value': '-9M'}}}}}]}])