Uploading your alert manager configuration file to Amazon Managed Service for Prometheus
Now, you must upload your alert manager configuration file to Amazon Managed Service for Prometheus. You can use either the console or the AWS CLI to upload it.
To use the Amazon Managed Service for Prometheus console to upload your alert manager 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 Alert manager tab.
-
If the workspace doesn't already have an alert manager definition, choose Add definition. If the workspace has an alert manager definition that you want to replace, choose Replace definition.
-
Choose Choose file, select the alert manager definition file, and choose Continue.
To use the AWS CLI to upload an alert manager configuration to a workspace for the first time
-
Base64 encode the contents of your alert manager 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
-
To upload the file, enter one of the following commands.
On AWS CLI version 2, enter:
aws amp create-alert-manager-definition --data file://
path_to_base_64_output_file
--workspace-idmy-workspace-id
--regionregion
On AWS CLI version 1, enter:
aws amp create-alert-manager-definition --data fileb://
path_to_base_64_output_file
--workspace-idmy-workspace-id
--regionregion
-
It takes a few seconds for your alert manager configuration to become active. To check the status, enter the following command:
aws amp describe-alert-manager-definition --workspace-id
workspace_id
--regionregion
If the
status
isACTIVE
, your new alert manager definition has taken effect.
To use the AWS CLI to replace a workspace's alert manager configuration with a new one
-
Base64 encode the contents of your alert manager 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
-
To upload the file, enter one of the following commands.
On AWS CLI version 2, enter:
aws amp put-alert-manager-definition --data file://
path_to_base_64_output_file
--workspace-idmy-workspace-id
--regionregion
On AWS CLI version 1, enter:
aws amp put-alert-manager-definition --data fileb://
path_to_base_64_output_file
--workspace-idmy-workspace-id
--regionregion
-
It takes a few seconds for your new alert manager configuration to become active. To check the status, enter the following command:
aws amp describe-alert-manager-definition --workspace-id
workspace_id
--regionregion
If the
status
isACTIVE
, your new alert manager definition has taken effect. Until that time, your previous alert manager configuration is still active.