id
stringlengths
8
78
source
stringclasses
743 values
chunk_id
int64
1
5.05k
text
stringlengths
593
49.7k
amazon-managed-prometheus-user-guide-038
amazon-managed-prometheus-user-guide.pdf
38
with service principals that have been given access to resources in your account. We recommend using the aws:SourceArn and aws:SourceAccount global condition context keys in resource policies to limit the permissions that Amazon Managed Service for Prometheus gives to Amazon SNS to the resource. If you use both global condition context keys, the aws:SourceAccount value and the account in the aws:SourceArn value must use the same account ID when used in the same policy statement. The value of aws:SourceArn must be the ARN of the Amazon Managed Service for Prometheus workspace. The most effective way to protect against the confused deputy problem is to use the aws:SourceArn global condition context key with the full ARN of the resource. If you don't know the full ARN of the resource or if you are specifying multiple resources, use the aws:SourceArn global context condition key with wildcards (*) for the unknown portions of the ARN. For example, arn:aws:servicename::123456789012:*. The policy shown in Giving Amazon Managed Service for Prometheus permission to send alert messages to your Amazon SNS topic shows how you can use the aws:SourceArn and aws:SourceAccount global condition context keys in Amazon Managed Service for Prometheus to prevent the confused deputy problem. Configure alert manager to send messages to your Amazon SNS topic After you have a (new or existing) Standard type Amazon SNS topic, you can add it to your alert manager configuration as an alert receiver. Alert manager can forward your alerts to a configured alert receiver. To complete this, you must know the Amazon Resource Name (ARN) of your Amazon SNS topic. For more information about Amazon SNS receiver configuration, see <sns_configs> in the Prometheus configuration documentation. Unsupported properties Amazon Managed Service for Prometheus supports Amazon SNS as the alert receiver. However, because of service constraints, not all of the properties of the Amazon SNS receiver are supported. The following properties are not allowed in an Amazon Managed Service for Prometheus alert manager configuration file: Send alerts to your Amazon SNS topic 116 Amazon Managed Service for Prometheus User Guide • api_url: – Amazon Managed Service for Prometheus sets the api_url for you, so this property is not allowed. • Http_config – This property allows you to set external proxies. Amazon Managed Service for Prometheus does not currently support this feature. Additionally, SigV4 settings are required to have a Region property. Without the Region property, Amazon Managed Service for Prometheus doesn't have enough information to make the authorization request. To configure alert manager with your Amazon SNS topic as the receiver 1. 2. If you are using an existing alert manager configuration file, open it in a text editor. If there are current receivers other than Amazon SNS in the receivers block, remove them. You can configure multiple Amazon SNS topics to be receivers by putting them in separate sns_config blocks within the receivers block. 3. Add the following YAML block within the receivers section. - name: name_of_receiver sns_configs: - sigv4: region: region topic_arn: ARN_of_SNS_topic subject: somesubject attributes: key: somekey value: somevalue If a subjectis not specified, by default, a subject would be generated with the default template with the label name and values, which may result in a value that is too long for SNS. To change the template that is applied to the subject, refer to Configure alert manager to send messages to Amazon SNS as JSON in this guide. Now you must upload your alert manager configuration file to Amazon Managed Service for Prometheus. For more information, see Upload your alert manager configuration file to Amazon Managed Service for Prometheus. Send alerts to your Amazon SNS topic 117 Amazon Managed Service for Prometheus User Guide Configure alert manager to send messages to Amazon SNS as JSON By default, Amazon Managed Service for Prometheus alert manager outputs messages in a plain text list format. This can be more difficult for other services to parse. You can configure alert manager to send alerts in JSON format instead. JSON can make it simpler to process the messages downstream from Amazon SNS in AWS Lambda or in webhook-receiving endpoints. Instead of using the default template, you can define a custom template to output the message contents in JSON, making it easier to parse in downstream functions. To output messages from alert manager to Amazon SNS in JSON format, update your alert manager configuration to contain the following code inside your template_files root section: default_template: | {{ define "sns.default.message" }}{{ "{" }}"receiver": "{{ .Receiver }}","status": "{{ .Status }}","alerts": [{{ range $alertIndex, $alerts := .Alerts }}{{ if $alertIndex }}, {{ end }}{{ "{" }}"status": "{{ $alerts.Status }}"{{ if gt (len $alerts.Labels.SortedPairs) 0 -}},"labels": {{ "{" }}{{ range $index, $label := $alerts.Labels.SortedPairs }}{{ if $index }}, {{ end }}"{{ $label.Name }}": "{{ $label.Value }}"{{ end }} {{ "}" }}{{- end }}{{ if gt
amazon-managed-prometheus-user-guide-039
amazon-managed-prometheus-user-guide.pdf
39
easier to parse in downstream functions. To output messages from alert manager to Amazon SNS in JSON format, update your alert manager configuration to contain the following code inside your template_files root section: default_template: | {{ define "sns.default.message" }}{{ "{" }}"receiver": "{{ .Receiver }}","status": "{{ .Status }}","alerts": [{{ range $alertIndex, $alerts := .Alerts }}{{ if $alertIndex }}, {{ end }}{{ "{" }}"status": "{{ $alerts.Status }}"{{ if gt (len $alerts.Labels.SortedPairs) 0 -}},"labels": {{ "{" }}{{ range $index, $label := $alerts.Labels.SortedPairs }}{{ if $index }}, {{ end }}"{{ $label.Name }}": "{{ $label.Value }}"{{ end }} {{ "}" }}{{- end }}{{ if gt (len $alerts.Annotations.SortedPairs ) 0 -}},"annotations": {{ "{" }}{{ range $index, $annotations := $alerts.Annotations.SortedPairs }}{{ if $index }}, {{ end }}"{{ $annotations.Name }}": "{{ $annotations.Value }}"{{ end }}{{ "}" }}{{- end }},"startsAt": "{{ $alerts.StartsAt }}","endsAt": "{{ $alerts.EndsAt }}","generatorURL": "{{ $alerts.GeneratorURL }}","fingerprint": "{{ $alerts.Fingerprint }}"{{ "}" }} {{ end }}]{{ if gt (len .GroupLabels) 0 -}},"groupLabels": {{ "{" }}{{ range $index, $groupLabels := .GroupLabels.SortedPairs }}{{ if $index }}, {{ end }}"{{ $groupLabels.Name }}": "{{ $groupLabels.Value }}"{{ end }} {{ "}" }}{{- end }}{{ if gt (len .CommonLabels) 0 -}},"commonLabels": {{ "{" }} {{ range $index, $commonLabels := .CommonLabels.SortedPairs }}{{ if $index }}, {{ end }}"{{ $commonLabels.Name }}": "{{ $commonLabels.Value }}"{{ end }}{{ "}" }}{{- end }}{{ if gt (len .CommonAnnotations) 0 -}},"commonAnnotations": {{ "{" }}{{ range $index, $commonAnnotations := .CommonAnnotations.SortedPairs }}{{ if $index }}, {{ end }}"{{ $commonAnnotations.Name }}": "{{ $commonAnnotations.Value }}"{{ end }} {{ "}" }}{{- end }}{{ "}" }}{{ end }} {{ define "sns.default.subject" }}[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}]{{ end }} Send messages as JSON 118 Amazon Managed Service for Prometheus User Guide Note This template creates JSON from alphanumeric data. If your data has special characters, encode them before using this template. To make sure that this template is used in outgoing notifications, reference it in your alertmanager_config block as follows: alertmanager_config: | global: templates: - 'default_template' Note This template is for the entire message body as JSON. This template overwrites the entire message body. You cannot override the message body if you wish to use this specific template. Any overrides that are manually done will take precedence over the template. For more information about: • The alert manager configuration file, see Create an alert manager configuration in Amazon Managed Service for Prometheus to manage and route alerts. • Uploading your configuration file, see Upload your alert manager configuration file to Amazon Managed Service for Prometheus. Configure Amazon SNS to send messages for alerts to other destinations Amazon Managed Service for Prometheus can only send alert messages to Amazon Simple Notification Service (Amazon SNS). To send those messages to other destinations, such as email, webhook, Slack, or OpsGenie, you must configure Amazon SNS to forward the messages on to those endpoints. The following sections describing configuring Amazon SNS to forward alerts to other destinations. Send alerts to other destinations 119 Amazon Managed Service for Prometheus User Guide Topics • Email • Webhook • Slack • OpsGenie Email To configure an Amazon SNS topic to output messages to email, create a subscription. In the Amazon SNS console, choose the Subscriptions tab to open the Subscriptions list page. Choose Create Subscription and select Email. Amazon SNS sends a confirmation email to the listed email address. After you accept the confirmation, you are able to receive Amazon SNS notifications as emails from the topic you subscribed to. For more information, see Subscribing to an Amazon SNS topic. Webhook To configure an Amazon SNS topic to output messages to a webhook endpoint, create a subscription. In the Amazon SNS console, choose the Subscriptions tab to open the Subscriptions list page. Choose Create Subscription and select HTTP/HTTPS. After you create the subscription, you must follow the confirmation steps to activate it. When it is active, your HTTP endpoint should receive the Amazon SNS notifications. For more information, see Subscribing to an Amazon SNS topic. For more information about using Slack webhooks to publish messages to various destinations, see How do I use webhooks to publish Amazon SNS messages to Amazon Chime, Slack, or Microsoft Teams? Slack To configure an Amazon SNS topic to output messages to Slack, you have two options. You can either integrate with Slack’s email-to-channel integration, which allows Slack to accept email messages and forward them to a Slack channel, or you can use a Lambda function to rewrite the Amazon SNS notification to Slack. For more information about forwarding emails to slack channels, see Confirming AWS SNS Topic Subscription for Slack Webhook. For more information about constructing a Lambda function to convert Amazon SNS messages to Slack, see How to integrate Amazon Managed Service for Prometheus with Slack. Send alerts to other destinations 120 Amazon Managed Service for Prometheus
amazon-managed-prometheus-user-guide-040
amazon-managed-prometheus-user-guide.pdf
40
output messages to Slack, you have two options. You can either integrate with Slack’s email-to-channel integration, which allows Slack to accept email messages and forward them to a Slack channel, or you can use a Lambda function to rewrite the Amazon SNS notification to Slack. For more information about forwarding emails to slack channels, see Confirming AWS SNS Topic Subscription for Slack Webhook. For more information about constructing a Lambda function to convert Amazon SNS messages to Slack, see How to integrate Amazon Managed Service for Prometheus with Slack. Send alerts to other destinations 120 Amazon Managed Service for Prometheus User Guide OpsGenie For information about how to configure an Amazon SNS topic to output messages to OpsGenie, see Integrate Opsgenie with Incoming Amazon SNS. Understanding Amazon SNS message validation rules Amazon Simple Notification Service (Amazon SNS) requires messages to meet certain standards. Messages that don't meed these standards will be modified when they are received. The alert messages will be validated, truncated, or modified, if necessary, by the Amazon SNS receiver based on the following rules: • Message contains non-utf characters. • Message will be replaced by "Error - not a valid UTF-8 encoded string." • One message attribute will be added with the key of "truncated" and the value of "true" • One message attribute will be added with the key of "modified" and the value of "Message: Error - not a valid UTF-8 encoded string." • Message is empty. • Message will be replaced by "Error - Message should not be empty." • One message attribute will be added with the key of "modified" and the value of "Message: Error - Message should not be empty." • Message has been truncated. • Message will have the truncated content. • One message attribute will be added with the key of "truncated" and the value of "true" • One message attribute will be added with the key of "modified" and the value of "Message: Error - Message has been truncated from X KB, because it exceeds the 256 KB size limit." • Subject is not ASCII. • Subject will be replaced by "Error - contains non printable ASCII characters." • One message attribute will be added with the key of "modified" and the value of "Subject: Error - contains non-printable ASCII characters." • Subject has been truncated. • Subject will have the truncated content. Amazon SNS validation rules 121 Amazon Managed Service for Prometheus User Guide • One message attribute will be added with the key of "modified" and the value of "Subject: Error - Subject has been truncated from X characters, because it exceeds the 100 character size limit." • Message attribute has invalid key/value. • Invalid message attribute will be removed. • One message attribue will be added with the key of "modified" and the value of "MessageAttribute: Error - X of the message attributes have been removed becasue of invalid MessageAttributeKey or MessageAttributeValue." • Message attribute has been truncated. • Extra message attributes will be removed. • One message attribute will be added with the key of "modified" and the value of "MessageAttribute: Error - X of the message attributes have been removed, because it exceeds the 256KB size limit. Upload your alert manager configuration file to Amazon Managed Service for Prometheus Once you know what you want in your Alert manager configuration file, you can create and edit it within the console, or you can upload an existing file with the Amazon Managed Service for Prometheus console or AWS CLI. Note If you are running an Amazon EKS cluster, you can also upload an Alert manager configuration file using AWS Controllers for Kubernetes. To use the Amazon Managed Service for Prometheus console to edit or replace your alert manager 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 Alert manager tab. Upload a configuration file 122 Amazon Managed Service for Prometheus User Guide 4. If the workspace doesn't already have an alert manager definition, choose Add definition. Note If the workspace has an alert manager definition that you want to replace, choose Modify instead. 5. Choose Choose file, select the alert manager definition file, and choose Continue. Note Alternately, you can create a new file and edit it directly in the console, by choosing the Create definition option. This will create a sample default configuration that you edit before uploading. To use the AWS CLI to upload an alert manager configuration to a workspace for the first time 1. Base64 encode the contents of your alert manager file. On Linux, you can use the following command: base64 input-file output-file On macOS,
amazon-managed-prometheus-user-guide-041
amazon-managed-prometheus-user-guide.pdf
41
has an alert manager definition that you want to replace, choose Modify instead. 5. Choose Choose file, select the alert manager definition file, and choose Continue. Note Alternately, you can create a new file and edit it directly in the console, by choosing the Create definition option. This will create a sample default configuration that you edit before uploading. To use the AWS CLI to upload an alert manager configuration to a workspace for the first time 1. 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 2. 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-id my-workspace-id --region region On AWS CLI version 1, enter: aws amp create-alert-manager-definition --data fileb://path_to_base_64_output_file --workspace-id my-workspace-id --region region Upload a configuration file 123 Amazon Managed Service for Prometheus User Guide 3. 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 -- region region If the status is ACTIVE, 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 1. 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 2. 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-id my-workspace-id --region region On AWS CLI version 1, enter: aws amp put-alert-manager-definition --data fileb://path_to_base_64_output_file -- workspace-id my-workspace-id --region region 3. 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 -- region region If the status is ACTIVE, your new alert manager definition has taken effect. Until that time, your previous alert manager configuration is still active. Upload a configuration file 124 Amazon Managed Service for Prometheus User Guide Integrate alerts with Amazon Managed Grafana or open source Grafana Alert rules that you have created in Alertmanager within Amazon Managed Service for Prometheus can be forwarded and viewed in Amazon Managed Grafana and Grafana, unifying your alert rules and alerts in a single environment. Within Amazon Managed Grafana, you can view your alert rules and the alerts that are generated. Prerequisites Before starting to integrate Amazon Managed Service for Prometheus into Amazon Managed Grafana, you must have completed the following prerequisites: • You must have an existing AWS account and IAM credentials to create Amazon Managed Service for Prometheus and IAM roles programmatically. For more information about creating an AWS account and IAM credentials, see Set up AWS. • You must have an Amazon Managed Service for Prometheus workspace, and be ingesting data into it. To set up a new workspace, see Create an Amazon Managed Service for Prometheus workspace. You should also be familiar with the Prometheus concepts such as Alertmanager and Ruler. For more information about these topics, see the Prometheus documentation. • You have an Alertmanager configuration and a rules file already configured in Amazon Managed Service for Prometheus. For more information about Alertmanager in Amazon Managed Service for Prometheus, see Managing and forwarding alerts in Amazon Managed Service for Prometheus with alert manager. For more information about rules, see Using rules to modify or monitor metrics as they are received. • You must either have Amazon Managed Grafana set up, or the open source version of Grafana running. • If you are using Amazon Managed Grafana, you must be using Grafana alerting. For more information see Migrating legacy dashboard alerts to Grafana alerting. • If you are using the open source version of Grafana, you must be running version 9.1 or higher. Note You can use earlier versions of Grafana, but you must enable the unified alerting (Grafana alerting) feature, and you might have to set up a sigv4 proxy to make calls Integrate alerts with Grafana 125 Amazon Managed Service for Prometheus User Guide from Grafana to Amazon Managed Service for Prometheus. For more information, see Set up Grafana open source or Grafana Enterprise for use with Amazon Managed Service for Prometheus. • Amazon Managed Grafana must have the following permissions for your Prometheus resources. You must add them to either the service-managed or customer-managed policies described in https://docs.aws.amazon.com/grafana/latest/userguide/AMG-manage-permissions.html. • aps:ListRules • aps:ListAlertManagerSilences • aps:ListAlertManagerAlerts • aps:GetAlertManagerStatus • aps:ListAlertManagerAlertGroups • aps:PutAlertManagerSilences • aps:DeleteAlertManagerSilence Setting up Amazon Managed Grafana If you have already set up rules and alerts in your Amazon Managed Service for Prometheus instance, the configuration to use
amazon-managed-prometheus-user-guide-042
amazon-managed-prometheus-user-guide.pdf
42
Service for Prometheus User Guide from Grafana to Amazon Managed Service for Prometheus. For more information, see Set up Grafana open source or Grafana Enterprise for use with Amazon Managed Service for Prometheus. • Amazon Managed Grafana must have the following permissions for your Prometheus resources. You must add them to either the service-managed or customer-managed policies described in https://docs.aws.amazon.com/grafana/latest/userguide/AMG-manage-permissions.html. • aps:ListRules • aps:ListAlertManagerSilences • aps:ListAlertManagerAlerts • aps:GetAlertManagerStatus • aps:ListAlertManagerAlertGroups • aps:PutAlertManagerSilences • aps:DeleteAlertManagerSilence Setting up Amazon Managed Grafana If you have already set up rules and alerts in your Amazon Managed Service for Prometheus instance, the configuration to use Amazon Managed Grafana as a dashboard for those alerts is done entirely within Amazon Managed Grafana. To configure Amazon Managed Grafana as your alerts dashboard 1. Open the Grafana console for your workspace. 2. Under Configurations, choose Data sources. 3. Either create or open your Prometheus data source. If you have not previously set up a Prometheus data source, see Step 2: Add the Prometheus data source in Grafana for more information. 4. In the Prometheus data source, select Manage alerts via Alertmanager UI. 5. Go back to the Data sources interface. 6. Create a new Alertmanager data source. 7. In the Alertmanager data source configuration page, add the following settings: • Set Implementation to Prometheus. Setting up Amazon Managed Grafana 126 Amazon Managed Service for Prometheus User Guide • For the URL setting, use the URL for your Prometheus workspace, remove everything after the workspace ID, and append /alertmanager to the end. For example, https://aps- workspaces.us-east1.amazonaws.com/workspaces/ws-example-1234-5678- abcd-xyz00000001/alertmanager. • Under Auth, turn on SigV4Auth. This tells Grafana to use the AWS authentication for the requests. • Under SigV4Auth Details, for Default Region, provide the region of your Prometheus instance, for example us-east-1. • Set the Default option to true. 8. Choose Save and test. 9. Your Amazon Managed Service for Prometheus alerts should now be configured to work with your Grafana instance. Verify that you can see any Alert rules, Alert groups (including active alerts), and Silences from your Amazon Managed Service for Prometheus instance in the Grafana Alerting page. Troubleshoot alert manager with CloudWatch Logs Using Monitor Amazon Managed Service for Prometheus events with CloudWatch Logs, you can troubleshoot Alert Manager and Ruler related issues. This section contains Alert Manager related troubleshooting topics. Topics • Empty content warning • Non ASCII warning • Invalid key/value warning • Message limit warning • No resource based policy error • Not authorized to call KMS Empty content warning When the log contains the following warning { Troubleshoot alert manager 127 Amazon Managed Service for Prometheus User Guide "workspaceId": "ws-abcd1234-ef56-78ab-cd90-1234abcd0000", "message": { "log": "Message has been modified because the content was empty." "level": "WARN" }, "component": "alertmanager" } This means that the Alert manager template resolved the outbound alert to an empty message. Action to take Validate your Alert manager template and ensure that you have a valid template for all receiver pathways. Non ASCII warning When the log contains the following warning { "workspaceId": "ws-abcd1234-ef56-78ab-cd90-1234abcd0000", "message": { "log": "Subject has been modified because it contains control or non-ASCII characters." "level": "WARN" }, "component": "alertmanager" } This means that the subject has non-ASCII characters. Action to take Remove references in subject field of your template to the labels that might contain non-ASCII characters. Invalid key/value warning When the log contains the following warning { "workspaceId": "ws-abcd1234-ef56-78ab-cd90-1234abcd0000", Non ASCII warning 128 Amazon Managed Service for Prometheus "message": { User Guide "log": "MessageAttributes has been removed because of invalid key/value, numberOfRemovedAttributes=1" "level": "WARN" }, "component": "alertmanager" } This means that some of the message attributes have been removed due to keys/values being invalid. Action to take Re-evaluate the templates you are using to populate the message attributes, and ensure it is resolving to a valid SNS message attribute. For more information about validating a message to an Amazon SNS topic, see Validating SNS topic Message limit warning When the log contains the following warning { "workspaceId": "ws-abcd1234-ef56-78ab-cd90-1234abcd0000", "message": { "log": "Message has been truncated because it exceeds size limit, originSize=266K, truncatedSize=12K" "level": "WARN" }, "component": "alertmanager" } This means that some of the message size is too big. Action to take Look at the Alert receiver message template and re-work it to fit within the size limit. No resource based policy error When the log contains the following error { Message limit warning 129 Amazon Managed Service for Prometheus User Guide "workspaceId": "ws-abcd1234-ef56-78ab-cd90-1234abcd0000", "message": { "log": "Notify for alerts failed, AMP is not authorized to perform: SNS:Publish on resource: arn:aws:sns:us-west-2:12345:testSnsReceiver because no resource-based policy allows the SNS:Publish action" "level": "ERROR" }, "component": "alertmanager" } This means that Amazon Managed Service for Prometheus does not have the permissions to submit the alert to the SNS topic specified. Action to take Validate that the access policy on
amazon-managed-prometheus-user-guide-043
amazon-managed-prometheus-user-guide.pdf
43
receiver message template and re-work it to fit within the size limit. No resource based policy error When the log contains the following error { Message limit warning 129 Amazon Managed Service for Prometheus User Guide "workspaceId": "ws-abcd1234-ef56-78ab-cd90-1234abcd0000", "message": { "log": "Notify for alerts failed, AMP is not authorized to perform: SNS:Publish on resource: arn:aws:sns:us-west-2:12345:testSnsReceiver because no resource-based policy allows the SNS:Publish action" "level": "ERROR" }, "component": "alertmanager" } This means that Amazon Managed Service for Prometheus does not have the permissions to submit the alert to the SNS topic specified. Action to take Validate that the access policy on your Amazon SNS topic grants Amazon Managed Service for Prometheus the ability to send SNS messages to the topic. Create an SNS Access Policy giving the service aps.amazonaws.com (Amazon Managed Service for Prometheus) access to your Amazon SNS topic. For more information about SNS Access Policies, see Using the Access Policy Language and Example cases for Amazon SNS access control in the Amazon Simple Notification Service Developer Guide. Not authorized to call KMS When the log contains the following AWS KMS error { "workspaceId": "ws-abcd1234-ef56-78ab-cd90-1234abcd0000", "message": { "log": "Notify for alerts failed, AMP is not authorized to call KMS", "level": "ERROR" }, "component": "alertmanager" } Action to take Validate that the key policy of the key used to encrypt the Amazon SNS topic allows the Amazon Managed Service for Prometheus service principal aps.amazonaws.com to perform the following actions: kms:GenerateDataKey*, and kms:Decrypt. For more information, see AWS KMS Permissions for SNS Topic. Not authorized to call KMS 130 Amazon Managed Service for Prometheus User Guide Logging and monitoring Amazon Managed Service for Prometheus workspaces Amazon Managed Service for Prometheus uses Amazon CloudWatch to provide data about its operation. You can use CloudWatch metrics to learn about resource usage and requests to your Amazon Managed Service for Prometheus workspaces. You can turn on CloudWatch Logs support to get logs for events that happen in your workspaces. The following topics describe using CloudWatch in more detail. Use CloudWatch metrics to monitor Amazon Managed Service for Prometheus resources Amazon Managed Service for Prometheus vends usage metrics to CloudWatch. These metrics provide visibility about your workspace utilization. The vended metrics can be found in the AWS/Usage and AWS/Prometheus namespaces in CloudWatch. These metrics are available in CloudWatch for no charge. For more information about usage metrics, see CloudWatch usage metrics. CloudWatch metric name ResourceCount* ResourceCount* Resource name CloudWatch namespace Description RemoteWri teTPS QueryMetr icsTPS AWS/Usage AWS/Usage Remote write operations per second Query operations per second ResourceCount IngestionRate AWS/Usage Sample ingestion rate Units: count per second Valid Statistics: Average, Minimum, Maximum, Sum CloudWatch metrics 131 Amazon Managed Service for Prometheus User Guide CloudWatch metric name Resource name CloudWatch namespace Description ResourceCount ActiveSeries AWS/Usage ResourceCount ActiveAlerts AWS/Usage ResourceCount SizeOfAlerts AWS/Usage ResourceCount Suppresse dAlerts AWS/Usage Number of active series per workspace Units: count Valid Statistics: Average, Minimum, Maximum, Sum Number of active alerts per workspace Units: count Valid Statistics: Average, Minimum, Maximum, Sum Total size of all alerts in the workspace, in bytes Units: bytes Valid Statistics: Average, Minimum, Maximum, Sum Number of alerts in suppressed state per workspace. An alert can be suppressed by a silence or inhibition. Units: count Valid Statistics: Average, Minimum, Maximum, Sum CloudWatch metrics 132 Amazon Managed Service for Prometheus User Guide Resource name CloudWatch namespace Description CloudWatch metric name ResourceCount Unprocess edAlerts AWS/Usage Number of alerts in unprocessed state per workspace. An alert is in unprocessed state once it is received by AlertMana ger, but is waiting for the next aggregation group evaluation. Units: count Valid Statistics: Average, Minimum, Maximum, Sum Number of alerts in any state per workspace. Units: count Valid Statistics: Average, Minimum, Maximum, Sum The current active series usage for each user-defi ned label set Units: count Valid Statistics: Average, Minimum, Maximum, Sum ResourceCount AllAlerts AWS/Usage ActiveSer iesPerLabelSet - AWS/Prometheus CloudWatch metrics 133 Amazon Managed Service for Prometheus User Guide CloudWatch metric name ActiveSer iesLimitP erLabelSet AlertMana gerAlerts Received AlertMana gerNotifi cationsFailed AlertMana gerNotifi cationsThrottled Resource name CloudWatch namespace Description - - - - AWS/Prometheus AWS/Prometheus AWS/Prometheus The current active series limit value for each user- defined label set Units: count Valid Statistics: Average, Minimum, Maximum, Sum Total successful alerts received by alert manager Units: count Valid Statistics: Average, Minimum, Maximum, Sum Number of failed alert deliveries Units: count Valid Statistics: Average, Minimum, Maximum, Sum AWS/Prometheus Number of throttled alerts Units: count Valid Statistics: Average, Minimum, Maximum, Sum CloudWatch metrics 134 Amazon Managed Service for Prometheus User Guide CloudWatch metric name Discarded Samples** Discarded SamplesPe rLabelSet Ingestion RatePerLabelSet QuerySamp lesProcessed Resource name CloudWatch namespace Description - - - - AWS/Prometheus AWS/Prometheus AWS/Prometheus AWS/Prometheus Number of discarded samples by reason Units: count Valid Statistics: Average, Minimum, Maximum, Sum The count of discarded samples for each user-defi ned label set Units:
amazon-managed-prometheus-user-guide-044
amazon-managed-prometheus-user-guide.pdf
44
alerts received by alert manager Units: count Valid Statistics: Average, Minimum, Maximum, Sum Number of failed alert deliveries Units: count Valid Statistics: Average, Minimum, Maximum, Sum AWS/Prometheus Number of throttled alerts Units: count Valid Statistics: Average, Minimum, Maximum, Sum CloudWatch metrics 134 Amazon Managed Service for Prometheus User Guide CloudWatch metric name Discarded Samples** Discarded SamplesPe rLabelSet Ingestion RatePerLabelSet QuerySamp lesProcessed Resource name CloudWatch namespace Description - - - - AWS/Prometheus AWS/Prometheus AWS/Prometheus AWS/Prometheus Number of discarded samples by reason Units: count Valid Statistics: Average, Minimum, Maximum, Sum The count of discarded samples for each user-defi ned label set Units: count Valid Statistics: Average, Minimum, Maximum, Sum The ingestion rate for each user-defined label set Units: count Valid Statistics: Average, Minimum, Maximum, Sum Number of query samples processed Units: count Valid Statistics: Average, Minimum, Maximum, Sum CloudWatch metrics 135 Amazon Managed Service for Prometheus User Guide CloudWatch metric name Resource name CloudWatch namespace Description RuleEvaluations - AWS/Prometheus RuleEvalu ationFailures RuleGroup IterationsMissed RuleGroup LastEvalu ationDuration - - - AWS/Prometheus AWS/Prometheus AWS/Prometheus Total number of rule evaluations Units: count Valid Statistics: Average, Minimum, Maximum, Sum Number of rule evaluation failures in the interval Units: count Valid Statistics: Average, Minimum, Maximum, Sum Number of Rule Group iterations missed in the interval. Units: count Valid Statistics: Average, Minimum, Maximum, Sum Duration of a rule group's last evaluation. Units: seconds Valid Statistics: Average, Minimum, Maximum, Sum *TPS metrics are generated every minute and are a per-second average over that minute. Short burst periods will not be captured in the TPS metrics. **Some of the reasons that cause samples to be discarded are as follows. CloudWatch metrics 136 Amazon Managed Service for Prometheus User Guide Reason Meaning greater_than_max_sample_age Discarding samples which are older than one hour. new-value-for-timestamp Duplicate samples are sent with a different timestamp than was previously recorded. per_labelset_series_limit User has hit the total number of active series per label set limit. per_metric_series_limit User has hit the active series per metric limit. per_user_series_limit User has hit the total number of active series limit. rate_limited Ingestion rate limited. sample-out-of-order Samples are sent out of order and cannot be processed. label_value_too_long Label value is longer than allowed character limit. max_label_names_per_series User has hit the label names per metric. missing_metric_name Metric name is not provided. metric_name_invalid Invalid metric name provided. label_invalid Invalid label provided. duplicate_label_names Duplicate label names provided. Note A metric not existing or missing is the same as the value of that metric being 0. CloudWatch metrics 137 Amazon Managed Service for Prometheus User Guide Note RuleGroupIterationsMissed, RuleEvaluations, RuleEvaluationFailures, and RuleGroupLastEvaluationDuration have the RuleGroup dimension of the following structure: RuleGroupNamespace;RuleGroup Setting a CloudWatch alarm on Prometheus vended metrics You can monitor usage of Prometheus resources using CloudWatch alarms. To set an alarm on the number of ActiveSeries in Prometheus 1. Choose the Graphed metrics tab and scroll down to the ActiveSeries label. In the Graphed metrics view, only the metrics currently being ingested will appear. 2. Choose the notification icon in the Actions column. 3. 4. In Specify metric and conditions, enter the threshold condition in the Conditions value field and choose Next. In Configure actions, select an existing SNS topic or create a new SNS topic to send the notification to. 5. In Add name and description, add the name of the alarm and an optional description. 6. Choose Create alarm. Monitor Amazon Managed Service for Prometheus events with CloudWatch Logs Amazon Managed Service for Prometheus logs Alert Manager and Ruler error and warning events in log groups in Amazon CloudWatch Logs. For more information about Alert Manager and Rulers, see Alert Manager topic in this guide. You can publish the workspace logs data to log streams in CloudWatch Logs. You can configure the logs that you wish to monitor in the Amazon Managed Service for Prometheus console or by using the AWS CLI. You can view or query these logs in the CloudWatch console. For more information about viewing CloudWatch Logs log streams in the console, see Working with log groups and log streams in CloudWatch in the CloudWatch user guide. Setting a CloudWatch alarm 138 Amazon Managed Service for Prometheus User Guide The CloudWatch free tier allows up to 5Gb of logs to be published in CloudWatch Logs. The logs that exceed the free tier allowance will be charged based on the CloudWatch pricing plan. Topics • Configuring CloudWatch Logs Configuring CloudWatch Logs Amazon Managed Service for Prometheus logs Alert Manager and Ruler error and warning events in log groups in Amazon CloudWatch Logs. You can set CloudWatch Logs logging configuration in Amazon Managed Service for Prometheus console or in the AWS CLI by calling the create-logging-configuration API request. Prerequisites Before calling create-logging-configuration, attach the following policy or equivalent permissions to the ID or role you will use to configure CloudWatch Logs. {
amazon-managed-prometheus-user-guide-045
amazon-managed-prometheus-user-guide.pdf
45
be published in CloudWatch Logs. The logs that exceed the free tier allowance will be charged based on the CloudWatch pricing plan. Topics • Configuring CloudWatch Logs Configuring CloudWatch Logs Amazon Managed Service for Prometheus logs Alert Manager and Ruler error and warning events in log groups in Amazon CloudWatch Logs. You can set CloudWatch Logs logging configuration in Amazon Managed Service for Prometheus console or in the AWS CLI by calling the create-logging-configuration API request. Prerequisites Before calling create-logging-configuration, attach the following policy or equivalent permissions to the ID or role you will use to configure CloudWatch Logs. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "logs:CreateLogDelivery", "logs:GetLogDelivery", "logs:UpdateLogDelivery", "logs:DeleteLogDelivery", "logs:ListLogDeliveries", "logs:PutResourcePolicy", "logs:DescribeResourcePolicies", "logs:DescribeLogGroups", "aps:CreateLoggingConfiguration", "aps:UpdateLoggingConfiguration", "aps:DescribeLoggingConfiguration", "aps:DeleteLoggingConfiguration" ], "Resource": "*" } ] Configuring CloudWatch Logs 139 Amazon Managed Service for Prometheus User Guide } To configure CloudWatch Logs You can configure logging in Amazon Managed Service for Prometheus using either the AWS console or the AWS CLI. Console To configure logging in Amazon Managed Service for Prometheus console 1. Navigate to the Logs tab in your workspace details panel. 2. Choose Manage logs on the upper right side of the Logs panel. 3. Choose all in the Log level dropdown list. 4. Choose the log group that you want to publish your logs to in the Log Group dropdown list. You can also create a new log group in CloudWatch console. 5. Choose Save changes. AWS CLI You can set logging configuration using the AWS CLI. To configure logging using the AWS CLI • Using the AWS CLI, run the following command. aws amp create-logging-configuration --workspace-id my_workspace_ID --log-group-arn my-log-group-arn Limitations • Not all events logged Amazon Managed Service for Prometheus only logs events that are at the warning or error level. • Policy size limits Configuring CloudWatch Logs 140 Amazon Managed Service for Prometheus User Guide CloudWatch Logs resource policies are limited to 5120 characters. When CloudWatch Logs detect that a policy approaches this size limit, it automatically enables log groups that start with /aws/ vendedlogs/. When you create an alert rule with logging enabled, Amazon Managed Service for Prometheus must update your CloudWatch Logs resource policy with the log group you specify. To avoid reaching the CloudWatch Logs resource policy size limit, prefix your CloudWatch Logs log group names with /aws/vendedlogs/. When you create a log group in the Amazon Managed Service for Prometheus console, the log group names are prefixed with /aws/vendedlogs/. For more information, see Enabling Logging from Certain AWS Services in the CloudWatch Logs User Guide. Configuring CloudWatch Logs 141 Amazon Managed Service for Prometheus User Guide Understand and optimize costs in Amazon Managed Service for Prometheus The following frequently asked questions and their answers may be helpful in understanding and optimizing costs associated with Amazon Managed Service for Prometheus. What contributes to my costs? For most customers, metric ingestion contributes the majority of costs. Customers with high query usage will also see some cost based on query samples processed, with metrics storage being a small driver of overall costs. For more information about the prices for each of these, see Pricing in the Amazon Managed Service for Prometheus product page. What is the best way to lower my costs? How do I lower ingestion costs? Ingestion rates (not storage of the metrics) is the majority of costs for most customers. You can reduce ingestion rates by reducing the collection frequency (increasing the collection interval) or by reducing the number of active series ingested. You can increase the collection (scraping) interval from your collection agent: Both the Prometheus server (running in Agent mode) and the AWS Distro for OpenTelemetry (ADOT) collector support the scrape_interval configuration. For example, increasing the collection interval from 30 seconds to 60 seconds will reduce your ingestion usage by half. You can also filter the metrics sent to Amazon Managed Service for Prometheus by using the <relabel_config>. For more information about relabeling in the Prometheus agent configuration, see https://prometheus.io/docs/prometheus/latest/configuration/configuration/ #relabel_config in the Prometheus documentation. What is the best way to lower my query costs? Query costs are based on the number of samples processed. You can reduce the frequency of queries to reduce your query costs. What contributes to my costs? 142 Amazon Managed Service for Prometheus User Guide To get more visibility into the queries that are contributing the most to your query costs, you can reach out to file a ticket with your support contact. The Amazon Managed Service for Prometheus team can help you understand the queries that are contributing the most to your costs. If I decrease the retention period of my metrics, will that help reduce my total bill? You can reduce your retention period, however, this is unlikely to substantially reduce your costs. For information about how to configure the retention period
amazon-managed-prometheus-user-guide-046
amazon-managed-prometheus-user-guide.pdf
46
to my costs? 142 Amazon Managed Service for Prometheus User Guide To get more visibility into the queries that are contributing the most to your query costs, you can reach out to file a ticket with your support contact. The Amazon Managed Service for Prometheus team can help you understand the queries that are contributing the most to your costs. If I decrease the retention period of my metrics, will that help reduce my total bill? You can reduce your retention period, however, this is unlikely to substantially reduce your costs. For information about how to configure the retention period of a workspace, see Configure your workspace. How can I keep my alert query costs low? Alerting creates queries against your data, which add to your query costs. Here are some strategies that you can use to optimize your alert queries, and keep your costs lower. • Use Amazon Managed Service for Prometheus alerting – Alerting systems external to Amazon Managed Service for Prometheus may require additional queries to add resiliency or high availability, as the external service queries the metrics from multiple availability zones or regions. This includes alerting in Grafana for high availability. This can multiply your cost by three times or more. The alerting in Amazon Managed Service for Prometheus is optimized and will give you high availability and resiliency with the fewest number of queries. We recommend using the native alerting in Amazon Managed Service for Prometheus rather than external alerting systems. • Optimize your alert interval – One quick way to optimize your alert queries is to increase the auto-refresh interval. If you have an alert that queries every minute, but is only needed every five minutes, increasing the auto-refresh interval could save you five times your query costs for that alert. • Use an optimal lookback – A larger lookback window in your query increases the costs of the query, as it pulls more data. Ensure that the lookback window in your PromQL query is reasonably sized for the data you need to alert. For example, in the following rule, the expression includes a ten minute lookback window: - alert: metric:alerting_rule expr: avg(rate(container_cpu_usage_seconds_total[10m])) > 0 If I decrease the retention period of my metrics, will that help reduce my total bill? 143 Amazon Managed Service for Prometheus for: 2m User Guide Changing the expr to avg(rate(container_cpu_usage_seconds_total[5m])) > 0 can help to reduce your query costs. In general, look at your alerting rules and make sure that you are alerting on the best metrics for your service. It's easy to create overlapping alerts on the same metrics or multiple alerts that give you the same information, especially as you add alerts over time. If you find that you often see groups of alerts happening at the same time, it's possible that you can optimize your alerts and not include all of them. These suggestions can help you to reduce costs. Ultimately, you must balance the costs with creating the right set of alerts for understanding the state of your system. For more information about alerting in Amazon Managed Service for Prometheus, see Managing and forwarding alerts in Amazon Managed Service for Prometheus with alert manager. What metrics can I use to monitor my costs? Monitor IngestionRate in Amazon CloudWatch to track your ingestion costs. For more information about monitoring Amazon Managed Service for Prometheus metrics in CloudWatch, see Use CloudWatch metrics to monitor Amazon Managed Service for Prometheus resources. Can I check my bill at any time? The AWS Cost and Usage Report tracks your AWS usage and provides estimated charges associated with your account within a billing period. For more information, see What are AWS Cost and Usage Reports? in the AWS Cost and Usage Reports User Guide Why is my bill higher at the beginning of the month than at the end of the month? Amazon Managed Service for Prometheus has a tiered pricing model for ingestion, which results in costs in your initial usage being higher. As your usage reaches higher ingest tiers, with lower costs, your costs are lower. For more information about pricing, including ingest tiers, see Pricing in the Amazon Managed Service for Prometheus product page. What metrics can I use to monitor my costs? 144 Amazon Managed Service for Prometheus User Guide Note • Tiers are for usage within a region, not across regions. Usage within a region must reach the next tier to use the lower rate. • In an organization in AWS Organizations, tier usage is tallied per payer account, not per account (the payer account is always the organization management account). When the total ingested metrics (within a region) for all accounts in an organization reaches the next tier, all accounts are charged the lower rate. I deleted all my Amazon Managed Service for Prometheus
amazon-managed-prometheus-user-guide-047
amazon-managed-prometheus-user-guide.pdf
47
I use to monitor my costs? 144 Amazon Managed Service for Prometheus User Guide Note • Tiers are for usage within a region, not across regions. Usage within a region must reach the next tier to use the lower rate. • In an organization in AWS Organizations, tier usage is tallied per payer account, not per account (the payer account is always the organization management account). When the total ingested metrics (within a region) for all accounts in an organization reaches the next tier, all accounts are charged the lower rate. I deleted all my Amazon Managed Service for Prometheus workspaces, but I still seem to be getting charged. What might be happening? One possibility in this case is that you still have AWS managed scrapers that are setup to send metrics to your deleted workspaces. Follow the instructions to Find and delete scrapers. I deleted all my Amazon Managed Service for Prometheus workspaces, but I still seem to be getting charged. What might be happening? 145 Amazon Managed Service for Prometheus User Guide Integrating with other AWS services Amazon Managed Service for Prometheus integrates with other AWS services. This section describes integrating with Amazon Elastic Kubernetes Service (Amazon EKS) cost monitoring (with Kubecost), and how to ingest metrics from CloudWatch using Amazon Data Firehose. It also describes setting up and managing Amazon Managed Service for Prometheus with AWS Observability Accelerator Terraform modules, or by using AWS Controllers for Kubernetes. Topics • Integrating with Amazon EKS cost monitoring • Set up Amazon Managed Service for Prometheus with AWS Observability Accelerator • Manage Amazon Managed Service for Prometheus with AWS Controllers for Kubernetes • Integrating CloudWatch metrics with Amazon Managed Service for Prometheus Integrating with Amazon EKS cost monitoring Amazon Managed Service for Prometheus integrates with Amazon Elastic Kubernetes Service (Amazon EKS) cost monitoring (with Kubecost) to perform cost allocation calculations and provide insights into optimizing your Kubernetes clusters. Using Amazon Managed Service for Prometheus with Kubecost, you can reliably scale your cost monitoring to support larger clusters. Integrating with Kubecost gives you granular visibility into your Amazon EKS cluster costs. You can aggregate costs by the majority of Kubernetes contexts, from the container level up to the cluster level, and even multi-cluster level. You can generate reports across containers or clusters to track costs for show back or chargeback purposes. The following give instructions for integrating with Kubecost in a single- or multi-cluster scenario: • Single-cluster integration – To learn how to integrate Amazon EKS cost monitoring with a single cluster, see the AWS blog post Integrating Kubecost with Amazon Managed Service for Prometheus. • Multi-cluster integration – To learn how to integrate Amazon EKS cost monitoring with a multiple clusters, see the AWS blog post Multi-cluster cost monitoring for Amazon EKS using Kubecost and Amazon Managed Service for Prometheus. Amazon EKS cost monitoring 146 Amazon Managed Service for Prometheus User Guide Note For more information about using Kubecost, see Cost monitoring in the Amazon EKS User Guide. Set up Amazon Managed Service for Prometheus with AWS Observability Accelerator AWS provides observability tools, including monitoring, logging, alerting, and dashboards, for your Amazon Elastic Kubernetes Service (Amazon EKS) projects. This includes Amazon Managed Service for Prometheus, Amazon Managed Grafana, AWS Distro for OpenTelemetry, and other tools. To help you use these tools together, AWS provides Terraform modules that configure observability with these services, called the AWS Observability Accelerator. AWS Observability Accelerator provides examples for monitoring infrastructure, NGINX deployements, and other scenarios. This section gives an example of monitoring infrastructure within your Amazon EKS cluster. The Terraform templates and detailed instructions can be found on the AWS Observability Accelerator for Terraform GitHub page. You can also read the blog post announcing AWS Observability Accelerator. Prerequisites To use AWS Observability Accelerator, you must have an existing Amazon EKS cluster, and the following prerequisites: • AWS CLI – used to call AWS functionality from the command line. • kubectl – used to control your EKS cluster from the command line. • Terraform – used to automate creation of the resources for this solution. You must have the AWS provider setup with an IAM role that has access to create and manage Amazon Managed Service for Prometheus, Amazon Managed Grafana, and IAM within your AWS account. For more information about how to configure the AWS provider for Terraform, see AWS provider in the Terraform documentation. AWS Observability Accelerator 147 Amazon Managed Service for Prometheus User Guide Using the infrastructure monitoring example AWS Observability Accelerator provides example templates that use the included Terraform modules to set up and configure observability for your Amazon EKS cluster. This example demonstrates using AWS Observability Accelerator to set up infrastructure monitoring. For more details about using this template and additional capabilities that it includes, see Existing Cluster with the AWS
amazon-managed-prometheus-user-guide-048
amazon-managed-prometheus-user-guide.pdf
48
for Prometheus, Amazon Managed Grafana, and IAM within your AWS account. For more information about how to configure the AWS provider for Terraform, see AWS provider in the Terraform documentation. AWS Observability Accelerator 147 Amazon Managed Service for Prometheus User Guide Using the infrastructure monitoring example AWS Observability Accelerator provides example templates that use the included Terraform modules to set up and configure observability for your Amazon EKS cluster. This example demonstrates using AWS Observability Accelerator to set up infrastructure monitoring. For more details about using this template and additional capabilities that it includes, see Existing Cluster with the AWS Observability Accelerator base and Infrastructure monitoring page on GitHub. To use the infrastructure monitoring Terraform module 1. From the folder you want to create your project in, clone the repo using the following command. git clone https://github.com/aws-observability/terraform-aws-observability- accelerator.git 2. Initialize Terraform with the following commands. cd examples/existing-cluster-with-base-and-infra terraform init 3. Create a new terraform.tfvars file, as in the following example. Use the AWS Region and cluster ID for your Amazon EKS cluster. # (mandatory) AWS Region where your resources will be located aws_region = "eu-west-1" # (mandatory) EKS Cluster name eks_cluster_id = "my-eks-cluster" 4. Create an Amazon Managed Grafana workspace, if you don't already have one that you want to use. For information about how to create a new workspace, see Create your first workspace in the Amazon Managed Grafana User Guide. 5. Create two variables for Terraform to use your Grafana workspace by running the following commands at the command line. You will need to replace the grafana-workspace-id with the ID from your Grafana workspace. export TF_VAR_managed_grafana_workspace_id=grafana-workspace-id Using the infrastructure monitoring example 148 Amazon Managed Service for Prometheus User Guide export TF_VAR_grafana_api_key=`aws grafana create-workspace-api-key --key-name "observability-accelerator-$(date +%s)" --key-role ADMIN --seconds-to-live 1200 -- workspace-id $TF_VAR_managed_grafana_workspace_id --query key --output text` 6. [Optional] To use an existing Amazon Managed Service for Prometheus workspace, add the ID to the terraform.tfvars file, as in the following example, replacing the prometheus- workspace-id with your Prometheus workspace ID. If you do not specify an existing workspace, then a new Prometheus workspace will be created for you. # (optional) Leave it empty for a new workspace to be created managed_prometheus_workspace_id = "prometheus-workspace-id" 7. Deploy the solution with the following command. terraform apply -var-file=terraform.tfvars This will create resources in your AWS account, including the following: • A new Amazon Managed Service for Prometheus workspace (unless you opted to use an existing workspace). • Alert manager configuration, alerts, and rules in your Prometheus workspace. • New Amazon Managed Grafana data source and dashboards in your current workspace. The data source will be called aws-observability-accelerator. The dashboards will be listed under Observability Accelerator Dashboards. • An AWS Distro for OpenTelemetry operator set up in the provided Amazon EKS cluster, to send metrics to your Amazon Managed Service for Prometheus workspace. To view your new dashboards, open the specific dashboard in your Amazon Managed Grafana workspace. For more information about using Amazon Managed Grafana, see Working in your Grafana workspace, in the Amazon Managed Grafana User Guide. Manage Amazon Managed Service for Prometheus with AWS Controllers for Kubernetes Amazon Managed Service for Prometheus is integrated with AWS Controllers for Kubernetes (ACK), with support for managing your workspace, Alert Manager, and Ruler resources in Amazon AWS Controllers for Kubernetes 149 Amazon Managed Service for Prometheus User Guide EKS. You can use AWS Controllers for Kubernetes custom resource definitions (CRDs) and native Kubernetes objects without having to define any resources outside of your cluster. This section describes how to set up AWS Controllers for Kubernetes and Amazon Managed Service for Prometheus in an existing Amazon EKS cluster. You can also read the blog posts introducing AWS Controllers for Kubernetes and introducing the ACK controller for Amazon Managed Service for Prometheus. Prerequisites Before starting to integrate AWS Controllers for Kubernetes and Amazon Managed Service for Prometheus with your Amazon EKS cluster, you must have the following prerequisites. • You must have an existing AWS account and permissions to create Amazon Managed Service for Prometheus and IAM roles programmatically. • You must have an existing Amazon EKS cluster with OpenID Connect (OIDC) enabled. If you do not have OIDC enabled, you can use the following command to enable it. Remember to replace the YOUR_CLUSTER_NAME and AWS_REGION with the correct values for your account. eksctl utils associate-iam-oidc-provider \ --cluster ${YOUR_CLUSTER_NAME} --region ${AWS_REGION} \ --approve For more information about using OIDC with Amazon EKS, see OIDC identity provider authentication and Creating an IAM OIDC provider in the Amazon EKS User Guide. • You must have the Amazon EBS CSI driver installed in your Amazon EKS cluster. • You must have the AWS CLI installed. The AWS CLI is used to call AWS functionality from the command line. • Helm, the package manager for Kubernetes, must be installed.
amazon-managed-prometheus-user-guide-049
amazon-managed-prometheus-user-guide.pdf
49
command to enable it. Remember to replace the YOUR_CLUSTER_NAME and AWS_REGION with the correct values for your account. eksctl utils associate-iam-oidc-provider \ --cluster ${YOUR_CLUSTER_NAME} --region ${AWS_REGION} \ --approve For more information about using OIDC with Amazon EKS, see OIDC identity provider authentication and Creating an IAM OIDC provider in the Amazon EKS User Guide. • You must have the Amazon EBS CSI driver installed in your Amazon EKS cluster. • You must have the AWS CLI installed. The AWS CLI is used to call AWS functionality from the command line. • Helm, the package manager for Kubernetes, must be installed. • Control plane metrics with Prometheus must be set up in your Amazon EKS cluster. • You must have an Amazon Simple Notification Service (Amazon SNS) topic where you want to send alerts from your new workspace. Make sure that you have given Amazon Managed Service for Prometheus permission to send messages to the topic. Prerequisites 150 Amazon Managed Service for Prometheus User Guide When your Amazon EKS cluster is configured appropriately, you should be able to see metrics formatted for Prometheus by calling kubectl get --raw /metrics. Now you are ready to install an AWS Controllers for Kubernetes service controller and use it to deploy Amazon Managed Service for Prometheus resources. Deploying a workspace with AWS Controllers for Kubernetes To deploy a new Amazon Managed Service for Prometheus workspace, you will install an AWS Controllers for Kubernetes controller, and then use that to create the workspace. To deploy a new Amazon Managed Service for Prometheus workspace with AWS Controllers for Kubernetes 1. Use the following commands to use Helm to install the Amazon Managed Service for Prometheus service controller. For more information see Install an ACK Controller in the AWS Controllers for Kubernetes documentation on GitHub. Use the correct region for your system, such as us-east-1. export SERVICE=prometheusservice export RELEASE_VERSION=`curl -sL https://api.github.com/repos/aws-controllers-k8s/ $SERVICE-controller/releases/latest | grep '"tag_name":' | cut -d'"' -f4` export ACK_SYSTEM_NAMESPACE=ack-system export AWS_REGION=region aws ecr-public get-login-password --region us-east-1 | helm registry login -- username AWS --password-stdin public.ecr.aws helm install --create-namespace -n $ACK_SYSTEM_NAMESPACE ack-$SERVICE-controller \ oci://public.ecr.aws/aws-controllers-k8s/$SERVICE-chart --version= $RELEASE_VERSION --set=aws.region=$AWS_REGION After a few moments, you should see a response similar to the following indicating success. You are now able to create Amazon Managed Service for Prometheus (AMP) resources! The controller is running in "cluster" mode. The controller is configured to manage AWS resources in region: "us-east-1" You can optionally verify that the AWS Controllers for Kubernetes controller has been successfully installed with the following command. Deploying a workspace 151 Amazon Managed Service for Prometheus User Guide helm list --namespace $ACK_SYSTEM_NAMESPACE -o yaml This will return information about the controller ack-prometheusservice-controller, including the status: deployed. 2. Create a file called workspace.yaml with the following text. This will be used as configuration for the workspace you are creating. apiVersion: prometheusservice.services.k8s.aws/v1alpha1 kind: Workspace metadata: name: my-amp-workspace spec: alias: my-amp-workspace tags: ClusterName: EKS-demo 3. Run the following command to create your workspace (this command depends on the system variables that you set up in step 1). kubectl apply -f workspace.yaml -n $ACK_SYSTEM_NAMESPACE Within a few moments, you should be able to see a new workspace, called my-amp- workspace in your account. Running the following command to view the details and status of your workspace including the workspace ID. Alternately, you can view the new workspace in the Amazon Managed Service for Prometheus console. kubectl describe workspace my-amp-workspace -n $ACK_SYSTEM_NAMESPACE Note You can also use an existing workspace rather than create a new one. 4. Create two new yaml files as configuration for the Rulegroups and AlertManager that you will create next using the following configuration. Deploying a workspace 152 Amazon Managed Service for Prometheus User Guide Save this configuration as rulegroup.yaml. Replace WORKSPACE-ID with the workspace ID from the previous step. apiVersion: prometheusservice.services.k8s.aws/v1alpha1 kind: RuleGroupsNamespace metadata: name: default-rule spec: workspaceID: WORKSPACE-ID name: default-rule configuration: | groups: - name: example rules: - alert: HostHighCpuLoad expr: 100 - (avg(rate(node_cpu_seconds_total{mode="idle"}[2m])) * 100) > 60 for: 5m labels: severity: warning event_type: scale_up annotations: summary: Host high CPU load (instance {{ $labels.instance }}) description: "CPU load is > 60%\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" - alert: HostLowCpuLoad expr: 100 - (avg(rate(node_cpu_seconds_total{mode="idle"}[2m])) * 100) < 30 for: 5m labels: severity: warning event_type: scale_down annotations: summary: Host low CPU load (instance {{ $labels.instance }}) description: "CPU load is < 30%\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" Save the following configuration as alertmanager.yaml. Replace WORKSPACE-ID with the workspace ID from the previous step. Replace TOPIC-ARN with the ARN for the Amazon SNS topic to send notifications to, and REGION with the AWS Region you are using. Remember that Amazon Managed Service for Prometheus must have permissions to the Amazon SNS topic. apiVersion: prometheusservice.services.k8s.aws/v1alpha1 Deploying a workspace 153 Amazon Managed Service for Prometheus User
amazon-managed-prometheus-user-guide-050
amazon-managed-prometheus-user-guide.pdf
50
30 for: 5m labels: severity: warning event_type: scale_down annotations: summary: Host low CPU load (instance {{ $labels.instance }}) description: "CPU load is < 30%\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" Save the following configuration as alertmanager.yaml. Replace WORKSPACE-ID with the workspace ID from the previous step. Replace TOPIC-ARN with the ARN for the Amazon SNS topic to send notifications to, and REGION with the AWS Region you are using. Remember that Amazon Managed Service for Prometheus must have permissions to the Amazon SNS topic. apiVersion: prometheusservice.services.k8s.aws/v1alpha1 Deploying a workspace 153 Amazon Managed Service for Prometheus User Guide kind: AlertManagerDefinition metadata: name: alert-manager spec: workspaceID: WORKSPACE-ID configuration: | alertmanager_config: | route: receiver: default_receiver receivers: - name: default_receiver sns_configs: - topic_arn: TOPIC-ARN sigv4: region: REGION message: | alert_type: {{ .CommonLabels.alertname }} event_type: {{ .CommonLabels.event_type }} Note To learn more about the formats of these configuration files, see RuleGroupsNamespaceData and AlertManagerDefinitionData. 5. Run the following commands to create your rule group and alert manager configuration (this command depends on the system variables that you set up in step 1). kubectl apply -f rulegroup.yaml -n $ACK_SYSTEM_NAMESPACE kubectl apply -f alertmanager.yaml -n $ACK_SYSTEM_NAMESPACE The changes will be available within a few moments. Note To update a resource, rather than create it, you simply update the yaml file, and run the kubectl apply command again. To delete a resource, run the following command. Replace ResourceType with the type of resource you want to delete Workspace, AlertManagerDefinition, or RuleGroupNamespace. Replace ResourceName with the name of the resource to delete. Deploying a workspace 154 Amazon Managed Service for Prometheus User Guide kubectl delete ResourceType ResourceName -n $ACK_SYSTEM_NAMESPACE That completes deploying the new workspace. The next section describes configuring your cluster to send metrics to that workspace. Configuring your Amazon EKS cluster to write to the Amazon Managed Service for Prometheus workspace This section describes how to use Helm to configure the Prometheus running in your Amazon EKS cluster to remote write metrics to the Amazon Managed Service for Prometheus workspace that you created in the previous section. For this procedure, you will need the name of the IAM role you have created to use for ingesting metrics. If you have not done this already, see Set up service roles for the ingestion of metrics from Amazon EKS clusters for more information and instructions. If you follow those instructions, the IAM role will be called amp-iamproxy-ingest-role. To configure your Amazon EKS cluster for remote write 1. Use the following command to get the prometheusEndpoint for your workspace. Replace WORKSPACE-ID with the workspace ID from the previous section. aws amp describe-workspace --workspace-id WORKSPACE-ID The prometheusEndpoint will be in the return results, and be formatted like this: https://aps-workspaces.us-west-2.amazonaws.com/workspaces/ws-a1b2c3d4-a123-b456- c789-ac1234567890/ Save this URL for use in the next few steps. 2. Create a new file with the following text and call it prometheus-config.yaml. Replace account with your account ID, workspaceURL/ with the URL you just found, and region with the appropriate AWS Region for your system. serviceAccounts: server: Configure cluster for remote write 155 Amazon Managed Service for Prometheus User Guide name: "amp-iamproxy-ingest-service-account" annotations: eks.amazonaws.com/role-arn: "arn:aws:iam::account:role/amp- iamproxy-ingest-role" server: remoteWrite: - url: workspaceURL/api/v1/remote_write sigv4: region: region queue_config: max_samples_per_send: 1000 max_shards: 200 capacity: 2500 3. Find the Prometheus chart and namespace names as well as the chart version with the following Helm command. helm ls --all-namespaces Based on the steps so far, the Prometheus chart and namespace should both be named prometheus, and the chart version may be 15.2.0 4. Run the following command, using the PrometheusChartName, PrometheusNamespace, and PrometheusChartVersion found in the previous step. helm upgrade PrometheusChartName prometheus-community/prometheus - n PrometheusNamespace -f prometheus-config.yaml --version PrometheusChartVersion After a few minutes, you'll see a message that the upgrade was successful. 5. Optionally, validate that metrics are succesfully being sent by querying the Amazon Managed Service for Prometheus endpoint via awscurl. Replace Region with the AWS Region that you are using, and workspaceURL/ with the URL you found in step 1. awscurl --service="aps" --region="Region" "workspaceURL/api/v1/query? query=node_cpu_seconds_total" You have now created an Amazon Managed Service for Prometheus workspace and connected to it from your Amazon EKS cluster, using YAML files as configuration. These files, called custom resource definitions (CRDs), live within your Amazon EKS cluster. You can use the AWS Controllers Configure cluster for remote write 156 Amazon Managed Service for Prometheus User Guide for Kubernetes controller to manage all of your Amazon Managed Service for Prometheus resources directly from the cluster. Integrating CloudWatch metrics with Amazon Managed Service for Prometheus It can help to have all your metrics in one place. Amazon Managed Service for Prometheus does not automatically ingest Amazon CloudWatch metrics. However, you can use Amazon Data Firehose and AWS Lambda to push CloudWatch metrics to Amazon Managed Service for Prometheus. This section describes how to instrument a Amazon CloudWatch
amazon-managed-prometheus-user-guide-051
amazon-managed-prometheus-user-guide.pdf
51
EKS cluster. You can use the AWS Controllers Configure cluster for remote write 156 Amazon Managed Service for Prometheus User Guide for Kubernetes controller to manage all of your Amazon Managed Service for Prometheus resources directly from the cluster. Integrating CloudWatch metrics with Amazon Managed Service for Prometheus It can help to have all your metrics in one place. Amazon Managed Service for Prometheus does not automatically ingest Amazon CloudWatch metrics. However, you can use Amazon Data Firehose and AWS Lambda to push CloudWatch metrics to Amazon Managed Service for Prometheus. This section describes how to instrument a Amazon CloudWatch metric stream and use Amazon Data Firehose and AWS Lambda to ingest metrics into Amazon Managed Service for Prometheus. You will set up a stack using AWS Cloud Development Kit (CDK) to create a Firehose Delivery Stream, a Lambda, and an Amazon S3 bucket to demonstrate a complete scenario. Infrastructure The first thing you must do is set up the infrastructure for this recipe. CloudWatch metric streams allow forwarding of the streaming metric data to an HTTP endpoint or Amazon S3 bucket. Setting up the infrastructure will consist of 4 steps: • Configuring prerequisites • Creating an Amazon Managed Service for Prometheus workspace • Installing dependencies • Deploying the stack Prerequisites • The AWS CLI is installed and configured in your environment. • The AWS CDK Typescript is installed in your environment. • Node.js and Go are installed in your environment. • The AWS observability CloudWatch metrics exporter github repository (CWMetricsStreamExporter) has been cloned to your local machine. Amazon CloudWatch metrics with Firehose 157 Amazon Managed Service for Prometheus User Guide To create a Amazon Managed Service for Prometheus workspace 1. The demo application in this recipe will be running on top of Amazon Managed Service for Prometheus. Create your Amazon Managed Service for Prometheus Workspace via the following command: aws amp create-workspace --alias prometheus-demo-recipe 2. Ensure your workspace has been created with the following command: aws amp list-workspaces For more information about Amazon Managed Service for Prometheus, see Amazon Managed Service for Prometheus User Guide. To install dependencies 1. Install dependencies From the root of the aws-o11y-recipes repository, change your directory to CWMetricStreamExporter using the command: cd sandbox/CWMetricStreamExporter This will now be considered the root of the repo, going forward. 2. Change directory to /cdk via the following command: cd cdk 3. Install the CDK dependencies via the following command: npm install 4. Change directory back to the root of the repo, and then change directory to /lambda using the following command: cd lambda 5. Once in the /lambda folder, install the Go dependencies using: Infrastructure 158 Amazon Managed Service for Prometheus User Guide go get All the dependencies are now installed. To deploy the stack 1. In the root of the repo, open config.yaml and modify the Amazon Managed Service for Prometheus workspace URL by replacing the {workspace} with the newly created workspace id, and the region your Amazon Managed Service for Prometheus workspace is in. For example, modify the following with: AMP: remote_write_url: "https://aps-workspaces.us-east-2.amazonaws.com/workspaces/ {workspaceId}/api/v1/remote_write" region: us-east-2 Change the names of the Firehose delivery stream and Amazon S3 bucket to your liking. 2. To build the AWS CDK and the Lambda code, in the root of the repo run the following commend: npm run build This build step ensures that the Go Lambda binary is built, and deploys the CDK to CloudFormation. 3. 4. To complete the deployment, review and accept the IAM changes that the stack requires. (Optional) You can very if that the stack has been created by running the following command. aws cloudformation list-stacks A stack named CDK Stack will be in the list. Creating a Amazon CloudWatch stream Now that you have a lambda function to handle the metrics, you can create the metrics stream from Amazon CloudWatch. Creating a Amazon CloudWatch stream 159 Amazon Managed Service for Prometheus User Guide To create an CloudWatch metrics stream 1. Navigate to the CloudWatch console, at https://console.aws.amazon.com/cloudwatch/ home#metric-streams:streamsList and select Create metric stream. 2. Select the metrics needed, either all metrics, or only from selected namespaces. 3. Under Configuration, choose Select an existing Firehose owned by your account. 4. You will be using the Firehose created earlier by the CDK. In the Select your Kinesis data Firehose stream drop down, select the stream created earlier. It will have a name like CdkStack-KinesisFirehoseStream123456AB-sample1234. 5. Change the output format to JSON. 6. Give the metric stream a name that is meaningful to you. 7. Choose Create metric stream. 8. (Optional) To verify the Lambda function invocation, navigate to the Lambda console and choose the function KinesisMessageHandler. Select the Monitor tab and Logs subtab, and under Recent Invocations there should be entries of the Lambda function being triggered. Note It may take up to 5 minutes before invocations
amazon-managed-prometheus-user-guide-052
amazon-managed-prometheus-user-guide.pdf
52
created earlier by the CDK. In the Select your Kinesis data Firehose stream drop down, select the stream created earlier. It will have a name like CdkStack-KinesisFirehoseStream123456AB-sample1234. 5. Change the output format to JSON. 6. Give the metric stream a name that is meaningful to you. 7. Choose Create metric stream. 8. (Optional) To verify the Lambda function invocation, navigate to the Lambda console and choose the function KinesisMessageHandler. Select the Monitor tab and Logs subtab, and under Recent Invocations there should be entries of the Lambda function being triggered. Note It may take up to 5 minutes before invocations begin to show in the Monitor tab. Your metrics are now being streamed from Amazon CloudWatch to Amazon Managed Service for Prometheus. Cleanup You may want to clean up the resources that were used in this example. The following procedure explains how to do so. This will stop the metrics stream that you created. To clean up resources 1. Start by deleting the CloudFormation stack with the following commands: cd cdk cdk destroy 2. Remove the Amazon Managed Service for Prometheus workspace: Cleanup 160 Amazon Managed Service for Prometheus User Guide aws amp delete-workspace --workspace-id \ `aws amp list-workspaces --alias prometheus-sample-app --query 'workspaces[0].workspaceId' --output text` 3. Finally, remove the Amazon CloudWatch metric stream using the Amazon CloudWatch console. Cleanup 161 Amazon Managed Service for Prometheus User Guide Security in Amazon Managed Service for Prometheus Cloud security at AWS is the highest priority. As an AWS customer, you benefit from data centers and network architectures that are built to meet the requirements of the most security-sensitive organizations. Security is a shared responsibility between AWS and you. The shared responsibility model describes this as security of the cloud and security in the cloud: • Security of the cloud – AWS is responsible for protecting the infrastructure that runs AWS services in the AWS Cloud. AWS also provides you with services that you can use securely. Third- party auditors regularly test and verify the effectiveness of our security as part of the AWS Compliance Programs. To learn about the compliance programs that apply to Amazon Managed Service for Prometheus, see AWS Services in Scope by Compliance Program. • Security in the cloud – Your responsibility is determined by the AWS service that you use. You are also responsible for other factors including the sensitivity of your data, your company’s requirements, and applicable laws and regulations. This documentation helps you understand how to apply the shared responsibility model when using Amazon Managed Service for Prometheus. The following topics show you how to configure Amazon Managed Service for Prometheus to meet your security and compliance objectives. You also learn how to use other AWS services that help you to monitor and secure your Amazon Managed Service for Prometheus resources. Topics • Data protection in Amazon Managed Service for Prometheus • Identity and Access Management for Amazon Managed Service for Prometheus • IAM permissions and policies • Compliance Validation for Amazon Managed Service for Prometheus • Resilience in Amazon Managed Service for Prometheus • Infrastructure Security in Amazon Managed Service for Prometheus • Using service-linked roles for Amazon Managed Service for Prometheus • Logging Amazon Managed Service for Prometheus API calls using AWS CloudTrail • Set up IAM roles for service accounts 162 Amazon Managed Service for Prometheus User Guide • Using Amazon Managed Service for Prometheus with interface VPC endpoints Data protection in Amazon Managed Service for Prometheus The AWS shared responsibility model applies to data protection in Amazon Managed Service for Prometheus. As described in this model, AWS is responsible for protecting the global infrastructure that runs all of the AWS Cloud. You are responsible for maintaining control over your content that is hosted on this infrastructure. You are also responsible for the security configuration and management tasks for the AWS services that you use. For more information about data privacy, see the Data Privacy FAQ. For information about data protection in Europe, see the AWS Shared Responsibility Model and GDPR blog post on the AWS Security Blog. For data protection purposes, we recommend that you protect AWS account credentials and set up individual users with AWS IAM Identity Center or AWS Identity and Access Management (IAM). That way, each user is given only the permissions necessary to fulfill their job duties. We also recommend that you secure your data in the following ways: • Use multi-factor authentication (MFA) with each account. • Use SSL/TLS to communicate with AWS resources. We require TLS 1.2 and recommend TLS 1.3. • Set up API and user activity logging with AWS CloudTrail. For information about using CloudTrail trails to capture AWS activities, see Working with CloudTrail trails in the AWS CloudTrail User Guide. • Use AWS encryption solutions, along with all default security controls within AWS services.
amazon-managed-prometheus-user-guide-053
amazon-managed-prometheus-user-guide.pdf
53
Access Management (IAM). That way, each user is given only the permissions necessary to fulfill their job duties. We also recommend that you secure your data in the following ways: • Use multi-factor authentication (MFA) with each account. • Use SSL/TLS to communicate with AWS resources. We require TLS 1.2 and recommend TLS 1.3. • Set up API and user activity logging with AWS CloudTrail. For information about using CloudTrail trails to capture AWS activities, see Working with CloudTrail trails in the AWS CloudTrail User Guide. • Use AWS encryption solutions, along with all default security controls within AWS services. • Use advanced managed security services such as Amazon Macie, which assists in discovering and securing sensitive data that is stored in Amazon S3. • If you require FIPS 140-3 validated cryptographic modules when accessing AWS through a command line interface or an API, use a FIPS endpoint. For more information about the available FIPS endpoints, see Federal Information Processing Standard (FIPS) 140-3. We strongly recommend that you never put confidential or sensitive information, such as your customers' email addresses, into tags or free-form text fields such as a Name field. This includes when you work with Amazon Managed Service for Prometheus or other AWS services using the console, API, AWS CLI, or AWS SDKs. Any data that you enter into tags or free-form text fields used for names may be used for billing or diagnostic logs. If you provide a URL to an external server, we strongly recommend that you do not include credentials information in the URL to validate your request to that server. Data protection 163 Amazon Managed Service for Prometheus User Guide Topics • Data collected by Amazon Managed Service for Prometheus • Encryption at rest Data collected by Amazon Managed Service for Prometheus Amazon Managed Service for Prometheus collects and stores operational metrics that you configure to be sent from Prometheus servers running in your account to Amazon Managed Service for Prometheus. This data includes the following: • Metric values • Metric labels (or arbitrary key-value pairs) that help identify and classify data • Timestamps for data samples Unique tenant IDs isolate data from different customers. These IDs limit what customer data is accessible. Customers can't change tenant IDs. Amazon Managed Service for Prometheus encrypts the data that it stores with AWS Key Management Service (AWS KMS) keys. Amazon Managed Service for Prometheus manages these keys. Note Amazon Managed Service for Prometheus supports the creation of customer managed keys for encrypting your data. For more information about the keys that Amazon Managed Service for Prometheus uses by default, and how to use your own customer managed keys, see Encryption at rest. Data in transit is encrypted with HTTPS automatically. Amazon Managed Service for Prometheus secures connections between Availability Zones within an AWS Region using HTTPS internally. Encryption at rest By default, Amazon Managed Service for Prometheus automatically provides you with encryption at rest and does this using AWS owned encryption keys. Data collected by Amazon Managed Service for Prometheus 164 Amazon Managed Service for Prometheus User Guide • AWS owned keys – Amazon Managed Service for Prometheus uses these keys to automatically encrypt data uploaded to your workspace. You can't view, manage or use AWS owned keys, or audit their use. However, you don't have to take any action or change any programs to protect the keys that encrypt your data. For more information, see AWS owned keys in the AWS Key Management Service Developer Guide. Encryption of data at rest helps reduce the operational overhead and complexity that goes into protecting sensitive customer data, such as personally identifiable information. It allows you to build secure applications that meet strict encryption compliance and regulatory requirements. You can alternatively choose to use a customer managed key when you create your workspace: • Customer managed keys – Amazon Managed Service for Prometheus supports the use of a symmetric customer managed key that you create, own, and manage to encrypt the data in your workspace. Because you have full control of this encryption, you can perform such tasks as: • Establishing and maintaining key policies • Establishing and maintaining IAM policies and grants • Enabling and disabling key policies • Rotating key cryptographic material • Adding tags • Creating key aliases • Scheduling keys for deletion For more information, see customer managed keys in the AWS Key Management Service Developer Guide. Choose whether to use customer managed keys or AWS owned keys carefully. Workspaces created with customer managed keys can't be converted to use AWS owned keys later (and vice versa). Note Amazon Managed Service for Prometheus automatically enables encryption at rest using AWS owned keys to protect your data at no charge. However, AWS KMS charges apply for using a customer managed key. For more information about
amazon-managed-prometheus-user-guide-054
amazon-managed-prometheus-user-guide.pdf
54
policies • Rotating key cryptographic material • Adding tags • Creating key aliases • Scheduling keys for deletion For more information, see customer managed keys in the AWS Key Management Service Developer Guide. Choose whether to use customer managed keys or AWS owned keys carefully. Workspaces created with customer managed keys can't be converted to use AWS owned keys later (and vice versa). Note Amazon Managed Service for Prometheus automatically enables encryption at rest using AWS owned keys to protect your data at no charge. However, AWS KMS charges apply for using a customer managed key. For more information about pricing, see AWS Key Management Service pricing. Encryption at rest 165 Amazon Managed Service for Prometheus User Guide For more information on AWS KMS, see What is AWS Key Management Service? Note Workspaces created with customer managed keys cannot use AWS managed collectors for ingestion. How Amazon Managed Service for Prometheus uses grants in AWS KMS Amazon Managed Service for Prometheus requires three grants to use your customer managed key. When you create an Amazon Managed Service for Prometheus workspace encrypted with a customer managed key, Amazon Managed Service for Prometheus creates the three grants on your behalf by sending CreateGrant requests to AWS KMS. Grants in AWS KMS are used to give Amazon Managed Service for Prometheus access to the KMS key in your account, even when not called directly on your behalf (for example, when storing metrics data that has been scraped from an Amazon EKS cluster. Amazon Managed Service for Prometheus requires the grants to use your customer managed key for the following internal operations: • Send DescribeKey requests to AWS KMS to verify that the symmetric customer managed KMS key given when creating a workspace is valid. • Send GenerateDataKey requests to AWS KMS to generate data keys encrypted by your customer managed key. • Send Decrypt requests to AWS KMS to decrypt the encrypted data keys so that they can be used to encrypt your data. Amazon Managed Service for Prometheus creates three grants to the AWS KMS key that allow Amazon Managed Service for Prometheus to use the key on your behalf. You can remove access to the key by changing the key policy, by disabling the key, or by revoking the grant. You should understand the consequences of these actions before performing them. This can cause data loss in your workspace. If you remove access to any of the grants in any way, Amazon Managed Service for Prometheus won't be able to access any of the data encrypted by the customer managed key, nor store new Encryption at rest 166 Amazon Managed Service for Prometheus User Guide data sent to the workspace, which affects operations that are dependent on that data. New data sent to the workspace will not be accessible and may be permanently lost. Warning • If you disable the key, or remove Amazon Managed Service for Prometheus access in the key policy, the workspace data is no longer accessible. New data being sent to the workspace will not be accessible and may be permanently lost. You can get access to the workspace data and start receiving new data again by restoring Amazon Managed Service for Prometheus access to the key. • If you revoke a grant, it can't be recreated, and the data in the workspace is lost permanently. Step 1: Create a customer managed key You can create a symmetric customer managed key by using the AWS Management Console, or the AWS KMS APIs. The key does not need to be in the same account as the Amazon Managed Service for Prometheus workspace, as long as you provide the correct access through policy, as described below. To create a symmetric customer managed key Follow the steps for Creating symmetric customer managed key in the AWS Key Management Service Developer Guide. Key policy Key policies control access to your customer managed key. Every customer managed key must have exactly one key policy, which contains statements that determine who can use the key and how they can use it. When you create your customer managed key, you can specify a key policy. For more information, see Managing access to customer managed keys in the AWS Key Management Service Developer Guide. To use your customer managed key with your Amazon Managed Service for Prometheus workspaces, the following API operations must be permitted in the key policy: • kms:CreateGrant – Adds a grant to a customer managed key. Grants control access to a specified KMS key, which allows access to grant operations Amazon Managed Service for Encryption at rest 167 Amazon Managed Service for Prometheus User Guide Prometheus requires. For more information, see Using Grants in the AWS Key Management Service Developer Guide. This allows Amazon Managed Service for Prometheus to do the
amazon-managed-prometheus-user-guide-055
amazon-managed-prometheus-user-guide.pdf
55
keys in the AWS Key Management Service Developer Guide. To use your customer managed key with your Amazon Managed Service for Prometheus workspaces, the following API operations must be permitted in the key policy: • kms:CreateGrant – Adds a grant to a customer managed key. Grants control access to a specified KMS key, which allows access to grant operations Amazon Managed Service for Encryption at rest 167 Amazon Managed Service for Prometheus User Guide Prometheus requires. For more information, see Using Grants in the AWS Key Management Service Developer Guide. This allows Amazon Managed Service for Prometheus to do the following: • Call GenerateDataKey to generate an encrypted data key and store it, because the data key isn't immediately used to encrypt. • Call Decrypt to use the stored encrypted data key to access encrypted data. • kms:DescribeKey – Provides the customer managed key details to allow Amazon Managed Service for Prometheus to validate the key. The following are policy statement examples you can add for Amazon Managed Service for Prometheus: "Statement" : [ { "Sid" : "Allow access to Amazon Managed Service for Prometheus principal within your account", "Effect" : "Allow", "Principal" : { "AWS" : "*" }, "Action" : [ "kms:DescribeKey", "kms:CreateGrant", "kms:GenerateDataKey", "kms:Decrypt" ], "Resource" : "*", "Condition" : { "StringEquals" : { "kms:ViaService" : "aps.region.amazonaws.com", "kms:CallerAccount" : "111122223333" } }, { "Sid": "Allow access for key administrators - not required for Amazon Managed Service for Prometheus", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111122223333:root" }, Encryption at rest 168 Amazon Managed Service for Prometheus User Guide "Action" : [ "kms:*" ], "Resource": "arn:aws:kms:region:111122223333:key/key_ID" }, <other statements needed for other non-Amazon Managed Service for Prometheus scenarios> ] • For more information about specifying permissions in a policy, see the AWS Key Management Service Developer Guide. • For more information about troubleshooting key access, see the AWS Key Management Service Developer Guide. Step 2: Specifying a customer managed key for Amazon Managed Service for Prometheus When you create a workspace, you can specify the customer managed key by entering a KMS Key ARN, which Amazon Managed Service for Prometheus uses to encrypt the data stored by the workspace. Step 3: Accessing data from other services, such as Amazon Managed Grafana This step is optional — it is only required if you need to access your Amazon Managed Service for Prometheus data from another service. Your encrypted data is not accessible from other services, unless they also have access to use the AWS KMS key. For example, if you want to use Amazon Managed Grafana to create a dashboard or alert on your data, you must give Amazon Managed Grafana access to the key. To give Amazon Managed Grafana access to your customer managed key 1. In your Amazon Managed Grafana workspaces list, select the name for the workspace that you want to have access to Amazon Managed Service for Prometheus. This shows you summary information about your Amazon Managed Grafana workspace. 2. Note the name of the IAM role used by your workspace. The name is in the format AmazonGrafanaServiceRole-<unique-id>. The console shows you the full ARN for the role. You will specify this name in the AWS KMS console in a later step. Encryption at rest 169 Amazon Managed Service for Prometheus User Guide 3. In your AWS KMS Customer managed keys list, choose the customer managed key you used during creation of your Amazon Managed Service for Prometheus workspace. This opens the key configuration details page. 4. Next to Key users, select the Add button. 5. From the list of names, choose the Amazon Managed Grafana IAM role that you noted above. To make it easier to find, you can search by the name, as well. 6. Choose Add to add the IAM role to the list of Key users. Your Amazon Managed Grafana workspace can now access the data in your Amazon Managed Service for Prometheus workspace. You can add other users or roles to the key users to enable other services to access your workspace. Amazon Managed Service for Prometheus encryption context An encryption context is an optional set of key-value pairs that contain additional contextual information about the data. AWS KMS uses the encryption context as additional authenticated data to support authenticated encryption. When you include an encryption context in a request to encrypt data, AWS KMS binds the encryption context to the encrypted data. To decrypt data, you include the same encryption context in the request. Amazon Managed Service for Prometheus encryption context Amazon Managed Service for Prometheus uses the same encryption context in all AWS KMS cryptographic operations, where the key is aws:amp:arn and the value is the Amazon Resource Name (ARN) of the workspace. Example "encryptionContext": { "aws:aps:arn": "arn:aws:aps:us-west-2:111122223333:workspace/ws-sample-1234- abcd-56ef-7890abcd12ef" } Using encryption context for monitoring When you use a symmetric customer
amazon-managed-prometheus-user-guide-056
amazon-managed-prometheus-user-guide.pdf
56
as additional authenticated data to support authenticated encryption. When you include an encryption context in a request to encrypt data, AWS KMS binds the encryption context to the encrypted data. To decrypt data, you include the same encryption context in the request. Amazon Managed Service for Prometheus encryption context Amazon Managed Service for Prometheus uses the same encryption context in all AWS KMS cryptographic operations, where the key is aws:amp:arn and the value is the Amazon Resource Name (ARN) of the workspace. Example "encryptionContext": { "aws:aps:arn": "arn:aws:aps:us-west-2:111122223333:workspace/ws-sample-1234- abcd-56ef-7890abcd12ef" } Using encryption context for monitoring When you use a symmetric customer managed key to encrypt your workspace data, you can also use the encryption context in audit records and logs to identify how the customer managed key is Encryption at rest 170 Amazon Managed Service for Prometheus User Guide being used. The encryption context also appears in logs generated by AWS CloudTrail or Amazon CloudWatch Logs. Using encryption context to control access to your customer managed key You can use the encryption context in key policies and IAM policies as conditions to control access to your symmetric customer managed key. You can also use encryption context constraints in a grant. Amazon Managed Service for Prometheus uses an encryption context constraint in grants to control access to the customer managed key in your account or region. The grant constraint requires that the operations that the grant allows use the specified encryption context. Example The following are example key policy statements to give access to a customer managed key for a specific encryption context. The condition in this policy statement requires that the grants have an encryption context constraint that specifies the encryption context. { "Sid": "Enable DescribeKey", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111122223333:role/ExampleReadOnlyRole" }, "Action": "kms:DescribeKey", "Resource": "*" }, { "Sid": "Enable CreateGrant", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111122223333:role/ExampleReadOnlyRole" }, "Action": "kms:CreateGrant", "Resource": "*", "Condition": { "StringEquals": { "kms:EncryptionContext:aws:aps:arn": "arn:aws:aps:us- west-2:111122223333:workspace/ws-sample-1234-abcd-56ef-7890abcd12ef" } } Encryption at rest 171 Amazon Managed Service for Prometheus User Guide } Monitoring your encryption keys for Amazon Managed Service for Prometheus When you use an AWS KMS customer managed key with your Amazon Managed Service for Prometheus workspaces, you can use AWS CloudTrail or Amazon CloudWatch Logs to track requests that Amazon Managed Service for Prometheus sends to AWS KMS. The following examples are AWS CloudTrail events for CreateGrant, GenerateDataKey, Decrypt, and DescribeKey to monitor KMS operations called by Amazon Managed Service for Prometheus to access data encrypted by your customer managed key: CreateGrant When you use an AWS KMS customer managed key to encrypt your workspace, Amazon Managed Service for Prometheus sends three CreateGrant requests on your behalf to access the KMS key you specified. The grants that Amazon Managed Service for Prometheus creates are specific to the resource associated with the AWS KMS customer managed key. The following example event records a CreateGrant operation: { "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "TESTANDEXAMPLE:Sampleuser01", "arn": "arn:aws:sts::111122223333:assumed-role/Admin/Sampleuser01", "accountId": "111122223333", "accessKeyId": "EXAMPLE-KEY-ID1", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "TESTANDEXAMPLE:Sampleuser01", "arn": "arn:aws:sts::111122223333:assumed-role/Admin/Sampleuser01", "accountId": "111122223333", "userName": "Admin" }, "webIdFederationData": {}, "attributes": { "mfaAuthenticated": "false", "creationDate": "2021-04-22T17:02:00Z" } Encryption at rest 172 Amazon Managed Service for Prometheus User Guide }, "invokedBy": "aps.amazonaws.com" }, "eventTime": "2021-04-22T17:07:02Z", "eventSource": "kms.amazonaws.com", "eventName": "CreateGrant", "awsRegion": "us-west-2", "sourceIPAddress": "172.12.34.56", "userAgent": "ExampleDesktop/1.0 (V1; OS)", "requestParameters": { "retiringPrincipal": "aps.region.amazonaws.com", "operations": [ "GenerateDataKey", "Decrypt", "DescribeKey" ], "keyId": "arn:aws:kms:us- west-2:111122223333:key/1234abcd-12ab-34cd-56ef-123456SAMPLE", "granteePrincipal": "aps.region.amazonaws.com" }, "responseElements": { "grantId": "0ab0ac0d0b000f00ea00cc0a0e00fc00bce000c000f0000000c0bc0a0000aaafSAMPLE" }, "requestID": "ff000af-00eb-00ce-0e00-ea000fb0fba0SAMPLE", "eventID": "ff000af-00eb-00ce-0e00-ea000fb0fba0SAMPLE", "readOnly": false, "resources": [ { "accountId": "111122223333", "type": "AWS::KMS::Key", "ARN": "arn:aws:kms:us- west-2:111122223333:key/1234abcd-12ab-34cd-56ef-123456SAMPLE" } ], "eventType": "AwsApiCall", "managementEvent": true, "eventCategory": "Management", "recipientAccountId": "111122223333" } Encryption at rest 173 Amazon Managed Service for Prometheus GenerateDataKey User Guide When you enable an AWS KMS customer managed key for your workspace, Amazon Managed Service for Prometheus creates a unique key. It sends a GenerateDataKey request to AWS KMS that specifies the AWS KMScustomer managed key for the resource. The following example event records the GenerateDataKey operation: { "eventVersion": "1.08", "userIdentity": { "type": "AWSService", "invokedBy": "aps.amazonaws.com" }, "eventTime": "2021-04-22T17:07:02Z", "eventSource": "kms.amazonaws.com", "eventName": "GenerateDataKey", "awsRegion": "us-west-2", "sourceIPAddress": "172.12.34.56", "userAgent": "ExampleDesktop/1.0 (V1; OS)", "requestParameters": { "encryptionContext": { "aws:aps:arn": "arn:aws:aps:us-west-2:111122223333:workspace/ws- sample-1234-abcd-56ef-7890abcd12ef" }, "keySpec": "AES_256", "keyId": "arn:aws:kms:us- west-2:111122223333:key/1234abcd-12ab-34cd-56ef-123456SAMPLE" }, "responseElements": null, "requestID": "ff000af-00eb-00ce-0e00-ea000fb0fba0SAMPLE", "eventID": "ff000af-00eb-00ce-0e00-ea000fb0fba0SAMPLE", "readOnly": true, "resources": [ { "accountId": "111122223333", "type": "AWS::KMS::Key", "ARN": "arn:aws:kms:us- west-2:111122223333:key/1234abcd-12ab-34cd-56ef-123456SAMPLE" } ], "eventType": "AwsApiCall", "managementEvent": true, Encryption at rest 174 Amazon Managed Service for Prometheus User Guide "eventCategory": "Management", "recipientAccountId": "111122223333", "sharedEventID": "57f5dbee-16da-413e-979f-2c4c6663475e" } Decrypt When a query is generated on an encrypted workspace, Amazon Managed Service for Prometheus calls the Decrypt operation to use the stored encrypted data key to access the encrypted data. The following example event records the Decrypt operation: { "eventVersion": "1.08", "userIdentity": { "type": "AWSService", "invokedBy": "aps.amazonaws.com" }, "eventTime": "2021-04-22T17:10:51Z", "eventSource": "kms.amazonaws.com", "eventName": "Decrypt", "awsRegion": "us-west-2", "sourceIPAddress": "172.12.34.56", "userAgent": "ExampleDesktop/1.0 (V1; OS)", "requestParameters": { "encryptionContext": {
amazon-managed-prometheus-user-guide-057
amazon-managed-prometheus-user-guide.pdf
57
[ { "accountId": "111122223333", "type": "AWS::KMS::Key", "ARN": "arn:aws:kms:us- west-2:111122223333:key/1234abcd-12ab-34cd-56ef-123456SAMPLE" } ], "eventType": "AwsApiCall", "managementEvent": true, Encryption at rest 174 Amazon Managed Service for Prometheus User Guide "eventCategory": "Management", "recipientAccountId": "111122223333", "sharedEventID": "57f5dbee-16da-413e-979f-2c4c6663475e" } Decrypt When a query is generated on an encrypted workspace, Amazon Managed Service for Prometheus calls the Decrypt operation to use the stored encrypted data key to access the encrypted data. The following example event records the Decrypt operation: { "eventVersion": "1.08", "userIdentity": { "type": "AWSService", "invokedBy": "aps.amazonaws.com" }, "eventTime": "2021-04-22T17:10:51Z", "eventSource": "kms.amazonaws.com", "eventName": "Decrypt", "awsRegion": "us-west-2", "sourceIPAddress": "172.12.34.56", "userAgent": "ExampleDesktop/1.0 (V1; OS)", "requestParameters": { "encryptionContext": { "aws:aps:arn": "arn:aws:aps:us-west-2:111122223333:workspace/ws- sample-1234-abcd-56ef-7890abcd12ef" }, "keyId": "arn:aws:kms:us- west-2:111122223333:key/1234abcd-12ab-34cd-56ef-123456SAMPLE", "encryptionAlgorithm": "SYMMETRIC_DEFAULT" }, "responseElements": null, "requestID": "ff000af-00eb-00ce-0e00-ea000fb0fba0SAMPLE", "eventID": "ff000af-00eb-00ce-0e00-ea000fb0fba0SAMPLE", "readOnly": true, "resources": [ { "accountId": "111122223333", "type": "AWS::KMS::Key", Encryption at rest 175 Amazon Managed Service for Prometheus User Guide "ARN": "arn:aws:kms:us- west-2:111122223333:key/1234abcd-12ab-34cd-56ef-123456SAMPLE" } ], "eventType": "AwsApiCall", "managementEvent": true, "eventCategory": "Management", "recipientAccountId": "111122223333", "sharedEventID": "dc129381-1d94-49bd-b522-f56a3482d088" } DescribeKey Amazon Managed Service for Prometheus uses the DescribeKey operation to verify if the AWS KMS customer managed key associated with your workspace exists in the account and region. The following example event records the DescribeKey operation: { "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "TESTANDEXAMPLE:Sampleuser01", "arn": "arn:aws:sts::111122223333:assumed-role/Admin/Sampleuser01", "accountId": "111122223333", "accessKeyId": "EXAMPLE-KEY-ID1", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "TESTANDEXAMPLE:Sampleuser01", "arn": "arn:aws:sts::111122223333:assumed-role/Admin/Sampleuser01", "accountId": "111122223333", "userName": "Admin" }, "webIdFederationData": {}, "attributes": { "mfaAuthenticated": "false", "creationDate": "2021-04-22T17:02:00Z" } }, "invokedBy": "aps.amazonaws.com" }, Encryption at rest 176 Amazon Managed Service for Prometheus User Guide "eventTime": "2021-04-22T17:07:02Z", "eventSource": "kms.amazonaws.com", "eventName": "DescribeKey", "awsRegion": "us-west-2", "sourceIPAddress": "172.12.34.56", "userAgent": "ExampleDesktop/1.0 (V1; OS)", "requestParameters": { "keyId": "00dd0db0-0000-0000-ac00-b0c000SAMPLE" }, "responseElements": null, "requestID": "ff000af-00eb-00ce-0e00-ea000fb0fba0SAMPLE", "eventID": "ff000af-00eb-00ce-0e00-ea000fb0fba0SAMPLE", "readOnly": true, "resources": [ { "accountId": "111122223333", "type": "AWS::KMS::Key", "ARN": "arn:aws:kms:us- west-2:111122223333:key/1234abcd-12ab-34cd-56ef-123456SAMPLE" } ], "eventType": "AwsApiCall", "managementEvent": true, "eventCategory": "Management", "recipientAccountId": "111122223333" } Learn more The following resources provide more information about data encryption at rest. • For more information about AWS Key Management Service basic concepts, see the AWS Key Management Service Developer Guide. • For more information about Security best practices for AWS Key Management Service, see the AWS Key Management Service Developer Guide. Identity and Access Management for Amazon Managed Service for Prometheus Identity and Access Management 177 Amazon Managed Service for Prometheus User Guide AWS Identity and Access Management (IAM) is an AWS service that helps an administrator securely control access to AWS resources. IAM administrators control who can be authenticated (signed in) and authorized (have permissions) to use Amazon Managed Service for Prometheus resources. IAM is an AWS service that you can use with no additional charge. Topics • Audience • Authenticating with identities • Managing access using policies • How Amazon Managed Service for Prometheus works with IAM • Identity-based policy examples for Amazon Managed Service for Prometheus • AWS managed policies for Amazon Managed Service for Prometheus • Troubleshooting Amazon Managed Service for Prometheus identity and access Audience How you use AWS Identity and Access Management (IAM) differs, depending on the work that you do in Amazon Managed Service for Prometheus. Service user – If you use the Amazon Managed Service for Prometheus service to do your job, then your administrator provides you with the credentials and permissions that you need. As you use more Amazon Managed Service for Prometheus features to do your work, you might need additional permissions. Understanding how access is managed can help you request the right permissions from your administrator. If you cannot access a feature in Amazon Managed Service for Prometheus, see Troubleshooting Amazon Managed Service for Prometheus identity and access. Service administrator – If you're in charge of Amazon Managed Service for Prometheus resources at your company, you probably have full access to Amazon Managed Service for Prometheus. It's your job to determine which Amazon Managed Service for Prometheus features and resources your service users should access. You must then submit requests to your IAM administrator to change the permissions of your service users. Review the information on this page to understand the basic concepts of IAM. To learn more about how your company can use IAM with Amazon Managed Service for Prometheus, see How Amazon Managed Service for Prometheus works with IAM. IAM administrator – If you're an IAM administrator, you might want to learn details about how you can write policies to manage access to Amazon Managed Service for Prometheus. To view example Audience 178 Amazon Managed Service for Prometheus User Guide Amazon Managed Service for Prometheus identity-based policies that you can use in IAM, see Identity-based policy examples for Amazon Managed Service for Prometheus. Authenticating with identities Authentication is how you sign in to AWS using your identity credentials. You must be authenticated (signed in to AWS) as the AWS account root user, as an IAM user, or by assuming an IAM role. You can sign in to AWS as a federated identity by using
amazon-managed-prometheus-user-guide-058
amazon-managed-prometheus-user-guide.pdf
58
how you can write policies to manage access to Amazon Managed Service for Prometheus. To view example Audience 178 Amazon Managed Service for Prometheus User Guide Amazon Managed Service for Prometheus identity-based policies that you can use in IAM, see Identity-based policy examples for Amazon Managed Service for Prometheus. Authenticating with identities Authentication is how you sign in to AWS using your identity credentials. You must be authenticated (signed in to AWS) as the AWS account root user, as an IAM user, or by assuming an IAM role. You can sign in to AWS as a federated identity by using credentials provided through an identity source. AWS IAM Identity Center (IAM Identity Center) users, your company's single sign-on authentication, and your Google or Facebook credentials are examples of federated identities. When you sign in as a federated identity, your administrator previously set up identity federation using IAM roles. When you access AWS by using federation, you are indirectly assuming a role. Depending on the type of user you are, you can sign in to the AWS Management Console or the AWS access portal. For more information about signing in to AWS, see How to sign in to your AWS account in the AWS Sign-In User Guide. If you access AWS programmatically, AWS provides a software development kit (SDK) and a command line interface (CLI) to cryptographically sign your requests by using your credentials. If you don't use AWS tools, you must sign requests yourself. For more information about using the recommended method to sign requests yourself, see AWS Signature Version 4 for API requests in the IAM User Guide. Regardless of the authentication method that you use, you might be required to provide additional security information. For example, AWS recommends that you use multi-factor authentication (MFA) to increase the security of your account. To learn more, see Multi-factor authentication in the AWS IAM Identity Center User Guide and AWS Multi-factor authentication in IAM in the IAM User Guide. AWS account root user When you create an AWS account, you begin with one sign-in identity that has complete access to all AWS services and resources in the account. This identity is called the AWS account root user and is accessed by signing in with the email address and password that you used to create the account. We strongly recommend that you don't use the root user for your everyday tasks. Safeguard your root user credentials and use them to perform the tasks that only the root user can perform. For the complete list of tasks that require you to sign in as the root user, see Tasks that require root user credentials in the IAM User Guide. Authenticating with identities 179 Amazon Managed Service for Prometheus Federated identity User Guide As a best practice, require human users, including users that require administrator access, to use federation with an identity provider to access AWS services by using temporary credentials. A federated identity is a user from your enterprise user directory, a web identity provider, the AWS Directory Service, the Identity Center directory, or any user that accesses AWS services by using credentials provided through an identity source. When federated identities access AWS accounts, they assume roles, and the roles provide temporary credentials. For centralized access management, we recommend that you use AWS IAM Identity Center. You can create users and groups in IAM Identity Center, or you can connect and synchronize to a set of users and groups in your own identity source for use across all your AWS accounts and applications. For information about IAM Identity Center, see What is IAM Identity Center? in the AWS IAM Identity Center User Guide. IAM users and groups An IAM user is an identity within your AWS account that has specific permissions for a single person or application. Where possible, we recommend relying on temporary credentials instead of creating IAM users who have long-term credentials such as passwords and access keys. However, if you have specific use cases that require long-term credentials with IAM users, we recommend that you rotate access keys. For more information, see Rotate access keys regularly for use cases that require long- term credentials in the IAM User Guide. An IAM group is an identity that specifies a collection of IAM users. You can't sign in as a group. You can use groups to specify permissions for multiple users at a time. Groups make permissions easier to manage for large sets of users. For example, you could have a group named IAMAdmins and give that group permissions to administer IAM resources. Users are different from roles. A user is uniquely associated with one person or application, but a role is intended to be assumable by anyone who needs it. Users have permanent long-term credentials, but roles provide temporary credentials. To
amazon-managed-prometheus-user-guide-059
amazon-managed-prometheus-user-guide.pdf
59
IAM group is an identity that specifies a collection of IAM users. You can't sign in as a group. You can use groups to specify permissions for multiple users at a time. Groups make permissions easier to manage for large sets of users. For example, you could have a group named IAMAdmins and give that group permissions to administer IAM resources. Users are different from roles. A user is uniquely associated with one person or application, but a role is intended to be assumable by anyone who needs it. Users have permanent long-term credentials, but roles provide temporary credentials. To learn more, see Use cases for IAM users in the IAM User Guide. IAM roles An IAM role is an identity within your AWS account that has specific permissions. It is similar to an IAM user, but is not associated with a specific person. To temporarily assume an IAM role in the AWS Management Console, you can switch from a user to an IAM role (console). You can assume a Authenticating with identities 180 Amazon Managed Service for Prometheus User Guide role by calling an AWS CLI or AWS API operation or by using a custom URL. For more information about methods for using roles, see Methods to assume a role in the IAM User Guide. IAM roles with temporary credentials are useful in the following situations: • Federated user access – To assign permissions to a federated identity, you create a role and define permissions for the role. When a federated identity authenticates, the identity is associated with the role and is granted the permissions that are defined by the role. For information about roles for federation, see Create a role for a third-party identity provider (federation) in the IAM User Guide. If you use IAM Identity Center, you configure a permission set. To control what your identities can access after they authenticate, IAM Identity Center correlates the permission set to a role in IAM. For information about permissions sets, see Permission sets in the AWS IAM Identity Center User Guide. • Temporary IAM user permissions – An IAM user or role can assume an IAM role to temporarily take on different permissions for a specific task. • Cross-account access – You can use an IAM role to allow someone (a trusted principal) in a different account to access resources in your account. Roles are the primary way to grant cross- account access. However, with some AWS services, you can attach a policy directly to a resource (instead of using a role as a proxy). To learn the difference between roles and resource-based policies for cross-account access, see Cross account resource access in IAM in the IAM User Guide. • Cross-service access – Some AWS services use features in other AWS services. For example, when you make a call in a service, it's common for that service to run applications in Amazon EC2 or store objects in Amazon S3. A service might do this using the calling principal's permissions, using a service role, or using a service-linked role. • Forward access sessions (FAS) – When you use an IAM user or role to perform actions in AWS, you are considered a principal. When you use some services, you might perform an action that then initiates another action in a different service. FAS uses the permissions of the principal calling an AWS service, combined with the requesting AWS service to make requests to downstream services. FAS requests are only made when a service receives a request that requires interactions with other AWS services or resources to complete. In this case, you must have permissions to perform both actions. For policy details when making FAS requests, see Forward access sessions. • Service role – A service role is an IAM role that a service assumes to perform actions on your behalf. An IAM administrator can create, modify, and delete a service role from within IAM. For more information, see Create a role to delegate permissions to an AWS service in the IAM User Guide. Authenticating with identities 181 Amazon Managed Service for Prometheus User Guide • Service-linked role – A service-linked role is a type of service role that is linked to an AWS service. The service can assume the role to perform an action on your behalf. Service-linked roles appear in your AWS account and are owned by the service. An IAM administrator can view, but not edit the permissions for service-linked roles. • Applications running on Amazon EC2 – You can use an IAM role to manage temporary credentials for applications that are running on an EC2 instance and making AWS CLI or AWS API requests. This is preferable to storing access keys within the EC2 instance. To assign an AWS role to an EC2 instance and make it
amazon-managed-prometheus-user-guide-060
amazon-managed-prometheus-user-guide.pdf
60
to an AWS service. The service can assume the role to perform an action on your behalf. Service-linked roles appear in your AWS account and are owned by the service. An IAM administrator can view, but not edit the permissions for service-linked roles. • Applications running on Amazon EC2 – You can use an IAM role to manage temporary credentials for applications that are running on an EC2 instance and making AWS CLI or AWS API requests. This is preferable to storing access keys within the EC2 instance. To assign an AWS role to an EC2 instance and make it available to all of its applications, you create an instance profile that is attached to the instance. An instance profile contains the role and enables programs that are running on the EC2 instance to get temporary credentials. For more information, see Use an IAM role to grant permissions to applications running on Amazon EC2 instances in the IAM User Guide. Managing access using policies You control access in AWS by creating policies and attaching them to AWS identities or resources. A policy is an object in AWS that, when associated with an identity or resource, defines their permissions. AWS evaluates these policies when a principal (user, root user, or role session) makes a request. Permissions in the policies determine whether the request is allowed or denied. Most policies are stored in AWS as JSON documents. For more information about the structure and contents of JSON policy documents, see Overview of JSON policies in the IAM User Guide. Administrators can use AWS JSON policies to specify who has access to what. That is, which principal can perform actions on what resources, and under what conditions. By default, users and roles have no permissions. To grant users permission to perform actions on the resources that they need, an IAM administrator can create IAM policies. The administrator can then add the IAM policies to roles, and users can assume the roles. IAM policies define permissions for an action regardless of the method that you use to perform the operation. For example, suppose that you have a policy that allows the iam:GetRole action. A user with that policy can get role information from the AWS Management Console, the AWS CLI, or the AWS API. Identity-based policies Identity-based policies are JSON permissions policy documents that you can attach to an identity, such as an IAM user, group of users, or role. These policies control what actions users and roles can Managing access using policies 182 Amazon Managed Service for Prometheus User Guide perform, on which resources, and under what conditions. To learn how to create an identity-based policy, see Define custom IAM permissions with customer managed policies in the IAM User Guide. Identity-based policies can be further categorized as inline policies or managed policies. Inline policies are embedded directly into a single user, group, or role. Managed policies are standalone policies that you can attach to multiple users, groups, and roles in your AWS account. Managed policies include AWS managed policies and customer managed policies. To learn how to choose between a managed policy or an inline policy, see Choose between managed policies and inline policies in the IAM User Guide. Resource-based policies Resource-based policies are JSON policy documents that you attach to a resource. Examples of resource-based policies are IAM role trust policies and Amazon S3 bucket policies. In services that support resource-based policies, service administrators can use them to control access to a specific resource. For the resource where the policy is attached, the policy defines what actions a specified principal can perform on that resource and under what conditions. You must specify a principal in a resource-based policy. Principals can include accounts, users, roles, federated users, or AWS services. Resource-based policies are inline policies that are located in that service. You can't use AWS managed policies from IAM in a resource-based policy. Access control lists (ACLs) Access control lists (ACLs) control which principals (account members, users, or roles) have permissions to access a resource. ACLs are similar to resource-based policies, although they do not use the JSON policy document format. Amazon S3, AWS WAF, and Amazon VPC are examples of services that support ACLs. To learn more about ACLs, see Access control list (ACL) overview in the Amazon Simple Storage Service Developer Guide. Other policy types AWS supports additional, less-common policy types. These policy types can set the maximum permissions granted to you by the more common policy types. • Permissions boundaries – A permissions boundary is an advanced feature in which you set the maximum permissions that an identity-based policy can grant to an IAM entity (IAM user Managing access using policies 183 Amazon Managed Service for Prometheus User Guide or role). You can set a permissions boundary for an entity.
amazon-managed-prometheus-user-guide-061
amazon-managed-prometheus-user-guide.pdf
61
support ACLs. To learn more about ACLs, see Access control list (ACL) overview in the Amazon Simple Storage Service Developer Guide. Other policy types AWS supports additional, less-common policy types. These policy types can set the maximum permissions granted to you by the more common policy types. • Permissions boundaries – A permissions boundary is an advanced feature in which you set the maximum permissions that an identity-based policy can grant to an IAM entity (IAM user Managing access using policies 183 Amazon Managed Service for Prometheus User Guide or role). You can set a permissions boundary for an entity. The resulting permissions are the intersection of an entity's identity-based policies and its permissions boundaries. Resource-based policies that specify the user or role in the Principal field are not limited by the permissions boundary. An explicit deny in any of these policies overrides the allow. For more information about permissions boundaries, see Permissions boundaries for IAM entities in the IAM User Guide. • Service control policies (SCPs) – SCPs are JSON policies that specify the maximum permissions for an organization or organizational unit (OU) in AWS Organizations. AWS Organizations is a service for grouping and centrally managing multiple AWS accounts that your business owns. If you enable all features in an organization, then you can apply service control policies (SCPs) to any or all of your accounts. The SCP limits permissions for entities in member accounts, including each AWS account root user. For more information about Organizations and SCPs, see Service control policies in the AWS Organizations User Guide. • Resource control policies (RCPs) – RCPs are JSON policies that you can use to set the maximum available permissions for resources in your accounts without updating the IAM policies attached to each resource that you own. The RCP limits permissions for resources in member accounts and can impact the effective permissions for identities, including the AWS account root user, regardless of whether they belong to your organization. For more information about Organizations and RCPs, including a list of AWS services that support RCPs, see Resource control policies (RCPs) in the AWS Organizations User Guide. • Session policies – Session policies are advanced policies that you pass as a parameter when you programmatically create a temporary session for a role or federated user. The resulting session's permissions are the intersection of the user or role's identity-based policies and the session policies. Permissions can also come from a resource-based policy. An explicit deny in any of these policies overrides the allow. For more information, see Session policies in the IAM User Guide. Multiple policy types When multiple types of policies apply to a request, the resulting permissions are more complicated to understand. To learn how AWS determines whether to allow a request when multiple policy types are involved, see Policy evaluation logic in the IAM User Guide. How Amazon Managed Service for Prometheus works with IAM Before you use IAM to manage access to Amazon Managed Service for Prometheus, learn what IAM features are available to use with Amazon Managed Service for Prometheus. How Amazon Managed Service for Prometheus works with IAM 184 Amazon Managed Service for Prometheus User Guide IAM features you can use with Amazon Managed Service for Prometheus IAM feature Identity-based policies Resource-based policies Policy actions Policy resources Policy condition keys ACLs ABAC (tags in policies) Temporary credentials Forward access sessions (FAS) Service roles Service-linked roles Amazon Managed Service for Prometheus support Yes No Yes Yes No No Yes Yes No No Yes To get a high-level view of how Amazon Managed Service for Prometheus and other AWS services work with most IAM features, see AWS services that work with IAM in the IAM User Guide. Identity-based policies for Amazon Managed Service for Prometheus Supports identity-based policies: Yes Identity-based policies are JSON permissions policy documents that you can attach to an identity, such as an IAM user, group of users, or role. These policies control what actions users and roles can perform, on which resources, and under what conditions. To learn how to create an identity-based policy, see Define custom IAM permissions with customer managed policies in the IAM User Guide. With IAM identity-based policies, you can specify allowed or denied actions and resources as well as the conditions under which actions are allowed or denied. You can't specify the principal in an How Amazon Managed Service for Prometheus works with IAM 185 Amazon Managed Service for Prometheus User Guide identity-based policy because it applies to the user or role to which it is attached. To learn about all of the elements that you can use in a JSON policy, see IAM JSON policy elements reference in the IAM User Guide. Identity-based policy examples for Amazon Managed Service for Prometheus To view examples of Amazon Managed Service for Prometheus
amazon-managed-prometheus-user-guide-062
amazon-managed-prometheus-user-guide.pdf
62
or denied actions and resources as well as the conditions under which actions are allowed or denied. You can't specify the principal in an How Amazon Managed Service for Prometheus works with IAM 185 Amazon Managed Service for Prometheus User Guide identity-based policy because it applies to the user or role to which it is attached. To learn about all of the elements that you can use in a JSON policy, see IAM JSON policy elements reference in the IAM User Guide. Identity-based policy examples for Amazon Managed Service for Prometheus To view examples of Amazon Managed Service for Prometheus identity-based policies, see Identity-based policy examples for Amazon Managed Service for Prometheus. Resource-based policies within Amazon Managed Service for Prometheus Supports resource-based policies: No Resource-based policies are JSON policy documents that you attach to a resource. Examples of resource-based policies are IAM role trust policies and Amazon S3 bucket policies. In services that support resource-based policies, service administrators can use them to control access to a specific resource. For the resource where the policy is attached, the policy defines what actions a specified principal can perform on that resource and under what conditions. You must specify a principal in a resource-based policy. Principals can include accounts, users, roles, federated users, or AWS services. To enable cross-account access, you can specify an entire account or IAM entities in another account as the principal in a resource-based policy. Adding a cross-account principal to a resource- based policy is only half of establishing the trust relationship. When the principal and the resource are in different AWS accounts, an IAM administrator in the trusted account must also grant the principal entity (user or role) permission to access the resource. They grant permission by attaching an identity-based policy to the entity. However, if a resource-based policy grants access to a principal in the same account, no additional identity-based policy is required. For more information, see Cross account resource access in IAM in the IAM User Guide. Policy actions for Amazon Managed Service for Prometheus Supports policy actions: Yes Administrators can use AWS JSON policies to specify who has access to what. That is, which principal can perform actions on what resources, and under what conditions. The Action element of a JSON policy describes the actions that you can use to allow or deny access in a policy. Policy actions usually have the same name as the associated AWS API operation. There are some exceptions, such as permission-only actions that don't have a matching API How Amazon Managed Service for Prometheus works with IAM 186 Amazon Managed Service for Prometheus User Guide operation. There are also some operations that require multiple actions in a policy. These additional actions are called dependent actions. Include actions in a policy to grant permissions to perform the associated operation. To see a list of Amazon Managed Service for Prometheus actions, see Actions defined by Amazon Managed Service for Prometheus in the Service Authorization Reference. Policy actions in Amazon Managed Service for Prometheus use the following prefix before the action: aps To specify multiple actions in a single statement, separate them with commas. "Action": [ "aps:action1", "aps:action2" ] To view examples of Amazon Managed Service for Prometheus identity-based policies, see Identity-based policy examples for Amazon Managed Service for Prometheus. Policy resources for Amazon Managed Service for Prometheus Supports policy resources: Yes Administrators can use AWS JSON policies to specify who has access to what. That is, which principal can perform actions on what resources, and under what conditions. The Resource JSON policy element specifies the object or objects to which the action applies. Statements must include either a Resource or a NotResource element. As a best practice, specify a resource using its Amazon Resource Name (ARN). You can do this for actions that support a specific resource type, known as resource-level permissions. For actions that don't support resource-level permissions, such as listing operations, use a wildcard (*) to indicate that the statement applies to all resources. "Resource": "*" How Amazon Managed Service for Prometheus works with IAM 187 Amazon Managed Service for Prometheus User Guide To see a list of Amazon Managed Service for Prometheus resource types and their ARNs, see Resources defined by Amazon Managed Service for Prometheus in the Service Authorization Reference. To learn with which actions you can specify the ARN of each resource, see Actions defined by Amazon Managed Service for Prometheus. To view examples of Amazon Managed Service for Prometheus identity-based policies, see Identity-based policy examples for Amazon Managed Service for Prometheus. Policy condition keys for Amazon Managed Service for Prometheus Supports service-specific policy condition keys: No Administrators can use AWS JSON policies to specify who has access to what. That is, which principal can perform actions on what resources, and under what conditions. The Condition
amazon-managed-prometheus-user-guide-063
amazon-managed-prometheus-user-guide.pdf
63
Resources defined by Amazon Managed Service for Prometheus in the Service Authorization Reference. To learn with which actions you can specify the ARN of each resource, see Actions defined by Amazon Managed Service for Prometheus. To view examples of Amazon Managed Service for Prometheus identity-based policies, see Identity-based policy examples for Amazon Managed Service for Prometheus. Policy condition keys for Amazon Managed Service for Prometheus Supports service-specific policy condition keys: No Administrators can use AWS JSON policies to specify who has access to what. That is, which principal can perform actions on what resources, and under what conditions. The Condition element (or Condition block) lets you specify conditions in which a statement is in effect. The Condition element is optional. You can create conditional expressions that use condition operators, such as equals or less than, to match the condition in the policy with values in the request. If you specify multiple Condition elements in a statement, or multiple keys in a single Condition element, AWS evaluates them using a logical AND operation. If you specify multiple values for a single condition key, AWS evaluates the condition using a logical OR operation. All of the conditions must be met before the statement's permissions are granted. You can also use placeholder variables when you specify conditions. For example, you can grant an IAM user permission to access a resource only if it is tagged with their IAM user name. For more information, see IAM policy elements: variables and tags in the IAM User Guide. AWS supports global condition keys and service-specific condition keys. To see all AWS global condition keys, see AWS global condition context keys in the IAM User Guide. To see a list of Amazon Managed Service for Prometheus condition keys, see Condition keys for Amazon Managed Service for Prometheus in the Service Authorization Reference. To learn with which actions and resources you can use a condition key, see Actions defined by Amazon Managed Service for Prometheus. To view examples of Amazon Managed Service for Prometheus identity-based policies, see Identity-based policy examples for Amazon Managed Service for Prometheus. How Amazon Managed Service for Prometheus works with IAM 188 Amazon Managed Service for Prometheus User Guide Access control lists (ACLs) in Amazon Managed Service for Prometheus Supports ACLs: No Access control lists (ACLs) control which principals (account members, users, or roles) have permissions to access a resource. ACLs are similar to resource-based policies, although they do not use the JSON policy document format. Attribute-based access control (ABAC) with Amazon Managed Service for Prometheus Supports ABAC (tags in policies): Yes Attribute-based access control (ABAC) is an authorization strategy that defines permissions based on attributes. In AWS, these attributes are called tags. You can attach tags to IAM entities (users or roles) and to many AWS resources. Tagging entities and resources is the first step of ABAC. Then you design ABAC policies to allow operations when the principal's tag matches the tag on the resource that they are trying to access. ABAC is helpful in environments that are growing rapidly and helps with situations where policy management becomes cumbersome. To control access based on tags, you provide tag information in the condition element of a policy using the aws:ResourceTag/key-name, aws:RequestTag/key-name, or aws:TagKeys condition keys. If a service supports all three condition keys for every resource type, then the value is Yes for the service. If a service supports all three condition keys for only some resource types, then the value is Partial. For more information about ABAC, see Define permissions with ABAC authorization in the IAM User Guide. To view a tutorial with steps for setting up ABAC, see Use attribute-based access control (ABAC) in the IAM User Guide. Using temporary credentials with Amazon Managed Service for Prometheus Supports temporary credentials: Yes Some AWS services don't work when you sign in using temporary credentials. For additional information, including which AWS services work with temporary credentials, see AWS services that work with IAM in the IAM User Guide. How Amazon Managed Service for Prometheus works with IAM 189 Amazon Managed Service for Prometheus User Guide You are using temporary credentials if you sign in to the AWS Management Console using any method except a user name and password. For example, when you access AWS using your company's single sign-on (SSO) link, that process automatically creates temporary credentials. You also automatically create temporary credentials when you sign in to the console as a user and then switch roles. For more information about switching roles, see Switch from a user to an IAM role (console) in the IAM User Guide. You can manually create temporary credentials using the AWS CLI or AWS API. You can then use those temporary credentials to access AWS. AWS recommends that you dynamically generate temporary credentials instead of using long-term access
amazon-managed-prometheus-user-guide-064
amazon-managed-prometheus-user-guide.pdf
64
user name and password. For example, when you access AWS using your company's single sign-on (SSO) link, that process automatically creates temporary credentials. You also automatically create temporary credentials when you sign in to the console as a user and then switch roles. For more information about switching roles, see Switch from a user to an IAM role (console) in the IAM User Guide. You can manually create temporary credentials using the AWS CLI or AWS API. You can then use those temporary credentials to access AWS. AWS recommends that you dynamically generate temporary credentials instead of using long-term access keys. For more information, see Temporary security credentials in IAM. Forward access sessions for Amazon Managed Service for Prometheus Supports forward access sessions (FAS): No When you use an IAM user or role to perform actions in AWS, you are considered a principal. When you use some services, you might perform an action that then initiates another action in a different service. FAS uses the permissions of the principal calling an AWS service, combined with the requesting AWS service to make requests to downstream services. FAS requests are only made when a service receives a request that requires interactions with other AWS services or resources to complete. In this case, you must have permissions to perform both actions. For policy details when making FAS requests, see Forward access sessions. Service roles for Amazon Managed Service for Prometheus Supports service roles: No A service role is an IAM role that a service assumes to perform actions on your behalf. An IAM administrator can create, modify, and delete a service role from within IAM. For more information, see Create a role to delegate permissions to an AWS service in the IAM User Guide. Warning Changing the permissions for a service role might break Amazon Managed Service for Prometheus functionality. Edit service roles only when Amazon Managed Service for Prometheus provides guidance to do so. How Amazon Managed Service for Prometheus works with IAM 190 Amazon Managed Service for Prometheus User Guide Service-linked roles for Amazon Managed Service for Prometheus Supports service-linked roles: Yes A service-linked role is a type of service role that is linked to an AWS service. The service can assume the role to perform an action on your behalf. Service-linked roles appear in your AWS account and are owned by the service. An IAM administrator can view, but not edit the permissions for service-linked roles. For details about creating or managing Amazon Managed Service for Prometheus service-linked roles, see Using service-linked roles for Amazon Managed Service for Prometheus. Identity-based policy examples for Amazon Managed Service for Prometheus By default, users and roles don't have permission to create or modify Amazon Managed Service for Prometheus resources. They also can't perform tasks by using the AWS Management Console, AWS Command Line Interface (AWS CLI), or AWS API. To grant users permission to perform actions on the resources that they need, an IAM administrator can create IAM policies. The administrator can then add the IAM policies to roles, and users can assume the roles. To learn how to create an IAM identity-based policy by using these example JSON policy documents, see Create IAM policies (console) in the IAM User Guide. For details about actions and resource types defined by Amazon Managed Service for Prometheus, including the format of the ARNs for each of the resource types, see Actions, resources, and condition keys for Amazon Managed Service for Prometheus in the Service Authorization Reference. Topics • Policy best practices • Using the Amazon Managed Service for Prometheus console • Allow users to view their own permissions Policy best practices Identity-based policies determine whether someone can create, access, or delete Amazon Managed Service for Prometheus resources in your account. These actions can incur costs for your AWS account. When you create or edit identity-based policies, follow these guidelines and recommendations: Identity-based policy examples 191 Amazon Managed Service for Prometheus User Guide • Get started with AWS managed policies and move toward least-privilege permissions – To get started granting permissions to your users and workloads, use the AWS managed policies that grant permissions for many common use cases. They are available in your AWS account. We recommend that you reduce permissions further by defining AWS customer managed policies that are specific to your use cases. For more information, see AWS managed policies or AWS managed policies for job functions in the IAM User Guide. • Apply least-privilege permissions – When you set permissions with IAM policies, grant only the permissions required to perform a task. You do this by defining the actions that can be taken on specific resources under specific conditions, also known as least-privilege permissions. For more information about using IAM to apply permissions, see Policies and permissions in IAM in the IAM
amazon-managed-prometheus-user-guide-065
amazon-managed-prometheus-user-guide.pdf
65
We recommend that you reduce permissions further by defining AWS customer managed policies that are specific to your use cases. For more information, see AWS managed policies or AWS managed policies for job functions in the IAM User Guide. • Apply least-privilege permissions – When you set permissions with IAM policies, grant only the permissions required to perform a task. You do this by defining the actions that can be taken on specific resources under specific conditions, also known as least-privilege permissions. For more information about using IAM to apply permissions, see Policies and permissions in IAM in the IAM User Guide. • Use conditions in IAM policies to further restrict access – You can add a condition to your policies to limit access to actions and resources. For example, you can write a policy condition to specify that all requests must be sent using SSL. You can also use conditions to grant access to service actions if they are used through a specific AWS service, such as AWS CloudFormation. For more information, see IAM JSON policy elements: Condition in the IAM User Guide. • Use IAM Access Analyzer to validate your IAM policies to ensure secure and functional permissions – IAM Access Analyzer validates new and existing policies so that the policies adhere to the IAM policy language (JSON) and IAM best practices. IAM Access Analyzer provides more than 100 policy checks and actionable recommendations to help you author secure and functional policies. For more information, see Validate policies with IAM Access Analyzer in the IAM User Guide. • Require multi-factor authentication (MFA) – If you have a scenario that requires IAM users or a root user in your AWS account, turn on MFA for additional security. To require MFA when API operations are called, add MFA conditions to your policies. For more information, see Secure API access with MFA in the IAM User Guide. For more information about best practices in IAM, see Security best practices in IAM in the IAM User Guide. Using the Amazon Managed Service for Prometheus console To access the Amazon Managed Service for Prometheus console, you must have a minimum set of permissions. These permissions must allow you to list and view details about the Amazon Managed Service for Prometheus resources in your AWS account. If you create an identity-based policy that Identity-based policy examples 192 Amazon Managed Service for Prometheus User Guide is more restrictive than the minimum required permissions, the console won't function as intended for entities (users or roles) with that policy. You don't need to allow minimum console permissions for users that are making calls only to the AWS CLI or the AWS API. Instead, allow access to only the actions that match the API operation that they're trying to perform. To ensure that users and roles can still use the Amazon Managed Service for Prometheus console, also attach the Amazon Managed Service for Prometheus ConsoleAccess or ReadOnly AWS managed policy to the entities. For more information, see Adding permissions to a user in the IAM User Guide. Allow users to view their own permissions This example shows how you might create a policy that allows IAM users to view the inline and managed policies that are attached to their user identity. This policy includes permissions to complete this action on the console or programmatically using the AWS CLI or AWS API. { "Version": "2012-10-17", "Statement": [ { "Sid": "ViewOwnUserInfo", "Effect": "Allow", "Action": [ "iam:GetUserPolicy", "iam:ListGroupsForUser", "iam:ListAttachedUserPolicies", "iam:ListUserPolicies", "iam:GetUser" ], "Resource": ["arn:aws:iam::*:user/${aws:username}"] }, { "Sid": "NavigateInConsole", "Effect": "Allow", "Action": [ "iam:GetGroupPolicy", "iam:GetPolicyVersion", "iam:GetPolicy", "iam:ListAttachedGroupPolicies", "iam:ListGroupPolicies", Identity-based policy examples 193 Amazon Managed Service for Prometheus User Guide "iam:ListPolicyVersions", "iam:ListPolicies", "iam:ListUsers" ], "Resource": "*" } ] } AWS managed policies for Amazon Managed Service for Prometheus An AWS managed policy is a standalone policy that is created and administered by AWS. AWS managed policies are designed to provide permissions for many common use cases so that you can start assigning permissions to users, groups, and roles. Keep in mind that AWS managed policies might not grant least-privilege permissions for your specific use cases because they're available for all AWS customers to use. We recommend that you reduce permissions further by defining customer managed policies that are specific to your use cases. You cannot change the permissions defined in AWS managed policies. If AWS updates the permissions defined in an AWS managed policy, the update affects all principal identities (users, groups, and roles) that the policy is attached to. AWS is most likely to update an AWS managed policy when a new AWS service is launched or new API operations become available for existing services. For more information, see AWS managed policies in the IAM User Guide. AmazonPrometheusFullAccess You can attach the AmazonPrometheusFullAccess policy to your IAM identities. Permissions details This policy
amazon-managed-prometheus-user-guide-066
amazon-managed-prometheus-user-guide.pdf
66
customer managed policies that are specific to your use cases. You cannot change the permissions defined in AWS managed policies. If AWS updates the permissions defined in an AWS managed policy, the update affects all principal identities (users, groups, and roles) that the policy is attached to. AWS is most likely to update an AWS managed policy when a new AWS service is launched or new API operations become available for existing services. For more information, see AWS managed policies in the IAM User Guide. AmazonPrometheusFullAccess You can attach the AmazonPrometheusFullAccess policy to your IAM identities. Permissions details This policy includes the following permissions. • aps – Allows full access to Amazon Managed Service for Prometheus • eks – Allows the Amazon Managed Service for Prometheus service to read information about your Amazon EKS clusters. This is required to allow creating managed scrapers and discover metrics in your cluster. AWS managed policies 194 Amazon Managed Service for Prometheus User Guide • ec2 – Allows the Amazon Managed Service for Prometheus service to read information about your Amazon EC2 networks. This is required to allow creating managed scrapers with access to your Amazon EKS metrics. • iam – Allows principals to create a service-linked role for managed metric scrapers. The contents of AmazonPrometheusFullAccess are as follows: { "Version": "2012-10-17", "Statement": [ { "Sid": "AllPrometheusActions", "Effect": "Allow", "Action": [ "aps:*" ], "Resource": "*" }, { "Sid": "DescribeCluster", "Effect": "Allow", "Action": [ "eks:DescribeCluster", "ec2:DescribeSubnets", "ec2:DescribeSecurityGroups" ], "Condition": { "ForAnyValue:StringEquals": { "aws:CalledVia": [ "aps.amazonaws.com" ] } }, "Resource": "*" }, { "Sid": "CreateServiceLinkedRole", "Effect": "Allow", "Action": "iam:CreateServiceLinkedRole", "Resource": "arn:aws:iam::*:role/aws-service-role/scraper.aps.amazonaws.com/ AWSServiceRoleForAmazonPrometheusScraper*", "Condition": { AWS managed policies 195 Amazon Managed Service for Prometheus "StringEquals": { "iam:AWSServiceName": "scraper.aps.amazonaws.com" } User Guide } } ] } AmazonPrometheusConsoleFullAccess You can attach the AmazonPrometheusConsoleFullAccess policy to your IAM identities. Permissions details This policy includes the following permissions. • The aps permissions enable users to create and manage workspaces, and to manage Amazon Managed Service for Prometheus in the console. • The tag permissions enable users to see the tags that have been applied to Amazon Managed Service for Prometheus resources. { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": [ "tag:GetTagValues", "tag:GetTagKeys" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "aps:CreateWorkspace", "aps:DescribeWorkspace", "aps:UpdateWorkspaceAlias", "aps:DeleteWorkspace", "aps:ListWorkspaces", "aps:DescribeAlertManagerDefinition", "aps:DescribeRuleGroupsNamespace", "aps:CreateAlertManagerDefinition", AWS managed policies 196 Amazon Managed Service for Prometheus User Guide "aps:CreateRuleGroupsNamespace", "aps:DeleteAlertManagerDefinition", "aps:DeleteRuleGroupsNamespace", "aps:ListRuleGroupsNamespaces", "aps:PutAlertManagerDefinition", "aps:PutRuleGroupsNamespace", "aps:TagResource", "aps:UntagResource", "aps:CreateLoggingConfiguration", "aps:UpdateLoggingConfiguration", "aps:DeleteLoggingConfiguration", "aps:DescribeLoggingConfiguration", "aps:UpdateWorkspaceConfiguration", "aps:DescribeWorkspaceConfiguration" ], "Resource": "*" } ] } AmazonPrometheusRemoteWriteAccess The contents of AmazonPrometheusRemoteWriteAccess are as follows: { "Version": "2012-10-17", "Statement": [ { "Action": [ "aps:RemoteWrite" ], "Effect": "Allow", "Resource": "*" } ] } AmazonPrometheusQueryAccess The contents of AmazonPrometheusQueryAccess are as follows: { "Version": "2012-10-17", AWS managed policies 197 User Guide Amazon Managed Service for Prometheus "Statement": [ { "Action": [ "aps:GetLabels", "aps:GetMetricMetadata", "aps:GetSeries", "aps:QueryMetrics" ], "Effect": "Allow", "Resource": "*" } ] } AWS managed policy: AmazonPrometheusScraperServiceRolePolicy You can't attach AmazonPrometheusScraperServiceRolePolicy to your IAM entities. This policy is attached to a service-linked role that allows Amazon Managed Service for Prometheus to perform actions on your behalf. For more information, see Using roles for scraping metrics from EKS. This policy grants contributor permissions that allow reading from your Amazon EKS cluster and writing to your Amazon Managed Service for Prometheus workspace. Note This user guide previously erroneously called this policy AmazonPrometheusScraperServiceLinkedRolePolicy Permissions details This policy includes the following permissions. • aps – Allows the service principal to write metrics to your Amazon Managed Service for Prometheus workspaces. • ec2 – Allows the service principal to read and modify network configuration to connect to the network that contains your Amazon EKS clusters. • eks – Allows the service principal to access your Amazon EKS clusters. This is required so that it can automatically scrape metrics. Also allows the principal to clean up Amazon EKS resources when a scraper is removed. AWS managed policies 198 Amazon Managed Service for Prometheus User Guide { "Version": "2012-10-17", "Statement": [ { "Sid": "DeleteSLR", "Effect": "Allow", "Action": [ "iam:DeleteRole" ], "Resource": "arn:aws:iam::*:role/aws-service-role/scraper.aps.amazonaws.com/ AWSServiceRoleForAmazonPrometheusScraper*" }, { "Sid": "NetworkDiscovery", "Effect": "Allow", "Action": [ "ec2:DescribeNetworkInterfaces", "ec2:DescribeSubnets", "ec2:DescribeSecurityGroups" ], "Resource": "*" }, { "Sid": "ENIManagement", "Effect": "Allow", "Action": "ec2:CreateNetworkInterface", "Resource": "*", "Condition": { "ForAllValues:StringEquals": { "aws:TagKeys": [ "AMPAgentlessScraper" ] } } }, { "Sid": "TagManagement", "Effect": "Allow", "Action": "ec2:CreateTags", "Resource": "arn:aws:ec2:*:*:network-interface/*", "Condition": { "StringEquals": { "ec2:CreateAction": "CreateNetworkInterface" AWS managed policies 199 Amazon Managed Service for Prometheus User Guide }, "Null": { "aws:RequestTag/AMPAgentlessScraper": "false" } } }, { "Sid": "ENIUpdating", "Effect": "Allow", "Action": [ "ec2:DeleteNetworkInterface", "ec2:ModifyNetworkInterfaceAttribute" ], "Resource": "*", "Condition": { "Null": { "ec2:ResourceTag/AMPAgentlessScraper": "false" } } }, { "Sid": "EKSAccess", "Effect": "Allow", "Action": "eks:DescribeCluster", "Resource": "arn:aws:eks:*:*:cluster/*" }, { "Sid": "DeleteEKSAccessEntry", "Effect": "Allow", "Action": "eks:DeleteAccessEntry", "Resource": "arn:aws:eks:*:*:access-entry/*/role/*", "Condition": { "StringEquals": { "aws:PrincipalAccount": "${aws:ResourceAccount}" }, "ArnLike": { "eks:principalArn": "arn:aws:iam::*:role/aws-service-role/ scraper.aps.amazonaws.com/AWSServiceRoleForAmazonPrometheusScraper*" } } }, { "Sid": "APSWriting", "Effect": "Allow", AWS managed policies 200 Amazon
amazon-managed-prometheus-user-guide-067
amazon-managed-prometheus-user-guide.pdf
67
}, { "Sid": "TagManagement", "Effect": "Allow", "Action": "ec2:CreateTags", "Resource": "arn:aws:ec2:*:*:network-interface/*", "Condition": { "StringEquals": { "ec2:CreateAction": "CreateNetworkInterface" AWS managed policies 199 Amazon Managed Service for Prometheus User Guide }, "Null": { "aws:RequestTag/AMPAgentlessScraper": "false" } } }, { "Sid": "ENIUpdating", "Effect": "Allow", "Action": [ "ec2:DeleteNetworkInterface", "ec2:ModifyNetworkInterfaceAttribute" ], "Resource": "*", "Condition": { "Null": { "ec2:ResourceTag/AMPAgentlessScraper": "false" } } }, { "Sid": "EKSAccess", "Effect": "Allow", "Action": "eks:DescribeCluster", "Resource": "arn:aws:eks:*:*:cluster/*" }, { "Sid": "DeleteEKSAccessEntry", "Effect": "Allow", "Action": "eks:DeleteAccessEntry", "Resource": "arn:aws:eks:*:*:access-entry/*/role/*", "Condition": { "StringEquals": { "aws:PrincipalAccount": "${aws:ResourceAccount}" }, "ArnLike": { "eks:principalArn": "arn:aws:iam::*:role/aws-service-role/ scraper.aps.amazonaws.com/AWSServiceRoleForAmazonPrometheusScraper*" } } }, { "Sid": "APSWriting", "Effect": "Allow", AWS managed policies 200 Amazon Managed Service for Prometheus User Guide "Action": "aps:RemoteWrite", "Resource": "arn:aws:aps:*:*:workspace/*", "Condition": { "StringEquals": { "aws:PrincipalAccount": "${aws:ResourceAccount}" } } } ] } Amazon Managed Service for Prometheus updates to AWS managed policies View details about updates to AWS managed policies for Amazon Managed Service for Prometheus since this service began tracking these changes. For automatic alerts about changes to this page, subscribe to the RSS feed on the Amazon Managed Service for Prometheus Document history page. Change Description Date AmazonPrometheusCo nsoleFullAccessPolicy – Amazon Managed Service for Prometheus added Update to an existing policy new permissions to April 14, 2025 AmazonPrometheusCo nsoleFullAccessPolicy. The aps:UpdateWorkspac eConfiguration and aps:DescribeWorksp aceConfiguration permissions were added so that users with this policy can view and edit workspace configuration information. Amazon Managed Service for Prometheus added new permissions to AmazonPro metheusScraperServ May 2, 2024 AmazonPrometheusSc raperServiceRolePolicy – Update to an existing policy AWS managed policies 201 Amazon Managed Service for Prometheus User Guide Change Description Date iceRolePolicy to support using access entries in Amazon EKS. Includes permissions for managing Amazon EKS access entries to allow cleaning up resources when scrapers are deleted. Note The user guide previously erroneous ly called this policy AmazonPro metheusSc raperServ iceLinked RolePolicy Amazon Managed Service for Prometheus added new permissions to AmazonPro metheusFullAccess to support creating managed scrapers for metrics in Amazon EKS clusters. Includes permissions for connecting to Amazon EKS clusters, reading Amazon EC2 networks, and creating a service-linked role for scrapers. November 26, 2023 AmazonPrometheusFu llAccess – Update to an existing policy AWS managed policies 202 Amazon Managed Service for Prometheus User Guide Change Description Date AmazonPrometheusSc raperServiceLinkedRolePolicy Amazon Managed Service for Prometheus added a November 26, 2023 – New policy AmazonPrometheusCo nsoleFullAccess – Update to an existing policy new service-linked role policy to read from Amazon EKS containers, to allow automatic scraping of metrics. Includes permissions for connecting to Amazon EKS clusters, reading Amazon EC2 networks, and creating and deleting networks tagged as AMPAgentlessScrape r , as well as for writing to Amazon Managed Service for Prometheus workspaces. Amazon Managed Service for Prometheus added new permissions to AmazonPro metheusConsoleFullAccess to support logging alert manager and ruler events in CloudWatch Logs. The aps:CreateLoggingC onfiguration , aps:UpdateLoggingC onfiguration , aps:DeleteLoggingC onfiguration , aps:DescribeLoggin gConfiguration permissions were added. October 24, 2022 AWS managed policies 203 Amazon Managed Service for Prometheus User Guide Change Description Date AmazonPrometheusCo nsoleFullAccess – Update to an existing policy September 29, 2021 Amazon Managed Service for Prometheus added new permissions to AmazonPro metheusConsoleFull Access to support new Amazon Managed Service for Prometheus features and so that users with this policy can see a list of tag suggestio ns when they apply tags to Amazon Managed Service for Prometheus resources. The tag:GetTagKeys , tag:GetTagValues , aps:CreateAlertMan agerDefinition , aps:CreateRuleGrou psNamespace , aps:DeleteAlertMan agerDefinition , aps:DeleteRuleGrou psNamespace , aps:DescribeAlertM , anagerDefinition aps:DescribeRuleGr oupsNamespace , aps:ListRuleGroups Namespaces , aps:PutAl ertManagerDefiniti on , aps:PutRu leGroupsNamespace aps:TagResource , and , AWS managed policies 204 Amazon Managed Service for Prometheus User Guide Change Description Date aps:UntagResource permissions were added. Amazon Managed Service for Prometheus started tracking Amazon Managed Service for Prometheus started tracking changes changes for its AWS managed September 15, 2021 policies. Troubleshooting Amazon Managed Service for Prometheus identity and access Use the following information to help you diagnose and fix common issues that you might encounter when working with Amazon Managed Service for Prometheus and IAM. Topics • I am not authorized to perform an action in Amazon Managed Service for Prometheus • I am not authorized to perform iam:PassRole • I want to allow people outside of my AWS account to access my Amazon Managed Service for Prometheus resources I am not authorized to perform an action in Amazon Managed Service for Prometheus If you receive an error that you're not authorized to perform an action, your policies must be updated to allow you to perform the action. The following example error occurs when the mateojackson IAM user tries to use the console to view details about a fictional my-example-widget resource but doesn't have the fictional aps:GetWidget permissions. User: arn:aws:iam::123456789012:user/mateojackson is not authorized to perform: aps:GetWidget on resource: my-example-widget In this case, the policy for the mateojackson user must be updated to
amazon-managed-prometheus-user-guide-068
amazon-managed-prometheus-user-guide.pdf
68
my Amazon Managed Service for Prometheus resources I am not authorized to perform an action in Amazon Managed Service for Prometheus If you receive an error that you're not authorized to perform an action, your policies must be updated to allow you to perform the action. The following example error occurs when the mateojackson IAM user tries to use the console to view details about a fictional my-example-widget resource but doesn't have the fictional aps:GetWidget permissions. User: arn:aws:iam::123456789012:user/mateojackson is not authorized to perform: aps:GetWidget on resource: my-example-widget In this case, the policy for the mateojackson user must be updated to allow access to the my- example-widget resource by using the aps:GetWidget action. Troubleshooting 205 Amazon Managed Service for Prometheus User Guide If you need help, contact your AWS administrator. Your administrator is the person who provided you with your sign-in credentials. I am not authorized to perform iam:PassRole If you receive an error that you're not authorized to perform the iam:PassRole action, your policies must be updated to allow you to pass a role to Amazon Managed Service for Prometheus. Some AWS services allow you to pass an existing role to that service instead of creating a new service role or service-linked role. To do this, you must have permissions to pass the role to the service. The following example error occurs when an IAM user named marymajor tries to use the console to perform an action in Amazon Managed Service for Prometheus. However, the action requires the service to have permissions that are granted by a service role. Mary does not have permissions to pass the role to the service. User: arn:aws:iam::123456789012:user/marymajor is not authorized to perform: iam:PassRole In this case, Mary's policies must be updated to allow her to perform the iam:PassRole action. If you need help, contact your AWS administrator. Your administrator is the person who provided you with your sign-in credentials. I want to allow people outside of my AWS account to access my Amazon Managed Service for Prometheus resources You can create a role that users in other accounts or people outside of your organization can use to access your resources. You can specify who is trusted to assume the role. For services that support resource-based policies or access control lists (ACLs), you can use those policies to grant people access to your resources. To learn more, consult the following: • To learn whether Amazon Managed Service for Prometheus supports these features, see How Amazon Managed Service for Prometheus works with IAM. • To learn how to provide access to your resources across AWS accounts that you own, see Providing access to an IAM user in another AWS account that you own in the IAM User Guide. Troubleshooting 206 Amazon Managed Service for Prometheus User Guide • To learn how to provide access to your resources to third-party AWS accounts, see Providing access to AWS accounts owned by third parties in the IAM User Guide. • To learn how to provide access through identity federation, see Providing access to externally authenticated users (identity federation) in the IAM User Guide. • To learn the difference between using roles and resource-based policies for cross-account access, see Cross account resource access in IAM in the IAM User Guide. IAM permissions and policies Access to Amazon Managed Service for Prometheus actions and data requires credentials. Those credentials must have permissions to perform the actions and to access the AWS resources, such as retrieving Amazon Managed Service for Prometheus data about your cloud resources. The following sections provide details about how you can use AWS Identity and Access Management (IAM) and Amazon Managed Service for Prometheus to help secure your resources, by controlling who can access them. For more information, see Policies and permissions in IAM. Amazon Managed Service for Prometheus permissions To see the list of possible Amazon Managed Service for Prometheus actions. resource types, and condition keys, see Actions, resources, and condition keys for Amazon Managed Service for Prometheus. Sample IAM policies This section provides examples of other self-managed policies that you can create. The following IAM policy grants full access to Amazon Managed Service for Prometheus and also enables a user to discover Amazon EKS clusters and see the details about them. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "aps:*", "eks:DescribeCluster", "eks:ListClusters" ], IAM permissions and policies 207 Amazon Managed Service for Prometheus "Resource": "*" } ] } User Guide Compliance Validation for Amazon Managed Service for Prometheus To learn whether an AWS service is within the scope of specific compliance programs, see AWS services in Scope by Compliance Program and choose the compliance program that you are interested in. For general information, see AWS Compliance Programs. You can download third-party audit reports using AWS Artifact. For more information, see Downloading Reports in AWS
amazon-managed-prometheus-user-guide-069
amazon-managed-prometheus-user-guide.pdf
69
see the details about them. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "aps:*", "eks:DescribeCluster", "eks:ListClusters" ], IAM permissions and policies 207 Amazon Managed Service for Prometheus "Resource": "*" } ] } User Guide Compliance Validation for Amazon Managed Service for Prometheus To learn whether an AWS service is within the scope of specific compliance programs, see AWS services in Scope by Compliance Program and choose the compliance program that you are interested in. For general information, see AWS Compliance Programs. You can download third-party audit reports using AWS Artifact. For more information, see Downloading Reports in AWS Artifact. Your compliance responsibility when using AWS services is determined by the sensitivity of your data, your company's compliance objectives, and applicable laws and regulations. AWS provides the following resources to help with compliance: • Security Compliance & Governance – These solution implementation guides discuss architectural considerations and provide steps for deploying security and compliance features. • HIPAA Eligible Services Reference – Lists HIPAA eligible services. Not all AWS services are HIPAA eligible. • AWS Compliance Resources – This collection of workbooks and guides might apply to your industry and location. • AWS Customer Compliance Guides – Understand the shared responsibility model through the lens of compliance. The guides summarize the best practices for securing AWS services and map the guidance to security controls across multiple frameworks (including National Institute of Standards and Technology (NIST), Payment Card Industry Security Standards Council (PCI), and International Organization for Standardization (ISO)). • Evaluating Resources with Rules in the AWS Config Developer Guide – The AWS Config service assesses how well your resource configurations comply with internal practices, industry guidelines, and regulations. • AWS Security Hub – This AWS service provides a comprehensive view of your security state within AWS. Security Hub uses security controls to evaluate your AWS resources and to check your compliance against security industry standards and best practices. For a list of supported services and controls, see Security Hub controls reference. Compliance Validation 208 Amazon Managed Service for Prometheus User Guide • Amazon GuardDuty – This AWS service detects potential threats to your AWS accounts, workloads, containers, and data by monitoring your environment for suspicious and malicious activities. GuardDuty can help you address various compliance requirements, like PCI DSS, by meeting intrusion detection requirements mandated by certain compliance frameworks. • AWS Audit Manager – This AWS service helps you continuously audit your AWS usage to simplify how you manage risk and compliance with regulations and industry standards. Resilience in Amazon Managed Service for Prometheus The AWS global infrastructure is built around AWS Regions and Availability Zones. AWS Regions provide multiple physically separated and isolated Availability Zones, which are connected with low-latency, high-throughput, and highly redundant networking. With Availability Zones, you can design and operate applications and databases that automatically fail over between zones without interruption. Availability Zones are more highly available, fault tolerant, and scalable than traditional single or multiple data center infrastructures. For more information about AWS Regions and Availability Zones, see AWS Global Infrastructure. In addition to the AWS global infrastructure, Amazon Managed Service for Prometheus offers several features to help support your data resiliency and backup needs, including support for high- availability data. Infrastructure Security in Amazon Managed Service for Prometheus As a managed service, Amazon Managed Service for Prometheus is protected by AWS global network security. For information about AWS security services and how AWS protects infrastructure, see AWS Cloud Security. To design your AWS environment using the best practices for infrastructure security, see Infrastructure Protection in Security Pillar AWS Well‐Architected Framework. You use AWS published API calls to access Amazon Managed Service for Prometheus through the network. Clients must support the following: • Transport Layer Security (TLS). We require TLS 1.2 and recommend TLS 1.3. Resilience 209 Amazon Managed Service for Prometheus User Guide • Cipher suites with perfect forward secrecy (PFS) such as DHE (Ephemeral Diffie-Hellman) or ECDHE (Elliptic Curve Ephemeral Diffie-Hellman). Most modern systems such as Java 7 and later support these modes. Additionally, requests must be signed by using an access key ID and a secret access key that is associated with an IAM principal. Or you can use the AWS Security Token Service (AWS STS) to generate temporary security credentials to sign requests. Using service-linked roles for Amazon Managed Service for Prometheus Amazon Managed Service for Prometheus uses AWS Identity and Access Management (IAM) service-linked roles. A service-linked role is a unique type of IAM role that is linked directly to Amazon Managed Service for Prometheus. Service-linked roles are predefined by Amazon Managed Service for Prometheus and include all the permissions that the service requires to call other AWS services on your behalf. A service-linked role makes setting up Amazon Managed Service for Prometheus easier because you don’t have to manually
amazon-managed-prometheus-user-guide-070
amazon-managed-prometheus-user-guide.pdf
70
Token Service (AWS STS) to generate temporary security credentials to sign requests. Using service-linked roles for Amazon Managed Service for Prometheus Amazon Managed Service for Prometheus uses AWS Identity and Access Management (IAM) service-linked roles. A service-linked role is a unique type of IAM role that is linked directly to Amazon Managed Service for Prometheus. Service-linked roles are predefined by Amazon Managed Service for Prometheus and include all the permissions that the service requires to call other AWS services on your behalf. A service-linked role makes setting up Amazon Managed Service for Prometheus easier because you don’t have to manually add the necessary permissions. Amazon Managed Service for Prometheus defines the permissions of its service-linked roles, and unless defined otherwise, only Amazon Managed Service for Prometheus can assume its roles. The defined permissions include the trust policy and the permissions policy, and that permissions policy cannot be attached to any other IAM entity. Using roles for scraping metrics from EKS When automatically scraping metrics using Amazon Managed Service for Prometheus managed collector, the AWSServiceRoleForAmazonPrometheusScraper service-linked role is used to make setting up managed collector easier, because you don't have to manually add the necessary permissions. Amazon Managed Service for Prometheus defines the permissions, and only Amazon Managed Service for Prometheus can assume the role. For information about other services that support service-linked roles, see AWS services that work with IAM and look for the services that have Yes in the Service-linked roles column. Choose a Yes with a link to view the service-linked role documentation for that service. Using service-linked roles 210 Amazon Managed Service for Prometheus User Guide Service-linked role permissions for Amazon Managed Service for Prometheus Amazon Managed Service for Prometheus uses a service-linked role named with the prefix AWSServiceRoleForAmazonPrometheusScraper to allow Amazon Managed Service for Prometheus to automatically scrape metrics in your Amazon EKS clusters. The AWSServiceRoleForAmazonPrometheusScraper service-linked role trusts the following services to assume the role: • scraper.aps.amazonaws.com The role permissions policy named AmazonPrometheusScraperServiceRolePolicy allows Amazon Managed Service for Prometheus to complete the following actions on the specified resources: • Ready and modify network configuration to connect to the network that contains your Amazon EKS cluster. • Read metrics from Amazon EKS clusters and write metrics to your Amazon Managed Service for Prometheus workspaces. You must configure permissions to allow your users, groups, or roles to create a service-linked role. For more information, see Service-linked role permissions in the IAM User Guide. Creating a service-linked role for Amazon Managed Service for Prometheus You don't need to manually create a service-linked role. When you create an managed collector instance using Amazon EKS or Amazon Managed Service for Prometheus in the AWS Management Console, the AWS CLI, or the AWS API, Amazon Managed Service for Prometheus creates the service-linked role for you. Important This service-linked role can appear in your account if you completed an action in another service that uses the features supported by this role. To learn more, see A new role appeared in my AWS account. If you delete this service-linked role, and then need to create it again, you can use the same process to recreate the role in your account. When you create an managed collector instance using Amazon Metric scraping role 211 Amazon Managed Service for Prometheus User Guide EKS or Amazon Managed Service for Prometheus, Amazon Managed Service for Prometheus creates the service-linked role for you again. Editing a service-linked role for Amazon Managed Service for Prometheus Amazon Managed Service for Prometheus does not allow you to edit the AWSServiceRoleForAmazonPrometheusScraper service-linked role. After you create a service- linked role, you cannot change the name of the role because various entities might reference the role. However, you can edit the description of the role using IAM. For more information, see Editing a service-linked role in the IAM User Guide. Deleting a service-linked role for Amazon Managed Service for Prometheus You don't need to manually delete the AWSServiceRoleForAmazonPrometheusScraper role. When you delete all managed collector instances associated with the role in the AWS Management Console, the AWS CLI, or the AWS API, Amazon Managed Service for Prometheus cleans up the resources and deletes the service-linked role for you. Supported Regions for Amazon Managed Service for Prometheus service-linked roles Amazon Managed Service for Prometheus supports using service-linked roles in all of the Regions where the service is available. For more information, see Supported Regions. Logging Amazon Managed Service for Prometheus API calls using AWS CloudTrail Amazon Managed Service for Prometheus is integrated with AWS CloudTrail, a service that provides a record of actions taken by a user, role, or an AWS service. CloudTrail captures all API calls for Amazon Managed Service for Prometheus as events. The calls captured include calls from the Amazon Managed Service for Prometheus console and code calls to the Amazon
amazon-managed-prometheus-user-guide-071
amazon-managed-prometheus-user-guide.pdf
71
Service for Prometheus service-linked roles Amazon Managed Service for Prometheus supports using service-linked roles in all of the Regions where the service is available. For more information, see Supported Regions. Logging Amazon Managed Service for Prometheus API calls using AWS CloudTrail Amazon Managed Service for Prometheus is integrated with AWS CloudTrail, a service that provides a record of actions taken by a user, role, or an AWS service. CloudTrail captures all API calls for Amazon Managed Service for Prometheus as events. The calls captured include calls from the Amazon Managed Service for Prometheus console and code calls to the Amazon Managed Service for Prometheus API operations. Using the information collected by CloudTrail, you can determine the request that was made to Amazon Managed Service for Prometheus, the IP address from which the request was made, when it was made, and additional details. Every event or log entry contains information about who generated the request. The identity information helps you determine the following: CloudTrail logs 212 Amazon Managed Service for Prometheus User Guide • Whether the request was made with root user or user credentials. • Whether the request was made on behalf of an IAM Identity Center user. • Whether the request was made with temporary security credentials for a role or federated user. • Whether the request was made by another AWS service. CloudTrail is active in your AWS account when you create the account and you automatically have access to the CloudTrail Event history. The CloudTrail Event history provides a viewable, searchable, downloadable, and immutable record of the past 90 days of recorded management events in an AWS Region. For more information, see Working with CloudTrail Event history in the AWS CloudTrail User Guide. There are no CloudTrail charges for viewing the Event history. For an ongoing record of events in your AWS account past 90 days, create a trail or a CloudTrail Lake event data store. CloudTrail trails A trail enables CloudTrail to deliver log files to an Amazon S3 bucket. All trails created using the AWS Management Console are multi-Region. You can create a single-Region or a multi-Region trail by using the AWS CLI. Creating a multi-Region trail is recommended because you capture activity in all AWS Regions in your account. If you create a single-Region trail, you can view only the events logged in the trail's AWS Region. For more information about trails, see Creating a trail for your AWS account and Creating a trail for an organization in the AWS CloudTrail User Guide. You can deliver one copy of your ongoing management events to your Amazon S3 bucket at no charge from CloudTrail by creating a trail, however, there are Amazon S3 storage charges. For more information about CloudTrail pricing, see AWS CloudTrail Pricing. For information about Amazon S3 pricing, see Amazon S3 Pricing. CloudTrail Lake event data stores CloudTrail Lake lets you run SQL-based queries on your events. CloudTrail Lake converts existing events in row-based JSON format to Apache ORC format. ORC is a columnar storage format that is optimized for fast retrieval of data. Events are aggregated into event data stores, which are immutable collections of events based on criteria that you select by applying advanced event selectors. The selectors that you apply to an event data store control which events persist and are available for you to query. For more information about CloudTrail Lake, see Working with AWS CloudTrail Lake in the AWS CloudTrail User Guide. CloudTrail logs 213 Amazon Managed Service for Prometheus User Guide CloudTrail Lake event data stores and queries incur costs. When you create an event data store, you choose the pricing option you want to use for the event data store. The pricing option determines the cost for ingesting and storing events, and the default and maximum retention period for the event data store. For more information about CloudTrail pricing, see AWS CloudTrail Pricing. Amazon Managed Service for Prometheus management events in CloudTrail Management events provide information about management operations that are performed on resources in your AWS account. These are also known as control plane operations. By default, CloudTrail logs management events. Amazon Managed Service for Prometheus logs all Amazon Managed Service for Prometheus control plane operations as management events. For a list of the Amazon Managed Service for Prometheus control plane operations that Amazon Managed Service for Prometheus logs to CloudTrail, see the Amazon Managed Service for Prometheus API Reference. Amazon Managed Service for Prometheus event examples An event represents a single request from any source and includes information about the requested API operation, the date and time of the operation, request parameters, and so on. CloudTrail log files aren't an ordered stack trace of the public API calls, so events don't appear in any specific order. Example: CreateWorkspace The following example shows a
amazon-managed-prometheus-user-guide-072
amazon-managed-prometheus-user-guide.pdf
72
plane operations as management events. For a list of the Amazon Managed Service for Prometheus control plane operations that Amazon Managed Service for Prometheus logs to CloudTrail, see the Amazon Managed Service for Prometheus API Reference. Amazon Managed Service for Prometheus event examples An event represents a single request from any source and includes information about the requested API operation, the date and time of the operation, request parameters, and so on. CloudTrail log files aren't an ordered stack trace of the public API calls, so events don't appear in any specific order. Example: CreateWorkspace The following example shows a CloudTrail log entry that demonstrates the CreateWorkspace action. { "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "EXAMPLE123EXAMPLE123-1234567890616", "arn": "arn:aws:sts::123456789012:assumed-role/Admin/admin", "accountId": "123456789012", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "sessionIssuer": { Amazon Managed Service for Prometheus management events in CloudTrail 214 Amazon Managed Service for Prometheus User Guide "type": "Role", "principalId": "AIDACKCEVSQ6C2EXAMPLE", "arn": "arn:aws:iam::123456789012:role/Admin", "accountId": "123456789012", "userName": "Admin" }, "webIdFederationData": { }, "attributes": { "mfaAuthenticated": "false", "creationDate": "2020-11-30T23:39:29Z" } } }, "eventTime": "2020-11-30T23:43:21Z", "eventSource": "aps.amazonaws.com", "eventName": "CreateWorkspace", "awsRegion": "us-west-2", "sourceIPAddress": "203.0.113.1", "userAgent": "aws-cli/1.11.167 Python/2.7.10 Darwin/16.7.0 botocore/1.7.25", "requestParameters": { "alias": "alias-example", "clientToken": "12345678-1234-abcd-1234-12345abcd1" }, "responseElements": { "Access-Control-Expose-Headers": "x-amzn-errortype,x-amzn-requestid,x-amzn- trace-id,x-amzn-errormessage,x-amz-apigw-id,date", "arn": "arn:aws:aps:us-west-2:123456789012:workspace/ws-abc123456- abcd-1234-5678-1234567890", "status": { "statusCode": "CREATING" }, "workspaceId": "ws-12345678-1234-abcd-1234-1234567890" }, "requestID": "890b8639-e51f-11e7-b038-EXAMPLE", "eventID": "874f89fa-70fc-4798-bc00-EXAMPLE", "readOnly": false, "eventType": "AwsApiCall", "managementEvent": true, "eventCategory": "Management", "recipientAccountId": "123456789012" } Amazon Managed Service for Prometheus event examples 215 Amazon Managed Service for Prometheus User Guide Example: CreateAlertManagerDefinition The following example shows a CloudTrail log entry that demonstrates the CreateAlertManagerDefinition action. { "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "EXAMPLE123EXAMPLE123-1234567890616", "arn": "arn:aws:sts::123456789012:assumed-role/Admin/admin", "accountId": "123456789012", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "AIDACKCEVSQ6C2EXAMPLE", "arn": "arn:aws:iam::123456789012:role/Admin", "accountId": "123456789012", "userName": "Admin" }, "webIdFederationData": { }, "attributes": { "mfaAuthenticated": "false", "creationDate": "2021-09-23T20:20:14Z" } } }, "eventTime": "2021-09-23T20:22:43Z", "eventSource": "aps.amazonaws.com", "eventName": "CreateAlertManagerDefinition", "awsRegion": "us-west-2", "sourceIPAddress": "203.0.113.1", "userAgent": "Boto3/1.17.46 Python/3.6.14 Linux/4.14.238-182.422.amzn2.x86_64 exec- env/AWS_ECS_FARGATE Botocore/1.20.46", "requestParameters": { "data": "YWxlcnRtYW5hZ2VyX2NvbmZpZzogfAogIGdsb2JhbDoKICAgIHNtdHBfc21hcnRob3N0OiAnbG9jYWxob3N0OjI1JwogICAgc210cF9mcm9tOiAnYXBzQGFtYXpvbmF3cy5jb20nCiAgdGVtcGxhdGVzOgogICAgLSAnZGVmYXVsdF90ZW1wbGF0ZScKICByb3V0ZToKICAgIHJlY2VpdmVyOiBleGFtcGxlLXNucwogIHJlY2VpdmVyczoKICAgIC0gbmFtZTogZXhhbXBsZS1zbnMKICAgICAgc25zX2NvbmZpZ3M6CiAgICAgIC0gdG9waWNfYXJuOiAnYXJuOmF3czpzbnM6dXMtd2VzdC0yOjQ5Mjk4MDc1OTMyMjp0ZXN0U25zUmVjZWl2ZXInCg==", "clientToken": "12345678-1234-abcd-1234-12345abcd1", "workspaceId": "ws-12345678-1234-abcd-1234-1234567890" }, "responseElements": { Amazon Managed Service for Prometheus event examples 216 Amazon Managed Service for Prometheus User Guide "Access-Control-Expose-Headers": "x-amzn-errortype,x-amzn-requestid,x-amzn- trace-id,x-amzn-errormessage,x-amz-apigw-id,date", "status": { "statusCode": "CREATING" } }, "requestID": "890b8639-e51f-11e7-b038-EXAMPLE", "eventID": "874f89fa-70fc-4798-bc00-EXAMPLE", "readOnly": false, "eventType": "AwsApiCall", "managementEvent": true, "eventCategory": "Management", "recipientAccountId": "123456789012" } Example: CreateRuleGroupsNamespace The following example shows a CloudTrail log entry that demonstrates the CreateRuleGroupsNamespace action. { "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "EXAMPLE123EXAMPLE123-1234567890616", "arn": "arn:aws:sts::123456789012:assumed-role/Admin/admin", "accountId": "123456789012", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "AIDACKCEVSQ6C2EXAMPLE", "arn": "arn:aws:iam::123456789012:role/Admin", "accountId": "123456789012", "userName": "Admin" }, "webIdFederationData": { }, "attributes": { "creationDate": "2021-09-23T20:22:19Z", "mfaAuthenticated": "false" } Amazon Managed Service for Prometheus event examples 217 Amazon Managed Service for Prometheus User Guide } }, "eventTime": "2021-09-23T20:25:08Z", "eventSource": "aps.amazonaws.com", "eventName": "CreateRuleGroupsNamespace", "awsRegion": "us-west-2", "sourceIPAddress": "34.212.33.165", "userAgent": "Boto3/1.17.63 Python/3.6.14 Linux/4.14.238-182.422.amzn2.x86_64 exec- env/AWS_ECS_FARGATE Botocore/1.20.63", "requestParameters": { "data": "Z3JvdXBzOgogIC0gbmFtZTogdGVzdFJ1bGVHcm91cHNOYW1lc3BhY2UKICAgIHJ1bGVzOgogICAgLSBhbGVydDogdGVzdEFsZXJ0UnVsZQogICAgICBleHByOiB0ZXN0QWxlcnRNZXRyaWMgPiAwCiAgICAgIGZvcjogMW0K", "clientToken": "12345678-1234-abcd-1234-12345abcd1", "name": "exampleRuleGroupsNamespace", "workspaceId": "ws-12345678-1234-abcd-1234-1234567890" }, "responseElements": { "Access-Control-Expose-Headers": "x-amzn-errortype,x-amzn-requestid,x-amzn- trace-id,x-amzn-errormessage,x-amz-apigw-id,date", "name": "exampleRuleGroupsNamespace", "arn": "arn:aws:aps:us-west-2:492980759322:rulegroupsnamespace/ws- ae46a85c-1609-4c22-90a3-2148642c3b6c/exampleRuleGroupsNamespace", "status": { "statusCode": "CREATING" }, "tags": {} }, "requestID": "890b8639-e51f-11e7-b038-EXAMPLE", "eventID": "874f89fa-70fc-4798-bc00-EXAMPLE", "readOnly": false, "eventType": "AwsApiCall", "managementEvent": true, "eventCategory": "Management", "recipientAccountId": "123456789012" } For information about CloudTrail record contents, see CloudTrail record contents in the AWS CloudTrail User Guide. Amazon Managed Service for Prometheus event examples 218 Amazon Managed Service for Prometheus User Guide Set up IAM roles for service accounts With IAM roles for service accounts, you can associate an IAM role with a Kubernetes service account. This service account can then provide AWS permissions to the containers in any pod that uses that service account. For more information, see IAM roles for service accounts. IAM roles for service accounts are also known as service roles. In Amazon Managed Service for Prometheus, using service roles can help you get the roles you need to authorize and authenticate between Amazon Managed Service for Prometheus, Prometheus servers, and Grafana servers. Prerequisites The procedures on this page require that you have the AWS CLI and EKSCTL command line interface installed. Set up service roles for the ingestion of metrics from Amazon EKS clusters To set up the service roles to enable Amazon Managed Service for Prometheus to ingest metrics from Prometheus servers in Amazon EKS clusters, you must be logged on to an account with the following permissions: • iam:CreateRole • iam:CreatePolicy • iam:GetRole • iam:AttachRolePolicy • iam:GetOpenIDConnectProvider To set up the service role for ingestion into Amazon Managed Service for Prometheus 1. Create a file named createIRSA-AMPIngest.sh with the following content. Replace <my_amazon_eks_clustername> with the name of your cluster, and replace <my_prometheus_namespace> with your Prometheus namespace. #!/bin/bash -e CLUSTER_NAME=<my_amazon_eks_clustername> Set up IAM roles for service accounts 219 Amazon Managed Service for Prometheus User Guide SERVICE_ACCOUNT_NAMESPACE=<my_prometheus_namespace> AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query "Account" --output text) OIDC_PROVIDER=$(aws eks describe-cluster --name $CLUSTER_NAME --query "cluster.identity.oidc.issuer" --output text | sed -e "s/^https:\/\///") SERVICE_ACCOUNT_AMP_INGEST_NAME=amp-iamproxy-ingest-service-account SERVICE_ACCOUNT_IAM_AMP_INGEST_ROLE=amp-iamproxy-ingest-role SERVICE_ACCOUNT_IAM_AMP_INGEST_POLICY=AMPIngestPolicy # # Set up a trust policy designed for a specific combination of K8s service account and namespace to sign in from a Kubernetes
amazon-managed-prometheus-user-guide-073
amazon-managed-prometheus-user-guide.pdf
73
role for ingestion into Amazon Managed Service for Prometheus 1. Create a file named createIRSA-AMPIngest.sh with the following content. Replace <my_amazon_eks_clustername> with the name of your cluster, and replace <my_prometheus_namespace> with your Prometheus namespace. #!/bin/bash -e CLUSTER_NAME=<my_amazon_eks_clustername> Set up IAM roles for service accounts 219 Amazon Managed Service for Prometheus User Guide SERVICE_ACCOUNT_NAMESPACE=<my_prometheus_namespace> AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query "Account" --output text) OIDC_PROVIDER=$(aws eks describe-cluster --name $CLUSTER_NAME --query "cluster.identity.oidc.issuer" --output text | sed -e "s/^https:\/\///") SERVICE_ACCOUNT_AMP_INGEST_NAME=amp-iamproxy-ingest-service-account SERVICE_ACCOUNT_IAM_AMP_INGEST_ROLE=amp-iamproxy-ingest-role SERVICE_ACCOUNT_IAM_AMP_INGEST_POLICY=AMPIngestPolicy # # Set up a trust policy designed for a specific combination of K8s service account and namespace to sign in from a Kubernetes cluster which hosts the OIDC Idp. # cat <<EOF > TrustPolicy.json { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Federated": "arn:aws:iam::${AWS_ACCOUNT_ID}:oidc-provider/ ${OIDC_PROVIDER}" }, "Action": "sts:AssumeRoleWithWebIdentity", "Condition": { "StringEquals": { "${OIDC_PROVIDER}:sub": "system:serviceaccount: ${SERVICE_ACCOUNT_NAMESPACE}:${SERVICE_ACCOUNT_AMP_INGEST_NAME}" } } } ] } EOF # # Set up the permission policy that grants ingest (remote write) permissions for all AMP workspaces # cat <<EOF > PermissionPolicyIngest.json { "Version": "2012-10-17", "Statement": [ {"Effect": "Allow", "Action": [ "aps:RemoteWrite", "aps:GetSeries", Set up service roles for the ingestion of metrics from Amazon EKS clusters 220 Amazon Managed Service for Prometheus User Guide "aps:GetLabels", "aps:GetMetricMetadata" ], "Resource": "*" } ] } EOF function getRoleArn() { OUTPUT=$(aws iam get-role --role-name $1 --query 'Role.Arn' --output text 2>&1) # Check for an expected exception if [[ $? -eq 0 ]]; then echo $OUTPUT elif [[ -n $(grep "NoSuchEntity" <<< $OUTPUT) ]]; then echo "" else >&2 echo $OUTPUT return 1 fi } # # Create the IAM Role for ingest with the above trust policy # SERVICE_ACCOUNT_IAM_AMP_INGEST_ROLE_ARN=$(getRoleArn $SERVICE_ACCOUNT_IAM_AMP_INGEST_ROLE) if [ "$SERVICE_ACCOUNT_IAM_AMP_INGEST_ROLE_ARN" = "" ]; then # # Create the IAM role for service account # SERVICE_ACCOUNT_IAM_AMP_INGEST_ROLE_ARN=$(aws iam create-role \ --role-name $SERVICE_ACCOUNT_IAM_AMP_INGEST_ROLE \ --assume-role-policy-document file://TrustPolicy.json \ --query "Role.Arn" --output text) # # Create an IAM permission policy # SERVICE_ACCOUNT_IAM_AMP_INGEST_ARN=$(aws iam create-policy --policy-name $SERVICE_ACCOUNT_IAM_AMP_INGEST_POLICY \ --policy-document file://PermissionPolicyIngest.json \ --query 'Policy.Arn' --output text) Set up service roles for the ingestion of metrics from Amazon EKS clusters 221 Amazon Managed Service for Prometheus User Guide # # Attach the required IAM policies to the IAM role created above # aws iam attach-role-policy \ --role-name $SERVICE_ACCOUNT_IAM_AMP_INGEST_ROLE \ --policy-arn $SERVICE_ACCOUNT_IAM_AMP_INGEST_ARN else echo "$SERVICE_ACCOUNT_IAM_AMP_INGEST_ROLE_ARN IAM role for ingest already exists" fi echo $SERVICE_ACCOUNT_IAM_AMP_INGEST_ROLE_ARN # # EKS cluster hosts an OIDC provider with a public discovery endpoint. # Associate this IdP with AWS IAM so that the latter can validate and accept the OIDC tokens issued by Kubernetes to service accounts. # Doing this with eksctl is the easier and best approach. # eksctl utils associate-iam-oidc-provider --cluster $CLUSTER_NAME --approve 2. Enter the following command to give the script the necessary privileges. chmod +x createIRSA-AMPIngest.sh 3. Run the script. Set up IAM roles for service accounts for the querying of metrics To set up the IAM role for service account (service role) to enable the querying of metrics from Amazon Managed Service for Prometheus workspaces, you must be logged on to an account with the following permissions: • iam:CreateRole • iam:CreatePolicy • iam:GetRole • iam:AttachRolePolicy • iam:GetOpenIDConnectProvider Set up IAM roles for service accounts for the querying of metrics 222 Amazon Managed Service for Prometheus User Guide To set up service roles for the querying of Amazon Managed Service for Prometheus metrics; 1. Create a file named createIRSA-AMPQuery.sh with the following content. Replace <my_amazon_eks_clustername> with the name of your cluster, and replace <my_prometheus_namespace> with your Prometheus namespace. #!/bin/bash -e CLUSTER_NAME=<my_amazon_eks_clustername> SERVICE_ACCOUNT_NAMESPACE=<my_prometheus_namespace> AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query "Account" --output text) OIDC_PROVIDER=$(aws eks describe-cluster --name $CLUSTER_NAME --query "cluster.identity.oidc.issuer" --output text | sed -e "s/^https:\/\///") SERVICE_ACCOUNT_AMP_QUERY_NAME=amp-iamproxy-query-service-account SERVICE_ACCOUNT_IAM_AMP_QUERY_ROLE=amp-iamproxy-query-role SERVICE_ACCOUNT_IAM_AMP_QUERY_POLICY=AMPQueryPolicy # # Setup a trust policy designed for a specific combination of K8s service account and namespace to sign in from a Kubernetes cluster which hosts the OIDC Idp. # cat <<EOF > TrustPolicy.json { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Federated": "arn:aws:iam::${AWS_ACCOUNT_ID}:oidc-provider/ ${OIDC_PROVIDER}" }, "Action": "sts:AssumeRoleWithWebIdentity", "Condition": { "StringEquals": { "${OIDC_PROVIDER}:sub": "system:serviceaccount: ${SERVICE_ACCOUNT_NAMESPACE}:${SERVICE_ACCOUNT_AMP_QUERY_NAME}" } } } ] } EOF # # Set up the permission policy that grants query permissions for all AMP workspaces # Set up IAM roles for service accounts for the querying of metrics 223 Amazon Managed Service for Prometheus User Guide cat <<EOF > PermissionPolicyQuery.json { "Version": "2012-10-17", "Statement": [ {"Effect": "Allow", "Action": [ "aps:QueryMetrics", "aps:GetSeries", "aps:GetLabels", "aps:GetMetricMetadata" ], "Resource": "*" } ] } EOF function getRoleArn() { OUTPUT=$(aws iam get-role --role-name $1 --query 'Role.Arn' --output text 2>&1) # Check for an expected exception if [[ $? -eq 0 ]]; then echo $OUTPUT elif [[ -n $(grep "NoSuchEntity" <<< $OUTPUT) ]]; then echo "" else >&2 echo $OUTPUT return 1 fi } # # Create the IAM Role for query with the above trust policy # SERVICE_ACCOUNT_IAM_AMP_QUERY_ROLE_ARN=$(getRoleArn $SERVICE_ACCOUNT_IAM_AMP_QUERY_ROLE) if [ "$SERVICE_ACCOUNT_IAM_AMP_QUERY_ROLE_ARN" = "" ]; then # # Create the IAM role for service account # SERVICE_ACCOUNT_IAM_AMP_QUERY_ROLE_ARN=$(aws iam create-role \
amazon-managed-prometheus-user-guide-074
amazon-managed-prometheus-user-guide.pdf
74
[ {"Effect": "Allow", "Action": [ "aps:QueryMetrics", "aps:GetSeries", "aps:GetLabels", "aps:GetMetricMetadata" ], "Resource": "*" } ] } EOF function getRoleArn() { OUTPUT=$(aws iam get-role --role-name $1 --query 'Role.Arn' --output text 2>&1) # Check for an expected exception if [[ $? -eq 0 ]]; then echo $OUTPUT elif [[ -n $(grep "NoSuchEntity" <<< $OUTPUT) ]]; then echo "" else >&2 echo $OUTPUT return 1 fi } # # Create the IAM Role for query with the above trust policy # SERVICE_ACCOUNT_IAM_AMP_QUERY_ROLE_ARN=$(getRoleArn $SERVICE_ACCOUNT_IAM_AMP_QUERY_ROLE) if [ "$SERVICE_ACCOUNT_IAM_AMP_QUERY_ROLE_ARN" = "" ]; then # # Create the IAM role for service account # SERVICE_ACCOUNT_IAM_AMP_QUERY_ROLE_ARN=$(aws iam create-role \ --role-name $SERVICE_ACCOUNT_IAM_AMP_QUERY_ROLE \ --assume-role-policy-document file://TrustPolicy.json \ Set up IAM roles for service accounts for the querying of metrics 224 Amazon Managed Service for Prometheus User Guide --query "Role.Arn" --output text) # # Create an IAM permission policy # SERVICE_ACCOUNT_IAM_AMP_QUERY_ARN=$(aws iam create-policy --policy-name $SERVICE_ACCOUNT_IAM_AMP_QUERY_POLICY \ --policy-document file://PermissionPolicyQuery.json \ --query 'Policy.Arn' --output text) # # Attach the required IAM policies to the IAM role create above # aws iam attach-role-policy \ --role-name $SERVICE_ACCOUNT_IAM_AMP_QUERY_ROLE \ --policy-arn $SERVICE_ACCOUNT_IAM_AMP_QUERY_ARN else echo "$SERVICE_ACCOUNT_IAM_AMP_QUERY_ROLE_ARN IAM role for query already exists" fi echo $SERVICE_ACCOUNT_IAM_AMP_QUERY_ROLE_ARN # # EKS cluster hosts an OIDC provider with a public discovery endpoint. # Associate this IdP with AWS IAM so that the latter can validate and accept the OIDC tokens issued by Kubernetes to service accounts. # Doing this with eksctl is the easier and best approach. # eksctl utils associate-iam-oidc-provider --cluster $CLUSTER_NAME --approve 2. Enter the following command to give the script the necessary privileges. chmod +x createIRSA-AMPQuery.sh 3. Run the script. Using Amazon Managed Service for Prometheus with interface VPC endpoints If you use Amazon Virtual Private Cloud (Amazon VPC) to host your AWS resources, you can establish private connections between your VPC and Amazon Managed Service for Prometheus. You can use these connections to enable Amazon Managed Service for Prometheus to communicate with your resources on your VPC without going through the public internet. Interface VPC endpoints 225 Amazon Managed Service for Prometheus User Guide Amazon VPC is an AWS service that you can use to launch AWS resources in a virtual network that you define. With a VPC, you have control over your network settings, such the IP address range, subnets, route tables, and network gateways. To connect your VPC to Amazon Managed Service for Prometheus, you define an interface VPC endpoint to connect your VPC to AWS services. The endpoint provides reliable, scalable connectivity to Amazon Managed Service for Prometheus without requiring an internet gateway, a network address translation (NAT) instance, or a VPN connection. For more information, see What Is Amazon VPC in the Amazon VPC User Guide. Interface VPC endpoints are powered by AWS PrivateLink, an AWS technology that enables private communication between AWS services using an elastic network interface with private IP addresses. For more information, see the New – AWS PrivateLink for AWS Services blog post. The following information is for Amazon VPC users. For information about how to get started with Amazon VPC, see Getting Started in the Amazon VPC User Guide. Create an interface VPC endpoint for Amazon Managed Service for Prometheus Create an interface VPC endpoint to begin using Amazon Managed Service for Prometheus. Choose from the following service name endpoints: • com.amazonaws.region.aps-workspaces Choose this service name to work with Prometheus-compatible APIs. For more information, see Prometheus-compatible APIs in the Amazon Managed Service for Prometheus User Guide. • com.amazonaws.region.aps Choose this service name to perform workspace management tasks. For more information, see Amazon Managed Service for Prometheus APIs in the Amazon Managed Service for Prometheus User Guide. Note If you are using remote_write in a VPC without direct internet access, you must also create an interface VPC endpoint for AWS Security Token Service, to allow sigv4 to work through the endpoint. For information about creating a VPC endpoint for AWS STS, see Using AWS Create an interface VPC endpoint for Amazon Managed Service for Prometheus 226 Amazon Managed Service for Prometheus User Guide STS interface VPC endpoints in the AWS Identity and Access Management User Guide. You must set AWS STS to use regionalized endpoints. For more information, including step-by-step instructions to create an interface VPC endpoint, see Creating an interface endpoint in the Amazon VPC User Guide. Note You can use VPC endpoint policies to control access to your Amazon Managed Service for Prometheus interface VPC endpoint. See the next section for more information. If you created an interface VPC endpoint for Amazon Managed Service for Prometheus and already have data flowing to the workspaces located on your VPC, the metrics will flow through the interface VPC endpoint by default. Amazon Managed Service for Prometheus uses public endpoints or private interface endpoints (whichever are in use) to perform this task. Controlling access to your Amazon Managed Service for Prometheus VPC
amazon-managed-prometheus-user-guide-075
amazon-managed-prometheus-user-guide.pdf
75
endpoint in the Amazon VPC User Guide. Note You can use VPC endpoint policies to control access to your Amazon Managed Service for Prometheus interface VPC endpoint. See the next section for more information. If you created an interface VPC endpoint for Amazon Managed Service for Prometheus and already have data flowing to the workspaces located on your VPC, the metrics will flow through the interface VPC endpoint by default. Amazon Managed Service for Prometheus uses public endpoints or private interface endpoints (whichever are in use) to perform this task. Controlling access to your Amazon Managed Service for Prometheus VPC endpoint You can use VPC endpoint policies to control access to your Amazon Managed Service for Prometheus interface VPC endpoint. A VPC endpoint policy is an IAM resource policy that you attach to an endpoint when you create or modify the endpoint. If you don't attach a policy when you create an endpoint, Amazon VPC attaches a default policy for you that allows full access to the service. An endpoint policy doesn't override or replace IAM identity-based policies or service- specific policies. It's a separate policy for controlling access from the endpoint to the specified service. For more information, see Controlling Access to Services with VPC Endpoints in the Amazon VPC User Guide. The following is an example of an endpoint policy for Amazon Managed Service for Prometheus. This policy allows users with the role PromUser connecting to Amazon Managed Service for Prometheus through the VPC to view workspaces and rule groups, but not, for example, to create or delete workspaces. { Create an interface VPC endpoint for Amazon Managed Service for Prometheus 227 Amazon Managed Service for Prometheus User Guide "Version": "2012-10-17", "Statement": [ { "Sid": "AmazonManagedPrometheusPermissions", "Effect": "Allow", "Action": [ "aps:DescribeWorkspace", "aps:DescribeRuleGroupsNamespace", "aps:ListRuleGroupsNamespace", "aps:ListWorkspaces" ], "Resource": "arn:aws:aps:*:*:/workspaces*", "Principal": { "AWS": [ "arn:aws:iam::111122223333:role/PromUser" ] } } ] } The following example shows a policy that only allows requests coming from a specified IP address in the specified VPC to succeed. Requests from other IP addresses will fail. { "Statement": [ { "Action": "aps:*", "Effect": "Allow", "Principal": "*", "Resource": "*", "Condition": { "IpAddress": { "aws:VpcSourceIp": "192.0.2.123" }, "StringEquals": { "aws:SourceVpc": "vpc-555555555555" } } } ] } Create an interface VPC endpoint for Amazon Managed Service for Prometheus 228 Amazon Managed Service for Prometheus User Guide Troubleshoot Amazon Managed Service for Prometheus errors Use the following sections to help troubleshoot issues with Amazon Managed Service for Prometheus. Topics • 429 or limit exceeded errors • I see duplicate samples • I see errors about sample timestamps • I see an error message related to a limit • Your local Prometheus server output exceeds the limit. • Some of my data isn't appearing 429 or limit exceeded errors If you see a 429 error similar to the following example, your requests have exceeded Amazon Managed Service for Prometheus ingestion quotas. ts=2020-10-29T15:34:41.845Z caller=dedupe.go:112 component=remote level=error remote_name=e13b0c url=http://iamproxy-external.prometheus.uswest2-prod.eks:9090/workspaces/workspace_id/ api/v1/remote_write msg="non-recoverable error" count=500 err="server returned HTTP status 429 Too Many Requests: ingestion rate limit (6666.666666666667) exceeded while adding 499 samples and 0 metadata If you see a 429 error similar to the following example, your requests have exceeded the Amazon Managed Service for Prometheus quota for the number of active metrics in a workspace. ts=2020-11-05T12:40:33.375Z caller=dedupe.go:112 component=remote level=error remote_name=aps url=http://iamproxy-external.prometheus.uswest2-prod.eks:9090/workspaces/workspace_id/ api/v1/remote_write msg="non-recoverable error" count=500 err="server returned HTTP status 429 Too Many Requests: user=accountid_workspace_id: 429 or limit exceeded errors 229 Amazon Managed Service for Prometheus User Guide per-user series limit (local limit: 0 global limit: 3000000 actual local limit: 500000) exceeded If you see a 429 error similar to the following example, your requests have exceeded the Amazon Managed Service for Prometheus quota for the rate (transactions per second) that you can send data to your workspace using the RemoteWrite Prometheus compatible API. ts=2024-03-26T16:50:21.780708811Z caller=dedupe.go:112 component=remote level=error remote_name=ab123c url=https://aps-workspaces.us-east-1.amazonaws.com/workspaces/workspace_id/api/v1/ remote_write msg="non-recoverable error" count=1000 exemplarCount=0 err="server returned HTTP status 429 Too Many Requests: {\"message\":\"Rate exceeded\"}" If you see a 400 error similar to the following example, your requests have exceeded Amazon Managed Service for Prometheus quota for active time series. For details about how active time series quotas are handled, see Active series default. ts=2024-03-26T16:50:21.780708811Z caller=push.go:53 level=warn url=https://aps-workspaces.us-east-1.amazonaws.com/workspaces/workspace_id/api/v1/ remote_write msg="non-recoverable error" count=500 exemplarCount=0 err="server returned HTTP status 400 Bad Request: maxFailure (quorum) on a given error family, rpc error: code = Code(400) desc = addr=10.1.41.23:9095 state=ACTIVE zone=us-east-1a, rpc error: code = Code(400) desc = user=accountid_workspace_id: per-user series limit of 10000000 exceeded, Capacity from 2,000,000 to 10,000,000 is automatically adjusted based on the last 30 min of usage. If throttled above 10,000,000 or in case of incoming surges, please contact administrator to raise it. (local limit: 0 global limit: 10000000 actual local limit: 92879)" For more information about Amazon Managed Service for Prometheus service quotas and about how to request increases, see Amazon Managed Service for Prometheus service
amazon-managed-prometheus-user-guide-076
amazon-managed-prometheus-user-guide.pdf
76
400 Bad Request: maxFailure (quorum) on a given error family, rpc error: code = Code(400) desc = addr=10.1.41.23:9095 state=ACTIVE zone=us-east-1a, rpc error: code = Code(400) desc = user=accountid_workspace_id: per-user series limit of 10000000 exceeded, Capacity from 2,000,000 to 10,000,000 is automatically adjusted based on the last 30 min of usage. If throttled above 10,000,000 or in case of incoming surges, please contact administrator to raise it. (local limit: 0 global limit: 10000000 actual local limit: 92879)" For more information about Amazon Managed Service for Prometheus service quotas and about how to request increases, see Amazon Managed Service for Prometheus service quotas I see duplicate samples If you are using a high-availability Prometheus group, you need to use external labels on your Prometheus instances to set up deduplication. For more information, see Deduplicating high availability metrics sent to Amazon Managed Service for Prometheus. I see duplicate samples 230 Amazon Managed Service for Prometheus User Guide Other issues around duplicated data are discussed in the next section. I see errors about sample timestamps Amazon Managed Service for Prometheus ingests data in order, and expects each sample to have a timestamp later than the previous sample. If your data does not arrive in order, you can see errors about out-of-order samples, duplicate sample for timestamp, or samples with different value but same timestamp. These issues are typically caused by incorrect setup of the client that is sending data to Amazon Managed Service for Prometheus. If you are using a Prometheus client running in agent mode, check the configuration for rules with duplicate series name, or duplicated targets. If your metrics provide the timestamp directly, check that they are not out of order. For more details about how this works, or ways to check your setup, see the blog post Understanding Duplicate Samples and Out-of-order Timestamp Errors in Prometheus from Prom Labs. I see an error message related to a limit Note Amazon Managed Service for Prometheus provides CloudWatch usage metrics to monitor Prometheus resource usage. Using the CloudWatch usage metrics alarm feature, you can monitor Prometheus resources and usage to prevent limit errors. If you see one of the following error messages, you can request an increase in one of the Amazon Managed Service for Prometheus quotas to solve the issue. For more information, see Amazon Managed Service for Prometheus service quotas. • per-user series limit of <value> exceeded, please contact administrator to raise it • per-metric series limit of <value> exceeded, please contact administrator to raise it • ingestion rate limit (...) exceeded • series has too many labels (...) series: '%s' • the query time range exceeds the limit (query length: xxx, limit: yyy) • the query hit the max number of chunks limit while fetching chunks from ingesters I see errors about sample timestamps 231 Amazon Managed Service for Prometheus User Guide • Limit exceeded. Maximum workspaces per account. Your local Prometheus server output exceeds the limit. Amazon Managed Service for Prometheus has service quotas for the amount of data that a workspace can receive from Prometheus servers. To find the amount of data that your Prometheus server is sending to Amazon Managed Service for Prometheus, you can run the following queries on your Prometheus server. If you find that your Prometheus output is exceeding a Amazon Managed Service for Prometheus limit, you can request an increase of the corresponding service quota. For more information, see Amazon Managed Service for Prometheus service quotas. Queries against your local self-run Prometheus server to find the output limits. Type of data Current active series Current ingestion rate Most-to-least list of active series per metric name Number of labels per metric series Query to use prometheu s_tsdb_he ad_series rate(prom etheus_ts db_head_s amples_ap pended_to tal[5m]) sort_desc (count by(__name __) ({__name__! =""})) group by(mylabe lname) ({__name__! =""}) Your local Prometheus server output exceeds the limit. 232 Amazon Managed Service for Prometheus User Guide Some of my data isn't appearing Data that is sent to Amazon Managed Service for Prometheus can be discarded for various reasons. The following table shows reasons that data might be discarded rather than being ingested. You can track the amount and reasons that data is discarded using Amazon CloudWatch. For more information, see Use CloudWatch metrics to monitor Amazon Managed Service for Prometheus resources. Reason Meaning greater_than_max_sample_age Discarding log lines which are older than the current time new-value-for-timestamp Duplicate samples are sent with a different timestamp than was previously recorded per_metric_series_limit User has hit the active series per metric limit per_user_series_limit User has hit the total number of active series limit rate_limited Ingestion rate limited sample-out-of-order Samples are sent out of order and cannot be processed label_value_too_long Label value is longer than allowed character limit max_label_names_per_series User has hit the label names per metric missing_metric_name Metric name is not provided metric_name_invalid Invalid
amazon-managed-prometheus-user-guide-077
amazon-managed-prometheus-user-guide.pdf
77
see Use CloudWatch metrics to monitor Amazon Managed Service for Prometheus resources. Reason Meaning greater_than_max_sample_age Discarding log lines which are older than the current time new-value-for-timestamp Duplicate samples are sent with a different timestamp than was previously recorded per_metric_series_limit User has hit the active series per metric limit per_user_series_limit User has hit the total number of active series limit rate_limited Ingestion rate limited sample-out-of-order Samples are sent out of order and cannot be processed label_value_too_long Label value is longer than allowed character limit max_label_names_per_series User has hit the label names per metric missing_metric_name Metric name is not provided metric_name_invalid Invalid metric name provided label_invalid Invalid label provided duplicate_label_names Duplicate label names provided Some of my data isn't appearing 233 Amazon Managed Service for Prometheus User Guide Tagging in Amazon Managed Service for Prometheus A tag is a custom attribute label that you or AWS assigns to an AWS resource. Each AWS tag has two parts: • A tag key (for example, CostCenter, Environment, Project, or Secret). Tag keys are case sensitive. • An optional field known as a tag value (for example, 111122223333, Production, or a team name). Omitting the tag value is the same as using an empty string. Like tag keys, tag values are case sensitive. Together these are known as key-value pairs. You can have as many as 50 tags assigned to each workspace. Tags help you identify and organize your AWS resources. Many AWS services support tagging, so you can assign the same tag to resources from different services to indicate that the resources are related. For example, you can assign the same tag to an Amazon Managed Service for Prometheus workspace that you assign to an Amazon S3 bucket. For more information about tagging strategies, see Tagging AWS Resources. In Amazon Managed Service for Prometheus, both workspaces and rule groups namespaces can be tagged. You can use the console, the AWS CLI, APIs, or SDKs to add, manage, and remove tags for these resources. In addition to identifying, organizing, and tracking your workspaces and rule groups namespaces with tags, you can use tags in IAM policies to help control who can view and interact with your Amazon Managed Service for Prometheus resources. Tag restrictions The following basic restrictions apply to tags: • Each resource can have a maximum of 50 tags. • For each resource, each tag key must be unique, and each tag key can have only one value. • The maximum tag key length is 128 Unicode characters in UTF-8. • The maximum tag value length is 256 Unicode characters in UTF-8. • If your tagging schema is used across multiple AWS services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are letters, numbers, spaces representable in UTF-8, and the following characters: . : + = @ _ / - (hyphen). 234 Amazon Managed Service for Prometheus User Guide • Tag keys and values are case sensitive. As a best practice, decide on a strategy for capitalizing tags and consistently implement that strategy across all resource types. For example, decide whether to use Costcenter, costcenter, or CostCenter and use the same convention for all tags. Avoid using similar tags with inconsistent case treatment. • Don't use aws:, AWS:, or any upper or lowercase combination of such as a prefix for either keys or values. These are reserved only for AWS use. You can't edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags-per-resource limit. Topics • Tag Amazon Managed Service for Prometheus workspaces • Tagging rule groups namespaces Tag Amazon Managed Service for Prometheus workspaces Tags are custom labels that can be assigned to a resource. They include a unique key and an optional value (in a key-value pair). Tags help you identify and organize your AWS resources. In Amazon Managed Service for Prometheus, workspaces (and rule groups namespaces) can be tagged. You can use the console, the AWS CLI, APIs, or SDKs to add, manage, and remove tags for these resources. In addition to identifying, organizing, and tracking your workspaces with tags, you can use tags in IAM policies to help control who can view and interact with your Amazon Managed Service for Prometheus resources. Use the procedures in this section to work with tags for Amazon Managed Service for Prometheus workspaces. Topics • Add a tag to a workspace • View tags for a workspace • Edit tags for a workspace • Remove a tag from a workspace Add a tag to a workspace Adding tags to an Amazon Managed Service for Prometheus workspace can help you identify and organize your AWS resources and manage access to them. First, you add one or more tags (key- Tagging workspaces 235 Amazon Managed Service for Prometheus
amazon-managed-prometheus-user-guide-078
amazon-managed-prometheus-user-guide.pdf
78
and interact with your Amazon Managed Service for Prometheus resources. Use the procedures in this section to work with tags for Amazon Managed Service for Prometheus workspaces. Topics • Add a tag to a workspace • View tags for a workspace • Edit tags for a workspace • Remove a tag from a workspace Add a tag to a workspace Adding tags to an Amazon Managed Service for Prometheus workspace can help you identify and organize your AWS resources and manage access to them. First, you add one or more tags (key- Tagging workspaces 235 Amazon Managed Service for Prometheus User Guide value pairs) to a workspace. After you have tags, you can create IAM policies to manage access to the workspace based on these tags. You can use the the console or the AWS CLI to add tags to an Amazon Managed Service for Prometheus workspace. Important Adding tags to a workspace can impact access to that workspace. Before you add a tag to a workspace, make sure to review any IAM policies that might use tags to control access to resources. For more information about adding tags to an Amazon Managed Service for Prometheus workspace when you create it, see Create a Amazon Managed Service for Prometheus workspace. Topics • Add a tag to a workspace (console) • Add a tag to a workspace (AWS CLI) Add a tag to a workspace (console) You can use the console to add one or more tags to a Amazon Managed Service for Prometheus workspace. 1. Open the Amazon Managed Service for Prometheus console at https:// console.aws.amazon.com/prometheus/. 2. In the navigation pane, choose the menu icon. 3. Choose All workspaces. 4. Choose the workspace ID of the workspace that you want to manage. 5. Choose the Tags tab. 6. 7. 8. If no tags have been added to the Amazon Managed Service for Prometheus workspace, choose Create tag. Otherwise, choose Manage tags. In Key, enter a name for the tag. You can add an optional value for the tag in Value. (Optional) To add another tag, choose Add tag again. 9. When you have finished adding tags, choose Save changes. Add a tag to a workspace 236 Amazon Managed Service for Prometheus User Guide Add a tag to a workspace (AWS CLI) Follow these steps to use the AWS CLI to add a tag to an Amazon Managed Service for Prometheus workspace. To add a tag to a workspace when you create it, see Create a Amazon Managed Service for Prometheus workspace. In these steps, we assume that you have already installed a recent version of the AWS CLI or updated to the current version. For more information, see Installing the AWS Command Line Interface. At the terminal or command line, run the tag-resource command, specifying the Amazon Resource Name (ARN) of the workspace where you want to add tags and the key and value of the tag you want to add. You can add more than one tag to an workspace. For example, to tag an Amazon Managed Service for Prometheus workspace named My-Workspace with two tags, a tag key named Status with the tag value of Secret, and a tag key named Team with the tag value of My- Team: aws amp tag-resource --resource-arn arn:aws:aps:us- west-2:123456789012:workspaces/IDstring --tags Status=Secret,Team=My-Team If successful, this command returns nothing. View tags for a workspace Tags can help you identify and organize your AWS resources and manage access to them. For more information about tagging strategies, see Tagging AWS Resources. View tags for an Amazon Managed Service for Prometheus workspace (console) You can use the console to view the tags associated with a Amazon Managed Service for Prometheus workspace. 1. Open the Amazon Managed Service for Prometheus console at https:// console.aws.amazon.com/prometheus/. 2. In the navigation pane, choose the menu icon. 3. Choose All workspaces. 4. Choose the workspace ID of the workspace that you want to manage. 5. Choose the Tags tab. View tags for a workspace 237 Amazon Managed Service for Prometheus User Guide View tags for an Amazon Managed Service for Prometheus workspace (AWS CLI) Follow these steps to use the AWS CLI to view the AWS tags for an workspace. If no tags have been added, the returned list is empty. At the terminal or command line, run the list-tags-for-resource command. For example, to view a list of tag keys and tag values for a workspace: aws amp list-tags-for-resource --resource-arn arn:aws:aps:us- west-2:123456789012:workspace/IDstring If successful, this command returns information similar to the following: { "tags": { "Status": "Secret", "Team": "My-Team" } } Edit tags for a workspace You can change the value for a tag associated with a workspace. You can also change the name of the key, which is equivalent to removing the current tag and adding a different one with the
amazon-managed-prometheus-user-guide-079
amazon-managed-prometheus-user-guide.pdf
79
tags have been added, the returned list is empty. At the terminal or command line, run the list-tags-for-resource command. For example, to view a list of tag keys and tag values for a workspace: aws amp list-tags-for-resource --resource-arn arn:aws:aps:us- west-2:123456789012:workspace/IDstring If successful, this command returns information similar to the following: { "tags": { "Status": "Secret", "Team": "My-Team" } } Edit tags for a workspace You can change the value for a tag associated with a workspace. You can also change the name of the key, which is equivalent to removing the current tag and adding a different one with the new name and the same value as the other key. Important Editing tags for an Amazon Managed Service for Prometheus workspace can impact access to that workspace. Before you edit the name (key) or value of a tag for a workspace, make sure to review any IAM policies that might use the key or value for a tag to control access to resources such as repositories. Edit a tag for an Amazon Managed Service for Prometheus workspace (console) You can use the console to edit the tags associated with a Amazon Managed Service for Prometheus workspace. Edit tags for a workspace 238 Amazon Managed Service for Prometheus User Guide 1. Open the Amazon Managed Service for Prometheus console at https:// console.aws.amazon.com/prometheus/. 2. In the navigation pane, choose the menu icon. 3. Choose All workspaces. 4. Choose the workspace ID of the workspace that you want to manage. 5. Choose the Tags tab. 6. 7. 8. If no tags have been added to the workspace, choose Create tag. Otherwise, choose Manage tags. In Key, enter a name for the tag. You can add an optional value for the tag in Value. (Optional) To add another tag, choose Add tag again. 9. When you have finished adding tags, choose Save changes. Edit tags for an Amazon Managed Service for Prometheus workspace (AWS CLI) Follow these steps to use the AWS CLI to update a tag for a workspace. You can change the value for an existing key, or add another key. At the terminal or command line, run the tag-resource command, specifying the Amazon Resource Name (ARN) of the Amazon Managed Service for Prometheus workspace where you want to update a tag and specify the tag key and tag value: aws amp tag-resource --resource-arn arn:aws:aps:us- west-2:123456789012:workspace/IDstring --tags Team=New-Team Remove a tag from a workspace You can remove one or more tags associated with a workspace. Removing a tag does not delete the tag from other AWS resources that are associated with that tag. Important Removing tags for a Amazon Managed Service for Prometheus workspace can impact access to that workspace. Before you remove a tag from a workspace, make sure to review any IAM policies that might use the key or value for a tag to control access to resources such as repositories. Remove a tag from a workspace 239 Amazon Managed Service for Prometheus User Guide Remove a tag from an Amazon Managed Service for Prometheus workspace (console) You can use the console to remove the association between a tag and a workspace. 1. Open the Amazon Managed Service for Prometheus console at https:// console.aws.amazon.com/prometheus/. 2. In the navigation pane, choose the menu icon. 3. Choose All workspaces. 4. Choose the workspace ID of the workspace that you want to manage. 5. Choose the Tags tab. 6. Choose Manage tags. 7. Find the tag that you want to delete, and choose Remove. Remove a tag from an Amazon Managed Service for Prometheus workspace (AWS CLI) Follow these steps to use the AWS CLI to remove a tag from an workspace. Removing a tag does not delete it, but simply removes the association between the tag and the workspace. Note If you delete an Amazon Managed Service for Prometheus workspace, all tag associations are removed from the deleted workspace. You do not have to remove tags before you delete a workspace. At the terminal or command line, run the untag-resource command, specifying the Amazon Resource Name (ARN) of the workspace where you want to remove tags and the tag key of the tag you want to remove. For example, to remove a tag on a workspace named My-Workspace with the tag key Status: aws amp untag-resource --resource-arn arn:aws:aps:us- west-2:123456789012:workspace/IDstring --tag-keys Status If successful, this command returns nothing. To verify the tags associated with the workspace, run the list-tags-for-resource command. Remove a tag from a workspace 240 Amazon Managed Service for Prometheus User Guide Tagging rule groups namespaces Tags are custom labels that can be assigned to a resource. They include a unique key and an optional value (in a key-value pair). Tags help you identify and organize your AWS resources. In Amazon Managed Service for Prometheus, rule groups namespaces (and workspaces) can
amazon-managed-prometheus-user-guide-080
amazon-managed-prometheus-user-guide.pdf
80
tag on a workspace named My-Workspace with the tag key Status: aws amp untag-resource --resource-arn arn:aws:aps:us- west-2:123456789012:workspace/IDstring --tag-keys Status If successful, this command returns nothing. To verify the tags associated with the workspace, run the list-tags-for-resource command. Remove a tag from a workspace 240 Amazon Managed Service for Prometheus User Guide Tagging rule groups namespaces Tags are custom labels that can be assigned to a resource. They include a unique key and an optional value (in a key-value pair). Tags help you identify and organize your AWS resources. In Amazon Managed Service for Prometheus, rule groups namespaces (and workspaces) can be tagged. You can use the console, the AWS CLI, APIs, or SDKs to add, manage, and remove tags for these resources. In addition to identifying, organizing, and tracking your rule groups namespaces with tags, you can use tags in IAM policies to help control who can view and interact with your Amazon Managed Service for Prometheus resources. Use the procedures in this section to work with tags for Amazon Managed Service for Prometheus rule groups namespaces. Topics • Add a tag to a rule groups namespace • View tags for a rule groups namespace • Edit tags for a rule groups namespace • Remove a tag from a rule groups namespace Add a tag to a rule groups namespace Adding tags to an Amazon Managed Service for Prometheus rule groups namespaces can help you identify and organize your AWS resources and manage access to them. First, you add one or more tags (key-value pairs) to a rule groups namespace. After you have tags, you can create IAM policies to manage access to the namespace based on these tags. You can use the the console or the AWS CLI to add tags to an Amazon Managed Service for Prometheus rule groups namespace. Important Adding tags to a rule groups namespace can impact access to that rule groups namespace. Before you add a tag, make sure to review any IAM policies that might use tags to control access to resources. For more information about adding tags to a rule groups namespace when you create it, see Create a rules file. Tagging rule groups namespaces 241 Amazon Managed Service for Prometheus User Guide Topics • Add a tag to a rule groups namespace (console) • Add a tag to a rule groups namespace (AWS CLI) Add a tag to a rule groups namespace (console) You can use the console to add one or more tags to a Amazon Managed Service for Prometheus rule groups namespace. 1. Open the Amazon Managed Service for Prometheus console at https:// console.aws.amazon.com/prometheus/. 2. In the navigation pane, choose the menu icon. 3. Choose All workspaces. 4. Choose the workspace ID of the workspace that you want to manage. 5. Choose the Rules management tab. 6. Choose the button next to the namespace name and choose Edit. 7. Choose Create tags, Add new tag. 8. 9. In Key, enter a name for the tag. You can add an optional value for the tag in Value. (Optional) To add another tag, choose Add new tag again. 10. When you have finished adding tags, choose Save changes. Add a tag to a rule groups namespace (AWS CLI) Follow these steps to use the AWS CLI to add a tag to an Amazon Managed Service for Prometheus rule groups namespace. To add a tag to a rule groups namespace when you create it, see Upload a rules configuration file to Amazon Managed Service for Prometheus. In these steps, we assume that you have already installed a recent version of the AWS CLI or updated to the current version. For more information, see Installing the AWS Command Line Interface. At the terminal or command line, run the tag-resource command, specifying the Amazon Resource Name (ARN) of the rule groups namespace where you want to add tags and the key and value of the tag you want to add. You can add more than one tag to an rule groups namespace. For Add a tag to a rule groups namespace 242 Amazon Managed Service for Prometheus User Guide example, to tag an Amazon Managed Service for Prometheus namespace named My-Workspace with two tags, a tag key named Status with the tag value of Secret, and a tag key named Team with the tag value of My-Team: aws amp tag-resource \ --resource-arn arn:aws:aps:us- west-2:123456789012:rulegroupsnamespace/IDstring/namespace_name \ --tags Status=Secret,Team=My-Team If successful, this command returns nothing. View tags for a rule groups namespace Tags can help you identify and organize your AWS resources and manage access to them. For more information about tagging strategies, see Tagging AWS Resources. View tags for an Amazon Managed Service for Prometheus rule groups namespace (console) You can use the console to view the tags associated with a Amazon Managed Service for
amazon-managed-prometheus-user-guide-081
amazon-managed-prometheus-user-guide.pdf
81
a tag key named Status with the tag value of Secret, and a tag key named Team with the tag value of My-Team: aws amp tag-resource \ --resource-arn arn:aws:aps:us- west-2:123456789012:rulegroupsnamespace/IDstring/namespace_name \ --tags Status=Secret,Team=My-Team If successful, this command returns nothing. View tags for a rule groups namespace Tags can help you identify and organize your AWS resources and manage access to them. For more information about tagging strategies, see Tagging AWS Resources. View tags for an Amazon Managed Service for Prometheus rule groups namespace (console) You can use the console to view the tags associated with a Amazon Managed Service for Prometheus rule groups namespace. 1. Open the Amazon Managed Service for Prometheus console at https:// console.aws.amazon.com/prometheus/. 2. In the navigation pane, choose the menu icon. 3. Choose All workspaces. 4. Choose the workspace ID of the workspace that you want to manage. 5. Choose the Rules management tab. 6. Choose the namespace name. View tags for an Amazon Managed Service for Prometheus workspace (AWS CLI) Follow these steps to use the AWS CLI to view the AWS tags for a rule groups namespace. If no tags have been added, the returned list is empty. At the terminal or command line, run the list-tags-for-resource command. For example, to view a list of tag keys and tag values for a rule groups namespace: View tags for a rule groups namespace 243 Amazon Managed Service for Prometheus User Guide aws amp list-tags-for-resource --resource-arn rn:aws:aps:us- west-2:123456789012:rulegroupsnamespace/IDstring/namespace_name If successful, this command returns information similar to the following: { "tags": { "Status": "Secret", "Team": "My-Team" } } Edit tags for a rule groups namespace You can change the value for a tag associated with a rule groups namespace. You can also change the name of the key, which is equivalent to removing the current tag and adding a different one with the new name and the same value as the other key. Important Editing tags for an rule groups namespace can impact access to it. Before you edit the name (key) or value of a tag for a resource, make sure to review any IAM policies that might use the key or value for a tag to control access to resources. Edit a tag for an Amazon Managed Service for Prometheus rule groups namespace (console) You can use the console to edit the tags associated with a Amazon Managed Service for Prometheus rule groups namespace. 1. Open the Amazon Managed Service for Prometheus console at https:// console.aws.amazon.com/prometheus/. 2. In the navigation pane, choose the menu icon. 3. Choose All workspaces. 4. Choose the workspace ID of the workspace that you want to manage. 5. Choose the Rules management tab. Edit tags for a rule groups namespace 244 Amazon Managed Service for Prometheus User Guide 6. Choose the name of the namespace. 7. Choose Manage tags, Add new tag. 8. 9. To change the value of an existing tag, enter the new value for Value. o add an additional tag, choose Add new tag. 10. When you have finished adding and editing tags, choose Save changes. Edit tags for an Amazon Managed Service for Prometheus rule groups namespace (AWS CLI) Follow these steps to use the AWS CLI to update a tag for a rule groups namespace. You can change the value for an existing key, or add another key. At the terminal or command line, run the tag-resource command, specifying the Amazon Resource Name (ARN) of the resource where you want to update a tag and specify the tag key and tag value: aws amp tag-resource --resource-arn rn:aws:aps:us- west-2:123456789012:rulegroupsnamespace/IDstring/namespace_name --tags Team=New-Team Remove a tag from a rule groups namespace You can remove one or more tags associated with a rule groups namespace. Removing a tag does not delete the tag from other AWS resources that are associated with that tag. Important Removing tags for a resource can impact access to that resource. Before you remove a tag from a resource, make sure to review any IAM policies that might use the key or value for a tag to control access to resources such as repositories. Remove a tag from an Amazon Managed Service for Prometheus rule groups namespace (console) You can use the console to remove the association between a tag and a rule groups namespace. 1. Open the Amazon Managed Service for Prometheus console at https:// console.aws.amazon.com/prometheus/. Remove a tag from a rule groups namespace 245 Amazon Managed Service for Prometheus User Guide 2. In the navigation pane, choose the menu icon. 3. Choose All workspaces. 4. Choose the workspace ID of the workspace that you want to manage. 5. Choose the Rules management tab. 6. Choose the name of the namespace. 7. Choose Manage tags. 8. Next to the tag you want to delete, choose Remove. 9. When you have finished, choose Save changes.
amazon-managed-prometheus-user-guide-082
amazon-managed-prometheus-user-guide.pdf
82
the association between a tag and a rule groups namespace. 1. Open the Amazon Managed Service for Prometheus console at https:// console.aws.amazon.com/prometheus/. Remove a tag from a rule groups namespace 245 Amazon Managed Service for Prometheus User Guide 2. In the navigation pane, choose the menu icon. 3. Choose All workspaces. 4. Choose the workspace ID of the workspace that you want to manage. 5. Choose the Rules management tab. 6. Choose the name of the namespace. 7. Choose Manage tags. 8. Next to the tag you want to delete, choose Remove. 9. When you have finished, choose Save changes. Remove a tag from an Amazon Managed Service for Prometheus rule groups namespace (AWS CLI) Follow these steps to use the AWS CLI to remove a tag from an rule groups namespace. Removing a tag does not delete it, but simply removes the association between the tag and the rule groups namespace. Note If you delete an Amazon Managed Service for Prometheus rule groups namespace, all tag associations are removed from the deleted nnamespace. You do not have to remove tags before you delete a namespace. At the terminal or command line, run the untag-resource command, specifying the Amazon Resource Name (ARN) of the rule groups namespace where you want to remove tags and the tag key of the tag you want to remove. For example, to remove a tag on a workspace named My- Workspace with the tag key Status: aws amp untag-resource --resource-arn rn:aws:aps:us- west-2:123456789012:rulegroupsnamespace/IDstring/namespace_name --tag-keys Status If successful, this command returns nothing. To verify the tags associated with the resource, run the list-tags-for-resource command. Remove a tag from a rule groups namespace 246 Amazon Managed Service for Prometheus User Guide Amazon Managed Service for Prometheus service quotas The following two sections describe the quotas and limits associated with Amazon Managed Service for Prometheus. Service quotas Amazon Managed Service for Prometheus has the following quotas. Amazon Managed Service for Prometheus vends CloudWatch usage metrics to monitor Prometheus resource usage. Using the CloudWatch usage metrics alarm feature, you can monitor Prometheus resources and usage to prevent limit errors. As your projects and workspaces grow, the most common quotas that you may need to monitor or request an increase for are: Active series per workspace, Ingestion rate per workspace, and Ingestion burst size per workspace. For all adjustable quotas, you can request a quota increase by selecting the link in the Adjustable column, or by requesting a quota increase. The Active series per workspace limit is dynamically applied. For more information, see Active series default. The Ingestion rate per workspace and Ingestion burst size per workspace together control how quickly you can ingest data into your workspace. For more information see Ingestion throttling. Note Unless otherwise noted, these quotas are per workspace. The maximum value for active series per workspace is one billion. Name Default Description Adjustabl e Active metrics with metadata per workspace Each supported Region: 20,000 No The number of unique active metrics with metadata per workspace . Note: If the limit is Service quotas 247 Amazon Managed Service for Prometheus User Guide Name Default Description Adjustabl e reached, metric sample is recorded, but metadata over the limit is dropped. Active series per workspace Each supported Region: 10,000,00 Yes The number of unique active series per 0 per 2 hours workspace (up to a maximum of 1 billion). A series is active if a sample has been reported in the past 2 hours. Capacity from 2M to 10M is automatically adjusted based on the last 30 min of usage. Alert aggregation group size in alert manager definition file Each supported Region: 1,000 Yes The maximum size of an alert aggregation Alert manager definition file size Alert payload size in Alert Manager Each supported Region: 1 Megabytes Each supported Region: 20 Megabytes No No group in alert manager definition file. Each label value combination of group_by would create an aggregation group. The maximum size of an alert manager definition file. The maximum alert payload size of all Alert Manager alerts per workspace. Alert size is dependent on labels and annotations. Service quotas 248 Amazon Managed Service for Prometheus User Guide Name Default Description Adjustabl e Alerts in Alert Manager Each supported Region: 1,000 Yes The maximum number of concurrent Alert Manager alerts per workspace. HA tracker clusters Each supported Region: 500 No The maximum number of clusters that HA tracker will keep track of for ingested samples per workspace. Ingestion burst size per workspace Each supported Region: 1,000,000 Yes The maximum number samples that could be ingested per workspace in one burst per second. Ingestion rate per workspace Each supported Region: 170,000 Yes Metric sample ingestion rate per workspace per second. Inhibition rules in alert manager definition file Each supported Region: 100 Yes The maximum number of inhibition rules
amazon-managed-prometheus-user-guide-083
amazon-managed-prometheus-user-guide.pdf
83
Each supported Region: 1,000 Yes The maximum number of concurrent Alert Manager alerts per workspace. HA tracker clusters Each supported Region: 500 No The maximum number of clusters that HA tracker will keep track of for ingested samples per workspace. Ingestion burst size per workspace Each supported Region: 1,000,000 Yes The maximum number samples that could be ingested per workspace in one burst per second. Ingestion rate per workspace Each supported Region: 170,000 Yes Metric sample ingestion rate per workspace per second. Inhibition rules in alert manager definition file Each supported Region: 100 Yes The maximum number of inhibition rules in alert Label size Each supported Region: 7 Kilobytes No LabelSet limits per workspace Each supported Region: 100 Yes manager definition file. The maximum combined size of all labels and label values accepted for a series. The maximum number of labelset limits that can be created per workspace . Service quotas 249 Amazon Managed Service for Prometheus User Guide Name Default Description Adjustabl e Labels per metric series Metadata length Metadata per metric Nodes in alert manager routing tree Each supported Region: 70 Each supported Region: 1 Kilobytes Each supported Region: 10 Each supported Region: 100 Number of API operations per region in transactions per second Each supported Region: 10 Yes No No Yes Yes Number of GetSeries, GetLabels and GetMetricMetadata API operations per workspace in transactions per second Each supported Region: 10 No Number of labels per metric series. The maximum length accepted for metric metadata. Metadata refers to Metric Name, Type, Unit and Help Text. The number of metadata per metric. The maximum number of nodes in the alert manager routing tree. The maximum number of API operations per second per region. This includes workspace CRUD APIs, tagging APIs, rule groups namespace CRUD APIs, and alert manager definition CRUD APIs. The maximum number of GetSeries, GetLabels and GetMetricMetadata Prometheus-compati ble API operations per second per workspace. Service quotas 250 Amazon Managed Service for Prometheus User Guide Name Default Description Adjustabl e Number of QueryMetrics API operation s per workspace in transactions per Each supported Region: 300 No The maximum number of QueryMetrics Prometheu second s-compatible API operations per second per workspace. Number of RemoteWrite API operation s per workspace in transactions per Each supported Region: 3,000 No The maximum number of RemoteWrite Prometheu second Number of other Prometheus-compati ble API operations per workspace in Each supported Region: 100 No transactions per second Query bytes for instant queries Query bytes for range queries Query chunks fetched Each supported Region: 5 Gigabytes Each supported Region: 5 Gigabytes Each supported Region: 20,000,00 0 No No No s-compatible API operations per second per workspace. The maximum number of API operations per second per workspace for all other Prometheu s-compatible APIs including ListAlerts, ListRules, etc. 750MB can be scanned by a single instant query. The maximum bytes that can be scanned per 24- hour interval in a single range query. The maximum number of chunks that can be scanned during a single query. Service quotas 251 Amazon Managed Service for Prometheus User Guide Name Default Description Adjustabl e Query samples Query series fetched Each supported Region: 50,000,00 No The maximum number of samples that can be 0 scanned during a single query. Each supported Region: 12,000,00 No The maximum number of series that can be 0 scanned during a single query. Query time range in days Each supported Region: 32 No The maximum time range of QueryMetrics, GetSeries, and GetLabels APIs. Request size Each supported Region: 1 Megabytes No The maximum request size for ingestion or query. Rule evaluation interval Each supported Region: 30 Yes Minimum rule evaluation interval. Rule group namespace definition file size Rules per workspace Seconds Each supported Region: 1 Megabytes Each supported Region: 2,000 Templates in alert manager definition file Each supported Region: 100 No Yes Yes The maximum size of a rule group namespace definition file. The maximum number of rules per workspace. The maximum number of templates in the alert manager definition file. Workspaces per region per account Each supported Region: 25 Yes The maximum number of workspaces per region. Service quotas 252 Amazon Managed Service for Prometheus Active series default User Guide Amazon Managed Service for Prometheus allows you to use up to your quota of active time series by default. Amazon Managed Service for Prometheus workspaces automatically adapt to your ingestion volume. As your usage increases, Amazon Managed Service for Prometheus will automatically increase your time series capacity to double your baseline usage, up to the default quota. For example, if your average active time series for the last 30 minutes is 3.5 million, you can use up to 7 million time series without throttling. If you need more than double your previous baseline, Amazon Managed Service for Prometheus automatically allocates more capacity as your
amazon-managed-prometheus-user-guide-084
amazon-managed-prometheus-user-guide.pdf
84
Prometheus allows you to use up to your quota of active time series by default. Amazon Managed Service for Prometheus workspaces automatically adapt to your ingestion volume. As your usage increases, Amazon Managed Service for Prometheus will automatically increase your time series capacity to double your baseline usage, up to the default quota. For example, if your average active time series for the last 30 minutes is 3.5 million, you can use up to 7 million time series without throttling. If you need more than double your previous baseline, Amazon Managed Service for Prometheus automatically allocates more capacity as your ingest volume increases, to help ensure your workload does not experience sustained throttling, up to your quota. However, throttling can occur if you exceed double your previous baseline computed over the last 30 minutes. To avoid throttling, Amazon Managed Service for Prometheus recommends gradually increasing ingestion when increasing to more than double your previous active time series. Note The minimum capacity for active time series is 2 million, there is no throttling when you have less than 2 million series. To go beyond your default quota, you can request a quota increase. Ingestion throttling Amazon Managed Service for Prometheus throttles ingestion for each workspace, based on your current limits. This helps maintain the performance of the workspace. If you exceed the limit, you will see DiscardedSamples in CloudWatch metrics (with the rate_limited reason). You can use Amazon CloudWatch to monitor your ingestion, and to create an alarm to warn you when you are close to reaching the throttling limits. For more information, see Use CloudWatch metrics to monitor Amazon Managed Service for Prometheus resources. Amazon Managed Service for Prometheus uses the token bucket algorithm to implement ingestion throttling. With this algorithm, your account has a bucket that holds a specific number of tokens. The number of tokens in the bucket represents your ingestion limit at any given second. Active series default 253 Amazon Managed Service for Prometheus User Guide Each data sample ingested removes one token from the bucket. If your bucket size (Ingestion burst size per workspace) is 1,000,000, your workspace can ingest one million data samples in one second. If it exceeds one million samples to ingest, it will be throttled, and will not ingest any more records. Additional data samples will be discarded. The bucket automatically refills at a set rate. If the bucket is below its maximum capacity, a set number of tokens is added back to it every second until it reaches its maximum capacity. If the bucket is full when the refill tokens arrive, they are discarded. The bucket can't hold more than its maximum number of tokens. The refill rate for sample ingestion is set by the Ingestion rate per workspace limit. If your Ingestion rate per workspace is set to 170,000, then the refill rate for the bucket is 170,000 tokens per second. If your workspace ingests 1,000,000 data samples in a second, your bucket is immediately reduced to zero tokens. The bucket is then refilled by 170,000 tokens every second, until it reaches it's maximum capacity of 1,000,000 tokens. If there is no more ingestion, the previously empty bucket will return to it's maximum capacity in 6 seconds. Note Ingestion happens in batched requests. If you have 100 tokens available, and send a request with 101 samples, the entire request is rejected. Amazon Managed Service for Prometheus does not partially accept requests. If you are writing a collector, you can manage retries (with smaller batches or after some time has passed). You do not need to wait for the bucket to be full before your workspace can ingest more data samples. You can use tokens as they are added to the bucket. If you immediately use the refill tokens, the bucket does not reach its maximum capacity. For example, if you deplete the bucket, you can continue to ingest 170,000 data samples per second. The bucket can refill to maximum capacity only if you ingest fewer than 170,000 data samples per second. Additional limits on ingested data Amazon Managed Service for Prometheus also has the following additional requirements for data ingested into the workspace. These are not adjustable. • Metric samples older than 1 hour are refused from being ingested. • Every sample and metadata must have a metric name. Additional limits on ingested data 254 Amazon Managed Service for Prometheus User Guide Amazon Managed Service for Prometheus API Reference Amazon Managed Service for Prometheus offers two types of APIs: 1. Amazon Managed Service for Prometheus APIs – These APIs allow you to create and manage your Amazon Managed Service for Prometheus workspaces, including operations for workspaces, scrapers, alert manager definitions, rule groups namespaces, and logging. You use the AWS SDKs, available for various programming languages, to interact with these APIs.
amazon-managed-prometheus-user-guide-085
amazon-managed-prometheus-user-guide.pdf
85
older than 1 hour are refused from being ingested. • Every sample and metadata must have a metric name. Additional limits on ingested data 254 Amazon Managed Service for Prometheus User Guide Amazon Managed Service for Prometheus API Reference Amazon Managed Service for Prometheus offers two types of APIs: 1. Amazon Managed Service for Prometheus APIs – These APIs allow you to create and manage your Amazon Managed Service for Prometheus workspaces, including operations for workspaces, scrapers, alert manager definitions, rule groups namespaces, and logging. You use the AWS SDKs, available for various programming languages, to interact with these APIs. 2. Prometheus-compatible APIs – Amazon Managed Service for Prometheus supports HTTP APIs that are compatible with Prometheus. These APIs enable building custom applications, automate workflows, integrate with other services or tools, and query and interact with your monitoring data using the Prometheus query language (PromQL). This section lists the API operations and data structures supported by Amazon Managed Service for Prometheus. For information about quotas for the series, labels, and API requests, see Amazon Managed Service for Prometheus service quotas in the Amazon Managed Service for Prometheus User Guide. Topics • Amazon Managed Service for Prometheus APIs • Prometheus-compatible APIs Amazon Managed Service for Prometheus APIs Amazon Managed Service for Prometheus provides API operations creating and maintaining your Amazon Managed Service for Prometheus workspaces. This includes APIs for workspaces, scrapers, alert manager definitions, rule groups namespaces, and logging. For detailed information about the Amazon Managed Service for Prometheus APIs, see the Amazon Managed Service for Prometheus API Reference. Using Amazon Managed Service for Prometheus with an AWS SDK AWS software development kits (SDKs) are available for many popular programming languages. Each SDK provides an API, code examples, and documentation that makes it easier for developers Amazon Managed Service for Prometheus APIs 255 Amazon Managed Service for Prometheus User Guide to build AWS applications in their preferred language. For a list of SDKs and tools by language, see Tools to Build on AWS in the AWS Developer Center. SDK Versions We recommend that you use the most recent build of the AWS SDK, and any other SDKs, that you use in your projects, and to keep the SDKs up to date. The AWS SDK provides you with the latest features and functionality, and also security updates. Prometheus-compatible APIs Amazon Managed Service for Prometheus supports the following Prometheus-compatible APIs. For more information about using Prometheus-compatible APIs, see Query using Prometheus- compatible APIs. Topics • CreateAlertManagerAlerts • DeleteAlertManagerSilence • GetAlertManagerStatus • GetAlertManagerSilence • GetLabels • GetMetricMetadata • GetSeries • ListAlerts • ListAlertManagerAlerts • ListAlertManagerAlertGroups • ListAlertManagerReceivers • ListAlertManagerSilences • ListRules • PutAlertManagerSilences • QueryMetrics • RemoteWrite Prometheus-compatible APIs 256 Amazon Managed Service for Prometheus User Guide CreateAlertManagerAlerts The CreateAlertManagerAlerts operation creates an alert in the workspace. Valid HTTP verbs: POST Valid URIs: /workspaces/workspaceId/alertmanager/api/v2/alerts URL query parameters: alerts An array of objects, where each object represents one alert. The following is an example of an alert object: [ { "startsAt": "2021-09-24T17:14:04.995Z", "endsAt": "2021-09-24T17:14:04.995Z", "annotations": { "additionalProp1": "string", "additionalProp2": "string", "additionalProp3": "string" }, "labels": { "additionalProp1": "string", "additionalProp2": "string", "additionalProp3": "string" }, "generatorURL": "string" } ] Sample request POST /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/alertmanager/api/v2/alerts HTTP/1.1 Content-Length: 203, Authorization: AUTHPARAMS X-Amz-Date: 20201201T193725Z User-Agent: Grafana/8.1.0 CreateAlertManagerAlerts 257 Amazon Managed Service for Prometheus User Guide [ { "labels": { "alertname": "test-alert" }, "annotations": { "summary": "this is a test alert used for demo purposes" }, "generatorURL": "https://www.amazon.com/" } ] Sample response HTTP/1.1 200 OK x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Content-Length: 0 Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon vary: Origin DeleteAlertManagerSilence The DeleteSilence deletes one alert silence. Valid HTTP verbs: DELETE Valid URIs: /workspaces/workspaceId/alertmanager/api/v2/silence/silenceID URL query parameters: none Sample request DELETE /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/alertmanager/api/v2/silence/ d29d9df3-9125-4441-912c-70b05f86f973 HTTP/1.1 DeleteAlertManagerSilence 258 Amazon Managed Service for Prometheus User Guide Content-Length: 0, Authorization: AUTHPARAMS X-Amz-Date: 20201201T193725Z User-Agent: Grafana/8.1.0 Sample response HTTP/1.1 200 OK x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Content-Length: 0 Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon vary: Origin GetAlertManagerStatus The GetAlertManagerStatus retrieves information about the status of alert manager. Valid HTTP verbs: GET Valid URIs: /workspaces/workspaceId/alertmanager/api/v2/status URL query parameters: none Sample request GET /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/alertmanager/api/v2/status HTTP/1.1 Content-Length: 0, Authorization: AUTHPARAMS X-Amz-Date: 20201201T193725Z User-Agent: Grafana/8.1.0 Sample response HTTP/1.1 200 OK GetAlertManagerStatus 259 Amazon Managed Service for Prometheus User Guide x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Content-Length: 941 Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon vary: Origin { "cluster": null, "config": { "original": "global:\n resolve_timeout: 5m\n http_config:\n follow_redirects: true\n smtp_hello: localhost\n smtp_require_tls: true\nroute: \n receiver: sns-0\n group_by:\n - label\n continue: false\nreceivers:\n- name: sns-0\n sns_configs:\n - send_resolved: false\n http_config:\n follow_redirects: true\n sigv4: {}\n topic_arn: arn:aws:sns:us- west-2:123456789012:test\n subject: '{{ template \"sns.default.subject\" . }}'\n message: '{{ template \"sns.default.message\" . }}'\n workspace_arn: arn:aws:aps:us-west-2:123456789012:workspace/ws-58a6a446-5ec4-415b-9052-a449073bbd0a \ntemplates: []\n" }, "uptime": null, "versionInfo": null } GetAlertManagerSilence The GetAlertManagerSilence retrieves information about one alert silence. Valid HTTP verbs: GET Valid URIs: /workspaces/workspaceId/alertmanager/api/v2/silence/silenceID
amazon-managed-prometheus-user-guide-086
amazon-managed-prometheus-user-guide.pdf
86
Service for Prometheus User Guide x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Content-Length: 941 Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon vary: Origin { "cluster": null, "config": { "original": "global:\n resolve_timeout: 5m\n http_config:\n follow_redirects: true\n smtp_hello: localhost\n smtp_require_tls: true\nroute: \n receiver: sns-0\n group_by:\n - label\n continue: false\nreceivers:\n- name: sns-0\n sns_configs:\n - send_resolved: false\n http_config:\n follow_redirects: true\n sigv4: {}\n topic_arn: arn:aws:sns:us- west-2:123456789012:test\n subject: '{{ template \"sns.default.subject\" . }}'\n message: '{{ template \"sns.default.message\" . }}'\n workspace_arn: arn:aws:aps:us-west-2:123456789012:workspace/ws-58a6a446-5ec4-415b-9052-a449073bbd0a \ntemplates: []\n" }, "uptime": null, "versionInfo": null } GetAlertManagerSilence The GetAlertManagerSilence retrieves information about one alert silence. Valid HTTP verbs: GET Valid URIs: /workspaces/workspaceId/alertmanager/api/v2/silence/silenceID URL query parameters: none Sample request GET /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/alertmanager/api/v2/silence/ d29d9df3-9125-4441-912c-70b05f86f973 HTTP/1.1 GetAlertManagerSilence 260 Amazon Managed Service for Prometheus User Guide Content-Length: 0, Authorization: AUTHPARAMS X-Amz-Date: 20201201T193725Z User-Agent: Grafana/8.1.0 Sample response HTTP/1.1 200 OK x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Content-Length: 310 Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon vary: Origin { "id": "d29d9df3-9125-4441-912c-70b05f86f973", "status": { "state": "active" }, "updatedAt": "2021-10-22T19:32:11.763Z", "comment": "hello-world", "createdBy": "test-person", "endsAt": "2023-07-24T01:05:36.000Z", "matchers": [ { "isEqual": true, "isRegex": true, "name": "job", "value": "hello" } ], "startsAt": "2021-10-22T19:32:11.763Z" } GetLabels The GetLabels operation retrieves the labels associated with a time series. Valid HTTP verbs: GET, POST GetLabels 261 Amazon Managed Service for Prometheus User Guide Valid URIs: /workspaces/workspaceId/api/v1/labels /workspaces/workspaceId/api/v1/label/label-name/values This URI supports only GET requests. URL query parameters: match[]=<series_selector> Repeated series selector argument that selects the series from which to read the label names. Optional. start=<rfc3339 | unix_timestamp> Start timestamp. Optional. end=<rfc3339 | unix_timestamp> End timestamp. Optional. Sample request for /workspaces/workspaceId/api/v1/labels GET /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/api/v1/labels HTTP/1.1 Content-Length: 0, Authorization: AUTHPARAMS X-Amz-Date: 20201201T193725Z User-Agent: Grafana/8.1.0 Sample response for /workspaces/workspaceId/api/v1/labels HTTP/1.1 200 OK x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Content-Length: 1435 Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon vary: Origin { "status": "success", "data": [ "__name__", "access_mode", "address", "alertname", GetLabels 262 User Guide Amazon Managed Service for Prometheus "alertstate", "apiservice", "app", "app_kubernetes_io_instance", "app_kubernetes_io_managed_by", "app_kubernetes_io_name", "area", "beta_kubernetes_io_arch", "beta_kubernetes_io_instance_type", "beta_kubernetes_io_os", "boot_id", "branch", "broadcast", "buildDate", ... ] } Sample request for /workspaces/workspaceId/api/v1/label/label-name/values GET /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/api/v1/label/access_mode/values HTTP/1.1 Content-Length: 0, Authorization: AUTHPARAMS X-Amz-Date: 20201201T193725Z User-Agent: Grafana/8.1.0 Sample response for /workspaces/workspaceId/api/v1/label/label-name/values HTTP/1.1 200 OK x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Content-Length: 74 Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon vary: Origin { "status": "success", "data": [ "ReadWriteOnce" ] GetLabels 263 Amazon Managed Service for Prometheus User Guide } GetMetricMetadata The GetMetricMetadata operation retrieves metadata about metrics that are currently being scraped from targets. It does not provide any target information. The data section of the query result consists of an object where each key is a metric name and each value is a list of unique metadata objects, as exposed for that metric name across all targets. Valid HTTP verbs: GET Valid URIs: /workspaces/workspaceId/api/v1/metadata URL query parameters: limit=<number> The maximum number of metrics to return. metric=<string> A metric name to filter metadata for. If you keep this empty, all metric metadata is retrieved. Sample request GET /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/api/v1/metadata HTTP/1.1 Content-Length: 0, Authorization: AUTHPARAMS X-Amz-Date: 20201201T193725Z User-Agent: Grafana/8.1.0 Sample response HTTP/1.1 200 OK x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon Transfer-Encoding: chunked GetMetricMetadata 264 Amazon Managed Service for Prometheus User Guide { "status": "success", "data": { "aggregator_openapi_v2_regeneration_count": [ { "type": "counter", "help": "[ALPHA] Counter of OpenAPI v2 spec regeneration count broken down by causing APIService name and reason.", "unit": "" } ], ... } } GetSeries The GetSeries operation retrieves list of time series that match a certain label set. Valid HTTP verbs: GET, POST Valid URIs: /workspaces/workspaceId/api/v1/series URL query parameters: match[]=<series_selector> Repeated series selector argument that selects the series to return. At least one match[] argument must be provided. start=<rfc3339 | unix_timestamp> Start timestamp. Optional end=<rfc3339 | unix_timestamp> End timestamp. Optional Sample request POST /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/api/v1/series --data-urlencode 'match[]=node_cpu_seconds_total{app="prometheus"}' --data-urlencode 'start=1634936400' --data-urlencode 'end=1634939100' HTTP/1.1 Content-Length: 0, GetSeries 265 User Guide Amazon Managed Service for Prometheus Authorization: AUTHPARAMS X-Amz-Date: 20201201T193725Z User-Agent: Grafana/8.1.0 Sample response HTTP/1.1 200 OK x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon content-encoding: gzip { "status": "success", "data": [ { "__name__": "node_cpu_seconds_total", "app": "prometheus", "app_kubernetes_io_managed_by": "Helm", "chart": "prometheus-11.12.1", "cluster": "cluster-1", "component": "node-exporter", "cpu": "0", "heritage": "Helm", "instance": "10.0.100.36:9100", "job": "kubernetes-service-endpoints", "kubernetes_name": "servicesstackprometheuscf14a6d7-node-exporter", "kubernetes_namespace": "default", "kubernetes_node": "ip-10-0-100-36.us-west-2.compute.internal", "mode": "idle", "release": "servicesstackprometheuscf14a6d7" }, { "__name__": "node_cpu_seconds_total", "app": "prometheus", "app_kubernetes_io_managed_by": "Helm", "chart": "prometheus-11.12.1", "cluster": "cluster-1", "component": "node-exporter", "cpu": "0", "heritage": "Helm", GetSeries 266 Amazon Managed Service for Prometheus User Guide "instance": "10.0.100.36:9100", "job": "kubernetes-service-endpoints", "kubernetes_name": "servicesstackprometheuscf14a6d7-node-exporter", "kubernetes_namespace": "default", "kubernetes_node": "ip-10-0-100-36.us-west-2.compute.internal", "mode": "iowait", "release": "servicesstackprometheuscf14a6d7" }, ... ] } ListAlerts The ListAlerts operation retrieves currently active alerts in the workspace. Valid HTTP verbs: GET Valid URIs: /workspaces/workspaceId/api/v1/alerts Sample request GET /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/api/v1/alerts HTTP/1.1 Content-Length: 0, Authorization: AUTHPARAMS X-Amz-Date: 20201201T193725Z User-Agent: Grafana/8.1.0 Sample response HTTP/1.1 200 OK x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Content-Length: 386 Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon vary:
amazon-managed-prometheus-user-guide-087
amazon-managed-prometheus-user-guide.pdf
87
"servicesstackprometheuscf14a6d7" }, { "__name__": "node_cpu_seconds_total", "app": "prometheus", "app_kubernetes_io_managed_by": "Helm", "chart": "prometheus-11.12.1", "cluster": "cluster-1", "component": "node-exporter", "cpu": "0", "heritage": "Helm", GetSeries 266 Amazon Managed Service for Prometheus User Guide "instance": "10.0.100.36:9100", "job": "kubernetes-service-endpoints", "kubernetes_name": "servicesstackprometheuscf14a6d7-node-exporter", "kubernetes_namespace": "default", "kubernetes_node": "ip-10-0-100-36.us-west-2.compute.internal", "mode": "iowait", "release": "servicesstackprometheuscf14a6d7" }, ... ] } ListAlerts The ListAlerts operation retrieves currently active alerts in the workspace. Valid HTTP verbs: GET Valid URIs: /workspaces/workspaceId/api/v1/alerts Sample request GET /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/api/v1/alerts HTTP/1.1 Content-Length: 0, Authorization: AUTHPARAMS X-Amz-Date: 20201201T193725Z User-Agent: Grafana/8.1.0 Sample response HTTP/1.1 200 OK x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Content-Length: 386 Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon vary: Origin ListAlerts 267 Amazon Managed Service for Prometheus User Guide { "status": "success", "data": { "alerts": [ { "labels": { "alertname": "test-1.alert", "severity": "none" }, "annotations": { "message": "message" }, "state": "firing", "activeAt": "2020-12-01T19:37:25.429565909Z", "value": "1e+00" } ] }, "errorType": "", "error": "" } ListAlertManagerAlerts The ListAlertManagerAlerts retrieves information about the alerts currently firing in alert manager in the workspace. Valid HTTP verbs: GET Valid URIs: /workspaces/workspaceId/alertmanager/api/v2/alerts Sample request GET /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/alertmanager/api/v2/alerts HTTP/1.1 Content-Length: 0, Authorization: AUTHPARAMS X-Amz-Date: 20201201T193725Z ListAlertManagerAlerts 268 User Guide Amazon Managed Service for Prometheus User-Agent: Grafana/8.1.0 Sample response HTTP/1.1 200 OK x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Content-Length: 354 Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon vary: Origin [ { "annotations": { "summary": "this is a test alert used for demo purposes" }, "endsAt": "2021-10-21T22:07:31.501Z", "fingerprint": "375eab7b59892505", "receivers": [ { "name": "sns-0" } ], "startsAt": "2021-10-21T22:02:31.501Z", "status": { "inhibitedBy": [], "silencedBy": [], "state": "active" }, "updatedAt": "2021-10-21T22:02:31.501Z", "labels": { "alertname": "test-alert" } } ] ListAlertManagerAlertGroups The ListAlertManagerAlertGroups operation retrieves a list of alert groups configured in alert manager in the workspace. ListAlertManagerAlertGroups 269 Amazon Managed Service for Prometheus Valid HTTP verbs: GET Valid URIs: User Guide /workspaces/workspaceId/alertmanager/api/v2/alerts/groups URL query parameters: active Boolean. If true, the returned list includes active alerts. The default is true. Optional silenced Boolean. If true, the returned list includes silenced alerts. The default is true. Optional inhibited Boolean. If true, the returned list includes inhibited alerts. The default is true. Optional filter An array of strings. A list of matchers to filter alerts by. Optional receiver String. A regular expression matching receivers to filter alerts by. Optional Sample request GET /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/alertmanager/api/v2/alerts/ groups HTTP/1.1 Content-Length: 0, Authorization: AUTHPARAMS X-Amz-Date: 20201201T193725Z User-Agent: Grafana/8.1.0 Sample response HTTP/1.1 200 OK x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Content-Length: 443 Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon vary: Origin [ { ListAlertManagerAlertGroups 270 Amazon Managed Service for Prometheus User Guide "alerts": [ { "annotations": { "summary": "this is a test alert used for demo purposes" }, "endsAt": "2021-10-21T22:07:31.501Z", "fingerprint": "375eab7b59892505", "receivers": [ { "name": "sns-0" } ], "startsAt": "2021-10-21T22:02:31.501Z", "status": { "inhibitedBy": [], "silencedBy": [], "state": "unprocessed" }, "updatedAt": "2021-10-21T22:02:31.501Z", "generatorURL": "https://www.amazon.com/", "labels": { "alertname": "test-alert" } } ], "labels": {}, "receiver": { "name": "sns-0" } } ] ListAlertManagerReceivers The ListAlertManagerReceivers operation retrieves information about the receivers configured in alert manager. Valid HTTP verbs: GET Valid URIs: /workspaces/workspaceId/alertmanager/api/v2/receivers ListAlertManagerReceivers 271 Amazon Managed Service for Prometheus URL query parameters: none Sample request User Guide GET /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/alertmanager/api/v2/receivers HTTP/1.1 Content-Length: 0, Authorization: AUTHPARAMS X-Amz-Date: 20201201T193725Z User-Agent: Grafana/8.1.0 Sample response HTTP/1.1 200 OK x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Content-Length: 19 Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon vary: Origin [ { "name": "sns-0" } ] ListAlertManagerSilences The ListAlertManagerSilences operation retrieves information about the alert silences configured in the workspace. Valid HTTP verbs: GET Valid URIs: /workspaces/workspaceId/alertmanager/api/v2/silences ListAlertManagerSilences 272 Amazon Managed Service for Prometheus User Guide Sample request GET /workspaces/ws-58a6a446-5ec4-415b-9052-a449073bbd0a/alertmanager/api/v2/silences HTTP/1.1 Content-Length: 0, Authorization: AUTHPARAMS X-Amz-Date: 20201201T193725Z User-Agent: Grafana/8.1.0 Sample response HTTP/1.1 200 OK x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Content-Length: 312 Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon vary: Origin [ { "id": "d29d9df3-9125-4441-912c-70b05f86f973", "status": { "state": "active" }, "updatedAt": "2021-10-22T19:32:11.763Z", "comment": "hello-world", "createdBy": "test-person", "endsAt": "2023-07-24T01:05:36.000Z", "matchers": [ { "isEqual": true, "isRegex": true, "name": "job", "value": "hello" } ], "startsAt": "2021-10-22T19:32:11.763Z" } ] ListAlertManagerSilences 273 Amazon Managed Service for Prometheus User Guide ListRules The ListRules retrieves information about the rules configured in the workspace. Valid HTTP verbs: GET Valid URIs: /workspaces/workspaceId/api/v1/rules Sample request GET /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/api/v1/rules HTTP/1.1 Content-Length: 0, Authorization: AUTHPARAMS X-Amz-Date: 20201201T193725Z User-Agent: Grafana/8.1.0 Sample response HTTP/1.1 200 OK x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Content-Length: 423 Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon vary: Origin { "status": "success", "data": { "groups": [ { "name": "test-1.rules", "file": "test-rules", "rules": [ { "name": "record:1", "query": "sum(rate(node_cpu_seconds_total[10m:1m]))", ListRules 274 Amazon Managed Service for Prometheus User Guide "labels": {}, "health": "ok", "lastError": "", "type": "recording", "lastEvaluation": "2021-10-21T21:22:34.429565909Z", "evaluationTime": 0.001005399 } ], "interval": 60, "lastEvaluation": "2021-10-21T21:22:34.429563992Z", "evaluationTime": 0.001010504 } ] }, "errorType": "", "error": "" } PutAlertManagerSilences The PutAlertManagerSilences operation creates a new alert silence or updates an existing one. Valid HTTP verbs: POST Valid URIs: /workspaces/workspaceId/alertmanager/api/v2/silences URL query parameters: silence An object that represents
amazon-managed-prometheus-user-guide-088
amazon-managed-prometheus-user-guide.pdf
88
Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon vary: Origin { "status": "success", "data": { "groups": [ { "name": "test-1.rules", "file": "test-rules", "rules": [ { "name": "record:1", "query": "sum(rate(node_cpu_seconds_total[10m:1m]))", ListRules 274 Amazon Managed Service for Prometheus User Guide "labels": {}, "health": "ok", "lastError": "", "type": "recording", "lastEvaluation": "2021-10-21T21:22:34.429565909Z", "evaluationTime": 0.001005399 } ], "interval": 60, "lastEvaluation": "2021-10-21T21:22:34.429563992Z", "evaluationTime": 0.001010504 } ] }, "errorType": "", "error": "" } PutAlertManagerSilences The PutAlertManagerSilences operation creates a new alert silence or updates an existing one. Valid HTTP verbs: POST Valid URIs: /workspaces/workspaceId/alertmanager/api/v2/silences URL query parameters: silence An object that represents the silence. The following is the format: { "id": "string", "matchers": [ { "name": "string", "value": "string", "isRegex": Boolean, "isEqual": Boolean } PutAlertManagerSilences 275 Amazon Managed Service for Prometheus User Guide ], "startsAt": "timestamp", "endsAt": "timestamp", "createdBy": "string", "comment": "string" } Sample request POST /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/alertmanager/api/v2/silences HTTP/1.1 Content-Length: 281, Authorization: AUTHPARAMS X-Amz-Date: 20201201T193725Z User-Agent: Grafana/8.1.0 { "matchers":[ { "name":"job", "value":"up", "isRegex":false, "isEqual":true } ], "startsAt":"2020-07-23T01:05:36+00:00", "endsAt":"2023-07-24T01:05:36+00:00", "createdBy":"test-person", "comment":"test silence" } Sample response HTTP/1.1 200 OK x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Content-Length: 53 Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon vary: Origin PutAlertManagerSilences 276 Amazon Managed Service for Prometheus User Guide { "silenceID": "512860da-74f3-43c9-8833-cec026542b32" } QueryMetrics The QueryMetrics operation evaluates an instant query at a single point in time or over a range of time. Valid HTTP verbs: GET, POST Valid URIs: /workspaces/workspaceId/api/v1/query This URI evaluates an instant query at a single point in time. /workspaces/workspaceId/api/v1/query_range This URI evaluates an instant query over a range of time. URL query parameters: query=<string> A Prometheus expression query string. Used in both query and query_range. time=<rfc3339 | unix_timestamp> (Optional) Evaluation timestamp if you are using the query for an instant query at a single point in time. timeout=<duration> (Optional) Evaluation timeout. Defaults to and is capped by the value of the -query.timeout flag. Used in both query and query_range. start=<rfc3339 | unix_timestamp> Start timestamp if you are using query_range to query for a range of time. end=<rfc3339 | unix_timestamp> End timestamp if you are using query_range to query for a range of time. step=<duration | float> Query resolution step width in duration format or as a float number of seconds. Use only if you are using query_range to query for a range of time, and required for such queries. QueryMetrics 277 Amazon Managed Service for Prometheus User Guide Duration A duration in a Prometheus-compatible API is a number, followed immediately by one of the following units: • ms milliseconds • s seconds • m minutes • h hours • d days, assuming a day always has 24h • w weeks, assuming a week always has 7d • y years, assuming a year always has 365d Sample request POST /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/api/v1/query? query=sum(node_cpu_seconds_total) HTTP/1.1 Content-Length: 0, Authorization: AUTHPARAMS X-Amz-Date: 20201201T193725Z User-Agent: Grafana/8.1.0 Sample response HTTP/1.1 200 OK x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Content-Length: 132 Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon content-encoding: gzip { "status": "success", "data": { "resultType": "vector", "result": [ { QueryMetrics 278 Amazon Managed Service for Prometheus User Guide "metric": {}, "value": [ 1634937046.322, "252590622.81000024" ] } ] } } RemoteWrite The RemoteWrite operation writes metrics from a Prometheus server to a remote URL in a standardized format. Typically, you will use an existing client such as a Prometheus server to call this operation. Valid HTTP verbs: POST Valid URIs: /workspaces/workspaceId/api/v1/remote_write URL query parameters: None RemoteWrite has an ingestion rate of 70,000 samples per second and ingestion burst size of 1,000,000 samples. Sample request POST /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/api/v1/remote_write --data- binary "@real-dataset.sz" HTTP/1.1 Authorization: AUTHPARAMS X-Amz-Date: 20201201T193725Z User-Agent: Prometheus/2.20.1 Content-Type: application/x-protobuf Content-Encoding: snappy X-Prometheus-Remote-Write-Version: 0.1.0 RemoteWrite 279 Amazon Managed Service for Prometheus User Guide body Note For the request body syntax, see to the protocol buffer definition at https://github.com/ prometheus/prometheus/blob/1c624c58ca934f618be737b4995e22051f5724c1/prompb/ remote.pb.go#L64. Sample response HTTP/1.1 200 OK x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Content-Length:0 Connection: keep-alive Date: Tue, 01 Dec 2020 19:37:25 GMT Content-Type: application/json Server: amazon vary: Origin RemoteWrite 280 Amazon Managed Service for Prometheus User Guide Document History for Amazon Managed Service for Prometheus User Guide The following table describes important documentation updates in the Amazon Managed Service for Prometheus User Guide. For notification about updates to this documentation, you can subscribe to an RSS feed. Change Description Date Update to the AmazonPro metheusConsoleFullAccess The AmazonPrometheusCo nsoleFullAccess policy was managed IAM policy. updated. The aps:Updat April 14, 2025 eWorkspaceConfigur ation and aps:Descr ibeWorkspaceConfig uration permissions were added to the policy. Added editing of rules definition files and Alert Amazon Managed Service for Prometheus adds support May 16, 2024 manager configuration files in for editing Alert manager the console Added simpler AWS managed collector setup with access entries for Amazon EKS May 2, 2024 configuration files and rules definition files from within the Amazon Managed Service for Prometheus console. Amazon Managed Service for Prometheus adds support
amazon-managed-prometheus-user-guide-089
amazon-managed-prometheus-user-guide.pdf
89
feed. Change Description Date Update to the AmazonPro metheusConsoleFullAccess The AmazonPrometheusCo nsoleFullAccess policy was managed IAM policy. updated. The aps:Updat April 14, 2025 eWorkspaceConfigur ation and aps:Descr ibeWorkspaceConfig uration permissions were added to the policy. Added editing of rules definition files and Alert Amazon Managed Service for Prometheus adds support May 16, 2024 manager configuration files in for editing Alert manager the console Added simpler AWS managed collector setup with access entries for Amazon EKS May 2, 2024 configuration files and rules definition files from within the Amazon Managed Service for Prometheus console. Amazon Managed Service for Prometheus adds support for Amazon EKS access entries to simplify setting up AWS managed collector s. The AmazonPrometheusSc raperServiceRolePolicy managed policy for AWS managed collectors is updated to allow deleting 281 Amazon Managed Service for Prometheus User Guide access entries that are no longer used. Move AWS API to a separate API reference guide The Amazon Managed Service for Prometheus AWS February 7, 2024 APIs are now available in their own reference, the Amazon Managed Service for Prometheus API Reference. Prometheus-compatible APIs continue to be documented in the Amazon Managed Service for Prometheus User Guide. Added customer managed keys for workspace encryptio Amazon Managed Service for Prometheus adds support December 21, 2023 n for customer managed keys for workspace encryption. For more information, see Encryption at rest. Added new permissions to AmazonPrometheusFu Added new permissions to the AmazonPrometheusFu November 26, 2023 llAccess Added new managed policy, AmazonPrometheusSc raperServiceLinkedRolePolicy llAccess managed policy to support creating AWS managed collectors for Amazon EKS clusters. Added a new managed policy, AmazonPrometheusSc raperServiceLinkedRolePolic y for AWS managed collector s to collect metrics from Amazon EKS clusters. November 26, 2023 Added AWS managed collectors as ingestion method Amazon Managed Service for Prometheus adds support for AWS managed collectors. November 26, 2023 282 Amazon Managed Service for Prometheus User Guide Added support for integrati ng with Amazon Managed Amazon Managed Service for Prometheus adds support November 23, 2022 Grafana for integrating with Amazon Managed Grafana alerts. Added new permissions to AmazonPrometheusCo Added new permissions to the AmazonPrometheusCo October 24, 2022 nsoleFullAccess Added Amazon EKS observabi lity solution. nsoleFullAccess managed policy to support logging alert manager and ruler events in CloudWatch Logs. Amazon Managed Service for Prometheus adds a new solution using AWS Observabi lity Accelerator. For more information, see Using AWS Observability Accelerator. October 14, 2022 Added support for integrati ng into Amazon EKS cost Amazon Managed Service for Prometheus adds support for monitoring. integrating into Amazon EKS September 22, 2022 Launched support for Alert Manager and Ruler logs in Amazon CloudWatch Logs. cost monitoring. For more information, see Integrati ng with Amazon EKS cost monitoring. Amazon Managed Service for Prometheus launches support for Alert Manager and Ruler error logs in Amazon CloudWatch Logs. For more information, see Amazon CloudWatch Logs. September 1, 2022 283 Amazon Managed Service for Prometheus User Guide Added custom storage retention support. August 12, 2022 Amazon Managed Service for Prometheus adds custom storage retention support, per workspace, by modifying the quota for that workspace . For more information about quotas in Amazon Managed Service for Prometheus, see Service quotas. Added usage metrics to Amazon CloudWatch. Amazon Managed Service for Prometheus adds support May 6, 2022 for sending usage metrics to Amazon CloudWatch. For more information, see Amazon CloudWatch metrics. Added support for the Europe (London) Region. Amazon Managed Service for Prometheus adds support for May 4, 2022 the Europe (London) Region. Amazon Managed Service for Prometheus is generally Amazon Managed Service for Prometheus is generally available, and adds support available. It also supports for rules and alert manager. rules and alert manager. September 29, 2021 Tagging support added. For more information, see Recording rules and alerting rules and Alert manager and templating. Amazon Managed Service for Prometheus supports tagging of Amazon Managed Service for Prometheus workspaces. September 7, 2021 284 Amazon Managed Service for Prometheus User Guide Active series and ingestion rate quotas increased. The active series quota increased to 1,000,000 and February 22, 2021 the ingestion rate quota increased to 70,000 samples per second. Amazon Managed Service for Prometheus preview release. The preview of Amazon Managed Service for December 15, 2020 Prometheus is released. 285
amazon-monitron-gsg-001
amazon-monitron-gsg.pdf
1
Getting Started Guide Amazon Monitron Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon Monitron Getting Started Guide Amazon Monitron: Getting Started Guide Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon. Amazon Monitron Table of Contents Getting Started Guide ......................................................................................................................................................... iv Getting started with Amazon Monitron ......................................................................................... 1 Setting up a project ..................................................................................................................................... 2 Step 1: Create an account ..................................................................................................................... 2 Step 2: Create a project ......................................................................................................................... 4 Step 3: Create admin users ................................................................................................................... 5 Step 4: (optional) Add Amazon Monitron users to your project .................................................... 6 Step 5: Invite users to your project .................................................................................................. 10 Adding assets and installing devices ..................................................................................................... 10 Step 1: Add a Gateway ........................................................................................................................ 11 Step 2: Adding Assets .......................................................................................................................... 15 Step 3: Attach Sensors ........................................................................................................................ 17 Understanding warnings and alerts ....................................................................................................... 21 Step 1: Understanding asset health ................................................................................................. 22 Step 2: Viewing asset conditions ....................................................................................................... 27 Step 3: Viewing and acknowledging a machine abnormality ...................................................... 29 Step 4: Resolving a machine abnormality ....................................................................................... 33 Step 5: Muting alerts ........................................................................................................................... 33 Detailed documentation ................................................................................................................ 36 Document history .......................................................................................................................... 37 iii Amazon Monitron Getting Started Guide Amazon Monitron is no longer open to new customers. Existing customers can continue to use the service as normal. For capabilities similar to Amazon Monitron, see our blog post. iv Amazon Monitron Getting Started Guide Getting started with Amazon Monitron Welcome to the Amazon Monitron Getting Started Guide. Amazon Monitron is an end-to-end system that automatically detects abnormal behavior in industrial machinery, enabling you to take proactive action on potential failures and reduce unplanned downtime. It includes sensor devices to capture vibration and temperature data, a gateway device to securely transfer data to the AWS Cloud, the Amazon Monitron service that analyzes the data for abnormal machine patterns using machine learning, and a companion mobile app to set up the devices and track potential failures in your machinery. Reliability managers can quickly deploy Amazon Monitron to easily track machine health of industrial equipment such as such as bearings, motors, gearboxes, and pumps without any development work or specialized training. This guide explains the basic steps to get started with Amazon Monitron: 1. Setting up a project—This provides the framework for the rest of your team to monitor your equipment. It uses the Amazon Monitron console and will probably only need to be done occasionally, or even just once, depending on the number of projects you choose to have. All other tasks are done through the Amazon Monitron mobile app. 2. Adding assets and installing devices—All of these tasks are done using the mobile app. It's a major activity at the beginning of the project. You can add a few assets and install just a few devices at first, and then come back to it with additional assets later on. 3. Understanding alerts—This is the daily use of Amazon Monitron and is done using the mobile app. It consists of daily monitoring, as well as the tasks that have to be dealt with when Amazon Monitron discovers a possible machine abnormality. For more detailed steps, refer to the Amazon Monitron User Guide. To learn more about Amazon Monitron, you can visit the Amazon Monitron product detail page. Topics • Setting up a project • Adding assets and installing devices • Understanding warnings and alerts 1 Amazon Monitron Getting Started Guide Setting up a project The first step with Amazon Monitron is to set up your project in the Amazon Monitron console. A project is where your team sets up gateways, assets, and sensors in the Amazon Monitron mobile app. Topics • Step 1: Create an account • Step 2: Create a project • Step 3: Create admin users • Step 4: (optional) Add Amazon Monitron users to your project • Step 5: Invite users to your project Step 1: Create an account Sign up for an AWS account If you do not have an AWS account, complete the following steps to create one. To sign up for an AWS account 1. Open https://portal.aws.amazon.com/billing/signup. 2. Follow the online instructions. Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad. When you sign up for an AWS account, an AWS account root user is created. The root user has access to all AWS services and resources in the account. As a security best practice, assign administrative
amazon-monitron-gsg-002
amazon-monitron-gsg.pdf
2
users to your project Step 1: Create an account Sign up for an AWS account If you do not have an AWS account, complete the following steps to create one. To sign up for an AWS account 1. Open https://portal.aws.amazon.com/billing/signup. 2. Follow the online instructions. Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad. When you sign up for an AWS account, an AWS account root user is created. The root user has access to all AWS services and resources in the account. As a security best practice, assign administrative access to a user, and use only the root user to perform tasks that require root user access. AWS sends you a confirmation email after the sign-up process is complete. At any time, you can view your current account activity and manage your account by going to https://aws.amazon.com/ and choosing My Account. Setting up a project 2 Amazon Monitron Getting Started Guide Create a user with administrative access After you sign up for an AWS account, secure your AWS account root user, enable AWS IAM Identity Center, and create an administrative user so that you don't use the root user for everyday tasks. Secure your AWS account root user 1. Sign in to the AWS Management Console as the account owner by choosing Root user and entering your AWS account email address. On the next page, enter your password. For help signing in by using root user, see Signing in as the root user in the AWS Sign-In User Guide. 2. Turn on multi-factor authentication (MFA) for your root user. For instructions, see Enable a virtual MFA device for your AWS account root user (console) in the IAM User Guide. Create a user with administrative access 1. Enable IAM Identity Center. For instructions, see Enabling AWS IAM Identity Center in the AWS IAM Identity Center User Guide. 2. In IAM Identity Center, grant administrative access to a user. For a tutorial about using the IAM Identity Center directory as your identity source, see Configure user access with the default IAM Identity Center directory in the AWS IAM Identity Center User Guide. Sign in as the user with administrative access • To sign in with your IAM Identity Center user, use the sign-in URL that was sent to your email address when you created the IAM Identity Center user. For help signing in using an IAM Identity Center user, see Signing in to the AWS access portal in the AWS Sign-In User Guide. Step 1: Create an account 3 Amazon Monitron Getting Started Guide Assign access to additional users 1. In IAM Identity Center, create a permission set that follows the best practice of applying least- privilege permissions. For instructions, see Create a permission set in the AWS IAM Identity Center User Guide. 2. Assign users to a group, and then assign single sign-on access to the group. For instructions, see Add groups in the AWS IAM Identity Center User Guide. Important Amazon Monitron supports all IAM Identity Center regions except opt-in and government regions. For a list of supported regions, see Understanding SSO requirements. Step 2: Create a project Now that you've signed in to the AWS Management Console, you can use the Amazon Monitron console to create your project. To create a project 1. Choose the AWS Region that you want to use in the Region selector. Amazon Monitron is available only in the US East (N. Virginia), Europe (Ireland), and Asia Pacific (Sydney) Regions. 2. Open the Amazon Monitron console at https://console.aws.amazon.com/monitron. 3. Choose Create project. 4. Under Project Details, for Project name, enter a name for the project. 5. (Optional) Under Data encryption, you can check Custom encryption settings (advanced) if you have an AWS KMS key in AWS Key Management Service. Amazon Monitron encrypts all data at rest and in transit. If you don't provide your own CMK, your data is encrypted by a CMK that Amazon Monitron owns and manages. For more information about encryption for your project, see KMS and Data Encryption in Amazon Monitron. 6. (Optional) To add a tag to the project, enter a key-value pair under Tags and then choose Add tag. Step 2: Create a project 4 Amazon Monitron Getting Started Guide For more information about tags, see Tags in Amazon Monitron. 7. Choose Next to create the project. When you create your first project, the owner of the AWS account will get an email from AWS Organizations. No action needs to be taken based on this email. Step 3: Create admin users Give access to one or more people in your organization (such as reliability managers) as admin users. An admin user is a person who belongs to an Amazon Monitron project and who can add other users to
amazon-monitron-gsg-003
amazon-monitron-gsg.pdf
3
tag. Step 2: Create a project 4 Amazon Monitron Getting Started Guide For more information about tags, see Tags in Amazon Monitron. 7. Choose Next to create the project. When you create your first project, the owner of the AWS account will get an email from AWS Organizations. No action needs to be taken based on this email. Step 3: Create admin users Give access to one or more people in your organization (such as reliability managers) as admin users. An admin user is a person who belongs to an Amazon Monitron project and who can add other users to the project. When you add an admin user, Amazon Monitron creates an account for that user in AWS IAM Identity Center. IAM Identity Center is a service that helps you manage SSO access to AWS accounts and applications in your organization. Amazon Monitron uses IAM Identity Center to authenticate users for the Amazon Monitron mobile app. If you haven't enabled IAM Identity Center in your AWS account, Amazon Monitron enables it for you when you create your first Amazon Monitron admin user. If you are already using IAM Identity Center in your account, then your IAM Identity Center users are shown in the Amazon Monitron console. Complete the steps in this section to add yourself to your project as an admin user. Repeat them for each additional admin user that you want to create. Step 3: Create admin users 5 Amazon Monitron To create an admin user Getting Started Guide Unless you already use IAM Identity Center in your AWS account, use Amazon Monitron to create admin users. If these users are already in IAM Identity Center, you can skip creating the users, and you are ready to assign the admin role to them. 1. Open the Amazon Monitron console at https://console.aws.amazon.com/monitron. 2. On the Add project admin user page, choose Create user. 3. In the Create user section, enter the admin user's email address and name. 4. Choose Create user. Amazon Monitron creates a user in IAM Identity Center. IAM Identity Center sends the user an email that contains a link to activate the account. The link is valid for up to seven days. Within this time, each user must open the email and accept the invitation. To assign the admin role to the admin users 1. On the Add project admin user page, select the checkbox for each admin user that you created. 2. Choose Add. You can add admin users to your project even if those people have not yet accepted the invitations to their IAM Identity Center accounts. Step 4: (optional) Add Amazon Monitron users to your project In addition to admin users, you can also add users who lack admin permissions. For example, these users might be technicians who only use the Amazon Monitron mobile app to monitor assets, acknowledge notifications and enter closure codes. For users who are not admin users: • You use IAM Identity Center, not Amazon Monitron, to create their user accounts. • You use the Amazon Monitron mobile app to add the users to projects, not the Amazon Monitron console. The following steps are not required if all of your users are admin users. Step 4: (optional) Add Amazon Monitron users to your project 6 Amazon Monitron Getting Started Guide To add users to IAM Identity Center If your users already have accounts in IAM Identity Center in your AWS account, you can skip these steps. You are ready to add the users to your project in the mobile app. Otherwise, add your users to IAM Identity Center by completing the following steps. 1. Open the AWS IAM Identity Center console at https://console.aws.amazon.com/singlesignon/. 2. In the IAM Identity Center console, choose Users. 3. Repeat the following steps for each user that will access your project in the Amazon Monitron mobile app. a. On the Users page choose Add user. b. In the User details section, provide the username and contact information. Leave Password set to Send an email to the user with password setup instructions. c. Choose Next: Groups. d. Choose Add user. IAM Identity Center sends the user an email that contains a link to activate the IAM Identity Center user. The link is valid for up to seven days. Each user must open the email and accept the invitation before accessing your project in the Amazon Monitron mobile app. Step 4: (optional) Add Amazon Monitron users to your project 7 Amazon Monitron Getting Started Guide To add a user using the mobile app 1. Log into the Amazon Monitron mobile app on your smartphone. 2. Navigate to the project or site that you want to add a user to, and then to the Users list. 3. Choose Add user. 4. Enter a user name. Amazon Monitron searches the
amazon-monitron-gsg-004
amazon-monitron-gsg.pdf
4
Center user. The link is valid for up to seven days. Each user must open the email and accept the invitation before accessing your project in the Amazon Monitron mobile app. Step 4: (optional) Add Amazon Monitron users to your project 7 Amazon Monitron Getting Started Guide To add a user using the mobile app 1. Log into the Amazon Monitron mobile app on your smartphone. 2. Navigate to the project or site that you want to add a user to, and then to the Users list. 3. Choose Add user. 4. Enter a user name. Amazon Monitron searches the user directory for the user. 5. Choose the user from the list. 6. Choose the role that you want to assign the user: Admin, Technician, or Viewer. 7. Choose Add. The new user appears on the Users list. 8. Send the new user an email invitation with a link for accessing the project and downloading the Amazon Monitron mobile app. For more information, see Sending an email invitation. How to add a user using the web app 1. Select Users from the navigation pane. 2. Choose Add user. Step 4: (optional) Add Amazon Monitron users to your project 8 Amazon Monitron Getting Started Guide 3. Enter a user name. Amazon Monitron searches the user directory for the user. 4. Choose the user from the list. 5. Choose the role that you want to assign the user: Admin, Technician, or Read only. 6. Choose Add. The new user appears on the Users list. 7. Send the new user an email invitation with a link for accessing the project and downloading the Amazon Monitron mobile app. For more information, see Sending an email invitation. Step 4: (optional) Add Amazon Monitron users to your project 9 Amazon Monitron Getting Started Guide Step 5: Invite users to your project Invite the users you've added to your Amazon Monitron project. 1. Open the Amazon Monitron console at https://console.aws.amazon.com/monitron. 2. In the navigation pane, choose Projects. 3. On the Projects page, choose your project name to open its details page. 4. Repeat the following steps for each user that you want to invite. a. Under How it works, choose Email instructions. Your email client opens a draft that contains an invitation to your Amazon Monitron project. It contains both a link to download the Amazon Monitron mobile app from the Google Play Store and a link to open the project. b. Email this message to the user. Adding assets and installing devices Once you've created a project, you or reliability managers and technicians from your team can use the Amazon Monitron mobile app to add gateways, create assets and pair sensors to them, and start monitoring your equipment. Only smartphones using Android 8.0+ or iOS 14+ with Near Field Communication (NFC) and Bluetooth are supported by Amazon Monitron. Step 5: Invite users to your project 10 Amazon Monitron Getting Started Guide Your IT manager or reliability manager will generate an email describing how to log in for the first time and connect to your project and send this to you. Once you've logged in for the first time, you can follow the steps to add gateways and install devices. Topics • Step 1: Add a Gateway • Step 2: Adding Assets • Step 3: Attach Sensors Step 1: Add a Gateway In Amazon Monitron, sensors collect data from machines and pass it to gateways, which transmit the data to the AWS Cloud and thus to Amazon Monitron for analysis. These gateways are usually mounted on the wall of a factory within 20 to 30 meters from the sensor and connect to the AWS Cloud using the local Wi-Fi network. Before adding a gateway, make sure that Bluetooth is turned on for your smartphone. To add a Wi-Fi gateway 1. Choose the menu icon (☰), and then choose Getting Started. 2. Choose Add gateway. Step 1: Add a Gateway 11 Amazon Monitron Getting Started Guide 3. In your factory, position your gateway in the location that works best for communicating with your sensors. The best place to mount your gateway is higher than the sensors and no more than 20 to 30 meters away. For more information about locating gateways, see Where to Install Your Gateway in the Amazon Monitron User Guide. 4. Plug the gateway in and make sure that the LED lights on the top alternatively blink yellow and blue. 5. Push the button on the side of the gateway to put it into commissioning mode. The lights will start blinking rapidly. 6. In the mobile app, choose Next. 7. Choose Add gateway. Amazon Monitron searches for the gateway, which can take a few moments. When it finds it, the gateway appears in the gateway list. Step 1: Add a Gateway 12 Amazon Monitron Getting
amazon-monitron-gsg-005
amazon-monitron-gsg.pdf
5
about locating gateways, see Where to Install Your Gateway in the Amazon Monitron User Guide. 4. Plug the gateway in and make sure that the LED lights on the top alternatively blink yellow and blue. 5. Push the button on the side of the gateway to put it into commissioning mode. The lights will start blinking rapidly. 6. In the mobile app, choose Next. 7. Choose Add gateway. Amazon Monitron searches for the gateway, which can take a few moments. When it finds it, the gateway appears in the gateway list. Step 1: Add a Gateway 12 Amazon Monitron Getting Started Guide If it can't find the gateway, see Setting Up Gateways in the Amazon Monitron User Guide for possible solutions. 8. When you see the new gateway in the list, choose it. It can take a few moments for Amazon Monitron to connect to the new gateway. 9. After it connects to the gateway, Amazon Monitron scans for Wi-Fi networks. Choose the Wi-Fi network that you want to use. 10. Enter your Wi-Fi password, and then choose Connect. It can take a few minutes for the gateway to be commissioned. To add an Ethernet gateway 1. If Bluetooth isn't already turned on for your smartphone, turn it on. 2. Position your gateway in the location that works best for communicating with your sensors. The best place to mount your gateway is higher than the sensors and no more than 20 to 30 meters away. 3. Plug in the gateway and make sure the network light (yellow) and the Bluetooth light (blue) on the front of your gateway are blinking alternatively. 4. Push the Config button on the gateway to put it into commissioning mode. the Bluetooth and network LED lights will start flashing rapidly. 5. Open the mobile app on your smartphone. 6. On the Getting started page or the Gateways page, choose Add gateway. Step 1: Add a Gateway 13 Amazon Monitron Getting Started Guide Amazon Monitron scans for the gateway. This can take a few moments. when Amazon Monitron finds the gateway, it displays it in the gateway list. 7. Choose the gateway. It can take a few moments for Amazon Monitron to connect to the new gateway. 8. After it connects to the gateway, Amazon Monitron will provide two options for you to configure the network connection for your gateway. 9. Choose your network configuation. It can take a few minutes for the gateway to be commissioned and to connect to the network. Step 1: Add a Gateway 14 Amazon Monitron Getting Started Guide a. If you choose automatic (DHCP), Amazon Monitron will automatically configure the network to connect the gateway. b. If you choose manual, enter your IP address, subnet mask, router, preferred DNS server, and alternate DNS server (optional) information. then choose connect. Step 2: Adding Assets In Amazon Monitron, the machines you monitor are known as assets. Assets are usually individual machines, but they can also be specific sections of equipment. Assets are paired to sensors, which directly monitor temperature and vibration to check for potential failures. Step 2: Adding Assets 15 Amazon Monitron To add an asset 1. On the Getting Started page, choose Add asset. Getting Started Guide 2. 3. For Asset name, enter a name for the asset that you want to create. For Machine class, choose the machine class of the asset. Asset machine class is based on ISO 20816 Standards. For more information about machine classes, see Assets. Note Asset machine class is based on ISO 20816 Standards. Amazon Monitron administrators can also create custom machine asset classes for all positions within a project. For more information about machine classes and customizing them, see Assets. 4. Choose Add. Step 2: Adding Assets 16 Amazon Monitron Getting Started Guide When you've added your first asset, it's displayed on the Assets list page. Step 3: Attach Sensors Assets are paired to sensors, which directly monitor an asset's health. You place each sensor on the asset in a position that you want to monitor. You can place one or more sensors on each asset. Each sensor takes vibration and temperature measurements at the position to which it is paired and sends it to the AWS Cloud for analysis of machine health using the gateway. Where to Place Sensors When placing a sensor, choose a location where it can accurately detect the machine's temperature or vibration. To achieve the greatest accuracy: • Mount the sensor directly onto the housing of the target component. • Minimize the length of the vibration transmission path, the distance between the source of vibration and sensor. • Avoid mounting the sensor in a location that can oscillate due to natural frequencies, such as sheet metal covers. Vibration will attenuate up to 30-36"/75-90 cm) from the source. Attributes
amazon-monitron-gsg-006
amazon-monitron-gsg.pdf
6
it to the AWS Cloud for analysis of machine health using the gateway. Where to Place Sensors When placing a sensor, choose a location where it can accurately detect the machine's temperature or vibration. To achieve the greatest accuracy: • Mount the sensor directly onto the housing of the target component. • Minimize the length of the vibration transmission path, the distance between the source of vibration and sensor. • Avoid mounting the sensor in a location that can oscillate due to natural frequencies, such as sheet metal covers. Vibration will attenuate up to 30-36"/75-90 cm) from the source. Attributes of the vibration transmission path length that can reduce the transmission path length include: • The number of mounting surfaces, causing signal reflection • Materials such as rubber and plastic that can absorb vibration The following examples show where to place sensors. For more information and examples, see Where to Place Your Sensors in the Amazon Monitron User Guide. Step 3: Attach Sensors 17 Amazon Monitron Getting Started Guide How to Place Sensors When you've decided where to place a sensor on an asset, make sure that a minimum of one- third of the sensor base is fixed to the asset. The sensors can pick up vibration and temperature measurements across the entire base of the sensor, but it's important to have the asset target area centered as much as possible on the sensor as shown in the following image. Step 3: Attach Sensors 18 Amazon Monitron Getting Started Guide Attach the sensor with an industrial adhesive. We recommend a cyanoacrylate-type epoxy. For additional information about attaching the sensor to your asset, see How to Place the Sensors in the Amazon Monitron User's Guide. Warning Amazon Monitron sensors can be attached to the equipment using industrial adhesive. We suggest you check the surface before selecting the adhesive. For surfaces up to 5 mm roughness/gaps, you can select an adhesive that fills the gap, such as LOCTITE® 3090. For flat surfaces (<0.1mm roughness), you can select a more generic adhesive, such as LOCTITE® 454. Always check and follow the processing guidelines outlined by the adhesive vendor. For more information about safely using the adhesive, see Loctite 454 Technical Information or Loctite 3090 Technical Information, as appropriate. To attach the Amazon Monitron sensor 1. Apply a thin layer of the adhesive on the bottom of the sensor, maximizing the contact area. 2. Hold the sensor to the mounting location on the machine part, pressing firmly for the length of time specified by the adhesive instructions. Step 4: Pairing Sensors to an Asset Each sensor that you pair to an asset has a designated position and is set to monitor a specific part of the asset. For example, a sensor set up to monitor bearings on a conveyor belt might have the position of Left bearing 1 with a position type of Bearing. Step 3: Attach Sensors 19 Amazon Monitron Getting Started Guide Amazon Monitron uses Near Field Communications (NFC), a short-range (4 cm or less) wireless technology for communication between two electronic devices. To use Amazon Monitron, you need an iOS or Android 8.0+ smartphone with NFC installed natively. Important The equipment that you want to monitor must be in a healthy state before you pair it to a sensor. Amazon Monitron must establish a baseline for the equipment based on its normal state so that it can later determine abnormalities. To pair a sensor with an asset 1. Attach your sensor in the correct position, as described in Step 3: Attach Sensors . You can also attach the sensor after pairing it to the asset in this step 4. 2. Make sure that the NFC feature on your smartphone is on and functioning. 3. From the Assets list, choose the asset that you just created. 4. Choose Pair sensor. 5. For Position name, provide a name for the sensor position. 6. Choose the Type of position that best fits the location that you're going to monitor: • Bearing • Compressor • Fan • Gearbox • Motor • Pump • Other Note After you pair the sensor, you can't change the position type. 7. Hold your phone close to the sensor to register it. A progress bar shows when registration is complete. Step 3: Attach Sensors 20 Amazon Monitron Getting Started Guide It can take a few moments for the sensor to be commissioned. If you have trouble pairing the sensor, see Pairing Your Sensor for more information. Tip If your smartphone fails to detect the sensor, try holding it so that the NFC antenna is close to the sensor. For iPhone models, the antenna is located at the top edge of the device. For Android models, the antenna location varies. The following resources might help you locate the NFC antenna on
amazon-monitron-gsg-007
amazon-monitron-gsg.pdf
7
register it. A progress bar shows when registration is complete. Step 3: Attach Sensors 20 Amazon Monitron Getting Started Guide It can take a few moments for the sensor to be commissioned. If you have trouble pairing the sensor, see Pairing Your Sensor for more information. Tip If your smartphone fails to detect the sensor, try holding it so that the NFC antenna is close to the sensor. For iPhone models, the antenna is located at the top edge of the device. For Android models, the antenna location varies. The following resources might help you locate the NFC antenna on an Android device: • NFC detection area (Samsung) • Pixel phone hardware diagram On the Assets page, the sensor is now paired to the asset and is identified by its position. Understanding warnings and alerts Note This section focuses on using the Amazon Monitron mobile app. To learn about the Amazon Monitron web app, see Understanding sensor measurements in the Amazon Monitron User Guide. After a sensor is paired to an asset, Amazon Monitron starts monitoring the asset's condition. When it detects an abnormal machine condition, it sends you a notification ( Understanding warnings and alerts ) 21 Amazon Monitron Getting Started Guide and changes the asset state. The alert notification is generated using a combination of machine learning and ISO 20816 standards for machine vibration. To monitor the data and respond to alerts about abnormalities, you use the Amazon Monitron mobile app. Your administrator will send you an email with information about how to log in for the first time and connect to your project. Topics • Step 1: Understanding asset health • Step 2: Viewing asset conditions • Step 3: Viewing and acknowledging a machine abnormality • Step 4: Resolving a machine abnormality • Step 5: Muting alerts Step 1: Understanding asset health To monitor assets using the Amazon Monitron mobile app, start with the Assets list. This list is displayed when you open the mobile app. Step 1: Understanding asset health 22 Amazon Monitron Getting Started Guide Each asset in your project or site is listed in the Assets list. On the Assets list page, each asset shows an icon indicating its health. The following table describes these icons. Icon Health state Healthy state: The status of all sensor positions on the asset is healthy. Warning state: A warning has been triggered for one of the positions of this asset, indicating that Step 1: Understanding asset health 23 Amazon Monitron Icon Getting Started Guide Health state Amazon Amazon Monitron has detected early signs of potential failure. Amazon Amazon Monitron identifie s warning conditions by analyzing equipment vibration and temperatu re, using a combination of machine learning and ISO vibration standards. Alarm state: Once an asset has been placed in a warning state, Amazon Monitron will continue to monitor it. Again, Amazon Monitron is using a combination of machine learning and vibration ISO standards. If the condition of the asset gets significa ntly worse, Amazon Amazon Monitron will escalate by sending an Alarm notificat ion when it detects that the equipment condition has significantly worsened. We recommend investigating the issue at the earliest opportuni ty. An equipment failure might occur if the issue isn't addressed. Step 1: Understanding asset health 24 Amazon Monitron Icon No sensor Getting Started Guide Health state Maintenance state: One of the asset's sensors is in the maintenance state. The alarm state of the asset has been acknowledged by a technicia n, but not yet addressed. No sensor: At least one position on the asset doesn't have a sensor paired to it. When you choose an asset, the app displays the health status of each underlying sensor position. The following table describes the position status indicators. Step 1: Understanding asset health 25 Amazon Monitron Status No sensor Getting Started Guide State The position is healthy: All measured values are within their normal range. A warning has been triggered for this position indicatin g early signs of a potential failure condition. We recommend that you monitor the equipment closely and initiate an investigation during an upcoming planned maintenance. An alarm has been triggered for this position, indicating that the machine vibration or temperature is out of the normal range at this position. We recommend investiga ting the issue at the earliest opportunity. An equipment failure might occur if the issue isn't addressed. The alarm state of the position has been acknowled ged by a technician, but not yet addressed. The position doesn't have a sensor paired to it. When an issue is raised for an individual position, the status changes for that position and for the asset as a whole. Step 1: Understanding asset health 26 Amazon Monitron Getting Started Guide Step 2: Viewing asset conditions Viewing assets is more than simply understanding the icons
amazon-monitron-gsg-008
amazon-monitron-gsg.pdf
8
of the normal range at this position. We recommend investiga ting the issue at the earliest opportunity. An equipment failure might occur if the issue isn't addressed. The alarm state of the position has been acknowled ged by a technician, but not yet addressed. The position doesn't have a sensor paired to it. When an issue is raised for an individual position, the status changes for that position and for the asset as a whole. Step 1: Understanding asset health 26 Amazon Monitron Getting Started Guide Step 2: Viewing asset conditions Viewing assets is more than simply understanding the icons that show the asset and position health status. It is often useful to see the data collected by the sensors yourself. To view sensor data in the Amazon Monitron mobile app 1. In the Assets list, choose the asset you want to view. 2. Choose the position with the data that you want to view. 3. Under the Vibration and Temperature tabs, choose the chart of recent sensor data and the level of detail that you want to see. You can choose separate versions for different time periods (1 day, 1 week, 2 weeks, 1 month, and so on). Step 2: Viewing asset conditions 27 Amazon Monitron Getting Started Guide Step 2: Viewing asset conditions 28 Amazon Monitron Getting Started Guide Step 3: Viewing and acknowledging a machine abnormality The longer Amazon Monitron monitors a position, the more it fine-tunes its baseline and increases its accuracy. When an Alarm or a Warning is triggered, Amazon Monitron sends a notification to the mobile app that is displayed as an icon in the upper right of your screen ( ). Choosing the notification icon opens the Notifications page, which lists all pending notifications. When you receive a notification, you must view and acknowledge it. This doesn't fix the issue with the asset, it just lets Amazon Monitron know that you are aware of it. To view and acknowledge an abnormality 1. On the Assets list, choose the asset with the alarm. Step 3: Viewing and acknowledging a machine abnormality 29 Amazon Monitron Getting Started Guide Step 3: Viewing and acknowledging a machine abnormality 30 Amazon Monitron Getting Started Guide 2. Choose the position with the alarm to view the issue. 3. To confirm that you are aware of the issue, choose Acknowledge. Note that the text on the following screens also indicates whether the alert notification was triggered based on the equipment's vibration or temperature, or by the vibration ISO thresholds or machine learning models. This information can be used by technicians to investigate and fix the issue. After an abnormality has been acknowledged and repaired, resolve the issue in the mobile app. Step 3: Viewing and acknowledging a machine abnormality 31 Amazon Monitron Getting Started Guide Step 3: Viewing and acknowledging a machine abnormality 32 Amazon Monitron Getting Started Guide The status of the asset changes to: After the alarm has been acknowledged, the abnormality can be examined and fixed as appropriate. Step 4: Resolving a machine abnormality Resolving an abnormality returns the sensor to healthy status and provides information about the issue to Amazon Monitron so it can better determine when a failure might occur in the future. For information about failure modes and causes, and how to resolve abnormalities, see Resolving a Machine Abnormality in the Amazon Monitron User Guide. To resolve an abnormality 1. In the Assets list, choose the asset with the issue. 2. Choose the position with the resolved abnormality. 3. Choose Resolve. 4. 5. 6. For Failure mode, choose one of the available types. For Failure cause, choose the cause. For Action taken choose the action taken. 7. Choose Submit. In the Assets list, the asset status returns to Healthy. Step 5: Muting alerts ISO thresholds apply broadly to large classes of equipment. Therefore, when detecting the potential failure of a specific asset, you may consider other factors as well. For example, you can mute a notification generated by ISO vibration thresholds if you assess that your equipment is still healthy when the alert is raised. You also can mute alerts by providing the ‘No failure detected’ feedback for the ‘Failure mode’ while closing the alert. Note that Amazon Monitron will continue to notify users of potential Step 4: Resolving a machine abnormality 33 Amazon Monitron Getting Started Guide failures detected based on Machine Learning, even when notifications based on ISO thresholds are muted. Step 5: Muting alerts 34 Amazon Monitron Getting Started Guide Step 5: Muting alerts 35 Amazon Monitron Getting Started Guide Detailed documentation You can learn more about Amazon Monitron by reading the following: • Amazon Monitron User Guide – An overview of Amazon Monitron and procedures for common admin and technician tasks. This guide provides information about setting up sites within
amazon-monitron-gsg-009
amazon-monitron-gsg.pdf
9
alert. Note that Amazon Monitron will continue to notify users of potential Step 4: Resolving a machine abnormality 33 Amazon Monitron Getting Started Guide failures detected based on Machine Learning, even when notifications based on ISO thresholds are muted. Step 5: Muting alerts 34 Amazon Monitron Getting Started Guide Step 5: Muting alerts 35 Amazon Monitron Getting Started Guide Detailed documentation You can learn more about Amazon Monitron by reading the following: • Amazon Monitron User Guide – An overview of Amazon Monitron and procedures for common admin and technician tasks. This guide provides information about setting up sites within your project, placement options for gateways and sensors, and Amazon Monitron hardware specifications. 36 Amazon Monitron Getting Started Guide Document history for the Amazon Monitron Getting Started Guide • Latest documentation update: Oct 31, 2024 The following table describes important changes in each release of Amazon Monitron. For notification about updates to this documentation, you can subscribe to the RSS feed. Change Description Date Amazon Monitron is no longer open to new customers Amazon Monitron is no longer open to new customers October 31, 2024 . Existing customers can . Existing customers can continue to use the service continue to use the service as normal. For capabilities as normal. For capabilities similar to Amazon Monitron, similar to Amazon Monitron, see our blog post. see our blog post. Amazon Monitron will no longer be open to new Amazon Monitron will no longer be open to new customers starting October customers starting October 31, 2024. If you would like 31, 2024. If you would like to use the service, sign up to use the service, sign up prior to that date. Existing prior to that date. Existing customers can continue to customers can continue to use the service as normal. For use the service as normal. For capabilities similar to Amazon capabilities similar to Amazon Monitron, see our blog post. Monitron, see our blog post. October 1, 2024 Updated mobile images Updated vibration ISO and ML temperature charts to show updated measurement functionality. March 16, 2023 37 Amazon Monitron New service and guide Getting Started Guide This is the initial release of the Amazon Monitron Getting Started Guide December 1, 2020 38
amazon-mq-api-001
amazon-mq-api.pdf
1
REST API Reference Amazon MQ Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon MQ REST API Reference Amazon MQ: REST API Reference Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon. Amazon MQ Table of Contents REST API Reference Welcome ........................................................................................................................................... 1 Example REST Request ................................................................................................................................ 1 Example REST Response ............................................................................................................................. 1 Resources .......................................................................................................................................... 5 Broker .............................................................................................................................................................. 5 URI .............................................................................................................................................................. 5 HTTP methods ......................................................................................................................................... 5 Schemas .................................................................................................................................................... 9 Properties ............................................................................................................................................... 16 See also ................................................................................................................................................... 44 Broker Engine Types .................................................................................................................................. 45 URI ............................................................................................................................................................ 45 HTTP methods ....................................................................................................................................... 45 Schemas .................................................................................................................................................. 47 Properties ............................................................................................................................................... 48 See also ................................................................................................................................................... 50 Broker Instance Options ........................................................................................................................... 51 URI ............................................................................................................................................................ 51 HTTP methods ....................................................................................................................................... 51 Schemas .................................................................................................................................................. 53 Properties ............................................................................................................................................... 53 See also ................................................................................................................................................... 57 Broker Reboot ............................................................................................................................................. 57 URI ............................................................................................................................................................ 58 HTTP methods ....................................................................................................................................... 58 Schemas .................................................................................................................................................. 59 Properties ............................................................................................................................................... 60 See also ................................................................................................................................................... 60 Brokers .......................................................................................................................................................... 61 URI ............................................................................................................................................................ 61 HTTP methods ....................................................................................................................................... 61 Schemas .................................................................................................................................................. 64 Properties ............................................................................................................................................... 67 See also ................................................................................................................................................... 84 iii Amazon MQ REST API Reference Brokers broker-id Promote ..................................................................................................................... 85 URI ............................................................................................................................................................ 85 HTTP methods ....................................................................................................................................... 85 Schemas .................................................................................................................................................. 87 Properties ............................................................................................................................................... 87 See also ................................................................................................................................................... 89 Configuration .............................................................................................................................................. 89 URI ............................................................................................................................................................ 90 HTTP methods ....................................................................................................................................... 90 Schemas .................................................................................................................................................. 94 Properties ............................................................................................................................................... 96 See also ................................................................................................................................................ 102 Configuration Revision ............................................................................................................................ 103 URI ......................................................................................................................................................... 104 HTTP methods .................................................................................................................................... 104 Schemas ................................................................................................................................................ 105 Properties ............................................................................................................................................. 106 See also ................................................................................................................................................ 107 Configuration Revisions .......................................................................................................................... 108 URI ......................................................................................................................................................... 108 HTTP methods .................................................................................................................................... 108 Schemas ................................................................................................................................................ 111 Properties ............................................................................................................................................. 111 See also ................................................................................................................................................ 113 Configurations .......................................................................................................................................... 114 URI ......................................................................................................................................................... 114 HTTP methods .................................................................................................................................... 114 Schemas ................................................................................................................................................ 117 Properties ............................................................................................................................................. 118 See also ................................................................................................................................................ 125 Tag ............................................................................................................................................................... 126 URI ......................................................................................................................................................... 126 HTTP methods .................................................................................................................................... 126 Schemas ................................................................................................................................................ 130 Properties ............................................................................................................................................. 131 See also ................................................................................................................................................ 132 iv Amazon MQ REST API Reference User ............................................................................................................................................................. 133 URI ......................................................................................................................................................... 133 HTTP methods .................................................................................................................................... 134 Schemas ................................................................................................................................................ 141 Properties ............................................................................................................................................. 142 See also ................................................................................................................................................ 148 Users ........................................................................................................................................................... 149 URI ......................................................................................................................................................... 150 HTTP methods .................................................................................................................................... 150 Schemas ................................................................................................................................................ 152 Properties ............................................................................................................................................. 153 See also ................................................................................................................................................ 155 Operations .................................................................................................................................... 156 v Amazon MQ Welcome REST API Reference Welcome to the Amazon MQ REST API reference. In this guide, you can find descriptions of REST resources, example requests, HTTP methods, schemas, parameters, and the errors that the service returns. Amazon MQ is a managed message broker service for Apache ActiveMQ and RabbitMQ that makes it easy to set up and operate message brokers in the cloud. A message broker allows software applications and components to communicate using various programming languages, operating systems, and formal messaging protocols. Amazon MQ works with your existing applications and services without the need to manage, operate, or maintain your own messaging system. Topics • Example REST Request • Example REST Response Additional Information • Amazon MQ Product Page • Amazon MQ Developer Guide • Amazon MQ in the AWS CLI Command Reference • Regions and Endpoints This document was last published on July 7, 2021 Example REST Request The following is an example of an Amazon MQ REST request (and its headers) which creates a new Amazon MQ for ActiveMQ broker: POST /v1/brokers HTTP/1.1 Content-Type: application/json X-Amz-Date: 20171123T214525Z Authorization: AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20171128/us- east-2/mq/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date, Signature=a12bc34567defg89h0ij1234kl56m789no01p2q345r6s789tu01v2w3x4567890 Example REST Request 1 Amazon MQ REST API Reference Host: mq.us-east-2.amazonaws.com Cache-Control: no-cache { "brokerName": "MyActiveMQBroker", "hostInstanceType": "mq.m5.large", "engineType": "ActiveMQ", "engineVersion": "5.15.8", "logs": { "general": true, "audit": false }, "deploymentMode": "ACTIVE_STANDBY_MULTI_AZ", "publiclyAccessible": true, "subnetIds": [ "subnet-12a3b45c", "subnet-67d8e90f" ], "securityGroups": [ "sg-a1b234cd", "sg-e5f678gh" ], "autoMinorVersionUpgrade": true, "users": [{ "password": "MyPassword456", "groups": [ "admins" ], "consoleAccess": true, "username": "jane.doe" }] } The following is an example of an Amazon MQ REST request (and its headers) which creates a new Amazon MQ for RabbitMQ broker: POST /v1/brokers HTTP/1.1 Content-Type: application/json X-Amz-Date: 20171123T214525Z Authorization: AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20171128/us- east-2/mq/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date, Signature=a12bc34567defg89h0ij1234kl56m789no01p2q345r6s789tu01v2w3x4567890 Host: mq.us-east-2.amazonaws.com Example REST Request 2 Amazon MQ Cache-Control: no-cache REST API Reference { "brokerName": "MyRabbitMQBroker", "hostInstanceType": "mq.m5.large", "engineType": "RabbitMQ", "engineVersion": "3.8.6", "logs": { "general": true }, "deploymentMode": "CLUSTER_MULTI_AZ", "publiclyAccessible": true, "subnetIds": [ "subnet-15a3b47c", "subnet-69d8n90j" ], "autoMinorVersionUpgrade": true, "users": [{ "password": "MyPassword456", "groups": [ "admins" ], "consoleAccess": true, "username": "jane.doe" }] } Example REST Response The following is an example of an Amazon MQ REST response (and its headers) which acknowledges the creation of the new broker: HTTP/1.1 200 OK Content-Type: application/json Content-Length: 250 Connection: keep-alive Date: Wed, 28 Nov 2017 12:00:00 GMT X-Amzn-RequestId: a12bc345-67de-89f0-g12h-345ij6k7l89m X-Amzn-Trace-Id: sampled=1;root=1-2345a67b-c8defg901hijk2lf3m4nopqr X-Cache: Miss from
amazon-mq-api-002
amazon-mq-api.pdf
2
Host: mq.us-east-2.amazonaws.com Example REST Request 2 Amazon MQ Cache-Control: no-cache REST API Reference { "brokerName": "MyRabbitMQBroker", "hostInstanceType": "mq.m5.large", "engineType": "RabbitMQ", "engineVersion": "3.8.6", "logs": { "general": true }, "deploymentMode": "CLUSTER_MULTI_AZ", "publiclyAccessible": true, "subnetIds": [ "subnet-15a3b47c", "subnet-69d8n90j" ], "autoMinorVersionUpgrade": true, "users": [{ "password": "MyPassword456", "groups": [ "admins" ], "consoleAccess": true, "username": "jane.doe" }] } Example REST Response The following is an example of an Amazon MQ REST response (and its headers) which acknowledges the creation of the new broker: HTTP/1.1 200 OK Content-Type: application/json Content-Length: 250 Connection: keep-alive Date: Wed, 28 Nov 2017 12:00:00 GMT X-Amzn-RequestId: a12bc345-67de-89f0-g12h-345ij6k7l89m X-Amzn-Trace-Id: sampled=1;root=1-2345a67b-c8defg901hijk2lf3m4nopqr X-Cache: Miss from cloudfront Via: 1.1 ab123456cd789ef012g34567890h1i23.cloudfront.net (CloudFront) X-Amz-Cf-Id: ABCa1D6b2-EcF3dG7e456_fGIgh7JKLMijNO_PQ8RSTUVWX-Y9k0ZA== Example REST Response 3 Amazon MQ REST API Reference { "brokerId" : "b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", "brokerArn": "arn:aws:mq:us- east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9" } Example REST Response 4 Amazon MQ Resources The Amazon MQ REST API includes the following resources. REST API Reference Topics • Broker • Broker Engine Types • Broker Instance Options • Broker Reboot • Brokers • Brokers broker-id Promote • Configuration • Configuration Revision • Configuration Revisions • Configurations • Tag • User • Users Broker A broker is a message broker environment running on Amazon MQ. It is the basic building block of Amazon MQ. For more information about the different components of an Amazon MQ broker, see How Amazon MQ works in the Amazon MQ Developer Guide. URI /v1/brokers/broker-id HTTP methods GET Operation ID: DescribeBroker Broker 5 Amazon MQ REST API Reference Returns information about the specified broker. Path parameters Name broker-id Type String Required Description True The unique ID that Amazon MQ generates for the broker. Responses Status code Response model Description 200 400 403 404 500 DescribeBrokerOutp HTTP Status Code 200: OK. ut Error Error Error Error HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. HTTP methods 6 Amazon MQ PUT Operation ID: UpdateBroker Adds a pending configuration change to a broker. Path parameters Name broker-id Type String REST API Reference Required Description True The unique ID that Amazon MQ generates for the broker. Responses Status code Response model Description 200 400 403 404 409 UpdateBrokerOutput HTTP Status Code 200: OK. Error Error Error Error HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it. HTTP Status Code 409: Configuration ID is already in use. Remove the configura HTTP methods 7 Amazon MQ REST API Reference Status code Response model Description 500 Error DELETE Operation ID: DeleteBroker Deletes a broker. Note: This API is asynchronous. Path parameters Name broker-id Type String tion from all brokers and retry the request. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. Required Description True The unique ID that Amazon MQ generates for the broker. Responses Status code Response model Description 200 400 403 DeleteBrokerOutput HTTP Status Code 200: OK. Error Error HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your HTTP methods 8 Amazon MQ REST API Reference Status code Response model Description credentials and then retry your request. HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. Required Description True The unique ID that Amazon MQ generates for the broker. 404 500 Error Error OPTIONS Path parameters Name broker-id Type String Responses Status code Response model Description 200 None Default response for CORS method Schemas Request bodies Schemas 9 REST API Reference Amazon MQ PUT schema { "dataReplicationMode": enum, "engineVersion": "string", "maintenanceWindowStartTime": { "dayOfWeek": enum, "timeZone": "string", "timeOfDay": "string" }, "configuration": { "id": "string", "revision": integer }, "storageConfiguration": { "efs": { "throughputMode": enum } }, "authenticationStrategy": enum, "securityGroups": [ "string" ], "ldapServerMetadata": { "roleSearchMatching": "string", "serviceAccountPassword": "string", "roleBase": "string", "hosts": [ "string" ], "roleName": "string", "userBase": "string", "roleSearchSubtree": boolean, "serviceAccountUsername": "string", "userRoleName": "string", "userSearchMatching": "string", "userSearchSubtree": boolean }, "logs": { "general": boolean, "audit": boolean }, "hostInstanceType": "string", "autoMinorVersionUpgrade": boolean Schemas 10 Amazon MQ } Response bodies DescribeBrokerOutput schema { "pendingEngineVersion": "string", "pendingAuthenticationStrategy": enum, "pendingSecurityGroups": [ "string" ], "configurations": { "current": { "id": "string", "revision": integer }, "pending": { "id": "string", "revision": integer }, "history": [ { "id": "string", "revision": integer } ] },
amazon-mq-api-003
amazon-mq-api.pdf
3
"string", "revision": integer }, "storageConfiguration": { "efs": { "throughputMode": enum } }, "authenticationStrategy": enum, "securityGroups": [ "string" ], "ldapServerMetadata": { "roleSearchMatching": "string", "serviceAccountPassword": "string", "roleBase": "string", "hosts": [ "string" ], "roleName": "string", "userBase": "string", "roleSearchSubtree": boolean, "serviceAccountUsername": "string", "userRoleName": "string", "userSearchMatching": "string", "userSearchSubtree": boolean }, "logs": { "general": boolean, "audit": boolean }, "hostInstanceType": "string", "autoMinorVersionUpgrade": boolean Schemas 10 Amazon MQ } Response bodies DescribeBrokerOutput schema { "pendingEngineVersion": "string", "pendingAuthenticationStrategy": enum, "pendingSecurityGroups": [ "string" ], "configurations": { "current": { "id": "string", "revision": integer }, "pending": { "id": "string", "revision": integer }, "history": [ { "id": "string", "revision": integer } ] }, "brokerState": enum, "pendingDataReplicationMode": enum, "engineType": enum, "brokerInstances": [ { "endpoints": [ "string" ], "consoleURL": "string", "ipAddress": "string", "monitoringEndpoints": [ { "endpoint": "string", "type": "string" } Schemas REST API Reference 11 REST API Reference Amazon MQ ] } ], "hostInstanceType": "string", "dataReplicationMode": enum, "storageConfiguration": { "efs": { "throughputMode": enum } }, "publiclyAccessible": boolean, "logs": { "generalLogGroup": "string", "general": boolean, "audit": boolean, "pending": { "general": boolean, "audit": boolean }, "auditLogGroup": "string" }, "ldapServerMetadata": { "roleSearchMatching": "string", "roleBase": "string", "hosts": [ "string" ], "roleName": "string", "userBase": "string", "roleSearchSubtree": boolean, "serviceAccountUsername": "string", "userRoleName": "string", "userSearchMatching": "string", "userSearchSubtree": boolean }, "subnetIds": [ "string" ], "pendingHostInstanceType": "string", "engineVersion": "string", "brokerArn": "string", "brokerId": "string", "deploymentMode": enum, "maintenanceWindowStartTime": { Schemas 12 Amazon MQ REST API Reference "dayOfWeek": enum, "timeZone": "string", "timeOfDay": "string" }, "created": "string", "authenticationStrategy": enum, "users": [ { "pendingChange": enum, "username": "string" } ], "pendingStorageConfiguration": { "efs": { "throughputMode": enum } }, "tags": { }, "dataReplicationMetadata": { "dataReplicationCounterpart": { "brokerId": "string", "region": "string" }, "dataReplicationRole": "string" }, "pendingLdapServerMetadata": { "roleSearchMatching": "string", "roleBase": "string", "hosts": [ "string" ], "roleName": "string", "userBase": "string", "roleSearchSubtree": boolean, "serviceAccountUsername": "string", "userRoleName": "string", "userSearchMatching": "string", "userSearchSubtree": boolean }, "encryptionOptions": { "useAwsOwnedKey": boolean, "kmsKeyId": "string" }, Schemas 13 Amazon MQ REST API Reference "pendingDataReplicationMetadata": { "dataReplicationCounterpart": { "brokerId": "string", "region": "string" }, "dataReplicationRole": "string" }, "storageType": enum, "actionsRequired": [ { "actionRequiredCode": "string", "actionRequiredInfo": "string" } ], "securityGroups": [ "string" ], "brokerName": "string", "autoMinorVersionUpgrade": boolean } UpdateBrokerOutput schema { "engineVersion": "string", "brokerId": "string", "maintenanceWindowStartTime": { "dayOfWeek": enum, "timeZone": "string", "timeOfDay": "string" }, "configuration": { "id": "string", "revision": integer }, "authenticationStrategy": enum, "pendingDataReplicationMode": enum, "hostInstanceType": "string", "pendingStorageConfiguration": { "efs": { "throughputMode": enum } }, Schemas 14 Amazon MQ REST API Reference "dataReplicationMode": enum, "dataReplicationMetadata": { "dataReplicationCounterpart": { "brokerId": "string", "region": "string" }, "dataReplicationRole": "string" }, "pendingDataReplicationMetadata": { "dataReplicationCounterpart": { "brokerId": "string", "region": "string" }, "dataReplicationRole": "string" }, "securityGroups": [ "string" ], "logs": { "general": boolean, "audit": boolean }, "ldapServerMetadata": { "roleSearchMatching": "string", "roleBase": "string", "hosts": [ "string" ], "roleName": "string", "userBase": "string", "roleSearchSubtree": boolean, "serviceAccountUsername": "string", "userRoleName": "string", "userSearchMatching": "string", "userSearchSubtree": boolean }, "autoMinorVersionUpgrade": boolean } DeleteBrokerOutput schema { "brokerId": "string" Schemas 15 REST API Reference Amazon MQ } Error schema { "errorAttribute": "string", "message": "string" } Properties ActionRequired Action required for a broker. actionRequiredCode The code you can use to find instructions on the action required to resolve your broker issue. Type: string Required: False actionRequiredInfo Information about the action required to resolve your broker issue. Type: string Required: False AuthenticationStrategy Optional. The authentication strategy used to secure the broker. The default is SIMPLE. SIMPLE LDAP BrokerInstance Returns information about all brokers. Properties 16 REST API Reference Amazon MQ endpoints The broker's wire-level protocol endpoints. Type: Array of type string Required: False consoleURL The brokers web console URL. Type: string Required: False ipAddress The IP address of the Elastic Network Interface (ENI) attached to the broker. Does not apply to RabbitMQ brokers. Type: string Required: False monitoringEndpoints The list of monitoring endpoints. Type: Array of type MonitoringEndpoint Required: False BrokerState The broker's status. CREATION_IN_PROGRESS CREATION_FAILED DELETION_IN_PROGRESS RUNNING REBOOT_IN_PROGRESS CRITICAL_ACTION_REQUIRED Properties 17 REST API Reference Amazon MQ REPLICA BrokerStorageConfiguration The storage configurations of a broker. efs Type: EfsBrokerStorageConfiguration Required: False BrokerStorageType The broker's storage type. Important EFS is not supported for RabbitMQ engine type. EBS EFS ChangeType The type of change pending for the ActiveMQ user. CREATE UPDATE DELETE ConfigurationId A list of information about the configuration. id Required. The unique ID that Amazon MQ generates for the configuration. Properties 18 REST API Reference Amazon MQ Type: string Required: True revision The revision number of the configuration. Type: integer Required: False Configurations Broker configuration information current The broker's current configuration. Type: ConfigurationId Required: False pending The broker's pending configuration. Type: ConfigurationId Required: False history The history of configurations applied to the broker. Type: Array of type ConfigurationId Required: False DataReplicationCounterpart Specifies a broker in a data replication pair. Properties 19 Amazon MQ brokerId Required. The unique broker id generated by Amazon MQ. REST API Reference Type: string Required: True region Required. The region of the broker. Type: string Required: True DataReplicationMetadataOutput The replication details of the data replication-enabled broker. Only returned if dataReplicationMode or pendingDataReplicationMode is set to CRDR. dataReplicationCounterpart Describes the replica/primary broker. Only
amazon-mq-api-004
amazon-mq-api.pdf
4
current The broker's current configuration. Type: ConfigurationId Required: False pending The broker's pending configuration. Type: ConfigurationId Required: False history The history of configurations applied to the broker. Type: Array of type ConfigurationId Required: False DataReplicationCounterpart Specifies a broker in a data replication pair. Properties 19 Amazon MQ brokerId Required. The unique broker id generated by Amazon MQ. REST API Reference Type: string Required: True region Required. The region of the broker. Type: string Required: True DataReplicationMetadataOutput The replication details of the data replication-enabled broker. Only returned if dataReplicationMode or pendingDataReplicationMode is set to CRDR. dataReplicationCounterpart Describes the replica/primary broker. Only returned if this broker is currently set as a primary or replica in the broker's dataReplicationRole property. Type: DataReplicationCounterpart Required: False dataReplicationRole Defines the role of this broker in a data replication pair. When a replica broker is promoted to primary, this role is interchanged. Type: string Required: True DataReplicationMode Specifies whether a broker is a part of a data replication pair. Properties 20 REST API Reference Amazon MQ NONE CRDR DeleteBrokerOutput Returns information about the deleted broker. brokerId The unique ID that Amazon MQ generates for the broker. Type: string Required: False DeploymentMode The broker's deployment mode. SINGLE_INSTANCE ACTIVE_STANDBY_MULTI_AZ CLUSTER_MULTI_AZ DescribeBrokerOutput Returns information about the specified broker. pendingEngineVersion The broker engine version to upgrade to. For more information, see the ActiveMQ version management and the RabbitMQ version management sections in the Amazon MQ Developer Guide. Type: string Required: False pendingAuthenticationStrategy The authentication strategy that will be applied when the broker is rebooted. The default is SIMPLE. Properties 21 Amazon MQ REST API Reference Type: AuthenticationStrategy Required: False pendingSecurityGroups The list of pending security groups to authorize connections to brokers. Type: Array of type string Required: False configurations The list of all revisions for the specified configuration. Type: Configurations Required: False brokerState The broker's status. Type: BrokerState Required: False pendingDataReplicationMode Describes whether this broker will be a part of a data replication pair after reboot. Type: DataReplicationMode Required: False engineType The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and RABBITMQ. Type: EngineType Required: True Properties 22 REST API Reference Amazon MQ brokerInstances A list of information about allocated brokers. Type: Array of type BrokerInstance Required: False hostInstanceType The broker's instance type. Type: string Required: False dataReplicationMode Describes whether this broker is a part of a data replication pair. Type: DataReplicationMode Required: False storageConfiguration The broker's storage configuration. Type: BrokerStorageConfiguration Required: False publiclyAccessible Enables connections from applications outside of the VPC that hosts the broker's subnets. Type: boolean Required: True logs The list of information about logs currently enabled and pending to be deployed for the specified broker. Properties 23 Amazon MQ Type: LogsSummary Required: False ldapServerMetadata REST API Reference The metadata of the LDAP server used to authenticate and authorize connections to the broker. Type: LdapServerMetadataOutput Required: False subnetIds The list of groups that define which subnets and IP ranges the broker can use from different Availability Zones. Type: Array of type string Required: False pendingHostInstanceType The broker's host instance type to upgrade to. For a list of supported instance types, see Broker instance types. Type: string Required: False engineVersion The broker engine version. For more information, see the ActiveMQ version management and the RabbitMQ version management sections in the Amazon MQ Developer Guide. Type: string Required: False brokerArn The broker's Amazon Resource Name (ARN). Properties 24 REST API Reference Amazon MQ Type: string Required: False brokerId The unique ID that Amazon MQ generates for the broker. Type: string Required: False deploymentMode The broker's deployment mode. Type: DeploymentMode Required: True maintenanceWindowStartTime The parameters that determine the WeeklyStartTime. Type: WeeklyStartTime Required: False created The time when the broker was created. Type: string Required: False Format: date-time authenticationStrategy The authentication strategy used to secure the broker. The default is SIMPLE. Type: AuthenticationStrategy Required: False Properties 25 REST API Reference Amazon MQ users The list of all broker usernames for the specified broker. Type: Array of type UserSummary Required: False pendingStorageConfiguration The pending broker's storage configuration. Type: BrokerStorageConfiguration Required: False tags The list of all tags associated with this broker. Type: object Required: False dataReplicationMetadata The replication details of the data replication-enabled broker. Only returned if dataReplicationMode is set to CRDR. Type: DataReplicationMetadataOutput Required: False pendingLdapServerMetadata The metadata of the LDAP server that will be used to authenticate and authorize connections to the broker after it is rebooted. Type: LdapServerMetadataOutput Required: False Properties 26 Amazon MQ encryptionOptions Encryption options for the broker. Type: EncryptionOptions Required: False pendingDataReplicationMetadata REST API Reference The pending replication details of the data replication-enabled broker. Only returned if pendingDataReplicationMode is set to CRDR. Type: DataReplicationMetadataOutput Required: False storageType The broker's storage type. Type: BrokerStorageType Required: False actionsRequired Actions required for a broker. Type: Array of type ActionRequired Required: False securityGroups The list of rules (1 minimum, 125
amazon-mq-api-005
amazon-mq-api.pdf
5
Type: DataReplicationMetadataOutput Required: False pendingLdapServerMetadata The metadata of the LDAP server that will be used to authenticate and authorize connections to the broker after it is rebooted. Type: LdapServerMetadataOutput Required: False Properties 26 Amazon MQ encryptionOptions Encryption options for the broker. Type: EncryptionOptions Required: False pendingDataReplicationMetadata REST API Reference The pending replication details of the data replication-enabled broker. Only returned if pendingDataReplicationMode is set to CRDR. Type: DataReplicationMetadataOutput Required: False storageType The broker's storage type. Type: BrokerStorageType Required: False actionsRequired Actions required for a broker. Type: Array of type ActionRequired Required: False securityGroups The list of rules (1 minimum, 125 maximum) that authorize connections to brokers. Type: Array of type string Required: False Properties 27 Amazon MQ brokerName REST API Reference The broker's name. This value must be unique in your AWS account account, 1-50 characters long, must contain only letters, numbers, dashes, and underscores, and must not contain white spaces, brackets, wildcard characters, or special characters. Type: string Required: False autoMinorVersionUpgrade Enables automatic upgrades to new patch versions for brokers as new versions are released and supported by Amazon MQ. Automatic upgrades occur during the scheduled maintenance window or after a manual broker reboot. Type: boolean Required: True EfsBrokerStorageConfiguration The storage configuration of an EFS broker storage throughputMode Throughput mode of EFS broker storage Type: string Required: False Values: ELASTIC | STANDARD EncryptionOptions Encryption options for the broker. useAwsOwnedKey Enables the use of an AWS owned CMK using AWS KMS (KMS). Set to true by default, if no value is provided, for example, for RabbitMQ brokers. Type: boolean Properties 28 Amazon MQ Required: True kmsKeyId REST API Reference The customer master key (CMK) to use for the A AWS KMS (KMS). This key is used to encrypt your data at rest. If not provided, Amazon MQ will use a default CMK to encrypt your data. Type: string Required: False EngineType The type of broker engine. Amazon MQ supports ActiveMQ and RabbitMQ. ACTIVEMQ RABBITMQ Error Returns information about an error. errorAttribute The attribute which caused the error. Type: string Required: False message The explanation of the error. Type: string Required: False LdapServerMetadataInput Optional. The metadata of the LDAP server used to authenticate and authorize connections to the broker. Properties 29 Amazon MQ Important Does not apply to RabbitMQ brokers. roleSearchMatching REST API Reference The LDAP search filter used to find roles within the roleBase. The distinguished name of the user matched by userSearchMatching is substituted into the {0} placeholder in the search filter. The client's username is substituted into the {1} placeholder. For example, if you set this option to (member=uid={1})for the user janedoe, the search filter becomes (member=uid=janedoe) after string substitution. It matches all role entries that have a member attribute equal to uid=janedoe under the subtree selected by the roleBase. Type: string Required: True serviceAccountPassword Service account password. A service account is an account in your LDAP server that has access to initiate a connection. For example, cn=admin,dc=corp, dc=example, dc=com. Type: string Required: True roleBase The distinguished name of the node in the directory information tree (DIT) to search for roles or groups. For example, ou=group, ou=corp, dc=corp, dc=example, dc=com. Type: string Required: True hosts Specifies the location of the LDAP server such as AWS Directory Service for Microsoft Active Directory. Optional failover server. Type: Array of type string Properties 30 Amazon MQ Required: True roleName REST API Reference Specifies the LDAP attribute that identifies the group name attribute in the object returned from the group membership query. Type: string Required: False userBase Select a particular subtree of the directory information tree (DIT) to search for user entries. The subtree is specified by a DN, which specifies the base node of the subtree. For example, by setting this option to ou=Users,ou=corp, dc=corp, dc=example, dc=com, the search for user entries is restricted to the subtree beneath ou=Users, ou=corp, dc=corp, dc=example, dc=com. Type: string Required: True roleSearchSubtree The directory search scope for the role. If set to true, scope is to search the entire subtree. Type: boolean Required: False serviceAccountUsername Service account username. A service account is an account in your LDAP server that has access to initiate a connection. For example, cn=admin,dc=corp, dc=example, dc=com. Type: string Required: True Properties 31 Amazon MQ userRoleName REST API Reference Specifies the name of the LDAP attribute for the user group membership. Type: string Required: False userSearchMatching The LDAP search filter used to find users within the userBase. The client's username is substituted into the {0} placeholder in the search filter. For example, if this option is set to (uid={0}) and the received username is janedoe, the search filter becomes (uid=janedoe) after string substitution. It will result in matching an entry like uid=janedoe, ou=Users,ou=corp, dc=corp, dc=example, dc=com. Type: string Required: True userSearchSubtree The directory search scope for the user. If set to true,
amazon-mq-api-006
amazon-mq-api.pdf
6
31 Amazon MQ userRoleName REST API Reference Specifies the name of the LDAP attribute for the user group membership. Type: string Required: False userSearchMatching The LDAP search filter used to find users within the userBase. The client's username is substituted into the {0} placeholder in the search filter. For example, if this option is set to (uid={0}) and the received username is janedoe, the search filter becomes (uid=janedoe) after string substitution. It will result in matching an entry like uid=janedoe, ou=Users,ou=corp, dc=corp, dc=example, dc=com. Type: string Required: True userSearchSubtree The directory search scope for the user. If set to true, scope is to search the entire subtree. Type: boolean Required: False LdapServerMetadataOutput Optional. The metadata of the LDAP server used to authenticate and authorize connections to the broker. roleSearchMatching The LDAP search filter used to find roles within the roleBase. The distinguished name of the user matched by userSearchMatching is substituted into the {0} placeholder in the search filter. The client's username is substituted into the {1} placeholder. For example, if you set this option to (member=uid={1})for the user janedoe, the search filter becomes (member=uid=janedoe) after string substitution. It matches all role entries that have a member attribute equal to uid=janedoe under the subtree selected by the roleBase. Properties 32 Amazon MQ Type: string Required: True roleBase REST API Reference The distinguished name of the node in the directory information tree (DIT) to search for roles or groups. For example, ou=group, ou=corp, dc=corp, dc=example, dc=com. Type: string Required: True hosts Specifies the location of the LDAP server such as AWS Directory Service for Microsoft Active Directory. Optional failover server. Type: Array of type string Required: True roleName Specifies the LDAP attribute that identifies the group name attribute in the object returned from the group membership query. Type: string Required: False userBase Select a particular subtree of the directory information tree (DIT) to search for user entries. The subtree is specified by a DN, which specifies the base node of the subtree. For example, by setting this option to ou=Users,ou=corp, dc=corp, dc=example, dc=com, the search for user entries is restricted to the subtree beneath ou=Users, ou=corp, dc=corp, dc=example, dc=com. Type: string Required: True Properties 33 Amazon MQ roleSearchSubtree REST API Reference The directory search scope for the role. If set to true, scope is to search the entire subtree. Type: boolean Required: False serviceAccountUsername Service account username. A service account is an account in your LDAP server that has access to initiate a connection. For example, cn=admin,dc=corp, dc=example, dc=com. Type: string Required: True userRoleName Specifies the name of the LDAP attribute for the user group membership. Type: string Required: False userSearchMatching The LDAP search filter used to find users within the userBase. The client's username is substituted into the {0} placeholder in the search filter. For example, if this option is set to (uid={0}) and the received username is janedoe, the search filter becomes (uid=janedoe) after string substitution. It will result in matching an entry like uid=janedoe, ou=Users,ou=corp, dc=corp, dc=example, dc=com. Type: string Required: True userSearchSubtree The directory search scope for the user. If set to true, scope is to search the entire subtree. Type: boolean Properties 34 Amazon MQ Required: False Logs The list of information about logs to be enabled for the specified broker. REST API Reference general Enables general logging. Type: boolean Required: False audit Enables audit logging. Every user management action made using JMX or the ActiveMQ Web Console is logged. Does not apply to RabbitMQ brokers. Type: boolean Required: False LogsSummary The list of information about logs currently enabled and pending to be deployed for the specified broker. generalLogGroup The location of the CloudWatch Logs log group where general logs are sent. Type: string Required: True general Enables general logging. Type: boolean Required: True Properties 35 Amazon MQ audit REST API Reference Enables audit logging. Every user management action made using JMX or the ActiveMQ Web Console is logged. Type: boolean Required: False pending The list of information about logs pending to be deployed for the specified broker. Type: PendingLogs Required: False auditLogGroup The location of the CloudWatch Logs log group where audit logs are sent. Type: string Required: False MonitoringEndpoint Monitoring endpoint for the broker. endpoint The broker's monitoring endpoint. Type: string Required: False type The broker's monitoring type. Type: string Required: False Properties 36 Amazon MQ PendingLogs REST API Reference The list of information about logs to be enabled for the specified broker. general Enables general logging. Type: boolean Required: False audit Enables audit logging. Every user management action made using JMX or the ActiveMQ Web Console is logged. Type: boolean Required: False UpdateBrokerInput Updates the broker using the specified properties. dataReplicationMode Defines whether this broker is a part of a data replication pair. Type: DataReplicationMode Required: False engineVersion The broker engine version. For
amazon-mq-api-007
amazon-mq-api.pdf
7
endpoint The broker's monitoring endpoint. Type: string Required: False type The broker's monitoring type. Type: string Required: False Properties 36 Amazon MQ PendingLogs REST API Reference The list of information about logs to be enabled for the specified broker. general Enables general logging. Type: boolean Required: False audit Enables audit logging. Every user management action made using JMX or the ActiveMQ Web Console is logged. Type: boolean Required: False UpdateBrokerInput Updates the broker using the specified properties. dataReplicationMode Defines whether this broker is a part of a data replication pair. Type: DataReplicationMode Required: False engineVersion The broker engine version. For more information, see the ActiveMQ version management and the RabbitMQ version management sections in the Amazon MQ Developer Guide. Note When upgrading to ActiveMQ version 5.18 and above or RabbitMQ version 3.13 and above, you must have autoMinorVersionUpgrade set to true for the broker. Properties 37 REST API Reference Amazon MQ Type: string Required: False maintenanceWindowStartTime The parameters that determine the WeeklyStartTime. Type: WeeklyStartTime Required: False configuration A list of information about the configuration. Type: ConfigurationId Required: False storageConfiguration The broker's storage configuration. Type: BrokerStorageConfiguration Required: False authenticationStrategy Optional. The authentication strategy used to secure the broker. The default is SIMPLE. Type: AuthenticationStrategy Required: False securityGroups The list of security groups (1 minimum, 5 maximum) that authorizes connections to brokers. Type: Array of type string Required: False Properties 38 Amazon MQ ldapServerMetadata REST API Reference Optional. The metadata of the LDAP server used to authenticate and authorize connections to the broker. Does not apply to RabbitMQ brokers. Type: LdapServerMetadataInput Required: False logs Enables Amazon CloudWatch logging for brokers. Type: Logs Required: False hostInstanceType The broker's host instance type to upgrade to. For a list of supported instance types, see Broker instance types. Type: string Required: False autoMinorVersionUpgrade Enables automatic upgrades to new patch versions for brokers as new versions are released and supported by Amazon MQ. Automatic upgrades occur during the scheduled maintenance window or after a manual broker reboot. Note Must be set to true for ActiveMQ brokers version 5.18 and above and for RabbitMQ brokers version 3.13 and above. Type: boolean Required: False Properties 39 Amazon MQ UpdateBrokerOutput Returns information about the updated broker. engineVersion REST API Reference The broker engine version to upgrade to. For more information, see the ActiveMQ version management and the RabbitMQ version management sections in the Amazon MQ Developer Guide. Type: string Required: False brokerId Required. The unique ID that Amazon MQ generates for the broker. Type: string Required: True maintenanceWindowStartTime The parameters that determine the WeeklyStartTime. Type: WeeklyStartTime Required: False configuration The ID of the updated configuration. Type: ConfigurationId Required: False authenticationStrategy Optional. The authentication strategy used to secure the broker. The default is SIMPLE. Type: AuthenticationStrategy Properties 40 Amazon MQ Required: False pendingDataReplicationMode REST API Reference Describes whether this broker will be a part of a data replication pair after reboot. Type: DataReplicationMode Required: False hostInstanceType The broker's host instance type to upgrade to. For a list of supported instance types, see Broker instance types. Type: string Required: False pendingStorageConfiguration The pending broker's storage configuration. Type: BrokerStorageConfiguration Required: False dataReplicationMode Describes whether this broker is a part of a data replication pair. Type: DataReplicationMode Required: False dataReplicationMetadata The replication details of the data replication-enabled broker. Only returned if dataReplicationMode is set to CRDR. Type: DataReplicationMetadataOutput Required: False Properties 41 Amazon MQ REST API Reference pendingDataReplicationMetadata The pending replication details of the data replication-enabled broker. Only returned if pendingDataReplicationMode is set to CRDR. Type: DataReplicationMetadataOutput Required: False securityGroups The list of security groups (1 minimum, 5 maximum) that authorizes connections to brokers. Type: Array of type string Required: False logs The list of information about logs to be enabled for the specified broker. Type: Logs Required: False ldapServerMetadata Optional. The metadata of the LDAP server used to authenticate and authorize connections to the broker. Does not apply to RabbitMQ brokers. Type: LdapServerMetadataOutput Required: False autoMinorVersionUpgrade Enables automatic upgrades to new patch versions for brokers as new versions are released and supported by Amazon MQ. Automatic upgrades occur during the scheduled maintenance window or after a manual broker reboot. Type: boolean Required: False Properties 42 Amazon MQ UserSummary REST API Reference Returns a list of all broker users. Does not apply to RabbitMQ brokers. pendingChange The type of change pending for the broker user. Type: ChangeType Required: False username Required. The username of the broker user. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long. Type: string Required: True WeeklyStartTime The scheduled time period relative to UTC during which Amazon MQ begins to apply pending updates or patches to the broker. dayOfWeek Required. The day of the week. Type: string Required: True Values: MONDAY | TUESDAY | WEDNESDAY |
amazon-mq-api-008
amazon-mq-api.pdf
8
list of all broker users. Does not apply to RabbitMQ brokers. pendingChange The type of change pending for the broker user. Type: ChangeType Required: False username Required. The username of the broker user. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long. Type: string Required: True WeeklyStartTime The scheduled time period relative to UTC during which Amazon MQ begins to apply pending updates or patches to the broker. dayOfWeek Required. The day of the week. Type: string Required: True Values: MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | SUNDAY timeZone The time zone, UTC by default, in either the Country/City format, or the UTC offset format. Type: string Required: False Properties 43 Amazon MQ timeOfDay Required. The time, in 24-hour format. Type: string Required: True See also REST API Reference For more information about using this API in one of the language-specific AWS SDKs and references, see the following: DescribeBroker • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 UpdateBroker • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin See also 44 REST API Reference Amazon MQ • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 DeleteBroker • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Broker Engine Types Retrieve information about available broker engines. AWS does not support all instance types in all availability zones and regions. For more information, see the ActiveMQ version management and the RabbitMQ version management sections in the Amazon MQ Developer Guide. This API will tell you, for a given region and availability zone, which broker engine types and engine versions you can create. URI /v1/broker-engine-types HTTP methods GET Operation ID: DescribeBrokerEngineTypes Broker Engine Types 45 Amazon MQ REST API Reference Describe available engine types and versions. Query parameters Name engineType Type String nextToken String Required Description False False maxResults String False Filter response by engine type. The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty. The maximum number of brokers that Amazon MQ can return per page (20 by default). This value must be an integer from 5 to 100. Responses Status code Response model Description 200 400 403 BrokerEngineTypeOu HTTP Status Code 200: OK. tput Error Error HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your HTTP methods 46 Amazon MQ REST API Reference Status code Response model Description credentials and then retry your request. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. 500 Error OPTIONS Responses Status code Response model Description 200 None Default response for CORS method Schemas Response bodies BrokerEngineTypeOutput schema { "nextToken": "string", "maxResults": integer, "brokerEngineTypes": [ { "engineVersions": [ { "name": "string" } ], "engineType": enum } ] } Schemas 47 REST API Reference Amazon MQ Error schema { "errorAttribute": "string", "message": "string" } Properties BrokerEngineType Types of broker engines. engineVersions The list of engine versions. Type: Array of type EngineVersion Required: False engineType The broker's engine type. Type: EngineType Required: False BrokerEngineTypeOutput Returns a list of broker engine type. nextToken The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty. Type: string Required: False Properties 48 Amazon MQ maxResults REST API Reference Required. The maximum number of engine types that can be returned per page (20 by default). This value must be an integer from 5 to 100. Type: integer Required: True Minimum: 5 Maximum: 100 brokerEngineTypes List of available engine types and versions. Type: Array of type BrokerEngineType Required: False EngineType The type of broker engine. Amazon MQ supports ActiveMQ and RabbitMQ. ACTIVEMQ RABBITMQ EngineVersion Id of the engine version. name Id for the version. Type: string Required: False Error Returns information about an error. Properties 49 REST API Reference Amazon MQ errorAttribute The attribute which caused the error. Type: string Required:
amazon-mq-api-009
amazon-mq-api.pdf
9
The maximum number of engine types that can be returned per page (20 by default). This value must be an integer from 5 to 100. Type: integer Required: True Minimum: 5 Maximum: 100 brokerEngineTypes List of available engine types and versions. Type: Array of type BrokerEngineType Required: False EngineType The type of broker engine. Amazon MQ supports ActiveMQ and RabbitMQ. ACTIVEMQ RABBITMQ EngineVersion Id of the engine version. name Id for the version. Type: string Required: False Error Returns information about an error. Properties 49 REST API Reference Amazon MQ errorAttribute The attribute which caused the error. Type: string Required: False message The explanation of the error. Type: string Required: False See also For more information about using this API in one of the language-specific AWS SDKs and references, see the following: DescribeBrokerEngineTypes • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See also 50 Amazon MQ REST API Reference Broker Instance Options You can retrieve information about broker instances. For more information about the different components of an Amazon MQ broker, see How Amazon MQ works in the Amazon MQ Developer Guide. URI /v1/broker-instance-options HTTP methods GET Operation ID: DescribeBrokerInstanceOptions Describe available broker instance options. Query parameters Name hostInsta nceType Type String nextToken String storageType String maxResults String Required Description False False False False Filter response by host instance type. The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty. Filter response by storage type. The maximum number of brokers that Amazon MQ can return per page (20 by default). This value Broker Instance Options 51 Amazon MQ Name Type Required Description REST API Reference engineType String False must be an integer from 5 to 100. Filter response by engine type. Responses Status code Response model Description BrokerInstanceOpti HTTP Status Code 200: OK. onsOutput Error Error Error HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. 200 400 403 500 OPTIONS Responses Status code Response model Description 200 None Default response for CORS method HTTP methods 52 REST API Reference Amazon MQ Schemas Response bodies BrokerInstanceOptionsOutput schema { "nextToken": "string", "maxResults": integer, "brokerInstanceOptions": [ { "supportedDeploymentModes": [ enum ], "supportedEngineVersions": [ "string" ], "storageType": enum, "engineType": enum, "availabilityZones": [ { "name": "string" } ], "hostInstanceType": "string" } ] } Error schema { "errorAttribute": "string", "message": "string" } Properties AvailabilityZone Name of the availability zone. Schemas 53 Amazon MQ name Id for the availability zone. Type: string Required: False BrokerInstanceOption Option for host instance type. supportedDeploymentModes The list of supported deployment modes. Type: Array of type DeploymentMode Required: False supportedEngineVersions The list of supported engine versions. Type: Array of type string Required: False storageType The broker's storage type. Type: BrokerStorageType Required: False engineType The broker's engine type. Type: EngineType Required: False Properties REST API Reference 54 REST API Reference Amazon MQ availabilityZones The list of available az. Type: Array of type AvailabilityZone Required: False hostInstanceType The broker's instance type. Type: string Required: False BrokerInstanceOptionsOutput Returns a list of broker instance options. nextToken The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty. Type: string Required: False maxResults Required. The maximum number of instance options that can be returned per page (20 by default). This value must be an integer from 5 to 100. Type: integer Required: True Minimum: 5 Maximum: 100 brokerInstanceOptions List of available broker instance options. Properties 55 Amazon MQ REST API Reference Type: Array of type BrokerInstanceOption Required: False BrokerStorageType The broker's storage type. Important EFS is not supported for RabbitMQ engine type. EBS EFS DeploymentMode The broker's deployment mode. SINGLE_INSTANCE ACTIVE_STANDBY_MULTI_AZ CLUSTER_MULTI_AZ EngineType The type of broker engine. Amazon MQ supports ActiveMQ and RabbitMQ. ACTIVEMQ RABBITMQ Error Returns information about an error. errorAttribute The attribute which caused the error. Type: string Properties 56 REST API Reference Amazon MQ Required: False message The explanation of the error. Type: string Required: False See also For more information about using this API in one of the language-specific AWS SDKs and references, see the following: DescribeBrokerInstanceOptions • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin •
amazon-mq-api-010
amazon-mq-api.pdf
10
ActiveMQ and RabbitMQ. ACTIVEMQ RABBITMQ Error Returns information about an error. errorAttribute The attribute which caused the error. Type: string Properties 56 REST API Reference Amazon MQ Required: False message The explanation of the error. Type: string Required: False See also For more information about using this API in one of the language-specific AWS SDKs and references, see the following: DescribeBrokerInstanceOptions • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Broker Reboot To apply a new configuration to a broker, you can reboot the broker. In addition, if your broker becomes unresponsive, you can reboot it to recover from a faulty state. Note You can reboot only a broker with the RUNNING status. See also 57 Amazon MQ URI /v1/brokers/broker-id/reboot HTTP methods POST Operation ID: RebootBroker Reboots a broker. Note: This API is asynchronous. Path parameters Name broker-id Type String REST API Reference Required Description True The unique ID that Amazon MQ generates for the broker. Responses Status code Response model Description 200 400 403 404 URI None Error Error Error HTTP Status Code 200: OK. HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 404: Resource not found due to 58 Amazon MQ REST API Reference Status code Response model Description 500 Error OPTIONS Path parameters Name broker-id Type String incorrect input. Correct your request and then retry it. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. Required Description True The unique ID that Amazon MQ generates for the broker. Responses Status code Response model Description 200 None Default response for CORS method Schemas Response bodies Error schema { "errorAttribute": "string", "message": "string" } Schemas 59 REST API Reference Amazon MQ Properties Error Returns information about an error. errorAttribute The attribute which caused the error. Type: string Required: False message The explanation of the error. Type: string Required: False See also For more information about using this API in one of the language-specific AWS SDKs and references, see the following: RebootBroker • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python Properties 60 Amazon MQ • AWS SDK for Ruby V3 Brokers REST API Reference This is a collection of brokers. A broker is a message broker environment running on Amazon MQ. It is the basic building block of Amazon MQ. For more information, see Broker instance types in the Amazon MQ Developer Guide. URI /v1/brokers HTTP methods GET Operation ID: ListBrokers Returns a list of all brokers. Query parameters Name nextToken Type String maxResults String False Required Description False The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty. The maximum number of brokers that Amazon MQ can return per page (20 by default). This value must be an integer from 5 to 100. Brokers 61 Amazon MQ Responses REST API Reference Status code Response model Description 200 400 403 500 ListBrokersOutput HTTP Status Code 200: OK. Error Error Error HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. POST Operation ID: CreateBroker Creates a broker. Note: This API is asynchronous. To create a broker, you must either use the AmazonMQFullAccess IAM policy or include the following EC2 permissions in your IAM policy. • ec2:CreateNetworkInterface This permission is required to allow Amazon MQ to create an elastic network interface (ENI) on behalf of your account. • ec2:CreateNetworkInterfacePermission This permission is required to attach the ENI to the broker instance. • ec2:DeleteNetworkInterface • ec2:DeleteNetworkInterfacePermission HTTP methods 62 Amazon MQ REST API Reference • ec2:DetachNetworkInterface • ec2:DescribeInternetGateways • ec2:DescribeNetworkInterfaces • ec2:DescribeNetworkInterfacePermissions • ec2:DescribeRouteTables • ec2:DescribeSecurityGroups • ec2:DescribeSubnets • ec2:DescribeVpcs For more information, see Create an IAM User and Get Your AWS Credentials and Never Modify or Delete the Amazon MQ Elastic Network Interface in the Amazon MQ Developer Guide. Responses Status code Response model Description 200 400 401 403 409 CreateBrokerOutput HTTP Status Code 200: OK. Error Error Error Error HTTP Status Code 400: Bad
amazon-mq-api-011
amazon-mq-api.pdf
11
your account. • ec2:CreateNetworkInterfacePermission This permission is required to attach the ENI to the broker instance. • ec2:DeleteNetworkInterface • ec2:DeleteNetworkInterfacePermission HTTP methods 62 Amazon MQ REST API Reference • ec2:DetachNetworkInterface • ec2:DescribeInternetGateways • ec2:DescribeNetworkInterfaces • ec2:DescribeNetworkInterfacePermissions • ec2:DescribeRouteTables • ec2:DescribeSecurityGroups • ec2:DescribeSubnets • ec2:DescribeVpcs For more information, see Create an IAM User and Get Your AWS Credentials and Never Modify or Delete the Amazon MQ Elastic Network Interface in the Amazon MQ Developer Guide. Responses Status code Response model Description 200 400 401 403 409 CreateBrokerOutput HTTP Status Code 200: OK. Error Error Error Error HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 401: Unauthorized request. The provided credentials couldn't be validated. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 409: Configuration ID is already in use. Remove the configura HTTP methods 63 Amazon MQ REST API Reference Status code Response model Description tion from all brokers and retry the request. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. 500 Error OPTIONS Responses Status code Response model Description 200 None Default response for CORS method Schemas Request bodies POST schema { "engineVersion": "string", "deploymentMode": enum, "maintenanceWindowStartTime": { "dayOfWeek": enum, "timeZone": "string", "timeOfDay": "string" }, "configuration": { "id": "string", "revision": integer }, "authenticationStrategy": enum, "engineType": enum, "hostInstanceType": "string", Schemas 64 REST API Reference Amazon MQ "users": [ { "password": "string", "replicationUser": boolean, "groups": [ "string" ], "consoleAccess": boolean, "jolokiaApiAccess": enum, "username": "string" } ], "tags": { }, "dataReplicationMode": enum, "creatorRequestId": "string", "storageConfiguration": { "efs": { "throughputMode": enum } }, "encryptionOptions": { "useAwsOwnedKey": boolean, "kmsKeyId": "string" }, "publiclyAccessible": boolean, "storageType": enum, "securityGroups": [ "string" ], "dataReplicationPrimaryBrokerArn": "string", "brokerName": "string", "logs": { "general": boolean, "audit": boolean }, "ldapServerMetadata": { "roleSearchMatching": "string", "serviceAccountPassword": "string", "roleBase": "string", "hosts": [ "string" ], "roleName": "string", Schemas 65 Amazon MQ REST API Reference "userBase": "string", "roleSearchSubtree": boolean, "serviceAccountUsername": "string", "userRoleName": "string", "userSearchMatching": "string", "userSearchSubtree": boolean }, "autoMinorVersionUpgrade": boolean, "subnetIds": [ "string" ] } Response bodies ListBrokersOutput schema { "brokerSummaries": [ { "brokerArn": "string", "brokerId": "string", "deploymentMode": enum, "created": "string", "brokerState": enum, "engineType": enum, "brokerName": "string", "hostInstanceType": "string" } ], "nextToken": "string" } CreateBrokerOutput schema { "brokerArn": "string", "brokerId": "string" } Schemas 66 REST API Reference Amazon MQ Error schema { "errorAttribute": "string", "message": "string" } Properties AuthenticationStrategy Optional. The authentication strategy used to secure the broker. The default is SIMPLE. SIMPLE LDAP BrokerState The broker's status. CREATION_IN_PROGRESS CREATION_FAILED DELETION_IN_PROGRESS RUNNING REBOOT_IN_PROGRESS CRITICAL_ACTION_REQUIRED REPLICA BrokerStorageConfiguration The storage configurations of a broker. efs Type: EfsBrokerStorageConfiguration Required: False Properties 67 REST API Reference Amazon MQ BrokerStorageType The broker's storage type. Important EFS is not supported for RabbitMQ engine type. EBS EFS BrokerSummary Returns information about all brokers. brokerArn The broker's Amazon Resource Name (ARN). Type: string Required: False brokerId The unique ID that Amazon MQ generates for the broker. Type: string Required: False deploymentMode The broker's deployment mode. Type: DeploymentMode Required: True created The time when the broker was created. Properties 68 REST API Reference Amazon MQ Type: string Required: False Format: date-time brokerState The broker's status. Type: BrokerState Required: False engineType The type of broker engine. Type: EngineType Required: True brokerName The broker's name. This value is unique in your AWS account, 1-50 characters long, and containing only letters, numbers, dashes, and underscores, and must not contain white spaces, brackets, wildcard characters, or special characters. Type: string Required: False hostInstanceType The broker's instance type. Type: string Required: False ConfigurationId A list of information about the configuration. Properties 69 Amazon MQ id REST API Reference Required. The unique ID that Amazon MQ generates for the configuration. Type: string Required: True revision The revision number of the configuration. Type: integer Required: False CreateBrokerInput Creates a broker. engineVersion The broker engine version. Defaults to the latest available version for the specified broker engine type. For more information, see the ActiveMQ version management and the RabbitMQ version management sections in the Amazon MQ Developer Guide. Type: string Required: False deploymentMode Required. The broker's deployment mode. Type: DeploymentMode Required: True maintenanceWindowStartTime The parameters that determine the WeeklyStartTime. Type: WeeklyStartTime Properties 70 REST API Reference Amazon MQ Required: False configuration A list of information about the configuration. Type: ConfigurationId Required: False authenticationStrategy Optional. The authentication strategy used to secure the broker. The default is SIMPLE. Type: AuthenticationStrategy Required: False engineType Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and RABBITMQ. Type: EngineType Required: True hostInstanceType Required. The broker's instance type. Type: string Required: True users The list of broker users (persons or applications) who can access queues and topics. For Amazon MQ for RabbitMQ brokers, one and only one administrative user is accepted and created when a broker is first provisioned. All subsequent broker users
amazon-mq-api-012
amazon-mq-api.pdf
12
False configuration A list of information about the configuration. Type: ConfigurationId Required: False authenticationStrategy Optional. The authentication strategy used to secure the broker. The default is SIMPLE. Type: AuthenticationStrategy Required: False engineType Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and RABBITMQ. Type: EngineType Required: True hostInstanceType Required. The broker's instance type. Type: string Required: True users The list of broker users (persons or applications) who can access queues and topics. For Amazon MQ for RabbitMQ brokers, one and only one administrative user is accepted and created when a broker is first provisioned. All subsequent broker users are created by making RabbitMQ API calls directly to brokers or via the RabbitMQ web console. Type: Array of type User Required: True Properties 71 REST API Reference Amazon MQ tags Create tags when creating the broker. Type: object Required: False dataReplicationMode Defines whether this broker is a part of a data replication pair. Type: DataReplicationMode Required: False creatorRequestId The unique ID that the requester receives for the created broker. Amazon MQ passes your ID with the API action. Note We recommend using a Universally Unique Identifier (UUID) for the creatorRequestId. You may omit the creatorRequestId if your application doesn't require idempotency. Type: string Required: False storageConfiguration The broker's storage configuration. Type: BrokerStorageConfiguration Required: False encryptionOptions Encryption options for the broker. Properties 72 Amazon MQ Type: EncryptionOptions Required: False publiclyAccessible REST API Reference Enables connections from applications outside of the VPC that hosts the broker's subnets. Set to false by default, if no value is provided. Type: boolean Required: True storageType The broker's storage type. Type: BrokerStorageType Required: False securityGroups The list of rules (1 minimum, 125 maximum) that authorize connections to brokers. Type: Array of type string Required: False dataReplicationPrimaryBrokerArn The Amazon Resource Name (ARN) of the primary broker that is used to replicate data from in a data replication pair, and is applied to the replica broker. Must be set when dataReplicationMode is set to CRDR. Type: string Required: False Properties 73 Amazon MQ brokerName REST API Reference Required. The broker's name. This value must be unique in your AWS account, 1-50 characters long, must contain only letters, numbers, dashes, and underscores, and must not contain white spaces, brackets, wildcard characters, or special characters. Important Do not add personally identifiable information (PII) or other confidential or sensitive information in broker names. Broker names are accessible to other AWS services, including CloudWatch Logs. Broker names are not intended to be used for private or sensitive data. Type: string Required: True logs Enables Amazon CloudWatch logging for brokers. Type: Logs Required: False ldapServerMetadata Optional. The metadata of the LDAP server used to authenticate and authorize connections to the broker. Does not apply to RabbitMQ brokers. Type: LdapServerMetadataInput Required: False autoMinorVersionUpgrade Enables automatic upgrades to new patch versions for brokers as new versions are released and supported by Amazon MQ. Automatic upgrades occur during the scheduled maintenance window or after a manual broker reboot. Set to true by default, if no value is specified. Properties 74 Amazon MQ Note REST API Reference Must be set to true for ActiveMQ brokers version 5.18 and above and for RabbitMQ brokers version 3.13 and above. Type: boolean Required: False subnetIds The list of groups that define which subnets and IP ranges the broker can use from different Availability Zones. If you specify more than one subnet, the subnets must be in different Availability Zones. Amazon MQ will not be able to create VPC endpoints for your broker with multiple subnets in the same Availability Zone. A SINGLE_INSTANCE deployment requires one subnet (for example, the default subnet). An ACTIVE_STANDBY_MULTI_AZ Amazon MQ for ActiveMQ deployment requires two subnets. A CLUSTER_MULTI_AZ Amazon MQ for RabbitMQ deployment has no subnet requirements when deployed with public accessibility. Deployment without public accessibility requires at least one subnet. Important If you specify subnets in a shared VPC for a RabbitMQ broker, the associated VPC to which the specified subnets belong must be owned by your AWS account. Amazon MQ will not be able to create VPC endpoints in VPCs that are not owned by your AWS account. Type: Array of type string Required: False CreateBrokerOutput Returns information about the created broker. brokerArn The broker's Amazon Resource Name (ARN). Type: string Properties 75 REST API Reference Amazon MQ Required: False brokerId The unique ID that Amazon MQ generates for the broker. Type: string Required: False DataReplicationMode Specifies whether a broker is a part of a data replication pair. NONE CRDR DeploymentMode The broker's deployment mode. SINGLE_INSTANCE ACTIVE_STANDBY_MULTI_AZ CLUSTER_MULTI_AZ EfsBrokerStorageConfiguration The storage configuration of an EFS broker storage throughputMode Throughput mode of EFS broker storage Type: string Required: False Values: ELASTIC | STANDARD EncryptionOptions Encryption options for the broker. Properties 76 Amazon MQ useAwsOwnedKey REST API Reference Enables the use of an AWS
amazon-mq-api-013
amazon-mq-api.pdf
13
brokerArn The broker's Amazon Resource Name (ARN). Type: string Properties 75 REST API Reference Amazon MQ Required: False brokerId The unique ID that Amazon MQ generates for the broker. Type: string Required: False DataReplicationMode Specifies whether a broker is a part of a data replication pair. NONE CRDR DeploymentMode The broker's deployment mode. SINGLE_INSTANCE ACTIVE_STANDBY_MULTI_AZ CLUSTER_MULTI_AZ EfsBrokerStorageConfiguration The storage configuration of an EFS broker storage throughputMode Throughput mode of EFS broker storage Type: string Required: False Values: ELASTIC | STANDARD EncryptionOptions Encryption options for the broker. Properties 76 Amazon MQ useAwsOwnedKey REST API Reference Enables the use of an AWS owned CMK using AWS KMS (KMS). Set to true by default, if no value is provided, for example, for RabbitMQ brokers. Type: boolean Required: True kmsKeyId The customer master key (CMK) to use for the A AWS KMS (KMS). This key is used to encrypt your data at rest. If not provided, Amazon MQ will use a default CMK to encrypt your data. Type: string Required: False EngineType The type of broker engine. Amazon MQ supports ActiveMQ and RabbitMQ. ACTIVEMQ RABBITMQ Error Returns information about an error. errorAttribute The attribute which caused the error. Type: string Required: False message The explanation of the error. Type: string Properties 77 Amazon MQ Required: False JolokiaApiAccess REST API Reference Jolokia access to the ActiveMQ broker (Does not apply to RabbitMQ brokers). READ_ONLY NONE LdapServerMetadataInput Optional. The metadata of the LDAP server used to authenticate and authorize connections to the broker. Important Does not apply to RabbitMQ brokers. roleSearchMatching The LDAP search filter used to find roles within the roleBase. The distinguished name of the user matched by userSearchMatching is substituted into the {0} placeholder in the search filter. The client's username is substituted into the {1} placeholder. For example, if you set this option to (member=uid={1})for the user janedoe, the search filter becomes (member=uid=janedoe) after string substitution. It matches all role entries that have a member attribute equal to uid=janedoe under the subtree selected by the roleBase. Type: string Required: True serviceAccountPassword Service account password. A service account is an account in your LDAP server that has access to initiate a connection. For example, cn=admin,dc=corp, dc=example, dc=com. Type: string Required: True Properties 78 Amazon MQ roleBase REST API Reference The distinguished name of the node in the directory information tree (DIT) to search for roles or groups. For example, ou=group, ou=corp, dc=corp, dc=example, dc=com. Type: string Required: True hosts Specifies the location of the LDAP server such as AWS Directory Service for Microsoft Active Directory. Optional failover server. Type: Array of type string Required: True roleName Specifies the LDAP attribute that identifies the group name attribute in the object returned from the group membership query. Type: string Required: False userBase Select a particular subtree of the directory information tree (DIT) to search for user entries. The subtree is specified by a DN, which specifies the base node of the subtree. For example, by setting this option to ou=Users,ou=corp, dc=corp, dc=example, dc=com, the search for user entries is restricted to the subtree beneath ou=Users, ou=corp, dc=corp, dc=example, dc=com. Type: string Required: True roleSearchSubtree The directory search scope for the role. If set to true, scope is to search the entire subtree. Properties 79 Amazon MQ Type: boolean Required: False serviceAccountUsername REST API Reference Service account username. A service account is an account in your LDAP server that has access to initiate a connection. For example, cn=admin,dc=corp, dc=example, dc=com. Type: string Required: True userRoleName Specifies the name of the LDAP attribute for the user group membership. Type: string Required: False userSearchMatching The LDAP search filter used to find users within the userBase. The client's username is substituted into the {0} placeholder in the search filter. For example, if this option is set to (uid={0}) and the received username is janedoe, the search filter becomes (uid=janedoe) after string substitution. It will result in matching an entry like uid=janedoe, ou=Users,ou=corp, dc=corp, dc=example, dc=com. Type: string Required: True userSearchSubtree The directory search scope for the user. If set to true, scope is to search the entire subtree. Type: boolean Required: False Properties 80 REST API Reference Amazon MQ ListBrokersOutput A list of information about all brokers. brokerSummaries A list of information about all brokers. Type: Array of type BrokerSummary Required: False nextToken The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty. Type: string Required: False Logs The list of information about logs to be enabled for the specified broker. general Enables general logging. Type: boolean Required: False audit Enables audit logging. Every user management action made using JMX or the ActiveMQ Web Console is logged. Does not apply to RabbitMQ brokers. Type: boolean Required: False Properties 81 Amazon MQ User REST API Reference A user associated
amazon-mq-api-014
amazon-mq-api.pdf
14
list of information about all brokers. Type: Array of type BrokerSummary Required: False nextToken The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty. Type: string Required: False Logs The list of information about logs to be enabled for the specified broker. general Enables general logging. Type: boolean Required: False audit Enables audit logging. Every user management action made using JMX or the ActiveMQ Web Console is logged. Does not apply to RabbitMQ brokers. Type: boolean Required: False Properties 81 Amazon MQ User REST API Reference A user associated with the broker. For Amazon MQ for RabbitMQ brokers, one and only one administrative user is accepted and created when a broker is first provisioned. All subsequent broker users are created by making RabbitMQ API calls directly to brokers or via the RabbitMQ web console. password Required. The password of the user. This value must be at least 12 characters long, must contain at least 4 unique characters, and must not contain commas, colons, or equal signs (,:=). Type: string Required: True Format: password replicationUser Defines if this user is intended for CRDR replication purposes. Type: boolean Required: False groups The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long. Does not apply to RabbitMQ brokers. Type: Array of type string Required: False consoleAccess Enables access to the ActiveMQ Web Console for the ActiveMQ user. Does not apply to RabbitMQ brokers. Type: boolean Required: False Properties 82 Amazon MQ jolokiaApiAccess REST API Reference Enables Jolokia access to the ActiveMQ broker for the ActiveMQ user (Does not apply to RabbitMQ brokers). Type: JolokiaApiAccess Required: False username The username of the broker user. The following restrictions apply to broker usernames: • For Amazon MQ for ActiveMQ brokers, this value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long. • For Amazon MQ for RabbitMQ brokers, this value can contain only alphanumeric characters, dashes, periods, underscores (- . _). This value must not contain a tilde (~) character. Amazon MQ prohibts using guest as a valid usename. This value must be 2-100 characters long. Important Do not add personally identifiable information (PII) or other confidential or sensitive information in broker usernames. Broker usernames are accessible to other AWS services, including CloudWatch Logs. Broker usernames are not intended to be used for private or sensitive data. Type: string Required: True WeeklyStartTime The scheduled time period relative to UTC during which Amazon MQ begins to apply pending updates or patches to the broker. dayOfWeek Required. The day of the week. Properties 83 Amazon MQ REST API Reference Type: string Required: True Values: MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | SUNDAY timeZone The time zone, UTC by default, in either the Country/City format, or the UTC offset format. Type: string Required: False timeOfDay Required. The time, in 24-hour format. Type: string Required: True See also For more information about using this API in one of the language-specific AWS SDKs and references, see the following: ListBrokers • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See also 84 REST API Reference Amazon MQ CreateBroker • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Brokers broker-id Promote URI /v1/brokers/broker-id/promote HTTP methods POST Operation ID: Promote Promotes a data replication replica broker to a primary. Path parameters Name broker-id Type String Required Description True The unique ID that Amazon MQ generates for the broker. Brokers broker-id Promote 85 Amazon MQ Responses REST API Reference Status code Response model Description 200 400 403 404 500 PromoteOutput HTTP Status Code 200: OK. Error Error Error Error HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. OPTIONS Path parameters Name broker-id Type String
amazon-mq-api-015
amazon-mq-api.pdf
15
broker-id Promote 85 Amazon MQ Responses REST API Reference Status code Response model Description 200 400 403 404 500 PromoteOutput HTTP Status Code 200: OK. Error Error Error Error HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. OPTIONS Path parameters Name broker-id Type String Required Description True The unique ID that Amazon MQ generates for the broker. HTTP methods 86 Amazon MQ Responses REST API Reference Status code Response model Description 200 None Default response for CORS method Schemas Request bodies POST schema { "mode": enum } Response bodies PromoteOutput schema { "brokerId": "string" } Error schema { "errorAttribute": "string", "message": "string" } Properties Error Returns information about an error. Schemas 87 REST API Reference Amazon MQ errorAttribute The attribute which caused the error. Type: string Required: False message The explanation of the error. Type: string Required: False PromoteInput Creates a Promote request with the properties specified. mode The Promote mode requested. Note: Valid values for the parameter are SWITCHOVER, FAILOVER. Type: PromoteMode Required: True PromoteMode The Promote mode requested. SWITCHOVER FAILOVER PromoteOutput Returns information about the updated broker. brokerId The unique ID that Amazon MQ generates for the broker. Properties 88 Amazon MQ Type: string Required: False See also REST API Reference For more information about using this API in one of the language-specific AWS SDKs and references, see the following: Promote • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Configuration A configuration contains all of the settings for your broker. For more information, see Amazon MQ for RabbitMQ broker configurations and Amazon MQ for ActiveMQ broker configurations in the Amazon MQ Developer Guide. You can create a configuration before creating any brokers. You can then apply the configuration to one or more brokers. Important Making changes to a configuration does not apply the changes to the broker immediately. To apply your changes, you must wait for the next maintenance window or reboot the broker. See also 89 REST API Reference Amazon MQ URI /v1/configurations/configuration-id HTTP methods GET Operation ID: DescribeConfiguration Returns information about the specified configuration. Path parameters Name Type Required Description configuration- String True id Responses The unique ID that Amazon MQ generates for the configuration. Status code Response model Description 200 400 403 404 URI Configuration HTTP Status Code 200: OK. Error Error Error HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 404: Resource not found due to 90 Amazon MQ REST API Reference Status code Response model Description incorrect input. Correct your request and then retry it. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. 500 Error PUT Operation ID: UpdateConfiguration Updates the specified configuration. Path parameters Name Type Required Description configuration- String True id Responses The unique ID that Amazon MQ generates for the configuration. Status code Response model Description 200 400 403 UpdateConfiguratio HTTP Status Code 200: OK. nOutput Error Error HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your HTTP methods 91 Amazon MQ REST API Reference Status code Response model Description credentials and then retry your request. HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it. HTTP Status Code 409: Configuration ID is already in use. Remove the configura tion from all brokers and retry the request. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. 404 409 Error Error 500 Error DELETE Operation ID: DeleteConfiguration Deletes the specified configuration. Path parameters Name Type Required Description configuration- String True id The unique ID that Amazon MQ generates for the configuration. HTTP methods 92 Amazon MQ Responses REST API Reference Status code Response model Description DeleteConfiguratio HTTP Status Code 200: OK. 200 400 403 404 409 nOutput Error Error Error Error 500 Error HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP
amazon-mq-api-016
amazon-mq-api.pdf
16
the issue. 404 409 Error Error 500 Error DELETE Operation ID: DeleteConfiguration Deletes the specified configuration. Path parameters Name Type Required Description configuration- String True id The unique ID that Amazon MQ generates for the configuration. HTTP methods 92 Amazon MQ Responses REST API Reference Status code Response model Description DeleteConfiguratio HTTP Status Code 200: OK. 200 400 403 404 409 nOutput Error Error Error Error 500 Error HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it. HTTP Status Code 409: Configuration ID is already in use. Remove the configura tion from all brokers and retry the request. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. HTTP methods 93 Amazon MQ OPTIONS Path parameters REST API Reference Name Type Required Description configuration- String True id Responses The unique ID that Amazon MQ generates for the configuration. Status code Response model Description 200 None Default response for CORS method Schemas Request bodies PUT schema { "data": "string", "description": "string" } Response bodies Configuration schema { "engineVersion": "string", "created": "string", "authenticationStrategy": enum, "name": "string", "description": "string", "engineType": enum, Schemas 94 Amazon MQ REST API Reference "id": "string", "arn": "string", "latestRevision": { "created": "string", "description": "string", "revision": integer }, "tags": { } } UpdateConfigurationOutput schema { "created": "string", "warnings": [ { "reason": enum, "attributeName": "string", "elementName": "string" } ], "name": "string", "id": "string", "arn": "string", "latestRevision": { "created": "string", "description": "string", "revision": integer } } DeleteConfigurationOutput schema { "configurationId": "string" } Error schema { Schemas 95 Amazon MQ REST API Reference "errorAttribute": "string", "message": "string" } Properties AuthenticationStrategy Optional. The authentication strategy used to secure the broker. The default is SIMPLE. SIMPLE LDAP Configuration Returns information about all configurations. engineVersion The broker engine version. Defaults to the latest available version for the specified broker engine type. For a list of supported engine versions, see the ActiveMQ version management and the RabbitMQ version management sections in the Amazon MQ Developer Guide. Type: string Required: True created Required. The date and time of the configuration revision. Type: string Required: True Format: date-time authenticationStrategy Optional. The authentication strategy associated with the configuration. The default is SIMPLE. Type: AuthenticationStrategy Required: True Properties 96 Amazon MQ name REST API Reference Required. The name of the configuration. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 1-150 characters long. Type: string Required: True description Required. The description of the configuration. Type: string Required: True engineType Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and RABBITMQ. Type: EngineType Required: True id Required. The unique ID that Amazon MQ generates for the configuration. Type: string Required: True arn Required. The ARN of the configuration. Type: string Required: True latestRevision Required. The latest revision of the configuration. Properties 97 Amazon MQ REST API Reference Type: ConfigurationRevision Required: True tags The list of all tags associated with this configuration. Type: object Required: False ConfigurationRevision Returns information about the specified configuration revision. created Required. The date and time of the configuration revision. Type: string Required: True Format: date-time description The description of the configuration revision. Type: string Required: False revision Required. The revision number of the configuration. Type: integer Required: True DeleteConfigurationOutput Returns information about the deleted configuration. Properties 98 Amazon MQ configurationId The unique ID that Amazon MQ generates for the configuration. REST API Reference Type: string Required: False EngineType The type of broker engine. Amazon MQ supports ActiveMQ and RabbitMQ. ACTIVEMQ RABBITMQ Error Returns information about an error. errorAttribute The attribute which caused the error. Type: string Required: False message The explanation of the error. Type: string Required: False SanitizationWarning Returns information about the configuration element or attribute that was sanitized in the configuration. reason The reason for which the configuration elements or attributes were sanitized. Properties 99 Amazon MQ REST API Reference Type: SanitizationWarningReason Required: True attributeName The name of the configuration attribute that has been sanitized. Type: string Required: False elementName The name of the configuration element that has been sanitized. Type: string Required: False SanitizationWarningReason The reason for which the configuration elements or attributes were sanitized. DISALLOWED_ELEMENT_REMOVED DISALLOWED_ATTRIBUTE_REMOVED INVALID_ATTRIBUTE_VALUE_REMOVED UpdateConfigurationInput Updates the specified configuration. data Amazon MQ for Active MQ: The base64-encoded XML configuration. Amazon MQ for RabbitMQ: the base64-encoded Cuttlefish configuration. Type: string Required: True Format: byte Properties 100 REST API Reference Amazon MQ description The description of the configuration. Type: string Required: False UpdateConfigurationOutput Returns information about the updated configuration. created Required. The date and time of the configuration. Type: string Required: True Format: date-time warnings
amazon-mq-api-017
amazon-mq-api.pdf
17
False elementName The name of the configuration element that has been sanitized. Type: string Required: False SanitizationWarningReason The reason for which the configuration elements or attributes were sanitized. DISALLOWED_ELEMENT_REMOVED DISALLOWED_ATTRIBUTE_REMOVED INVALID_ATTRIBUTE_VALUE_REMOVED UpdateConfigurationInput Updates the specified configuration. data Amazon MQ for Active MQ: The base64-encoded XML configuration. Amazon MQ for RabbitMQ: the base64-encoded Cuttlefish configuration. Type: string Required: True Format: byte Properties 100 REST API Reference Amazon MQ description The description of the configuration. Type: string Required: False UpdateConfigurationOutput Returns information about the updated configuration. created Required. The date and time of the configuration. Type: string Required: True Format: date-time warnings The list of the first 20 warnings about the configuration elements or attributes that were sanitized. Type: Array of type SanitizationWarning Required: False name The name of the configuration. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 1-150 characters long. Type: string Required: True id The unique ID that Amazon MQ generates for the configuration. Type: string Required: True Properties 101 Amazon MQ arn The Amazon Resource Name (ARN) of the configuration. REST API Reference Type: string Required: True latestRevision The latest revision of the configuration. Type: ConfigurationRevision Required: False See also For more information about using this API in one of the language-specific AWS SDKs and references, see the following: DescribeConfiguration • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 UpdateConfiguration • AWS Command Line Interface • AWS SDK for .NET See also 102 REST API Reference Amazon MQ • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 DeleteConfiguration • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Configuration Revision To keep track of the changes you make to your configuration, you can create configuration revisions. For more information, see Configuration in the Amazon MQ Developer Guide. Important Making changes to a configuration does not apply the changes to the broker immediately. To apply your changes, you must wait for the next maintenance window or reboot the broker. Configuration Revision 103 Amazon MQ URI REST API Reference /v1/configurations/configuration-id/revisions/configuration-revision HTTP methods GET Operation ID: DescribeConfigurationRevision Returns the specified configuration revision for the specified configuration. Path parameters Name Type Required Description configuration- String revision configuration- String id True True The revision of the configuration. The unique ID that Amazon MQ generates for the configuration. Responses Status code Response model Description 200 400 403 URI DescribeConfigurat HTTP Status Code 200: OK. ionRevisionOutput Error Error HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. 104 Amazon MQ REST API Reference Status code Response model Description 404 500 Error Error OPTIONS Path parameters HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. Name Type Required Description configuration- String revision configuration- String id True True The revision of the configuration. The unique ID that Amazon MQ generates for the configuration. Responses Status code Response model Description 200 None Default response for CORS method Schemas Response bodies Schemas 105 Amazon MQ REST API Reference DescribeConfigurationRevisionOutput schema { "data": "string", "created": "string", "description": "string", "configurationId": "string" } Error schema { "errorAttribute": "string", "message": "string" } Properties DescribeConfigurationRevisionOutput Returns the specified configuration revision for the specified configuration. data Amazon MQ for ActiveMQ: the base64-encoded XML configuration. Amazon MQ for RabbitMQ: base64-encoded Cuttlefish. Type: string Required: True Format: byte created Required. The date and time of the configuration. Type: string Required: True Format: date-time Properties 106 REST API Reference Amazon MQ description The description of the configuration. Type: string Required: False configurationId Required. The unique ID that Amazon MQ generates for the configuration. Type: string Required: True Error Returns information about an error. errorAttribute The attribute which caused the error. Type: string Required: False message The explanation of the error. Type: string Required: False See also For more information about using this API
amazon-mq-api-018
amazon-mq-api.pdf
18
the base64-encoded XML configuration. Amazon MQ for RabbitMQ: base64-encoded Cuttlefish. Type: string Required: True Format: byte created Required. The date and time of the configuration. Type: string Required: True Format: date-time Properties 106 REST API Reference Amazon MQ description The description of the configuration. Type: string Required: False configurationId Required. The unique ID that Amazon MQ generates for the configuration. Type: string Required: True Error Returns information about an error. errorAttribute The attribute which caused the error. Type: string Required: False message The explanation of the error. Type: string Required: False See also For more information about using this API in one of the language-specific AWS SDKs and references, see the following: DescribeConfigurationRevision • AWS Command Line Interface See also 107 REST API Reference Amazon MQ • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Configuration Revisions This is a collection of configuration revisions. To keep track of the changes you make to your configuration, you can create configuration revisions. For more information, see Configuration in the Amazon MQ Developer Guide. Important Making changes to a configuration does not apply the changes to the broker immediately. To apply your changes, you must wait for the next maintenance window or reboot the broker. URI /v1/configurations/configuration-id/revisions HTTP methods GET Operation ID: ListConfigurationRevisions Returns a list of all revisions for the specified configuration. Configuration Revisions 108 Amazon MQ Path parameters REST API Reference Name Type Required Description configuration- String True id The unique ID that Amazon MQ generates for the configuration. Query parameters Name nextToken Type String Required Description False maxResults String False The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty. The maximum number of brokers that Amazon MQ can return per page (20 by default). This value must be an integer from 5 to 100. Responses Status code Response model Description 200 400 ListConfigurationR HTTP Status Code 200: OK. evisionsOutput Error HTTP Status Code 400: Bad request due to incorrect HTTP methods 109 Amazon MQ REST API Reference Status code Response model Description input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. Error Error Error 403 404 500 OPTIONS Path parameters Name Type Required Description configuration- String True id Responses The unique ID that Amazon MQ generates for the configuration. Status code Response model Description 200 None Default response for CORS method HTTP methods 110 REST API Reference Amazon MQ Schemas Response bodies ListConfigurationRevisionsOutput schema { "nextToken": "string", "maxResults": integer, "revisions": [ { "created": "string", "description": "string", "revision": integer } ], "configurationId": "string" } Error schema { "errorAttribute": "string", "message": "string" } Properties ConfigurationRevision Returns information about the specified configuration revision. created Required. The date and time of the configuration revision. Type: string Required: True Format: date-time Schemas 111 REST API Reference Amazon MQ description The description of the configuration revision. Type: string Required: False revision Required. The revision number of the configuration. Type: integer Required: True Error Returns information about an error. errorAttribute The attribute which caused the error. Type: string Required: False message The explanation of the error. Type: string Required: False ListConfigurationRevisionsOutput Returns a list of all revisions for the specified configuration. nextToken The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty. Properties 112 Amazon MQ Type: string Required: False maxResults REST API Reference The maximum number of configuration revisions that can be returned per page (20 by default). This value must be an integer from 5 to 100. Type: integer Required: False revisions The list of all revisions for the specified configuration. Type: Array of type ConfigurationRevision Required: False configurationId The unique ID that Amazon MQ generates for the configuration. Type: string Required: False See also For more information about using this API in one of the language-specific AWS SDKs and references, see the following: ListConfigurationRevisions • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 See also 113 REST API Reference Amazon MQ • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Configurations This is a collection of configurations.
amazon-mq-api-019
amazon-mq-api.pdf
19
generates for the configuration. Type: string Required: False See also For more information about using this API in one of the language-specific AWS SDKs and references, see the following: ListConfigurationRevisions • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 See also 113 REST API Reference Amazon MQ • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Configurations This is a collection of configurations. A configuration contains all of the settings for your broker. For more information, see Configuration and Amazon MQ Broker Configuration Parameters in the Amazon MQ Developer Guide. You can create a configuration before creating any brokers. You can then apply the configuration to one or more brokers. Important Making changes to a configuration does not apply the changes to the broker immediately. To apply your changes, you must wait for the next maintenance window or reboot the broker. URI /v1/configurations HTTP methods GET Operation ID: ListConfigurations Returns a list of all configurations. Configurations 114 Amazon MQ Query parameters Name nextToken Type String REST API Reference Required Description False maxResults String False The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty. The maximum number of brokers that Amazon MQ can return per page (20 by default). This value must be an integer from 5 to 100. Responses Status code Response model Description 200 400 403 500 ListConfigurations HTTP Status Code 200: OK. Output Error Error Error HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 500: Unexpected internal server HTTP methods 115 Amazon MQ REST API Reference Status code Response model Description error. Retrying your request might resolve the issue. POST Operation ID: CreateConfiguration Creates a new configuration for the specified configuration name. Amazon MQ uses the default configuration (the engine type and version). Responses Status code Response model Description CreateConfiguratio HTTP Status Code 200: OK. 200 400 403 409 nOutput Error Error Error 500 Error HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 409: Configuration ID is already in use. Remove the configura tion from all brokers and retry the request. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. HTTP methods 116 Amazon MQ OPTIONS Responses REST API Reference Status code Response model Description 200 None Default response for CORS method Schemas Request bodies POST schema { "engineVersion": "string", "authenticationStrategy": enum, "name": "string", "engineType": enum, "tags": { } } Response bodies ListConfigurationsOutput schema { "nextToken": "string", "maxResults": integer, "configurations": [ { "engineVersion": "string", "created": "string", "authenticationStrategy": enum, "name": "string", "description": "string", "engineType": enum, "id": "string", Schemas 117 Amazon MQ REST API Reference "arn": "string", "latestRevision": { "created": "string", "description": "string", "revision": integer }, "tags": { } } ] } CreateConfigurationOutput schema { "created": "string", "authenticationStrategy": enum, "name": "string", "id": "string", "arn": "string", "latestRevision": { "created": "string", "description": "string", "revision": integer } } Error schema { "errorAttribute": "string", "message": "string" } Properties AuthenticationStrategy Optional. The authentication strategy used to secure the broker. The default is SIMPLE. Properties 118 Amazon MQ SIMPLE LDAP Configuration Returns information about all configurations. engineVersion REST API Reference The broker engine version. Defaults to the latest available version for the specified broker engine type. For a list of supported engine versions, see the ActiveMQ version management and the RabbitMQ version management sections in the Amazon MQ Developer Guide. Type: string Required: True created Required. The date and time of the configuration revision. Type: string Required: True Format: date-time authenticationStrategy Optional. The authentication strategy associated with the configuration. The default is SIMPLE. Type: AuthenticationStrategy Required: True name Required. The name of the configuration. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 1-150 characters long. Type: string Required: True Properties 119 Amazon MQ description Required. The description of the configuration. Type: string Required: True engineType REST API Reference Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and RABBITMQ. Type: EngineType Required: True id Required. The unique ID that Amazon MQ generates for the configuration. Type: string Required: True arn Required. The ARN of the configuration. Type: string Required: True latestRevision Required. The latest revision of the configuration. Type: ConfigurationRevision Required: True tags The list of all tags associated with this configuration. Properties 120 REST
amazon-mq-api-020
amazon-mq-api.pdf
20
~). This value must be 1-150 characters long. Type: string Required: True Properties 119 Amazon MQ description Required. The description of the configuration. Type: string Required: True engineType REST API Reference Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and RABBITMQ. Type: EngineType Required: True id Required. The unique ID that Amazon MQ generates for the configuration. Type: string Required: True arn Required. The ARN of the configuration. Type: string Required: True latestRevision Required. The latest revision of the configuration. Type: ConfigurationRevision Required: True tags The list of all tags associated with this configuration. Properties 120 REST API Reference Amazon MQ Type: object Required: False ConfigurationRevision Returns information about the specified configuration revision. created Required. The date and time of the configuration revision. Type: string Required: True Format: date-time description The description of the configuration revision. Type: string Required: False revision Required. The revision number of the configuration. Type: integer Required: True CreateConfigurationInput Creates a new configuration for the specified configuration name. Amazon MQ uses the default configuration (the engine type and version). engineVersion The broker engine version. Defaults to the latest available version for the specified broker engine type. For more information, see the ActiveMQ version management and the RabbitMQ version management sections in the Amazon MQ Developer Guide. Properties 121 Amazon MQ Type: string Required: False authenticationStrategy REST API Reference Optional. The authentication strategy associated with the configuration. The default is SIMPLE. Type: AuthenticationStrategy Required: False name Required. The name of the configuration. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 1-150 characters long. Type: string Required: True engineType Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and RABBITMQ. Type: EngineType Required: True tags Create tags when creating the configuration. Type: object Required: False CreateConfigurationOutput Returns information about the created configuration. created Required. The date and time of the configuration. Properties 122 Amazon MQ Type: string Required: True Format: date-time authenticationStrategy REST API Reference Optional. The authentication strategy associated with the configuration. The default is SIMPLE. Type: AuthenticationStrategy Required: True name Required. The name of the configuration. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 1-150 characters long. Type: string Required: True id Required. The unique ID that Amazon MQ generates for the configuration. Type: string Required: True arn Required. The Amazon Resource Name (ARN) of the configuration. Type: string Required: True latestRevision The latest revision of the configuration. Type: ConfigurationRevision Properties 123 Amazon MQ Required: False EngineType The type of broker engine. Amazon MQ supports ActiveMQ and RabbitMQ. REST API Reference ACTIVEMQ RABBITMQ Error Returns information about an error. errorAttribute The attribute which caused the error. Type: string Required: False message The explanation of the error. Type: string Required: False ListConfigurationsOutput Returns a list of all configurations. nextToken The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty. Type: string Required: False Properties 124 Amazon MQ maxResults REST API Reference The maximum number of configurations that Amazon MQ can return per page (20 by default). This value must be an integer from 5 to 100. Type: integer Required: False configurations The list of all revisions for the specified configuration. Type: Array of type Configuration Required: False See also For more information about using this API in one of the language-specific AWS SDKs and references, see the following: ListConfigurations • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 CreateConfiguration • AWS Command Line Interface See also 125 REST API Reference Amazon MQ • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Tag A tag is a key-value pair associated with a resource. You can use these metadata tags to identify the purpose of a broker or configuration. For more information see Tagging resources in the Amazon MQ Developer Guide. URI /v1/tags/resource-arn HTTP methods GET Operation ID: ListTags Lists tags for a resource. Path parameters Name Type Required Description resource-arn String True The Amazon Resource Name (ARN) of the resource tag. Tag 126 Amazon MQ Responses REST API Reference Status code Response model Description HTTP Status Code 200: OK. HTTP Status Code 400: Bad request due to incorrect input. Correct your
amazon-mq-api-021
amazon-mq-api.pdf
21
V3 Tag A tag is a key-value pair associated with a resource. You can use these metadata tags to identify the purpose of a broker or configuration. For more information see Tagging resources in the Amazon MQ Developer Guide. URI /v1/tags/resource-arn HTTP methods GET Operation ID: ListTags Lists tags for a resource. Path parameters Name Type Required Description resource-arn String True The Amazon Resource Name (ARN) of the resource tag. Tag 126 Amazon MQ Responses REST API Reference Status code Response model Description HTTP Status Code 200: OK. HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. 200 400 403 404 500 Tags Error Error Error Error POST Operation ID: CreateTags Add a tag to a resource. Path parameters Name Type Required Description resource-arn String True The Amazon Resource Name (ARN) of the resource tag. HTTP methods 127 Amazon MQ Responses REST API Reference Status code Response model Description 204 400 403 404 500 None Error Error Error Error DELETE Operation ID: DeleteTags Removes a tag from a resource. HTTP Status Code 204: Successful response. HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. HTTP methods 128 Amazon MQ Path parameters REST API Reference Name Type Required Description resource-arn String True The Amazon Resource Name (ARN) of the resource tag. Query parameters Name tagKeys Responses Type String Required Description True An array of tag keys to delete Status code Response model Description 204 400 403 404 500 None Error Error Error Error HTTP Status Code 204: Successful response. HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it. HTTP Status Code 500: Unexpected internal server HTTP methods 129 Amazon MQ REST API Reference Status code Response model Description error. Retrying your request might resolve the issue. OPTIONS Path parameters Name Type Required Description resource-arn String True The Amazon Resource Name (ARN) of the resource tag. Responses Status code Response model Description 200 None Default response for CORS method Schemas Request bodies POST schema { "tags": { } } Response bodies Tags schema { Schemas 130 REST API Reference Amazon MQ "tags": { } } Error schema { "errorAttribute": "string", "message": "string" } Properties Error Returns information about an error. errorAttribute The attribute which caused the error. Type: string Required: False message The explanation of the error. Type: string Required: False Tags A map of the key-value pairs for the resource tag. tags The key-value pair for the resource tag. Type: object Properties 131 Amazon MQ Required: False See also REST API Reference For more information about using this API in one of the language-specific AWS SDKs and references, see the following: ListTags • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 CreateTags • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See also 132 REST API Reference Amazon MQ DeleteTags • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 User Note Does not apply to RabbitMQ brokers. An ActiveMQ user is a person or an application that can access the queues and topics of an ActiveMQ broker. For more information, see User in the Amazon MQ Developer Guide. A user can belong to
amazon-mq-api-022
amazon-mq-api.pdf
22
DeleteTags • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 User Note Does not apply to RabbitMQ brokers. An ActiveMQ user is a person or an application that can access the queues and topics of an ActiveMQ broker. For more information, see User in the Amazon MQ Developer Guide. A user can belong to a group. You can configure which users belong to which groups and which groups have permission to send to, receive from, and administer specific queues and topics. Important Making changes to a user does not apply the changes to the user immediately. To apply your changes, you must wait for the next maintenance window or reboot the broker. URI /v1/brokers/broker-id/users/username User 133 Amazon MQ HTTP methods GET Operation ID: DescribeUser Returns information about an ActiveMQ user. Path parameters Name username Type String REST API Reference Required Description True The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, underscor es, and tildes (- . _ ~). This value must be 2-100 characters long. The unique ID that Amazon MQ generates for the broker. broker-id String True Responses Status code Response model Description 200 400 DescribeUserOutput HTTP Status Code 200: OK. Error HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP methods 134 Amazon MQ REST API Reference Status code Response model Description HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. 403 404 500 Error Error Error POST Operation ID: CreateUser Creates an ActiveMQ user. Important Do not add personally identifiable information (PII) or other confidential or sensitive information in broker usernames. Broker usernames are accessible to other AWS services, including CloudWatch Logs. Broker usernames are not intended to be used for private or sensitive data. Path parameters Name username Type String Required Description True The username of the ActiveMQ user. This value can contain HTTP methods 135 Amazon MQ Name Type Required Description REST API Reference broker-id String True only alphanumeric characters, dashes, periods, underscor es, and tildes (- . _ ~). This value must be 2-100 characters long. The unique ID that Amazon MQ generates for the broker. Responses Status code Response model Description 200 400 403 404 409 None Error Error Error Error HTTP Status Code 200: OK. HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it. HTTP Status Code 409: Configuration ID is already HTTP methods 136 Amazon MQ REST API Reference Status code Response model Description 500 Error PUT Operation ID: UpdateUser Updates the information for an ActiveMQ user. Path parameters Name username Type String in use. Remove the configura tion from all brokers and retry the request. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. Required Description True The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, underscor es, and tildes (- . _ ~). This value must be 2-100 characters long. The unique ID that Amazon MQ generates for the broker. broker-id String True HTTP methods 137 Amazon MQ Responses REST API Reference Status code Response model Description 200 400 403 404 409 None Error Error Error Error 500 Error DELETE Operation ID: DeleteUser Deletes an ActiveMQ user. HTTP Status Code 200: OK. HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it. HTTP Status Code 409: Configuration ID is already in use. Remove the configura tion from all brokers and retry the request. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. HTTP methods 138 Amazon MQ Path parameters Name username Type String REST API Reference Required Description True The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, underscor es, and tildes (- . _ ~). This value must be 2-100 characters long. The unique ID
amazon-mq-api-023
amazon-mq-api.pdf
23
Resource not found due to incorrect input. Correct your request and then retry it. HTTP Status Code 409: Configuration ID is already in use. Remove the configura tion from all brokers and retry the request. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. HTTP methods 138 Amazon MQ Path parameters Name username Type String REST API Reference Required Description True The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, underscor es, and tildes (- . _ ~). This value must be 2-100 characters long. The unique ID that Amazon MQ generates for the broker. broker-id String True Responses Status code Response model Description 200 400 403 404 None Error Error Error HTTP Status Code 200: OK. HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 404: Resource not found due to HTTP methods 139 Amazon MQ REST API Reference Status code Response model Description 500 Error OPTIONS Path parameters Name username Type String incorrect input. Correct your request and then retry it. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. Required Description True broker-id String True The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, underscor es, and tildes (- . _ ~). This value must be 2-100 characters long. The unique ID that Amazon MQ generates for the broker. HTTP methods 140 Amazon MQ Responses REST API Reference Status code Response model Description 200 None Default response for CORS method Schemas Request bodies POST schema { "password": "string", "replicationUser": boolean, "groups": [ "string" ], "consoleAccess": boolean, "jolokiaApiAccess": enum } PUT schema { "password": "string", "replicationUser": boolean, "groups": [ "string" ], "consoleAccess": boolean, "jolokiaApiAccess": enum } Response bodies DescribeUserOutput schema { Schemas 141 Amazon MQ REST API Reference "brokerId": "string", "replicationUser": boolean, "pending": { "pendingChange": enum, "groups": [ "string" ], "consoleAccess": boolean, "jolokiaApiAccess": enum }, "groups": [ "string" ], "consoleAccess": boolean, "jolokiaApiAccess": enum, "username": "string" } Error schema { "errorAttribute": "string", "message": "string" } Properties ChangeType The type of change pending for the ActiveMQ user. CREATE UPDATE DELETE CreateUserInput Creates a new ActiveMQ user. Properties 142 Amazon MQ password REST API Reference Required. The password of the user. This value must be at least 12 characters long, must contain at least 4 unique characters, and must not contain commas, colons, or equal signs (,:=). Type: string Required: True Format: password replicationUser Defines if this user is intended for CRDR replication purposes. Type: boolean Required: False groups The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long. Type: Array of type string Required: False consoleAccess Enables access to the ActiveMQ Web Console for the ActiveMQ user. Type: boolean Required: False jolokiaApiAccess Enable Jolokia access to the ActiveMQ broker (Does not apply to RabbitMQ brokers). Type: JolokiaApiAccess Required: False Properties 143 Amazon MQ DescribeUserOutput Returns information about an ActiveMQ user. brokerId Required. The unique ID that Amazon MQ generates for the broker. REST API Reference Type: string Required: True replicationUser Describes whether the user is intended for data replication replication Type: boolean Required: False pending The status of the changes pending for the ActiveMQ user. Type: UserPendingChanges Required: False groups The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long. Type: Array of type string Required: False consoleAccess Enables access to the the ActiveMQ Web Console for the ActiveMQ user. Type: boolean Properties 144 Amazon MQ Required: False jolokiaApiAccess REST API Reference Enable Jolokia access to the ActiveMQ broker (Does not apply to RabbitMQ brokers). Type: JolokiaApiAccess Required: False username Required. The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long. Type: string Required: True Error Returns information about an error. errorAttribute The attribute which caused the error. Type: string Required: False message The explanation of the error. Type: string Required: False JolokiaApiAccess Jolokia access to the ActiveMQ broker (Does not apply to RabbitMQ brokers). Properties 145 Amazon MQ READ_ONLY NONE UpdateUserInput Updates the information for an ActiveMQ user. password REST API Reference The password of the user. This value must be at least 12 characters long, must contain at least 4 unique characters, and must not contain commas, colons, or equal signs (,:=). Type: string Required: False Format: password replicationUser Defines
amazon-mq-api-024
amazon-mq-api.pdf
24
string Required: True Error Returns information about an error. errorAttribute The attribute which caused the error. Type: string Required: False message The explanation of the error. Type: string Required: False JolokiaApiAccess Jolokia access to the ActiveMQ broker (Does not apply to RabbitMQ brokers). Properties 145 Amazon MQ READ_ONLY NONE UpdateUserInput Updates the information for an ActiveMQ user. password REST API Reference The password of the user. This value must be at least 12 characters long, must contain at least 4 unique characters, and must not contain commas, colons, or equal signs (,:=). Type: string Required: False Format: password replicationUser Defines whether the user is intended for data replication replication. Type: boolean Required: False groups The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long. Type: Array of type string Required: False consoleAccess Enables access to the the ActiveMQ Web Console for the ActiveMQ user. Type: boolean Required: False Properties 146 Amazon MQ jolokiaApiAccess REST API Reference Enable Jolokia access to the ActiveMQ broker (Does not apply to RabbitMQ brokers). Type: JolokiaApiAccess Required: False UserPendingChanges Returns information about the status of the changes pending for the ActiveMQ user. pendingChange Required. The type of change pending for the ActiveMQ user. Type: ChangeType Required: True groups The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long. Type: Array of type string Required: False consoleAccess Enables access to the the ActiveMQ Web Console for the ActiveMQ user. Type: boolean Required: False jolokiaApiAccess Enable Jolokia access to the ActiveMQ broker (Does not apply to RabbitMQ brokers). Type: JolokiaApiAccess Properties 147 Amazon MQ Required: False See also REST API Reference For more information about using this API in one of the language-specific AWS SDKs and references, see the following: DescribeUser • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 CreateUser • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See also 148 REST API Reference Amazon MQ UpdateUser • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 DeleteUser • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Users Note Does not apply to RabbitMQ brokers. Users 149 Amazon MQ REST API Reference This is a collection of ActiveMQ users for the specified broker. An ActiveMQ user is a person or an application that can access the queues and topics of an ActiveMQ broker. For more information, see User in the Amazon MQ Developer Guide. You can configure to have specific permissions. For example, you can allow some users to access the ActiveMQ Web Console. A user can belong to a group. You can configure which users belong to which groups and which groups have permission to send to, receive from, and administer specific queues and topics. Important Making changes to a user does not apply the changes to the user immediately. To apply your changes, you must wait for the next maintenance window or reboot the broker. URI /v1/brokers/broker-id/users HTTP methods GET Operation ID: ListUsers Returns a list of all ActiveMQ users. Path parameters Name broker-id Type String Required Description True The unique ID that Amazon MQ generates for the broker. URI 150 Amazon MQ Query parameters Name nextToken Type String REST API Reference Required Description False maxResults String False The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty. The maximum number of brokers that Amazon MQ can return per page (20 by default). This value must be an integer
amazon-mq-api-025
amazon-mq-api.pdf
25
window or reboot the broker. URI /v1/brokers/broker-id/users HTTP methods GET Operation ID: ListUsers Returns a list of all ActiveMQ users. Path parameters Name broker-id Type String Required Description True The unique ID that Amazon MQ generates for the broker. URI 150 Amazon MQ Query parameters Name nextToken Type String REST API Reference Required Description False maxResults String False The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty. The maximum number of brokers that Amazon MQ can return per page (20 by default). This value must be an integer from 5 to 100. Responses Status code Response model Description 200 400 403 404 ListUsersOutput HTTP Status Code 200: OK. Error Error Error HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it. HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request. HTTP Status Code 404: Resource not found due to HTTP methods 151 Amazon MQ REST API Reference Status code Response model Description 500 Error OPTIONS Path parameters Name broker-id Type String incorrect input. Correct your request and then retry it. HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue. Required Description True The unique ID that Amazon MQ generates for the broker. Responses Status code Response model Description 200 None Default response for CORS method Schemas Response bodies ListUsersOutput schema { "brokerId": "string", "nextToken": "string", "maxResults": integer, Schemas 152 REST API Reference Amazon MQ "users": [ { "pendingChange": enum, "username": "string" } ] } Error schema { "errorAttribute": "string", "message": "string" } Properties ChangeType The type of change pending for the ActiveMQ user. CREATE UPDATE DELETE Error Returns information about an error. errorAttribute The attribute which caused the error. Type: string Required: False message The explanation of the error. Properties 153 Amazon MQ Type: string Required: False ListUsersOutput Returns a list of all ActiveMQ users. brokerId REST API Reference Required. The unique ID that Amazon MQ generates for the broker. Type: string Required: True nextToken The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty. Type: string Required: False maxResults Required. The maximum number of ActiveMQ users that can be returned per page (20 by default). This value must be an integer from 5 to 100. Type: integer Required: True Minimum: 5 Maximum: 100 users Required. The list of all ActiveMQ usernames for the specified broker. Does not apply to RabbitMQ brokers. Type: Array of type UserSummary Required: True Properties 154 Amazon MQ UserSummary REST API Reference Returns a list of all broker users. Does not apply to RabbitMQ brokers. pendingChange The type of change pending for the broker user. Type: ChangeType Required: False username Required. The username of the broker user. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long. Type: string Required: True See also For more information about using this API in one of the language-specific AWS SDKs and references, see the following: ListUsers • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See also 155 Amazon MQ Operations The Amazon MQ REST API includes the following operations. • CreateBroker Creates a broker. Note: This API is asynchronous. REST API Reference To create a broker, you must either use the AmazonMQFullAccess IAM policy or include the following EC2 permissions in your IAM policy. • ec2:CreateNetworkInterface This permission is required to allow Amazon MQ to create an elastic network interface (ENI) on behalf of your account. • ec2:CreateNetworkInterfacePermission This permission is required to attach the ENI to the broker instance. • ec2:DeleteNetworkInterface • ec2:DeleteNetworkInterfacePermission • ec2:DetachNetworkInterface • ec2:DescribeInternetGateways • ec2:DescribeNetworkInterfaces • ec2:DescribeNetworkInterfacePermissions • ec2:DescribeRouteTables • ec2:DescribeSecurityGroups • ec2:DescribeSubnets • ec2:DescribeVpcs For more information, see Create an IAM User and Get Your AWS Credentials and Never Modify or Delete the Amazon MQ Elastic Network Interface in the Amazon MQ Developer Guide. • CreateConfiguration Creates a new configuration for the specified configuration name. Amazon MQ uses the default configuration (the engine type and version). • CreateTags 156 Amazon MQ Add a tag to a resource. • CreateUser Creates an ActiveMQ user. Important REST API Reference Do not add personally identifiable information (PII) or other confidential or sensitive information in broker usernames. Broker usernames are accessible to other AWS services, including CloudWatch Logs. Broker usernames are not intended to be used for private or sensitive data. • DeleteBroker Deletes a
amazon-mq-api-026
amazon-mq-api.pdf
26
Delete the Amazon MQ Elastic Network Interface in the Amazon MQ Developer Guide. • CreateConfiguration Creates a new configuration for the specified configuration name. Amazon MQ uses the default configuration (the engine type and version). • CreateTags 156 Amazon MQ Add a tag to a resource. • CreateUser Creates an ActiveMQ user. Important REST API Reference Do not add personally identifiable information (PII) or other confidential or sensitive information in broker usernames. Broker usernames are accessible to other AWS services, including CloudWatch Logs. Broker usernames are not intended to be used for private or sensitive data. • DeleteBroker Deletes a broker. Note: This API is asynchronous. • DeleteConfiguration Deletes the specified configuration. • DeleteTags Removes a tag from a resource. • DeleteUser Deletes an ActiveMQ user. • DescribeBroker Returns information about the specified broker. • DescribeBrokerEngineTypes Describe available engine types and versions. • DescribeBrokerInstanceOptions Describe available broker instance options. • DescribeConfiguration Returns information about the specified configuration. • DescribeConfigurationRevision 157 Amazon MQ REST API Reference Returns the specified configuration revision for the specified configuration. • DescribeUser Returns information about an ActiveMQ user. • ListBrokers Returns a list of all brokers. • ListConfigurationRevisions Returns a list of all revisions for the specified configuration. • ListConfigurations Returns a list of all configurations. • ListTags Lists tags for a resource. • ListUsers Returns a list of all ActiveMQ users. • Promote Promotes a data replication replica broker to a primary. • RebootBroker Reboots a broker. Note: This API is asynchronous. • UpdateBroker Adds a pending configuration change to a broker. • UpdateConfiguration Updates the specified configuration. • UpdateUser Updates the information for an ActiveMQ user. 158
amazon-mq-dg-001
amazon-mq-dg.pdf
1
Developer Guide Amazon MQ Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon MQ Developer Guide Amazon MQ: Developer Guide Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon. Amazon MQ Table of Contents Developer Guide What is Amazon MQ? ...................................................................................................................... 1 Amazon MQ features ................................................................................................................................... 1 How can I get started with Amazon MQ? ............................................................................................... 2 How can I provide feedback to Amazon MQ? ........................................................................................ 3 Setting up ........................................................................................................................................ 4 Step 1: Prerequisites .................................................................................................................................... 4 Sign up for an AWS account ................................................................................................................ 4 Create a user with administrative access ........................................................................................... 4 Create a user and get your AWS credentials .......................................................................................... 6 Step 3: get ready to use the example codes .......................................................................................... 7 Next steps ...................................................................................................................................................... 7 Getting started: Creating and connecting to an ActiveMQ broker ............................................... 9 Create an ActiveMQ broker ........................................................................................................................ 9 Getting started: Creating and connecting to a RabbitMQ broker .............................................. 12 Create a RabbitMQ broker ....................................................................................................................... 12 Managing a broker ........................................................................................................................ 15 Connecting to Amazon MQ ..................................................................................................................... 15 Service endpoints .................................................................................................................................. 15 Broker endpoints ................................................................................................................................... 16 Connect to Amazon MQ using Dual-stack (IPv4 and IPv6) endpoints ....................................... 16 Connect to Amazon MQ using AWS PrivateLink ............................................................................ 16 Upgrading the engine version ................................................................................................................. 17 Manually upgrading the engine version .......................................................................................... 18 Automatically upgrading the minor engine version ...................................................................... 21 Upgrading the instance type ................................................................................................................... 23 Storage ......................................................................................................................................................... 26 Differences between Storage Types .................................................................................................. 26 Configuring a private broker ................................................................................................................... 27 Configuring a private broker in the AWS Management Console ................................................. 28 Accessing the Amazon MQ broker web console without public accessibility ............................ 29 Scheduling broker maintenance ............................................................................................................. 30 Rebooting a broker .................................................................................................................................... 33 To Reboot an Amazon MQ Broker .................................................................................................... 33 Deleting a broker ....................................................................................................................................... 34 iii Amazon MQ Developer Guide Deleting an Amazon MQ broker ........................................................................................................ 34 Broker statuses ........................................................................................................................................... 34 Tagging ......................................................................................................................................................... 35 Adding tags in the Amazon MQ Console ........................................................................................ 36 Amazon MQ for ActiveMQ ............................................................................................................ 37 Amazon MQ for ActiveMQ brokers ........................................................................................................ 37 Broker ...................................................................................................................................................... 37 User .......................................................................................................................................................... 40 Deploying a broker .................................................................................................................................... 41 Single-instance broker ......................................................................................................................... 41 Active/standby broker .......................................................................................................................... 42 Network of brokers .................................................................................................................................... 43 How does a Network of Brokers work? ............................................................................................ 43 How Does a Network of Brokers Handle Credentials? .................................................................. 44 Cross region ........................................................................................................................................... 44 Dynamic Failover With Transport Connectors ................................................................................ 46 Instance types ............................................................................................................................................. 47 Broker configurations ................................................................................................................................ 48 Attributes ................................................................................................................................................ 49 Using Spring XML configuration files ............................................................................................... 49 Creating a configuration ..................................................................................................................... 50 Edit a configuration revision .............................................................................................................. 53 Permitted elements .............................................................................................................................. 55 Permitted Attributes ............................................................................................................................ 58 Permitted Collections ........................................................................................................................... 70 Child Element Attributes ..................................................................................................................... 77 Cross-Region data replication .................................................................................................................. 84 Primary and replica brokers ............................................................................................................... 84 Creating a CRDR broker ....................................................................................................................... 85 Deleting a CRDR broker ....................................................................................................................... 89 Promoting a CRDR broker ................................................................................................................... 89 Metrics ..................................................................................................................................................... 92 ActiveMQ tutorials ..................................................................................................................................... 94 Creating and configuring a network of brokers ............................................................................. 94 Connecting a Java application to your broker ............................................................................. 100 Integrating ActiveMQ brokers with LDAP ...................................................................................... 105 iv Amazon MQ Developer Guide Step 3: (Optional) Connect to an AWS Lambda function .......................................................... 121 Creating an ActiveMQ broker user .................................................................................................. 123 Edit an ActiveMQ broker user .......................................................................................................... 125 Delete an ActiveMQ broker user ..................................................................................................... 125 Working Java examples ..................................................................................................................... 126 Version management .............................................................................................................................. 138 Supported engine versions on Amazon MQ for ActiveMQ ........................................................ 138 Engine version upgrades ................................................................................................................... 139 Listing supported engine versions .................................................................................................. 139 Amazon MQ for ActiveMQ best practices ........................................................................................... 140 Never Modify or Delete the Amazon MQ Elastic Network Interface ........................................ 140 Always Use Connection Pooling ...................................................................................................... 141 Always Use the Failover Transport to Connect to Multiple Broker Endpoints ........................ 142 Avoid Using Message Selectors ....................................................................................................... 142 Prefer Virtual Destinations to Durable Subscriptions ................................................................. 142 If using Amazon VPC peering, avoid client IPs in CIDR range 10.0.0.0/16 ........................ 142 Disable Concurrent Store and Dispatch for Queues with Slow Consumers ............................ 143 Choose the Correct Broker Instance Type for the Best Throughput ........................................ 143 Choose the correct broker storage type for the best throughput ............................................ 144 Configure Your Network of Brokers Correctly .............................................................................. 144 Avoid slow restarts by recovering prepared XA transactions .................................................... 145 Amazon MQ for RabbitMQ ......................................................................................................... 147 Amazon MQ for RabbitMQ brokers ..................................................................................................... 147 Broker .................................................................................................................................................... 147 Broker users ......................................................................................................................................... 149 Broker defaults .................................................................................................................................... 150 Sizing guidelines ................................................................................................................................. 154 Plugins ................................................................................................................................................... 157 Policies .................................................................................................................................................. 160 Deploying a RabbitMQ broker .............................................................................................................. 165 Single-instance broker ....................................................................................................................... 165 Cluster deployment ............................................................................................................................ 166 Instance types ........................................................................................................................................... 168 Broker configurations
amazon-mq-dg-002
amazon-mq-dg.pdf
2
Slow Consumers ............................ 143 Choose the Correct Broker Instance Type for the Best Throughput ........................................ 143 Choose the correct broker storage type for the best throughput ............................................ 144 Configure Your Network of Brokers Correctly .............................................................................. 144 Avoid slow restarts by recovering prepared XA transactions .................................................... 145 Amazon MQ for RabbitMQ ......................................................................................................... 147 Amazon MQ for RabbitMQ brokers ..................................................................................................... 147 Broker .................................................................................................................................................... 147 Broker users ......................................................................................................................................... 149 Broker defaults .................................................................................................................................... 150 Sizing guidelines ................................................................................................................................. 154 Plugins ................................................................................................................................................... 157 Policies .................................................................................................................................................. 160 Deploying a RabbitMQ broker .............................................................................................................. 165 Single-instance broker ....................................................................................................................... 165 Cluster deployment ............................................................................................................................ 166 Instance types ........................................................................................................................................... 168 Broker configurations .............................................................................................................................. 169 Attributes ................................................................................................................................................ 49 Creating a configuration ................................................................................................................... 170 v Amazon MQ Developer Guide Editing a configuration revision ...................................................................................................... 172 Configuration values .......................................................................................................................... 174 Quorum queues ........................................................................................................................................ 177 Migrating to quorum queues ........................................................................................................... 178 Policy configuration ........................................................................................................................... 179 Best practices ...................................................................................................................................... 180 RabbitMQ tutorials .................................................................................................................................. 181 Editing broker preferences ............................................................................................................... 181 Using Python Pika with Amazon MQ for RabbitMQ ................................................................... 182 Resolving paused queue sync .......................................................................................................... 189 Step 2: Connect a JVM-based application to your broker ......................................................... 195 Step 3: (Optional) Connect to an AWS Lambda function .......................................................... 199 Version management .............................................................................................................................. 202 Supported engine versions on Amazon MQ for RabbitMQ ....................................................... 202 Engine version upgrades ................................................................................................................... 203 Listing supported engine versions .................................................................................................. 204 Amazon MQ for RabbitMQ best practices .......................................................................................... 204 Choose the correct broker instance type for the best throughput ........................................... 205 Use multiple channels ....................................................................................................................... 205 Use persistent messages and durable queues .............................................................................. 205 Keep queues short ............................................................................................................................. 206 Configure publisher confirmation and consumer delivery acknowledgement ....................... 207 Configure pre-fetching ...................................................................................................................... 208 Use Celery 5.5.0 or later with quorum queues ............................................................................ 209 Automatically recover from network failures ............................................................................... 210 Security ........................................................................................................................................ 212 Data protection ........................................................................................................................................ 212 Encryption ............................................................................................................................................ 214 Encryption at rest ............................................................................................................................... 214 Encryption in transit .......................................................................................................................... 223 Identity and access management ......................................................................................................... 225 Audience ............................................................................................................................................... 225 Authenticating with identities ......................................................................................................... 226 Managing access using policies ....................................................................................................... 229 How Amazon MQ works with IAM .................................................................................................. 231 Identity-based policy examples ....................................................................................................... 237 vi Amazon MQ Developer Guide API authentication and authorization ............................................................................................ 240 AWS managed policies ...................................................................................................................... 244 Using service-linked roles ................................................................................................................. 245 Troubleshooting .................................................................................................................................. 251 Compliance validation ............................................................................................................................ 253 Resilience ................................................................................................................................................... 254 Infrastructure security ............................................................................................................................. 255 Security best practices ............................................................................................................................ 255 Prefer brokers without public accessibility ................................................................................... 255 Always configure an authorization map ........................................................................................ 256 Block Unnecessary Protocols ........................................................................................................... 256 Logging and monitoring ............................................................................................................. 257 Accessing CloudWatch metrics .............................................................................................................. 257 Accesing CloudWatch metrics using the AWS Management Console ...................................... 257 Metrics for ActiveMQ .............................................................................................................................. 258 Amazon MQ for ActiveMQ metrics ................................................................................................. 258 ActiveMQ destination (queue and topic) metrics ........................................................................ 264 Metrics for RabbitMQ .............................................................................................................................. 267 RabbitMQ broker metrics .................................................................................................................. 267 Dimensions for RabbitMQ broker metrics ..................................................................................... 272 RabbitMQ node metrics .................................................................................................................... 272 Dimensions for RabbitMQ node metrics ....................................................................................... 273 RabbitMQ queue metrics .................................................................................................................. 273 Dimensions for RabbitMQ queue metrics ..................................................................................... 274 Configuring Amazon MQ for RabbitMQ logs ................................................................................ 274 Logging API calls using CloudTrail ....................................................................................................... 275 Amazon MQ Information in CloudTrail .......................................................................................... 275 Example Amazon MQ Log File Entry ............................................................................................. 277 Configuring Amazon MQ for ActiveMQ logs ...................................................................................... 279 Understanding the structure of logging in CloudWatch Logs ................................................... 280 Add the CreateLogGroup permission to your Amazon MQ user ........................................... 280 Configure a resource-based policy for Amazon MQ .................................................................... 281 Cross-service confused deputy prevention ................................................................................... 282 Troubleshooting ....................................................................................................................................... 284 Log Groups Don't Appear in CloudWatch ..................................................................................... 285 Log Streams Don't Appear in CloudWatch Log Groups .............................................................. 285 vii Amazon MQ Developer Guide Quotas .......................................................................................................................................... 286 Brokers ........................................................................................................................................................ 286 Configurations .......................................................................................................................................... 287 Users ........................................................................................................................................................... 288 Data Storage ............................................................................................................................................. 289 API Throttling ........................................................................................................................................... 290 Troubleshooting ........................................................................................................................... 291 Troubleshooting ActiveMQ on Amazon MQ ....................................................................................... 291 Troubleshooting RabbitMQ on Amazon MQ ...................................................................................... 291 Troubleshooting: General Amazon MQ ............................................................................................... 293 I can't connect to my broker web console or endpoints. ........................................................... 293 SSL exceptions .................................................................................................................................... 299 I created a broker but broker creation failed. .............................................................................. 299 My broker restarted and I'm not sure why. ................................................................................... 299 Troubleshooting ActiveMQ on Amazon MQ ....................................................................................... 300 Retrieving CloudWatch Logs ............................................................................................................ 300 Connecting to broker after a restart .............................................................................................. 301 Some clients unable to connect ...................................................................................................... 302 JSP exception on the web console ................................................................................................ 302 Troubleshooting: RabbitMQ on Amazon MQ ..................................................................................... 303 I can’t see metrics for my queues or virtual hosts in CloudWatch. .......................................... 303 How do I enable plugins in RabbitMQ on Amazon MQ? ............................................................ 304 I'm unable to change Amazon VPC configuration for the broker. ............................................ 304 BROKER_ENI_DELETED ........................................................................................................................... 304 BROKER_OOM .......................................................................................................................................... 304 RABBITMQ_MEMORY_ALARM ................................................................................................................. 306 Diagnosing high memory alarm using the RabbitMQ web console ........................................ 307 Diagnosing high memory alarm using Amazon MQ metrics ..................................................... 308 Addressing high memory alarm ..................................................................................................... 309 Reducing the number of connections and channels ................................................................... 311 Addressing paused queue synchronizations in cluster deployments ...................................... 311 Addressing restart loops in single-instance brokers .................................................................. 312 Preventing high memory
amazon-mq-dg-003
amazon-mq-dg.pdf
3
metrics for my queues or virtual hosts in CloudWatch. .......................................... 303 How do I enable plugins in RabbitMQ on Amazon MQ? ............................................................ 304 I'm unable to change Amazon VPC configuration for the broker. ............................................ 304 BROKER_ENI_DELETED ........................................................................................................................... 304 BROKER_OOM .......................................................................................................................................... 304 RABBITMQ_MEMORY_ALARM ................................................................................................................. 306 Diagnosing high memory alarm using the RabbitMQ web console ........................................ 307 Diagnosing high memory alarm using Amazon MQ metrics ..................................................... 308 Addressing high memory alarm ..................................................................................................... 309 Reducing the number of connections and channels ................................................................... 311 Addressing paused queue synchronizations in cluster deployments ...................................... 311 Addressing restart loops in single-instance brokers .................................................................. 312 Preventing high memory alarms ................................................................................................... 312 RABBITMQ_INVALID_KMS_KEY ............................................................................................................. 313 Diagnosing and addressing INVALID_KMS_KEY ........................................................................... 314 RABBITMQ_DISK_ALARM ........................................................................................................................ 314 viii Amazon MQ Developer Guide Diagnosing and addressing disk limit alarm ................................................................................. 315 RABBITMQ_QUORUM_QUEUES_NOT_SUPPORTED_ON_CURRENT_VERSION ........................... 316 Related resources ........................................................................................................................ 317 Amazon MQ resources ............................................................................................................................ 317 Amazon MQ for ActiveMQ resources ................................................................................................... 318 Amazon MQ for RabbitMQ resources .................................................................................................. 318 Release notes ............................................................................................................................... 320 ix Amazon MQ Developer Guide What is Amazon MQ? Amazon MQ is a managed message broker service for Apache ActiveMQ Classic and RabbitMQ that manages the setup, operation, and maintenance of message brokers. You can create a new Amazon MQ broker using industry standard messaging protocols, or migrate existing message brokers to Amazon MQ without rewriting messaging code. A broker is a message broker environment running on Amazon MQ. It is the basic building block of Amazon MQ. A message broker allows software applications and components to communicate using various programming languages, operating systems, and formal messaging protocols. You can use Amazon MQ brokers for communication between large scale, cloud native applications and components. Topics • Amazon MQ features • How can I get started with Amazon MQ? • How can I provide feedback to Amazon MQ? Amazon MQ features Managed maintenance and version upgrades Amazon MQ performs maintenance and version upgrades for a message broker during your scheduled maintenance window. Monitor brokers with CloudWatch Amazon MQ is integrated with Amazon CloudWatch so you can view and analyze metrics for your brokers and queues. You can view and analyze metrics from the Amazon MQ console, the CloudWatch console, command line, and API. Metrics are automatically collected and pushed to CloudWatch every minute. Security Amazon MQ provides encryption of your messages at rest and in transit. Connections to the broker use SSL, and access can be restricted to a private endpoint within your Amazon VPC. Additonality, Amazon MQ features 1 Amazon MQ Developer Guide you can use AWS Identity and Access Management (IAM) to control the actions your IAM users and groups can take on specific Amazon MQ brokers. Quorum queues for RabbitMQ on Amazon MQ Quorum queues are a replicated queue type made up of a leader node (primary replica) and follower nodes (other replicas). Each node is in a different availability zone, so if one node is temporarily unavailable, message delivery continues with a newly elected leader replica in another availability zone. Quorum queues are useful for handling poison messages, which occur when a message fails and is requeued multiple times. Cross-Region data replication for ActiveMQ on Amazon MQ Cross-Region data replication (CRDR) allows for asynchronous message replication from the primary broker in a primary AWS Region to the replica broker in a replica Region. By issuing a failover request to the Amazon MQ API, the current replica broker is promoted to the primary broker role, and the current primary broker is demoted to the replica role. How can I get started with Amazon MQ? To get started with ActiveMQ on Amazon MQ, review the following documentation: • Getting started: Creating and connecting to an ActiveMQ broker • the section called “Deploying a broker” • ActiveMQ tutorials • the section called “Amazon MQ for ActiveMQ best practices” To get started with RabbitMQ on Amazon MQ, review the following documentation: • Getting started: Creating and connecting to a RabbitMQ broker • the section called “Deploying a RabbitMQ broker” • the section called “RabbitMQ tutorials” • the section called “Amazon MQ for RabbitMQ best practices” To learn about Amazon MQ REST APIs, see the Amazon MQ REST API Reference. To learn about Amazon MQ AWS CLI commands, see Amazon MQ in the AWS CLI Command Reference. How can I get started with Amazon MQ? 2 Amazon MQ Developer Guide How can I provide feedback to Amazon MQ? We welcome and encourgae your feedback on the documentation. You can use the thumbs up and thumbs down icons on the right hand side to submit feedback, or you can use the "Provide feedback" form linked below. To contact the Amazon MQ team, use the Amazon MQ Discussion Forum. How can I provide feedback to Amazon MQ? 3 Amazon MQ Developer Guide Setting up Amazon MQ Before you can use Amazon MQ, you must complete the
amazon-mq-dg-004
amazon-mq-dg.pdf
4
CLI Command Reference. How can I get started with Amazon MQ? 2 Amazon MQ Developer Guide How can I provide feedback to Amazon MQ? We welcome and encourgae your feedback on the documentation. You can use the thumbs up and thumbs down icons on the right hand side to submit feedback, or you can use the "Provide feedback" form linked below. To contact the Amazon MQ team, use the Amazon MQ Discussion Forum. How can I provide feedback to Amazon MQ? 3 Amazon MQ Developer Guide Setting up Amazon MQ Before you can use Amazon MQ, you must complete the following steps. Topics • Step 1: Prerequisites • Step 2: create a user and get your AWS credentials • Step 3: get ready to use the example codes • Next steps Step 1: Prerequisites Sign up for an AWS account If you do not have an AWS account, complete the following steps to create one. To sign up for an AWS account 1. Open https://portal.aws.amazon.com/billing/signup. 2. Follow the online instructions. Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad. When you sign up for an AWS account, an AWS account root user is created. The root user has access to all AWS services and resources in the account. As a security best practice, assign administrative access to a user, and use only the root user to perform tasks that require root user access. AWS sends you a confirmation email after the sign-up process is complete. At any time, you can view your current account activity and manage your account by going to https://aws.amazon.com/ and choosing My Account. Create a user with administrative access After you sign up for an AWS account, secure your AWS account root user, enable AWS IAM Identity Center, and create an administrative user so that you don't use the root user for everyday tasks. Step 1: Prerequisites 4 Amazon MQ Developer Guide Secure your AWS account root user 1. Sign in to the AWS Management Console as the account owner by choosing Root user and entering your AWS account email address. On the next page, enter your password. For help signing in by using root user, see Signing in as the root user in the AWS Sign-In User Guide. 2. Turn on multi-factor authentication (MFA) for your root user. For instructions, see Enable a virtual MFA device for your AWS account root user (console) in the IAM User Guide. Create a user with administrative access 1. Enable IAM Identity Center. For instructions, see Enabling AWS IAM Identity Center in the AWS IAM Identity Center User Guide. 2. In IAM Identity Center, grant administrative access to a user. For a tutorial about using the IAM Identity Center directory as your identity source, see Configure user access with the default IAM Identity Center directory in the AWS IAM Identity Center User Guide. Sign in as the user with administrative access • To sign in with your IAM Identity Center user, use the sign-in URL that was sent to your email address when you created the IAM Identity Center user. For help signing in using an IAM Identity Center user, see Signing in to the AWS access portal in the AWS Sign-In User Guide. Assign access to additional users 1. In IAM Identity Center, create a permission set that follows the best practice of applying least- privilege permissions. For instructions, see Create a permission set in the AWS IAM Identity Center User Guide. Create a user with administrative access 5 Amazon MQ Developer Guide 2. Assign users to a group, and then assign single sign-on access to the group. For instructions, see Add groups in the AWS IAM Identity Center User Guide. Step 2: create a user and get your AWS credentials Users need programmatic access if they want to interact with AWS outside of the AWS Management Console. The way to grant programmatic access depends on the type of user that's accessing AWS. To grant users programmatic access, choose one of the following options. Which user needs programmatic access? To By Workforce identity (Users managed in IAM Identity Center) Use temporary credentials to sign programmatic requests Following the instructions for the interface that you want to to the AWS CLI, AWS SDKs, or use. AWS APIs. • For the AWS CLI, see Configuring the AWS CLI to use AWS IAM Identity Center in the AWS Command Line Interface User Guide. • For AWS SDKs, tools, and AWS APIs, see IAM Identity Center authentication in the AWS SDKs and Tools Reference Guide. IAM Use temporary credentials to sign programmatic requests to the AWS CLI, AWS SDKs, or AWS APIs. Following the instructions in Using temporary credentia ls with AWS resources in the IAM User Guide. Create a user and
amazon-mq-dg-005
amazon-mq-dg.pdf
5
instructions for the interface that you want to to the AWS CLI, AWS SDKs, or use. AWS APIs. • For the AWS CLI, see Configuring the AWS CLI to use AWS IAM Identity Center in the AWS Command Line Interface User Guide. • For AWS SDKs, tools, and AWS APIs, see IAM Identity Center authentication in the AWS SDKs and Tools Reference Guide. IAM Use temporary credentials to sign programmatic requests to the AWS CLI, AWS SDKs, or AWS APIs. Following the instructions in Using temporary credentia ls with AWS resources in the IAM User Guide. Create a user and get your AWS credentials 6 Amazon MQ Developer Guide Which user needs programmatic access? To By IAM (Not recommended) Use long-term credentials to Following the instructions for the interface that you want to sign programmatic requests use. to the AWS CLI, AWS SDKs, or AWS APIs. • For the AWS CLI, see Authenticating using IAM user credentials in the AWS Command Line Interface User Guide. • For AWS SDKs and tools, see Authenticate using long-term credentials in the AWS SDKs and Tools Reference Guide. • For AWS APIs, see Managing access keys for IAM users in the IAM User Guide. Step 3: get ready to use the example codes The following tutorials show how you can work with Amazon MQ brokers using the AWS Management Console as well as how to connect to your Amazon MQ for ActiveMQ and Amazon MQ for RabbitMQ brokers programatically. To use the ActiveMQ Java example code, you must install the Java Standard Edition Development Kit and make some changes to the code. You can also create and manage brokers programmatically using Amazon MQ REST API and AWS SDKs. Next steps Now that you're prepared to work with Amazon MQ, get started by creating a broker. Depending on your broker engine type, you can then connect a Java application to your Amazon MQ for Step 3: get ready to use the example codes 7 Amazon MQ Developer Guide ActiveMQ broker or use the RabbitMQ Java client library to connect a JVM-based application to your Amazon MQ for RabbitMQ broker. Next steps 8 Amazon MQ Developer Guide Getting started: Creating and connecting to an ActiveMQ broker A broker is a message broker environment running on Amazon MQ. It is the basic building block of Amazon MQ. The combined description of the broker instance class (m5, t3) and size (large, micro) is called the broker instance type (for example, mq.m5.large). For more information, see What is an Amazon MQ for ActiveMQ broker?. Create an ActiveMQ broker The first and most common Amazon MQ task is creating a broker. The following example shows how you can use the AWS Management Console to create a basic broker. 1. Sign in to the Amazon MQ console. 2. On the Select broker engine page, choose Apache ActiveMQ. 3. On the Select deployment and storage page, in the Deployment mode and storage type section, do the following: a. Choose the Deployment mode (for example, Active/standby broker). For more information, see Deployment options for Amazon MQ for ActiveMQ brokers. • A Single-instance broker is comprised of one broker in one Availability Zone. The broker communicates with your application and with an Amazon EBS or Amazon EFS storage volume. For more information, see Option 1: Amazon MQ single-instance brokers. • An Active/standby broker for high availability is comprised of two brokers in two different Availability Zones, configured in a redundant pair. These brokers communicate synchronously with your application, and with Amazon EFS. For more information, see Option 2: Amazon MQ active/standby brokers for high availability. b. Choose the Storage type (for example, EBS). For more information, see Storage. Note Amazon EBS replicates data within a single Availability Zone and doesn't support the ActiveMQ active/standby deployment mode. Create an ActiveMQ broker 9 Amazon MQ c. Choose Next. Developer Guide 4. On the Configure settings page, in the Details section, do the following: a. Enter the Broker name. Important Do not add personally identifiable information (PII) or other confidential or sensitive information in broker names. Broker names are accessible to other AWS services, including CloudWatch Logs. Broker names are not intended to be used for private or sensitive data. Note In the Additional settings section, you can also configure the following: • Configurations • CloudWatch logs • Private access • Broker maintenance window b. Choose the Broker instance type (for example, mq.m5.large). For more information, see Broker instance types. 5. In the ActiveMQ Web Console access section, provide a Username and Password. The following restrictions apply to broker usernames and passwords: • Your username can contain only alphanumeric characters, dashes, periods, underscores, and tildas (- . _ ~). • Your password must be at least 12 characters long, contain at least 4 unique characters and must
amazon-mq-dg-006
amazon-mq-dg.pdf
6
or sensitive data. Note In the Additional settings section, you can also configure the following: • Configurations • CloudWatch logs • Private access • Broker maintenance window b. Choose the Broker instance type (for example, mq.m5.large). For more information, see Broker instance types. 5. In the ActiveMQ Web Console access section, provide a Username and Password. The following restrictions apply to broker usernames and passwords: • Your username can contain only alphanumeric characters, dashes, periods, underscores, and tildas (- . _ ~). • Your password must be at least 12 characters long, contain at least 4 unique characters and must not contain commas, colons, or equal signs (,:=). Important Do not add personally identifiable information (PII) or other confidential or sensitive information in broker usernames. Broker usernames are accessible to other AWS Create an ActiveMQ broker 10 Amazon MQ Developer Guide services, including CloudWatch Logs. Broker usernames are not intended to be used for private or sensitive data. 6. Choose Deploy. While Amazon MQ creates your broker, it displays the Creation in progress status. Creating the broker takes about 15 minutes. When your broker is created successfully, Amazon MQ displays the Running status. 7. Choose MyBroker. On the MyBroker page, in the Connect section, note your broker's ActiveMQ web console URL, for example: https://b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9-1.mq.us-east-2.amazonaws.com:8162 Also, note your broker's wire-level protocol Endpoints. The following is an example of an OpenWire endpoint: ssl://b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9-1.mq.us-east-2.amazonaws.com:61617 Create an ActiveMQ broker 11 Amazon MQ Developer Guide Getting started: Creating and connecting to a RabbitMQ broker A broker is a message broker environment running on Amazon MQ. It is the basic building block of Amazon MQ. The combined description of the broker instance class (m5, t3) and size (large, micro) is called the broker instance type (for example, mq.m5.large). For more information, see What is an Amazon MQ for RabbitMQ broker? Create a RabbitMQ broker The first and most common Amazon MQ task is creating a broker. The following example shows how you can use the AWS Management Console to create a basic broker. After creating a broker, review the best practices for RabbitMQ for recommendations for maximizing performance and minimizing throughput costs when working with RabbitMQ brokers Amazon MQ. 1. Sign in to the Amazon MQ console. 2. On the Select broker engine page, choose RabbitMQ, and then choose Next. 3. On the Select deployment mode page, choose the Deployment mode, for example, Cluster deployment, and then choose Next. • A single-instance broker is comprised of one broker in one Availability Zone behind a Network Load Balancer (NLB). The broker communicates with your application and with an Amazon EBS storage volume. For more information, see Option 1: Amazon MQ for RabbitMQ single-instance broker. • A RabbitMQ cluster deployment for high availability is a logical grouping of three RabbitMQ broker nodes behind a Network Load Balancer, each sharing users, queues, and a distributed state across multiple Availability Zones (AZ). For more information, see Option 2: Amazon MQ for RabbitMQ cluster deployment. 4. On the Configure settings page, in the Details section, the following: a. Enter the Broker name. Create a RabbitMQ broker 12 Amazon MQ Developer Guide Important Do not add personally identifiable information (PII) or other confidential or sensitive information in broker names. Broker names are accessible to other AWS services, including CloudWatch Logs. Broker names are not intended to be used for private or sensitive data. b. Choose the Broker instance type (for example, mq.m5.large). For more information, see Broker instance types. 5. On the Configure settings page, in the RabbitMQ access section, provide a Username and Password. The following restrictions apply to broker sign-in credentials: • Your username can contain only alphanumeric characters, dashes, periods, and underscores (- . _). This value must not contain any tilde (~) characters. Amazon MQ prohibits using guest as a username. • Your password must be at least 12 characters long, contain at least 4 unique characters and must not contain commas, colons, or equal signs (,:=). Important Do not add personally identifiable information (PII) or other confidential or sensitive information in broker usernames. Broker usernames are accessible to other AWS services, including CloudWatch Logs. Broker usernames are not intended to be used for private or sensitive data. Note In the Additional settings section, you can also configure the following: • Configurations • CloudWatch logs • Private access • Broker maintenance window Create a RabbitMQ broker 13 Amazon MQ 6. Choose Next. Developer Guide 7. On the Review and create page, you can review your selections and edit them as needed. 8. Choose Create broker. While Amazon MQ creates your broker, it displays the Creation in progress status. Creating the broker takes about 15 minutes. When your broker is created successfully, Amazon MQ displays the Running status. 9. Choose MyBroker. On the MyBroker page, in the Connect section,
amazon-mq-dg-007
amazon-mq-dg.pdf
7
Note In the Additional settings section, you can also configure the following: • Configurations • CloudWatch logs • Private access • Broker maintenance window Create a RabbitMQ broker 13 Amazon MQ 6. Choose Next. Developer Guide 7. On the Review and create page, you can review your selections and edit them as needed. 8. Choose Create broker. While Amazon MQ creates your broker, it displays the Creation in progress status. Creating the broker takes about 15 minutes. When your broker is created successfully, Amazon MQ displays the Running status. 9. Choose MyBroker. On the MyBroker page, in the Connect section, note your broker's RabbitMQ web console URL, for example: https://b-c8349341-ec91-4a78-ad9c-a57f23f235bb.mq.us-west-2.on.aws Also, note your broker's secure-AMQP Endpoint. The following is an example of an amqps endpoint exposing listener port 5671. amqps://b-c8349341-ec91-4a78-ad9c-a57f23f235bb.mq.us-west-2.on.aws:5671 Create a RabbitMQ broker 14 Amazon MQ Developer Guide Managing an Amazon MQ broker After you create a broker, you can manage and maintain the different componenets of your Amazon MQ broker. Topics • Connecting to Amazon MQ • Upgrading an Amazon MQ broker engine version • Upgrading an Amazon MQ broker instance type • Amazon MQ for ActiveMQ storage types • Configuring a private Amazon MQ broker • Scheduling the maintenance window for an Amazon MQ broker • Rebooting an Amazon MQ broker • Deleting an Amazon MQ broker • Amazon MQ broker statuses • Adding tags to Amazon MQ resources Connecting to Amazon MQ You can connect to Amazon MQ from other AWS services using service endpoints and broker endpoints. Service endpoints The following connection methods are used for the Amazon MQ service API: Domains Connection method mq.region.amazonaws.com IPv4 mq.region.api.aws Dual-stack (IPv4 and IPv6) mq-fips.region.amazonaws.com FIPS with IPv4 only Connecting to Amazon MQ 15 Amazon MQ Domains Connection method Developer Guide mq-fips.region.api.aws FIPS with Dual-stack Broker endpoints The following connection methods are used for Amazon MQ brokers: Domains Connection method brokerId.mq.region.amazonaws.com IPv4 brokerId.mq.region.on.aws Dual-stack (IPv4 and IPv6) Note Amazon MQ for ActiveMQ brokers do not support dual-stack. Connect to Amazon MQ using Dual-stack (IPv4 and IPv6) endpoints Dual-stack endpoints support both IPv4 and IPv6 traffic. When you make a request to a dual-stack endpoint, the endpoint URL resolves to an IPv4 or an IPv6 address. For more information on dual- stack and FIPS endpoints, see the SDK Reference guide. Amazon MQ supports Regional dual-stack endpoints, which means that you must specify the AWS Region as part of the endpoint name. Dual-stack endpoint names use the following naming convention: mq.region.api.aws. For example, the dual-stack endpoint name for the eu-west-1 Region is mq.eu-west-1.api.aws. For the full list of Amazon MQ endpoints, see the AWS General Reference. Connect to Amazon MQ using AWS PrivateLink AWS PrivateLink endpoints for Amazon MQ API with support for IPv4 and IPv6 provides private connectivity between virtual private clouds (VPCs) and the Amazon MQ API without exposing your traffic to the public internet. Broker endpoints 16 Amazon MQ Note Developer Guide Support for PrivateLink is only available for the Amazon MQ API endpoint, not the broker endpoint. For more information on privately connecting to a broker endpoint, see Configuring a private Amazon MQ broker. Note PrivateLink for Amazon MQ is not supported in the Asia Pacific (Thailand) and Mexico (Central) Regions. To access Amazon MQ API using PrivateLink, you must first create an interface VPC endpoint in the specific VPC you want to connect from. When you create the VPC endpoint, use the service name com.amazonaws.region.mq or com.amazonaws.region.mq-fips for FIPS endpoints. When you call Amazon MQ using the AWS CLI or SDK, you must specify the endpoint URL to use the dual-stack domain name: mq.region.api.aws or mq-fips.region.api.aws. PrivateLink for Amazon MQ does not support the default domain name ending in amazonaws.com. For more information , see Dual-stack and FIPS endpoints in the SDK Reference Guide. The following CLI example shows how to call the describe-broker-engine-type in the Asia Pacific (Sydney) Region through an Amazon MQ VPC endpoint. AWS_USE_DUALSTACK=true aws mq describe-broker-engine-types --region ap-southeast-2 For other ways to configure the endpoint in CLI, see Using endpoints in the AWS CLI You can also determine user access to the VPC endpoints using VPC endpoint policies. For more information, see Control access to VPC endpoints using endpoint policies. Upgrading an Amazon MQ broker engine version Amazon MQ regularly provides new broker engine versions for all supported broker engine types. New engine versions include security patches, bug fixes, and other broker engine improvements. Upgrading the engine version 17 Amazon MQ Developer Guide Amazon MQ organizes version numbers according to semantic versioning specification as X.Y.Z. In Amazon MQ implementations, X denotes the major version, Y represents the minor version, and Z denotes the patch version number. There are two types of upgrades: • Major version upgrade – Occurs when the major engine version numbers change. For example, upgrading from version 1.0
amazon-mq-dg-008
amazon-mq-dg.pdf
8
an Amazon MQ broker engine version Amazon MQ regularly provides new broker engine versions for all supported broker engine types. New engine versions include security patches, bug fixes, and other broker engine improvements. Upgrading the engine version 17 Amazon MQ Developer Guide Amazon MQ organizes version numbers according to semantic versioning specification as X.Y.Z. In Amazon MQ implementations, X denotes the major version, Y represents the minor version, and Z denotes the patch version number. There are two types of upgrades: • Major version upgrade – Occurs when the major engine version numbers change. For example, upgrading from version 1.0 to version 2.0 is considered a major version upgrade. • Minor version upgrade – Occurs when only the minor engine version number changes. For example, upgrading from version 1.5 to version 1.6 is considered a minor version upgrade. You can manually upgrade your broker at any time to the next supported major or minor version. When you turn on automatic minor version upgrades, Amazon MQ will upgrade your broker to the latest supported patch version. For all brokers using engine version 3.13 and above, Amazon MQ manages upgrades to the latest supported patch version during the maintenance window. Amazon MQ upgrades your broker to the next minor version when the current minor version reaches end of support. Both manual and automatic version upgrades occur during the scheduled maintenance window or after you reboot your broker. The following topics describe how you can manually upgrade the broker engine version, and activate automatic minor version upgrades. Topics • Manually upgrading the engine version • Automatically upgrading the minor engine version Manually upgrading the engine version To manually upgrade the engine version of a broker to a new major or minor version, you can use the AWS Management Console, the AWS CLI, or the Amazon MQ API. AWS Management Console To upgrade the engine version of a broker by using the AWS Management Console 1. 2. Sign in to the Amazon MQ console. In the left navigation pane, choose Brokers, and then choose the broker that you want to upgrade from the list. 3. On the broker details page, choose Edit. Manually upgrading the engine version 18 Amazon MQ Developer Guide 4. Under Specifications, for Broker engine version choose the new version number from the dropdown list. 5. Scroll to the bottom of the page, and choose Schedule modifications. 6. On the Schedule broker modifications page, for When to apply modifications, choose one of the following. • Choose After the next reboot, if you want Amazon MQ to complete the version upgrade during the next scheduled maintenance window. • Choose Immediately, if you want to reboot the broker and upgrade the engine version immediately. Important Single instance brokers are offline while being rebooted. For cluster brokers, only one node is down at a time while the broker reboots. 7. Choose Apply to finish applying the changes. AWS CLI To upgrade the engine version of a broker by using the AWS CLI 1. Use the update-broker CLI command and specify the following parameters, as shown in the example. • --broker-id – The unique ID that Amazon MQ generates for the broker. You can parse the ID from your broker ARN. For example, given the following ARN, arn:aws:mq:us- east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9, the broker ID would be b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9. • --engine-version – The engine version number for the broker engine to upgrade to. aws mq update-broker --broker-id broker-id --engine-version version-number 2. (Optional) Use the reboot-broker CLI command to reboot your broker if, you want to upgrade the engine version immediately. Manually upgrading the engine version 19 Amazon MQ Developer Guide aws mq reboot-broker --broker-id broker-id If you do not want to reboot your broker and apply the changes immediately, Amazon MQ will upgrade the broker during the next scheduled maintenance window. Important Single instance brokers are offline while being rebooted. For cluster brokers, only one node is down at a time while the broker reboots. Amazon MQ API To upgrade the engine version of a broker by using the Amazon MQ API 1. Use the UpdateBroker API operation. Specify broker-id as a path parameter. The following examples assumes a broker in the us-west-2 region. For more information about available Amazon MQ endpoints, see Amazon MQ endpoints and quotas. in the AWS General Reference PUT /v1/brokers/broker-id HTTP/1.1 Host: mq.us-west-2.amazonaws.com Date: Mon, 7 June 2021 12:00:00 GMT x-amz-date: Mon, 7 June 2021 12:00:00 GMT Authorization: authorization-string Use engineVersion in the request payload to specify the version number for the broker to upgrade to. { "engineVersion": "engine-version-number" } 2. (Optional) Use the RebootBroker API operation to reboot your broker, if you want to upgrade the engine version immediately. broker-id is specified as a path parameter. POST /v1/brokers/broker-id/reboot-broker HTTP/1.1 Host: mq.us-west-2.amazonaws.com Date: Mon, 7 June 2021 12:00:00 GMT x-amz-date: Mon, 7 June 2021
amazon-mq-dg-009
amazon-mq-dg.pdf
9
Amazon MQ endpoints, see Amazon MQ endpoints and quotas. in the AWS General Reference PUT /v1/brokers/broker-id HTTP/1.1 Host: mq.us-west-2.amazonaws.com Date: Mon, 7 June 2021 12:00:00 GMT x-amz-date: Mon, 7 June 2021 12:00:00 GMT Authorization: authorization-string Use engineVersion in the request payload to specify the version number for the broker to upgrade to. { "engineVersion": "engine-version-number" } 2. (Optional) Use the RebootBroker API operation to reboot your broker, if you want to upgrade the engine version immediately. broker-id is specified as a path parameter. POST /v1/brokers/broker-id/reboot-broker HTTP/1.1 Host: mq.us-west-2.amazonaws.com Date: Mon, 7 June 2021 12:00:00 GMT x-amz-date: Mon, 7 June 2021 12:00:00 GMT Manually upgrading the engine version 20 Amazon MQ Developer Guide Authorization: authorization-string If you do not want to reboot your broker and apply the changes immediately, Amazon MQ will upgrade the broker during the next scheduled maintenance window. Important Single instance brokers are offline while being rebooted. For cluster brokers, only one node is down at a time while the broker reboots. Automatically upgrading the minor engine version You can control whether automatic minor version upgrade is activated for a broker when you first create the broker, or by modifying broker preferences. To activate auto minor version upgrades for an existing broker, you can use the AWS Management Console, the AWS CLI, or the Amazon MQ API. AWS Management Console To activate automatic minor version upgrades by using the AWS Management Console 1. 2. Sign in to the Amazon MQ console. In the left navigation pane, choose Brokers, and then choose the broker that you want to upgrade from the list. 3. On the broker details page, choose Edit. 4. Under Maintenance, choose Enable automatic minor version upgrades. Note If the option is already selected, you do not need to make any changes. 5. Choose Save at the bottom of the page. AWS CLI To activate automatic minor version upgrades via the AWS CLI, use the update-broker CLI command and specify the following parameters. Automatically upgrading the minor engine version 21 Amazon MQ Developer Guide • --broker-id – The unique ID that Amazon MQ generates for the broker. You can parse the ID from your broker ARN. For example, given the following ARN, arn:aws:mq:us- east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9, the broker ID would be b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9. • --auto-minor-version-upgrade – Activates the auto minor version upgrade option. aws mq update-broker --broker-id broker-id --auto-minor-version-upgrade Note If you want to deactivate auto minor version upgrades for your ActiveMQ broker, use the -- no-auto-minor-version-upgrade parameter. Amazon MQ API To activate automatic minor version upgrades via the Amazon MQ API, use the UpdateBroker API operation. Specify broker-id as a path parameter. The following example assumes a broker in the us-west-2 region. For more information about available Amazon MQ endpoints, see Amazon MQ endpoints and quotas. in the AWS General Reference PUT /v1/brokers/broker-id HTTP/1.1 Host: mq.us-west-2.amazonaws.com Date: Mon, 7 June 2021 12:00:00 GMT x-amz-date: Mon, 7 June 2021 12:00:00 GMT Authorization: authorization-string Use the autoMinorVersionUpgrade property in the request payload to activate auto minor version upgrade. { "autoMinorVersionUpgrade": "true" } If you want to deactivate auto minor version upgrades for your broker, set "autoMinorVersionUpgrade": "false" in the request payload. Automatically upgrading the minor engine version 22 Amazon MQ Developer Guide Upgrading an Amazon MQ broker instance type The combined description of the broker instance class (m5, t3) and size (large, micro) is called the broker instance type (for example, mq.m5.large). When choosing an instance type, it is important to consider factors that will affect broker performance: • the number of clients and queues • the volume of messages sent • messages kept in memory • redundant messages Smaller broker instance types (mq.t3.micro) are recommended only for testing application performance. We recommend larger broker instance types (mq.m5.large and above) for production levels of clients and queues, high throughput, messages in memory, and redundant messages. We recommend upgrading to a larger instance type (i.e. from micro to large) if you are experiencing performance issues, or if you are moving from testing to a production environment. To upgrade your instance type, you can use the AWS Management Console, the AWS CLI, or the Amazon MQ API. AWS Management Console To upgrade to a larger instance type using the AWS Management Console, do the following: 1. 2. Sign in to the Amazon MQ console. In the left navigation pane, choose Brokers, and then choose the broker that you want to upgrade from the list. 3. On the broker details page, choose Edit. 4. Under Specifications, for Broker instance type choose the new instance type from the dropdown list. 5. At the bottom of the page, choose Schedule modifications. 6. On the Schedule broker modifications page, for When to apply modifications, choose one of the following. • Choose After the next reboot, if you want Amazon MQ to complete the upgrade during the next
amazon-mq-dg-010
amazon-mq-dg.pdf
10
the following: 1. 2. Sign in to the Amazon MQ console. In the left navigation pane, choose Brokers, and then choose the broker that you want to upgrade from the list. 3. On the broker details page, choose Edit. 4. Under Specifications, for Broker instance type choose the new instance type from the dropdown list. 5. At the bottom of the page, choose Schedule modifications. 6. On the Schedule broker modifications page, for When to apply modifications, choose one of the following. • Choose After the next reboot, if you want Amazon MQ to complete the upgrade during the next scheduled maintenance window. Upgrading the instance type 23 Amazon MQ Developer Guide • Choose Immediately, if you want to reboot the broker and upgrade the instance type immediately. Important Single instance brokers are offline while being rebooted. For cluster brokers, only one node is down at a time while the broker reboots. 7. Choose Apply to finish applying the changes. AWS CLI To upgrade the instance type of a broker by using the AWS CLI 1. Use the modify-broker CLI command and specify the following parameters, as shown in the example. • --broker-id – The unique ID that Amazon MQ generates for the broker. • --host-instance-type – The engine version number for the broker engine to upgrade to. aws mq modify-broker --broker-id broker-id --host-instance-type instance-type 2. (Optional) Use the reboot-broker CLI command to reboot your broker if, you want to upgrade the instance type immediately. aws mq reboot-broker --broker-id broker-id If you do not want to reboot your broker and apply the changes immediately, Amazon MQ will upgrade the broker during the next scheduled maintenance window. Important Single instance brokers are offline while being rebooted. For cluster brokers, only one node is down at a time while the broker reboots. Upgrading the instance type 24 Amazon MQ Amazon MQ API Developer Guide To upgrade the instance-type of a broker by using the Amazon MQ API 1. Use the ModifyBroker API operation. Specify broker-id as a path parameter. The following examples assumes a broker in the us-west-2 region. For more information about available Amazon MQ endpoints, see Amazon MQ endpoints and quotas. in the AWS General Reference PUT /v1/brokers/broker-id HTTP/1.1 Host: mq.us-west-2.amazonaws.com Date: Mon, 7 June 2021 12:00:00 GMT x-amz-date: Mon, 7 June 2021 12:00:00 GMT Authorization: authorization-string Use host-instance-type in the request payload to specify the instance type for the broker to upgrade to. { "host-instance-type": "host-instance-type" } 2. (Optional) Use the RebootBroker API operation to reboot your broker, if you want to upgrade the engine version immediately. broker-id is specified as a path parameter. POST /v1/brokers/broker-id/reboot-broker HTTP/1.1 Host: mq.us-west-2.amazonaws.com Date: Mon, 7 June 2021 12:00:00 GMT x-amz-date: Mon, 7 June 2021 12:00:00 GMT Authorization: authorization-string If you do not want to reboot your broker and apply the changes immediately, Amazon MQ will upgrade the broker during the next scheduled maintenance window. Important Single instance brokers are offline while being rebooted. For cluster brokers, only one node is down at a time while the broker reboots. Upgrading the instance type 25 Amazon MQ Developer Guide Amazon MQ for ActiveMQ storage types Amazon MQ for ActiveMQ supports Amazon Elastic File System (EFS) and Amazon Elastic Block Store (EBS). By default, ActiveMQ brokers use Amazon EFS for broker storage. To take advantage of high durability and replication across multiple Availability Zones, use Amazon EFS. To take advantage of low latency and high throughput, use Amazon EBS. Important • You can use Amazon EBS only with the mq.m5 broker instance type family. • Although you can change the broker instance type, you can't change the broker storage type after you create the broker. • Amazon EBS replicates data within a single Availability Zone and doesn't support the ActiveMQ active/standby deployment mode. Differences between Storage Types The following table provides a brief overview of the differences between in-memory, Amazon EFS, and Amazon EBS storage types for ActiveMQ brokers. Storage Type Persistence Example Use Case Replication Approxima te Maximum Number of Messages Enqueued per Producer, per Second (1KB Message) In-memory Non-persistent • Stock quotes 5,000 None • Location data updates • Frequently changed data Storage 26 Amazon MQ Storage Type Persistence Example Use Case Approxima te Maximum Number of Messages Enqueued per Producer, per Second (1KB Message) Amazon EBS Persistent • High volumes 500 Amazon EFS Persistent of text • Order processing Financial transactions 80 Developer Guide Replication Multiple copies within a single Availability Zone (AZ) Multiple copies across multiple AZs In-memory message storage provides the lowest latency and the highest throughput. However, messages are lost during instance replacement or broker restart. Amazon EFS is designed to be highly durable, replicated across multiple AZs to prevent the loss of data resulting from the failure of any single component or an issue that affects the availability
amazon-mq-dg-011
amazon-mq-dg.pdf
11
te Maximum Number of Messages Enqueued per Producer, per Second (1KB Message) Amazon EBS Persistent • High volumes 500 Amazon EFS Persistent of text • Order processing Financial transactions 80 Developer Guide Replication Multiple copies within a single Availability Zone (AZ) Multiple copies across multiple AZs In-memory message storage provides the lowest latency and the highest throughput. However, messages are lost during instance replacement or broker restart. Amazon EFS is designed to be highly durable, replicated across multiple AZs to prevent the loss of data resulting from the failure of any single component or an issue that affects the availability of an AZ. Amazon EBS is optimized for throughput and replicated across multiple servers within a single AZ. Configuring a private Amazon MQ broker A private broker does not have public accessibility and cannot be accessed from outside of your VPC. Before configuring a private broker, view the following information about VPCs, subnets, and security groups: • VPCs • A broker's subnet(s) and security group(s) must be in the same VPC. Configuring a private broker 27 Amazon MQ Developer Guide • When you are using a private broker, you may see IP addresses that you did not configure with your VPC. These are IP addresses from the Amazon MQ infrastructure, and they require no action. • Subnets • If subnets are within a shared VPC, the VPC must be owned by the same account creating the broker. • If no subnets are provided, the default subnets in the default VPC will be used. • Once the broker is created, the subnets used cannot be changed. • For cluster and active/standby brokers, subnets must be in different Availability Zones. • For single instance brokers, you can specify which subnet to use and the broker will be created within the same Availability Zone. • Security groups • If no security group is provided, the default security groups in the default VPC will be used. • Single-instance, cluster, and active/standby brokers require at least one security group (for example, the default security group). Note Public RabbitMQ brokers do not use subnets or security groups. • Once the broker is created, the security group used cannot be changed. The security groups can themselves still be modified. Configuring a private broker in the AWS Management Console To configure a private broker, begin creating a new broker in the AWS Management Console. Then, in the Network settings section, to configure your broker's connectivity, do the following: 1. Choose Private access for your broker. To connect to a private broker, you can use IPv4, IPv6, or dual-stack (IPv4 and IPv6). For more information, see Connecting to Amazon MQ. 2. Next, choose Use the default VPC, subnet(s), and security group(s), or choose Select existing VPC, subnet(s), and security group(s). If you do not wish to use the default or existing VPC, subnet(s), or security group(s), you must create a new one to connect to the private broker. Configuring a private broker in the AWS Management Console 28 Amazon MQ Note Developer Guide For private broker access, the connection method will be the same as the selected IP type of the subnet. Once the broker is created, the VPC endpoint cannot be changed and will always have the IP type of the selected subnets. If you want to use a new IP type, you must create a new broker. Note Amazon MQ for ActiveMQ does not use VPC endpoints. When you first create an ActiveMQ broker, Amazon MQ provisions an elastic network interface (ENI) in the VPC. Security groups are placed in the ENI and can be used for both public and private brokers. Accessing the Amazon MQ broker web console without public accessibility When you turn off public accessibility for your broker, the AWS account ID that created the broker can access the private broker. If you turn off public accessibility for your broker, you must perform the following steps to access the broker web console. 1. Create a Linux EC2 instance in public-vpc (with a public IP, if necessary). 2. 3. To verify that your VPC is configured correctly, establish an ssh connection to the EC2 instance and use the curl command with the URI of your broker. From your machine, create an ssh tunnel to the EC2 instance using the path to your private key file and the IP address of your public EC2 instance. For example: ssh -i ~/.ssh/id_rsa -N -C -q -f -D 8080 ec2-user@203.0.113.0 A forward proxy server is started on your machine. 4. Install a proxy client such as FoxyProxy on your machine. 5. Configure your proxy client using the following settings: Accessing the Amazon MQ broker web console without public accessibility 29 Amazon MQ Developer Guide • For proxy type, specify SOCKS5. • For IP address, DNS name, and server name,
amazon-mq-dg-012
amazon-mq-dg.pdf
12
broker. From your machine, create an ssh tunnel to the EC2 instance using the path to your private key file and the IP address of your public EC2 instance. For example: ssh -i ~/.ssh/id_rsa -N -C -q -f -D 8080 ec2-user@203.0.113.0 A forward proxy server is started on your machine. 4. Install a proxy client such as FoxyProxy on your machine. 5. Configure your proxy client using the following settings: Accessing the Amazon MQ broker web console without public accessibility 29 Amazon MQ Developer Guide • For proxy type, specify SOCKS5. • For IP address, DNS name, and server name, specify localhost. • For port, specify 8080. • Remove any existing URL patterns. • For the URL pattern, specify *.mq.*.amazonaws.com* • For the connection type, specify HTTP(S). When you enable your proxy client, you can access the web console on your machine. Important If you are using a private broker, you may see IP addresses that you did not configure with your VPC. These are IP addresses from the RabbitMQ on Amazon MQ infrastructure, and they require no action. Scheduling the maintenance window for an Amazon MQ broker Periodically, Amazon MQ performs maintenance to the hardware, operating system, or the engine software of a message broker during the maintenance window. For example, if you changed the broker instance type, Amazon MQ will apply your changes during the next scheduled maintenance window. The duration of the maintenance can last up to two hours depending on the operations that are scheduled for your message broker. You can minimize downtime during a maintenance window by selecting a broker deployment mode with high availability across multiple Availability Zones (AZ). Amazon MQ for ActiveMQ provides active/standby deployments for high availability. In active/ standby mode, Amazon MQ performs maintenance operations one instance at a time, and at least one instance remains available. In addition, you can configure a network of brokers with maintenance windows varied across the week. Amazon MQ for RabbitMQ provides the cluster deployments for high availability. In cluster deployments, Amazon MQ performs maintenance operations one node at a time by keeping at least two running nodes at all times. When you first create your broker, you can schedule the maintenance window to occur once a week at a specified time. You can only adjust the maintenance window of a broker up to four times Scheduling broker maintenance 30 Amazon MQ Developer Guide before the next scheduled maintenance window. Once a broker maintenance window is completed, Amazon MQ resets the limit, and you can adjust the schedule again before the next maintenance window occurs. Broker availability is not affected when adjusting the broker maintenance window. To adjust the broker maintenance window, you can use the AWS Management Console, the AWS CLI, or the Amazon MQ API. Schedule the broker maintenance window using the AWS Management Console To adjust the broker maintenance window by using the AWS Management Console 1. 2. Sign in to the Amazon MQ console. In the left navigation pane, choose Brokers, and then choose the broker that you want to upgrade from the list. 3. On the broker details page, choose Edit. 4. Under Maintenance, do the following. a. b. For Start day, choose a day of the week, for example, Sunday, from the drop-down list. For Start time, choose the hour and minute of the day that you want to schedule for the next broker maintenance window, for example, 12:00. Note The Start time options are configured in UTC+0 time zone. 5. Next, select Schedule modifications. Then choose After the next reboot or Immediately. Choosing After the next reboot will immediately update the maintenance window without rebooting the broker. Choosing Immediately will immediately reboot the broker. 6. On the broker details page, under Maintenance window, verify that your new preferred schedule is displayed. Schedule the broker maintenance window using the AWS CLI To adjust the broker maintenance window using the AWS CLI 1. Use the update-broker CLI command and specify the following parameters, as shown in the example. Scheduling broker maintenance 31 Amazon MQ Developer Guide • --broker-id – The unique ID that Amazon MQ generates for the broker. You can parse the ID from your broker ARN. For example, given the following ARN, arn:aws:mq:us- east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9, the broker ID would be b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9. • --maintenance-window-start-time – The parameters that determine the weekly maintenance window start time provided in the following structure. • DayOfWeek – The day of the week, in the following syntax: MONDAY| TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | SUNDAY • TimeOfDay – The time, in 24-hour format. • TimeZone – (Optional) The time zone, in either the Country/City, or the UTC offset format. Set to UTC by default. aws mq update-broker --broker-id broker-id \ --maintenance-window-start-time DayOfWeek=SUNDAY,TimeOfDay=13:00,TimeZone=America/ Los_Angeles 2. (Optional) Use the describe-broker CLI command to
amazon-mq-dg-013
amazon-mq-dg.pdf
13
given the following ARN, arn:aws:mq:us- east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9, the broker ID would be b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9. • --maintenance-window-start-time – The parameters that determine the weekly maintenance window start time provided in the following structure. • DayOfWeek – The day of the week, in the following syntax: MONDAY| TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | SUNDAY • TimeOfDay – The time, in 24-hour format. • TimeZone – (Optional) The time zone, in either the Country/City, or the UTC offset format. Set to UTC by default. aws mq update-broker --broker-id broker-id \ --maintenance-window-start-time DayOfWeek=SUNDAY,TimeOfDay=13:00,TimeZone=America/ Los_Angeles 2. (Optional) Use the describe-broker CLI command to verify that the maintenance window is successfully updated. aws mq describe-broker --broker-id broker-id Schedule the broker maintenance window using the Amazon MQ API To adjust the broker maintenance window using the Amazon MQ API 1. Use the UpdateBroker API operation. Specify broker-id as a path parameter. The following examples assumes a broker in the us-west-2 region. For more information about available Amazon MQ endpoints, see Amazon MQ endpoints and quotas. in the AWS General Reference PUT /v1/brokers/broker-id HTTP/1.1 Host: mq.us-west-2.amazonaws.com Date: Wed, 7 July 2021 12:00:00 GMT x-amz-date: Wed, 7 July 2021 12:00:00 GMT Authorization: authorization-string Scheduling broker maintenance 32 Amazon MQ Developer Guide Use the maintenanceWindowStartTime parameter and the WeeklyStartTime resource type in the request payload. { "maintenanceWindowStartTime": { "dayOfWeek": "SUNDAY", "timeZone": "America/Los_Angeles", "timeOfDay": "13:00" } } 2. (Optional) Use the DescribeBroker API operation to verify that the maintenance window has been successfully updated. broker-id is specified as a path parameter. GET /v1/brokers/broker-id HTTP/1.1 Host: mq.us-west-2.amazonaws.com Date: Wed, 7 July 2021 12:00:00 GMT x-amz-date: Wed, 7 July 2021 12:00:00 GMT Authorization: authorization-string Rebooting an Amazon MQ broker To apply a new configuration to a broker, you can reboot the broker. Note If your ActiveMQ broker becomes unresponsive, you can reboot it to recover from a faulty state. The following example shows how you can reboot an Amazon MQ broker using the AWS Management Console. To Reboot an Amazon MQ Broker 1. 2. Sign in to the Amazon MQ console. From the broker list, choose the name of your broker (for example, MyBroker). 3. On the MyBroker page, choose Actions, Reboot broker. Rebooting a broker 33 Amazon MQ Developer Guide Important Single instance brokers will be offline while being rebooted. Cluster brokers will be available, but each node is rebooted one at a time. 4. In the Reboot broker dialog box, choose Reboot. Rebooting a broker takes about 5 minutes. If the reboot includes instance size changes or is performed on a broker with high queue depth, the rebooting process can take longer. Deleting an Amazon MQ broker If you don't use an Amazon MQ broker (and don't foresee using it in the near future), it is a best practice to delete it from Amazon MQ to reduce your AWS costs. The following example shows how you can delete a broker using the AWS Management Console. Deleting an Amazon MQ broker 1. 2. 3. Sign in to the Amazon MQ console. From the broker list, select your broker (for example, MyBroker) and then choose Delete. In the Delete MyBroker? dialog box, type delete and then choose Delete. Deleting a broker takes about 5 minutes. Amazon MQ broker statuses A broker's current condition is indicated by a status. The following table lists the statuses of an Amazon MQ broker. Console API Description Creation failed CREATION_FAILED Creation in progress CREATION_IN_PROGRESS The broker couldn't be created. The broker is currently being created. Deleting a broker 34 Amazon MQ Console API Description Developer Guide Deletion in progress DELETION_IN_PROGRESS Reboot in progress REBOOT_IN_PROGRESS The broker is currently being deleted. The broker is currently being rebooted. Running RUNNING The broker is operational. Critical action required CRITICAL_ACTION_RE QUIRED The broker is running, but is in a degraded state and requires immediate action. You can find instructions to resolve the issue by chosing the action required code from the list in Troubleshooting. Adding tags to Amazon MQ resources To organize and identify your Amazon MQ resources for cost allocation, you can add metadata tags that identify the purpose of a broker or configuration. This is especially useful when you have many brokers. You can use cost allocation tags to organize your AWS bill to reflect your own cost structure. To do this, sign up to get your AWS account bill to include the tag keys and values. For more information, see Setting Up a Monthly Cost Allocation Report in the AWS Billing User Guide. For instance, you could add tags that represent the cost center and purpose of your Amazon MQ resources: Resource Key Cost Center Value 34567 Broker1 Broker2 Tagging Stack Production Cost Center 34567 Stack Production 35 Amazon MQ Resource Broker3 Developer Guide Key Cost Center Value 12345 Stack Development This tagging scheme allows you to