Amazon Managed Grafana examples using Amazon CLI - Amazon Command Line Interface
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

This documentation is for Version 1 of the Amazon CLI only. For documentation related to Version 2 of the Amazon CLI, see the Version 2 User Guide.

Amazon Managed Grafana examples using Amazon CLI

The following code examples show you how to perform actions and implement common scenarios by using the Amazon Command Line Interface with Amazon Managed Grafana.

Actions are code excerpts from larger programs and must be run in context. While actions show you how to call individual service functions, you can see actions in context in their related scenarios.

Each example includes a link to the complete source code, where you can find instructions on how to set up and run the code in context.

Topics

Actions

The following code example shows how to use list-workspaces.

Amazon CLI

To list workspaces for the account in the Region specified by the user credential

The following list-workspaces example lists Grafana workspaces for the account's Region.

aws grafana list-workspaces

Output:

{ "workspaces": [ { "authentication": { "providers": [ "AWS_SSO" ] }, "created": "2022-04-04T16:20:21.796000-07:00", "description": "to test tags", "endpoint": "g-949e7b44df.grafana-workspace.us-east-1.amazonaws.com", "grafanaVersion": "8.2", "id": "g-949e7b44df", "modified": "2022-04-04T16:20:21.796000-07:00", "name": "testtag2", "notificationDestinations": [ "SNS" ], "status": "ACTIVE" }, { "authentication": { "providers": [ "AWS_SSO" ] }, "created": "2022-04-20T10:22:15.115000-07:00", "description": "ww", "endpoint": "g-bffa51ed1b.grafana-workspace.us-east-1.amazonaws.com", "grafanaVersion": "8.2", "id": "g-bffa51ed1b", "modified": "2022-04-20T10:22:15.115000-07:00", "name": "ww", "notificationDestinations": [ "SNS" ], "status": "ACTIVE" } ] }
  • For API details, see ListWorkspaces in Amazon CLI Command Reference.