Edit or replace a rules configuration file
If you want to change the rules in a rule file that you have already uploaded to Amazon Managed Service for Prometheus, you can either upload a new rules file to replace the existing configuration, or you can edit the current configuration directly in the console. 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.
-
Select the name of the rules configuration file that you want to edit.
-
(Optional) If you want to download the current rules configuration file, choose Download or Copy.
-
Choose Modify to edit the configuration directly within the console. Choose Save when complete.
Alternately, you can choose Replace configuration to upload a new configuration file. If so, select the new rules definition file, and choose Continue to upload it.
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.