amazon-managed-grafana-migrator

command module
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

README

Amazon Managed Grafana Migrator

Build Go Report Card

Amazon Managed Grafana Migrator is a CLI migration utility to migrate Grafana content (data sources, dashboards, folders and alert rules) to Amazon Managed Grafana. It supports the following migration scenarios:

  • Migrating from and to Amazon Managed Grafana Workspace (eg. Moving to v9.4)
  • Migrating from a Grafana server to an Amazon Managed Grafana Workspace

⚠ Alerting rules migration are only supported in Amazon Managed Grafana v9.4

Installation

Build from latest release. This requires Go installed on your environement.

go install github.com/aws-observability/amazon-managed-grafana-migrator@latest

You can also download the pre-compiled binary for your OS and CPU architecture from our GitHub releases.

Usage

Discovering your Workspaces
amazon-managed-grafana-migrator discover --region eu-west-1
Migrating between Workspaces
amazon-managed-grafana-migrator migrate \
  --src g-abcdef1234.grafana-workspace.eu-central-1.amazonaws.com \
  --dst g-abcdef5678.grafana-workspace.us-west-2.amazonaws.com
Migrating to Amazon Managed Grafana
amazon-managed-grafana-migrator migrate \
  --src-url https://grafana.example.com/
  --src-api-key API_KEY_HERE
  --dst g-abcdef5678.grafana-workspace.us-west-2.amazonaws.com
Getting help
amazon-managed-grafana-migrator --help

# command specific help
amazon-managed-grafana-migrator migrate --help

Permissions

To run this tool you need AWS permissions through IAM. Make sure you have the AWS command line tool installed and have already run aws configure before you start. Below are the minimum permissions required by the tool:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "grafana:DeleteWorkspaceApiKey",
                "grafana:DescribeWorkspace",
                "grafana:CreateWorkspaceApiKey"
            ],
            "Resource": "arn:aws:grafana:*:<ACCOUNT_ID>:/workspaces/<WORKSPACE_ID>"
        },
        {
            "Effect": "Allow",
            "Action": "grafana:ListWorkspaces",
            "Resource": "*"
        }
    ]
}

If you a migrating from a Grafana server, you will need an active API Key with "ADMIN" role.

Contributing

See CONTRIBUTING for more information.

License

This project is licensed under the Apache-2.0 License.

Documentation

Overview

Main CLI entrypoint.

Directories

Path Synopsis
internal
pkg/app
Package app provides the grafana migration logic
Package app provides the grafana migration logic
pkg/app/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
pkg/aws
Package aws provides a wrapper around the AWS Grafana API
Package aws provides a wrapper around the AWS Grafana API
pkg/aws/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
pkg/cli
Package cli provides the CLI
Package cli provides the CLI
pkg/grafana
Package grafana is an http client for api calls authenticated with not supported by github.com/grafana/grafana-api-golang-client TODO: make a PR to gapi and drop this duplicate implementation
Package grafana is an http client for api calls authenticated with not supported by github.com/grafana/grafana-api-golang-client TODO: make a PR to gapi and drop this duplicate implementation
pkg/grafana/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
pkg/log
Package log provides logging functions wraps fmt.Println with options and colors
Package log provides logging functions wraps fmt.Println with options and colors

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL