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
-
Open the Amazon Managed Service for Prometheus console at https://console.aws.amazon.com/prometheus/
. -
In the upper left corner of the page, choose the menu icon, and then choose All workspaces.
-
Choose the workspace ID of the workspace, and then choose the Rules management tab.
-
(Optional) If you want to start by editing the current rules configuration file, choose Download or Copy.
-
When your new rules file is ready, choose Replace.
-
Choose Choose file, select the new rules definition file, and choose Continue.
To use the AWS CLI to edit a rules configuration file
-
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
-
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
--namenamespace-name
--workspace-idmy-workspace-id
--regionregion
On AWS CLI version 1, enter:
aws amp put-rule-groups-namespace --data fileb://
path_to_base_64_output_file
--namenamespace-name
--workspace-idmy-workspace-id
--regionregion
-
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
--namenamespace-name
--regionregion
If the
status
isACTIVE
, your rules file has taken effect. Until then, the previous version of this rules file is still active.