Editing a rules configuration file - Amazon Managed Service for Prometheus

Editing a rules configuration file

You can't edit a rules configuration file directly in the console. Instead, you upload a new rules file to replace it. Optionally, you can download the current file, edit it in a text editor, then upload the new version.

To use the Amazon Managed Service for Prometheus console to edit your rules configuration
  1. Open the Amazon Managed Service for Prometheus console at https://console.aws.amazon.com/prometheus/.

  2. In the upper left corner of the page, choose the menu icon, and then choose All workspaces.

  3. Choose the workspace ID of the workspace, and then choose the Rules management tab.

  4. (Optional) If you want to start by editing the current rules configuration file, choose Download or Copy.

  5. When your new rules file is ready, choose Replace.

  6. Choose Choose file, select the new rules definition file, and choose Continue.

To use the AWS CLI to edit a rules configuration file
  1. Base64 encode the contents of your rules file. On Linux, you can use the following command:

    base64 input-file output-file

    On macOS, you can use the following command:

    openssl base64 input-file output-file
  2. Enter one of the following commands to upload the new file.

    On AWS CLI version 2, enter:

    aws amp put-rule-groups-namespace --data file://path_to_base_64_output_file --name namespace-name --workspace-id my-workspace-id --region region

    On AWS CLI version 1, enter:

    aws amp put-rule-groups-namespace --data fileb://path_to_base_64_output_file --name namespace-name --workspace-id my-workspace-id --region region
  3. It takes a few seconds for your rules file to become active. To check the status, enter the following command:

    aws amp describe-rule-groups-namespace --workspace-id workspace_id --name namespace-name --region region

    If the status is ACTIVE, your rules file has taken effect. Until then, the previous version of this rules file is still active.