id
stringlengths
8
78
source
stringclasses
743 values
chunk_id
int64
1
5.05k
text
stringlengths
593
49.7k
acw-ug-571
acw-ug.pdf
571
metrics from being sent,without uninstalling the agents. The document in SSM that you can use to activate or deactivate agents is called AmazonCloudWatch-NetworkFlowMonitorManageAgent. To access and run the document, follow the steps in the procedure. Install agents 2107 Amazon CloudWatch User Guide To activate or deactivate Network Flow Monitor agents 1. In the AWS Management Console, in AWS Systems Manager, under Change Management Tools, choose Documents. 2. Under Owned by Amazon, locate the Network Flow Monitor document, AmazonCloudWatch- NetworkFlowMonitorManageAgent, and select the document. 3. 4. In the Target selection section, choose how you want to select your EC2 instances to install agents on. You can select instances based on tags, choose instances manually, or base the choice on resource groups. In the Command parameters section, under Action, choose Activate or Deactivate, depending on the action that you want to take for the agents. 5. Scroll down, if necessary, and then choose Run to start the installation. Download prebuilt packages of the Network Flow Monitor agent by using the command line You can use the command line to install the Network Flow Monitor agent as a package in Amazon Linux 2023, or download and install prebuilt packages of the Network Flow Monitor agent. Before or after you download a prebuilt package, you can optionally verify the package signature. For more information, see Verify the signature of the Network Flow Monitor agent package. Choose from the following instructions, depending on the Linux operating system that you're using and the type of installation that you want. Amazon Linux AMIs The Network Flow Monitor agent is available as a package in Amazon Linux 2023. If you're using this operating system, you can install the package by entering the following command: sudo yum install network-flow-monitor-agent You must also make sure that the IAM role attached to the instance has the CloudWatchNetworkFlowMonitorAgentPublishPolicy policy attached. For more information, see Configure permissions for agents. Amazon Linux 2023 Install the package for your architecture by using one of the following commands: • x86_64: sudo yum install https://networkflowmonitoragent.awsstatic.com/ latest/x86_64/network-flow-monitor-agent.rpm Install agents 2108 Amazon CloudWatch User Guide • ARM64 (Graviton): sudo yum install https:// networkflowmonitoragent.awsstatic.com/latest/arm64/network-flow- monitor-agent.rpm Verify that Network Flow Monitor agent is successfully installed by running the following command and verifying that the response shows that the agent is enabled and active: service network-flow-monitor status network-flow-monitor.service - Network Flow Monitor Agent Loaded: loaded (/usr/lib/systemd/system/network-flow-monitor.service; enabled; preset: enabled) Active: active (running) since Wed 2025-04-23 19:17:16 UTC; 1min 9s ago DEB-based distributions (Debian, Ubuntu) Install the package for your architecture by using one of the following commands: • x86_64: wget https://networkflowmonitoragent.awsstatic.com/latest/ x86_64/network-flow-monitor-agent.deb • ARM64 (Graviton): wget https://networkflowmonitoragent.awsstatic.com/ latest/arm64/network-flow-monitor-agent.deb Install the package by using the following command: $ sudo apt-get install ./ network-flow-monitor-agent.deb Verify that Network Flow Monitor agent is successfully installed by running the following command and verifying that the response shows that the agent is enabled and active: service network-flow-monitor status network-flow-monitor.service - Network Flow Monitor Agent Loaded: loaded (/usr/lib/systemd/system/network-flow-monitor.service; enabled; preset: enabled) Active: active (running) since Wed 2025-04-23 19:17:16 UTC; 1min 9s ago Verify the signature of the Network Flow Monitor agent package The Network Flow Monitor agent rpm and deb installer packages for Linux instances are cryptographically signed. You can use a public key to verify that the agent package is original and unmodified. If the files are damaged or have been altered, the verification fails. You can verify Install agents 2109 Amazon CloudWatch User Guide the signature of the installer package using either RPM or GPG. The following information is for Network Flow Monitor agent versions 0.1.3 or later. To find the correct signature file for each architecture and operating system, use the following table. Architecture Platform Download link Signature file link x86-64 Amazon Linux 2023 https://networkflowmonitora gent.awsstatic.com/latest/ https://networkflowmonitora gent.awsstatic.com/latest/ x86_64/network-flow- x86_64/network-flow- monitor-agent.rpm monitor-agent.rpm.sig ARM64 Amazon Linux 2023 https://networkflowmonitora gent.awsstatic.com/latest/a https://networkflowmonitora gent.awsstatic.com/latest/a rm64/network-flow-monitor- rm64/network-flow-monitor- agent.rpm agent.rpm.sig x86-64 Debian/Ub untu https://networkflowmonitora gent.awsstatic.com/latest/ https://networkflowmonitora gent.awsstatic.com/latest/ x86_64/network-flow- x86_64/network-flow- monitor-agent.deb monitor-agent.deb.sig ARM64 Debian/Ub untu https://networkflowmonitora gent.awsstatic.com/latest/a https://networkflowmonitora gent.awsstatic.com/latest/a rm64/network-flow-monitor- rm64/network-flow-monitor- agent.deb agent.deb.sig Follow the steps here to verify the signature of the Network Flow Monitor agent. To verify the signature of the Network Flow Monitor agent for Amazon S3 package 1. Install GnuPG so that you can run the gpg command. GnuPG is required to verify the authenticity and integrity of a downloaded Network Flow Monitor agent for an Amazon S3 package. GnuPG is installed by default on Amazon Linux Amazon Machine Images (AMIs). 2. Copy the following public key and save it to a file named nfm-agent.gpg. -----BEGIN PGP PUBLIC KEY BLOCK----- Install agents 2110 Amazon CloudWatch User Guide mQINBGf0b5IBEAC6YQc0aYrTbcHNWWMbLuqsqfspzWrtCvoU0yQ62ld7nvCGBha9 lu4lbhtiwoDawC3h6Xsxc3Pmm6kbMQfZdbo4Gda4ahf6zDOVI5zVHs3Yu2VXC2AU 5BpKQJmYddTb7dMI3GBgEodJY05NHQhq1Qd2ptdh03rsX+96Fvi4A6t+jsGzMLJU I+hGEKGif69pJVyptJSibK5bWCDXh3eS/+vB/CbXumAKi0sq4rXv/VPiIhn6bsCI A2lmzFd3vMJQUM/T7m7skrqetZ4mWHr1LPDFPK/H/81s8TJawx7MACsK6kIRUxu+ oicW8Icmg9S+BpIgONT2+Io5P1tYO5a9AyVF7X7gU0VgHUA1RoLnjHQHXbCmnFtW cYEuwhUuENMl+tLQCZ+fk0kKjOlIKqeS9AVwhks92oETh8wpTwTE+DTBvUBP9aHo S39RTiJCnUmA6ZCehepgpwW9AYCc1lHv/xcahD418E0UHV22qIw943EwAkzMDA4Q damdRm0Nud0OmilCjo9oogEB+NUoy//5XgQMH1hhfsHquVLU/tneYexXYMfo/Iu5 TKyWL2KdkjKKP/dMR4lMAXYi0RjTJJ5tg5w/VrHhrHePFfKdYsgN6pihWwj2Px/M ids3W1Ce50LOEBc2MOKXYXGd9OZWyR8l15ZGkySvLqVlRGwDwKGMC/nS2wARAQAB tEJOZXR3b3JrIEZsb3cgTW9uaXRvciBBZ2VudCA8bmV0d29yay1mbG93LW1vbml0 b3ItYWdlbnRAYW1hem9uLmNvbT6JAlcEEwEIAEEWIQR2c2ypl63T6dJ3JqjvvaTM vJX60QUCZ/RvkgIbAwUJBaOagAULCQgHAgIiAgYVCgkICwIEFgIDAQIeBwIXgAAK CRDvvaTMvJX60euSD/9cIu2BDL4+MFFHhyHmG3/se8+3ibW0g8SyP3hsnq7qN+bm ZzLAhll7DVoveNmEHI1VC7Qjwb30exgLcyK2Ld6uN6lwjjK0qiGGz943t230pJ3z u7V2fVtAN+vgDVmD7agE6iqrRCWu3WfcgzFlEkE/7nkhtbWzlaK+NkdEBzNZ+W7/ FmLClzIbMjIBW2M8LdeZdQX0SWljy18x7NGNukWeNTJxmkDsjAeKl+zkXYk9h7ay n3AVl1KrLZ5P9vQ5XsV5e4T6qfQ3XNY1lm54cpa+eD7NyYcTGRDK+vIxO4xD8i2M yl1iNf2+84Tt6/SAgR/P9SJ5tbKD0iU9n4g1eBJVGmHDuXTtDR4H/Ur7xRSxtuMl yZP/sLWm8p7+Ic7aQJ5OVw36MC7Oa7/K/zQEnLFFPmgBwGGiNiw5cUSyCBHNvmtv FK0Q2XMXtBEBU9f44FMyzNJqVdPywg8Y6xE4wc/68uy7G6PyqoxDSP2ye/p+i7oi OoA+OgifchZfDVhe5Ie0zKR0/nMEKTBV0ecjglb/WhVezEJgUFsQcjfOXNUBesJW a9kDGcs3jIAchzxhzp/ViUBmTg6SoGKh3t+3uG/RK2ougRObJMW3G+DI7xWyY+3f 7YsLm0eDd3dAZG3PdltMGp0hKTdslvpws9qoY8kyR0Fau4l222JvYP27BK44qg== =INr5 -----END PGP PUBLIC KEY BLOCK----- 3. Import the public key into your keyring and note the
acw-ug-572
acw-ug.pdf
572
is required to verify the authenticity and integrity of a downloaded Network Flow Monitor agent for an Amazon S3 package. GnuPG is installed by default on Amazon Linux Amazon Machine Images (AMIs). 2. Copy the following public key and save it to a file named nfm-agent.gpg. -----BEGIN PGP PUBLIC KEY BLOCK----- Install agents 2110 Amazon CloudWatch User Guide mQINBGf0b5IBEAC6YQc0aYrTbcHNWWMbLuqsqfspzWrtCvoU0yQ62ld7nvCGBha9 lu4lbhtiwoDawC3h6Xsxc3Pmm6kbMQfZdbo4Gda4ahf6zDOVI5zVHs3Yu2VXC2AU 5BpKQJmYddTb7dMI3GBgEodJY05NHQhq1Qd2ptdh03rsX+96Fvi4A6t+jsGzMLJU I+hGEKGif69pJVyptJSibK5bWCDXh3eS/+vB/CbXumAKi0sq4rXv/VPiIhn6bsCI A2lmzFd3vMJQUM/T7m7skrqetZ4mWHr1LPDFPK/H/81s8TJawx7MACsK6kIRUxu+ oicW8Icmg9S+BpIgONT2+Io5P1tYO5a9AyVF7X7gU0VgHUA1RoLnjHQHXbCmnFtW cYEuwhUuENMl+tLQCZ+fk0kKjOlIKqeS9AVwhks92oETh8wpTwTE+DTBvUBP9aHo S39RTiJCnUmA6ZCehepgpwW9AYCc1lHv/xcahD418E0UHV22qIw943EwAkzMDA4Q damdRm0Nud0OmilCjo9oogEB+NUoy//5XgQMH1hhfsHquVLU/tneYexXYMfo/Iu5 TKyWL2KdkjKKP/dMR4lMAXYi0RjTJJ5tg5w/VrHhrHePFfKdYsgN6pihWwj2Px/M ids3W1Ce50LOEBc2MOKXYXGd9OZWyR8l15ZGkySvLqVlRGwDwKGMC/nS2wARAQAB tEJOZXR3b3JrIEZsb3cgTW9uaXRvciBBZ2VudCA8bmV0d29yay1mbG93LW1vbml0 b3ItYWdlbnRAYW1hem9uLmNvbT6JAlcEEwEIAEEWIQR2c2ypl63T6dJ3JqjvvaTM vJX60QUCZ/RvkgIbAwUJBaOagAULCQgHAgIiAgYVCgkICwIEFgIDAQIeBwIXgAAK CRDvvaTMvJX60euSD/9cIu2BDL4+MFFHhyHmG3/se8+3ibW0g8SyP3hsnq7qN+bm ZzLAhll7DVoveNmEHI1VC7Qjwb30exgLcyK2Ld6uN6lwjjK0qiGGz943t230pJ3z u7V2fVtAN+vgDVmD7agE6iqrRCWu3WfcgzFlEkE/7nkhtbWzlaK+NkdEBzNZ+W7/ FmLClzIbMjIBW2M8LdeZdQX0SWljy18x7NGNukWeNTJxmkDsjAeKl+zkXYk9h7ay n3AVl1KrLZ5P9vQ5XsV5e4T6qfQ3XNY1lm54cpa+eD7NyYcTGRDK+vIxO4xD8i2M yl1iNf2+84Tt6/SAgR/P9SJ5tbKD0iU9n4g1eBJVGmHDuXTtDR4H/Ur7xRSxtuMl yZP/sLWm8p7+Ic7aQJ5OVw36MC7Oa7/K/zQEnLFFPmgBwGGiNiw5cUSyCBHNvmtv FK0Q2XMXtBEBU9f44FMyzNJqVdPywg8Y6xE4wc/68uy7G6PyqoxDSP2ye/p+i7oi OoA+OgifchZfDVhe5Ie0zKR0/nMEKTBV0ecjglb/WhVezEJgUFsQcjfOXNUBesJW a9kDGcs3jIAchzxhzp/ViUBmTg6SoGKh3t+3uG/RK2ougRObJMW3G+DI7xWyY+3f 7YsLm0eDd3dAZG3PdltMGp0hKTdslvpws9qoY8kyR0Fau4l222JvYP27BK44qg== =INr5 -----END PGP PUBLIC KEY BLOCK----- 3. Import the public key into your keyring and note the returned value. PS> gpg --import nfm-agent.gpg gpg: key 3B789C72: public key "Network Flow Monitor Agent" imported gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) Make a note of the key value because you need it in the next step. In this example, the key value is 3B789C72. 4. Verify the fingerprint by running the following command. Be sure to replace key-value with the value from the preceding step. We recommend that you use GPG to verify the fingerprint even if you use RPM to verify the installer package. Install agents 2111 Amazon CloudWatch User Guide PS> gpg --fingerprint key-value pub rsa4096 2025-04-08 [SC] [expires: 2028-04-07] 7673 6CA9 97AD D3E9 D277 26A8 EFBD A4CC BC95 FAD1 uid Network Flow Monitor Agent <network-flow-monitor-agent@amazon.com> The fingerprint string should be equal to the following: 7673 6CA9 97AD D3E9 D277 26A8 EFBD A4CC BC95 FAD1 If the fingerprint string doesn't match, don't install the agent. Contact Amazon Web Services. After you have verified the fingerprint, you can use it to verify the signature of the Network Flow Monitor agent package. 5. Download the package signature file, if you haven't already done so, based on your instance's architecture and operating system. 6. Verify the installer package signature. Be sure to replace the signature-filename and agent-download-filename with the values that you specified when you downloaded the signature file and agent, as shown in the table earlier in this topic. PS> gpg --verify sig-filename agent-download-filename gpg: Signature made Tue Apr 8 00:40:02 2025 UTC gpg: using RSA key 77777777EXAMPLEKEY gpg: issuer "network-flow-monitor-agent@amazon.com" gpg: Good signature from "Network Flow Monitor Agent <network-flow-monitor- agent@amazon.com>" [unknown] gpg: WARNING: Using untrusted key! If the output includes the phrase BAD signature, check to make sure that you performed the procedure correctly. If you continue to get this response, contact AWS Support and avoid using the downloaded file. Note the warning about trust. A key is trusted only if you or someone who you trust has signed it. This doesn't mean that the signature is invalid, only that you have not verified the public key. Next, follow the steps here to verify the RPM package. Install agents 2112 Amazon CloudWatch User Guide To verify the signature of the RPM package 1. Copy the following public key and save it to a file named nfm-agent.gpg. -----BEGIN PGP PUBLIC KEY BLOCK----- mQINBGf0b5IBEAC6YQc0aYrTbcHNWWMbLuqsqfspzWrtCvoU0yQ62ld7nvCGBha9 lu4lbhtiwoDawC3h6Xsxc3Pmm6kbMQfZdbo4Gda4ahf6zDOVI5zVHs3Yu2VXC2AU 5BpKQJmYddTb7dMI3GBgEodJY05NHQhq1Qd2ptdh03rsX+96Fvi4A6t+jsGzMLJU I+hGEKGif69pJVyptJSibK5bWCDXh3eS/+vB/CbXumAKi0sq4rXv/VPiIhn6bsCI A2lmzFd3vMJQUM/T7m7skrqetZ4mWHr1LPDFPK/H/81s8TJawx7MACsK6kIRUxu+ oicW8Icmg9S+BpIgONT2+Io5P1tYO5a9AyVF7X7gU0VgHUA1RoLnjHQHXbCmnFtW cYEuwhUuENMl+tLQCZ+fk0kKjOlIKqeS9AVwhks92oETh8wpTwTE+DTBvUBP9aHo S39RTiJCnUmA6ZCehepgpwW9AYCc1lHv/xcahD418E0UHV22qIw943EwAkzMDA4Q damdRm0Nud0OmilCjo9oogEB+NUoy//5XgQMH1hhfsHquVLU/tneYexXYMfo/Iu5 TKyWL2KdkjKKP/dMR4lMAXYi0RjTJJ5tg5w/VrHhrHePFfKdYsgN6pihWwj2Px/M ids3W1Ce50LOEBc2MOKXYXGd9OZWyR8l15ZGkySvLqVlRGwDwKGMC/nS2wARAQAB tEJOZXR3b3JrIEZsb3cgTW9uaXRvciBBZ2VudCA8bmV0d29yay1mbG93LW1vbml0 b3ItYWdlbnRAYW1hem9uLmNvbT6JAlcEEwEIAEEWIQR2c2ypl63T6dJ3JqjvvaTM vJX60QUCZ/RvkgIbAwUJBaOagAULCQgHAgIiAgYVCgkICwIEFgIDAQIeBwIXgAAK CRDvvaTMvJX60euSD/9cIu2BDL4+MFFHhyHmG3/se8+3ibW0g8SyP3hsnq7qN+bm ZzLAhll7DVoveNmEHI1VC7Qjwb30exgLcyK2Ld6uN6lwjjK0qiGGz943t230pJ3z u7V2fVtAN+vgDVmD7agE6iqrRCWu3WfcgzFlEkE/7nkhtbWzlaK+NkdEBzNZ+W7/ FmLClzIbMjIBW2M8LdeZdQX0SWljy18x7NGNukWeNTJxmkDsjAeKl+zkXYk9h7ay n3AVl1KrLZ5P9vQ5XsV5e4T6qfQ3XNY1lm54cpa+eD7NyYcTGRDK+vIxO4xD8i2M yl1iNf2+84Tt6/SAgR/P9SJ5tbKD0iU9n4g1eBJVGmHDuXTtDR4H/Ur7xRSxtuMl yZP/sLWm8p7+Ic7aQJ5OVw36MC7Oa7/K/zQEnLFFPmgBwGGiNiw5cUSyCBHNvmtv FK0Q2XMXtBEBU9f44FMyzNJqVdPywg8Y6xE4wc/68uy7G6PyqoxDSP2ye/p+i7oi OoA+OgifchZfDVhe5Ie0zKR0/nMEKTBV0ecjglb/WhVezEJgUFsQcjfOXNUBesJW a9kDGcs3jIAchzxhzp/ViUBmTg6SoGKh3t+3uG/RK2ougRObJMW3G+DI7xWyY+3f 7YsLm0eDd3dAZG3PdltMGp0hKTdslvpws9qoY8kyR0Fau4l222JvYP27BK44qg== =INr5 -----END PGP PUBLIC KEY BLOCK----- 2. Import the public key into your keyring. PS> gpg --import nfm-agent.gpg 3. Verify the installer package signature. Be sure to replace the agent-download-filename with the value that you specified when you downloaded the agent, as shown in the table earlier in this topic. Install agents 2113 Amazon CloudWatch User Guide PS> rpm --checksig agent-download-filename For example, for the x86_64 architecture on Amazon Linux 2023, use the following command: PS> rpm --checksig network-flow-monitor-agent.rpm This command returns output similar to the following. network-flow-monitor-agent.rpm: digests signatures OK If the output contains the phrase NOT OK (MISSING KEYS: (MD5) key-id), check to make sure that you performed the procedure correctly. If you continue to get this response, contact AWS Support and don't install the agent. Install agents for self-managed Kubernetes instances Follow the steps in this section to install Network Flow Monitor agents for workloads on self- managed Kubernetes clusters. After you complete the steps, Network Flow Monitor agent pods will be running on all of your self-managed Kubernetes cluster nodes. If you use Amazon Elastic Kubernetes Service (Amazon EKS), the installation steps to follow are in the following section: Install the EKS AWS Network Flow Monitor Agent add-on. Contents • Before you begin • Download Helm charts and install agents • Configure permissions for agents to deliver metrics Before you begin Before you start the installation process, follow the steps in this section to make sure that your environment is set up to successfully install agents on the right Kubernetes clusters. Ensure that your version of Kubernetes is supported Network Flow Monitor agent installation requires Kubernetes Version 1.25, or a more recent version. Install agents 2114 Amazon CloudWatch User Guide Ensure that you have
acw-ug-573
acw-ug.pdf
573
are in the following section: Install the EKS AWS Network Flow Monitor Agent add-on. Contents • Before you begin • Download Helm charts and install agents • Configure permissions for agents to deliver metrics Before you begin Before you start the installation process, follow the steps in this section to make sure that your environment is set up to successfully install agents on the right Kubernetes clusters. Ensure that your version of Kubernetes is supported Network Flow Monitor agent installation requires Kubernetes Version 1.25, or a more recent version. Install agents 2114 Amazon CloudWatch User Guide Ensure that you have installed required tools The scripts that you use for this installation process require that you install the following tools. If you don’t have the tools installed already, see the provided links for more information. • The AWS Command Line Interface (CLI). For more information, see Installing or updating to the latest version of the AWS Command Line Interface in the AWS Command Line Interface Reference Guide. • The Helm package manager. For more information, see Installing Helm on the Helm website. • The kubectl command line tool. For more information, see Install kubectl on the Kubernetes website. • The make Linux command dependency. For more information, see the following blog post: Intro to make Linux Command: Installation and Usage. For example, do one of the following: • For Debian based distributions, such as Ubuntu, use the following command: sudo apt- get install make • For RPM-based distributions, such as CentOS, use the following command: sudo yum install make Ensure that you have valid, correctly configured KubeConfig environment variables Network Flow Monitor agent installation uses the Helm package manager tool, which uses the kubeconfig variable, $HELM_KUBECONTEXT, to determine the target Kubernetes clusters to work with. Also, be aware that when Helm runs installation scripts, by default, it references the standard ~/.kube/config file. You can change the configuration environment variables, to use a different config file (by updating $KUBECONFIG) or to define the target cluster you want to work with (by updating $HELM_KUBECONTEXT). Create a Network Flow Monitor Kubernetes namespace The Network Flow Monitor agent's Kubernetes application installs its resources into a specific namespace. The namespace must exist for the installation to succeed. To ensure that the required namespace is in place, you can do one of the following: • Create the default namespace, amazon-network-flow-monitor, before you begin. • Create a different namespace, and then define it in the $NAMESPACE environment variable when you run the installation to make targets. Install agents 2115 Amazon CloudWatch User Guide Download Helm charts and install agents You can download the Network Flow Monitor agent Helm charts from the AWS public repository by using the following command. Make sure that you first authenticate with your GitHub account. git clone https://github.com/aws/network-flow-monitor-agent.git In the ./charts/amazon-network-flow-monitor-agent directory, you can find the Network Flow Monitor agent Helm charts and Makefile that contain the installation make targets that you use for installing agents. You install agents for Network Flow Monitor by using the following Makefile target: helm/install/customer You can customize the installation if you like, for example, by doing the following: # Overwrite the kubeconfig files to use KUBECONFIG=<MY_KUBECONFIG_ABS_PATH> make helm/install/customer # Overwrite the Kubernetes namespace to use NAMESPACE=<MY_K8S_NAMESPACE> make helm/install/customer To verify that the Kubernetes application pods for the Network Flow Monitor agents have been created and deployed successfully, check to be sure that their state is Running. You can check state of the agents by running the following command: kubectl get pods -o wide -A | grep amazon-network-flow-monitor Configure permissions for agents to deliver metrics After you install agents for Network Flow Monitor, you must enable the agents to send network metrics to the Network Flow Monitor ingestion APIs. Agents in Network Flow Monitor must have permission to access the Network Flow Monitor ingestion APIs so that they can deliver network flow metrics that they've collected for each instance. You grant this access by implementing IAM roles for service accounts (IRSA). To enable agents to deliver network metrics to Network Flow Monitor, follow the steps in this section. 1. Implement IAM roles for service accounts IAM roles for service accounts provides the ability to manage credentials for your applications, similar to the way that Amazon EC2 instance profiles provide credentials to Amazon EC2 instances. Implementing IRSA is the recommended way to provide all permissions required by Install agents 2116 Amazon CloudWatch User Guide Network Flow Monitor agents to successfully access Network Flow Monitor ingestion APIs. For more information, see IAM roles for service accounts in the Amazon EKS User Guide. When you set up IRSA for Network Flow Monitor agents, use the following information: • ServiceAccount: When you define your IAM role trust policy, for ServiceAccount, specify aws-network-flow-monitor-agent-service-account. • Namespace: For the namespace, specify amazon-network-flow-monitor. • Temporary credentials deployment:
acw-ug-574
acw-ug.pdf
574
similar to the way that Amazon EC2 instance profiles provide credentials to Amazon EC2 instances. Implementing IRSA is the recommended way to provide all permissions required by Install agents 2116 Amazon CloudWatch User Guide Network Flow Monitor agents to successfully access Network Flow Monitor ingestion APIs. For more information, see IAM roles for service accounts in the Amazon EKS User Guide. When you set up IRSA for Network Flow Monitor agents, use the following information: • ServiceAccount: When you define your IAM role trust policy, for ServiceAccount, specify aws-network-flow-monitor-agent-service-account. • Namespace: For the namespace, specify amazon-network-flow-monitor. • Temporary credentials deployment: When you configure permissions after you have deployed Network Flow Monitor agent pods, updating the ServiceAccount with your IAM role, Kubernetes does not deploy the IAM role credentials. To ensure that the Network Flow Monitor agents acquire the IAM role credentials that you've specified, you must rolling out a restart of DaemonSet. For example, use a command like the following: kubectl rollout restart daemonset -n amazon-network-flow-monitor aws- network-flow-monitor-agent 2. Confirm that the Network Flow Monitor agent is successfully accessing the Network Flow Monitor ingestion APIs You can check to make sure that your configuration for agents is working correctly by using the HTTP 200 logs for Network Flow Monitor agent pods. First, search for a Network Flow Monitor agent pod, and then search through the log files to find successful HTTP 200 requests. For example, you can do the following: a. Locate a Network Flow Monitor agent Pod name. For example, you can use the following command: RANDOM_AGENT_POD_NAME=$(kubectl get pods -o wide -A | grep amazon-network-flow- monitor | grep Running | head -n 1 | tr -s ' ' | cut -d " " -f 2) b. Grep all the HTTP logs for the pod name that you've located. If you've changed the NAMESPACE, make sure that you use the new one. NAMESPACE=amazon-network-flow-monitor kubectl logs $RANDOM_AGENT_POD_NAME -\-namespace ${NAMESPACE} | grep HTTP If access has been granted successfully, you should see log entries similar to the following: ... Install agents 2117 Amazon CloudWatch User Guide {"level":"INFO","message":"HTTP request complete","status":200,"target":"amzn_nefmon::reports::publisher_endpoint","timestamp":1737027525679} {"level":"INFO","message":"HTTP request complete","status":200,"target":"amzn_nefmon::reports::publisher_endpoint","timestamp":1737027552827} Note that the Network Flow Monitor agent publishes network flow reports every 30 seconds, by calling the Network Flow Monitor ingestion APIs. Install the EKS AWS Network Flow Monitor Agent add-on Follow the steps in this section to install the AWS Network Flow Monitor Agent add-on for Amazon Elastic Kubernetes Service (Amazon EKS), to send Network Flow Monitor metrics to the Network Flow Monitor backend from Kubernetes clusters. After you complete the steps, AWS Network Flow Monitor Agent pods will be running on all of your Kubernetes cluster nodes. If you use self-managed Kubernetes clusters, the installation steps to follow are in the previous section: Install agents for self-managed Kubernetes instances. Be aware that Customer Managed prefix lists Customer Managed prefix lists are not supported for Network Flow Monitor. You can install the add-on by using the console or by using API commands with the AWS Command Line Interface. Contents • Prerequisites for installing the add-on • Install the AWS Network Flow Monitor Agent add-on by using the console • Install the AWS Network Flow Monitor Agent add-on by using the AWS Command Line Interface Prerequisites for installing the add-on Regardless of whether you use the console or the CLI to install the AWS Network Flow Monitor Agent add-on, there are several requirements for installing the add-on with Kubernetes. Ensure that your version of Kubernetes is supported Network Flow Monitor agent installation requires Kubernetes Version 1.25, or a more recent version. Install agents 2118 Amazon CloudWatch User Guide Amazon EKS Pod Identity Agent add-on installation You can install the Amazon EKS Pod Identity Agent add-on in the console or by using the CLI. Amazon EKS Pod Identity associations provide the ability to manage credentials for your applications, similar to the way that Amazon EC2 instance profiles provide credentials to Amazon EC2 instances. Amazon EKS Pod Identity provides credentials to your workloads with an additional Amazon EKS Auth API and an agent pod that runs on each node. To learn more and see the steps for installing the Amazon EKS Pod Identity add-on, see Set up the Amazon EKS Pod Identity Agent in the Amazon EKS User Guide. Install the AWS Network Flow Monitor Agent add-on by using the console Follow the steps in this section to install and configure the AWS Network Flow Monitor Agent add- on in the Amazon EKS console. If you have already installed the add-on and have issues upgrading to a new version, see Troubleshoot issues in EKS agents installation. Before you begin, make sure that you have installed the Amazon EKS Pod Identity Agent add-on. For more information, see the previous section. To install the add-on using the console 1. In the AWS Management Console,
acw-ug-575
acw-ug.pdf
575
Agent in the Amazon EKS User Guide. Install the AWS Network Flow Monitor Agent add-on by using the console Follow the steps in this section to install and configure the AWS Network Flow Monitor Agent add- on in the Amazon EKS console. If you have already installed the add-on and have issues upgrading to a new version, see Troubleshoot issues in EKS agents installation. Before you begin, make sure that you have installed the Amazon EKS Pod Identity Agent add-on. For more information, see the previous section. To install the add-on using the console 1. In the AWS Management Console, navigate to the Amazon EKS console. 2. On the page for installing add-ons, in the list of add-ons, choose AWS Network Flow Monitor Agent. 3. Configure the add-on settings. 1. For Add-on access, choose EKS Pod Identity. 2. For the IAM role to use with the add-on, use a role that has the following AWS managed policy attached: CloudWatchNetworkFlowMonitorAgentPublishPolicy. This policy gives permission for an agent to send telemetry reports to the Network Flow Monitor endpoint. If you don't already have a role with the policy attached, create a role by choosing Create recommended role, and following the steps in the IAM console. 3. Choose Next. 4. On the Review and add page, make sure that the add-on configuration looks correct, and then choose Create. Install agents 2119 Amazon CloudWatch User Guide Install the AWS Network Flow Monitor Agent add-on by using the AWS Command Line Interface Follow the steps in this section to install the AWS Network Flow Monitor Agent add-on for Amazon EKS by using the AWS Command Line Interface. 1. Install the EKS Pod Identity Agent add-on Before you begin, make sure that you have installed the Amazon EKS Pod Identity Agent add- on. For more information, see the earlier section. 2. Create the required IAM role The AWS Network Flow Monitor Agent add-on must have permission to send metrics to the Network Flow Monitor backend. You must attach a role with the required permissions when you create the add-on. Create a role that has the following AWS managed policy attached: CloudWatchNetworkFlowMonitorAgentPublishPolicy. You need the ARN of this IAM role to install the add-on. 3. Install the AWS Network Flow Monitor Agent add-on To install the AWS Network Flow Monitor Agent add-on for your cluster, run the following command: aws eks create-addon --cluster-name CLUSTER NAME --addon-name aws- network-flow-monitoring-agent --region AWS REGION --pod-identity- associations serviceAccount=aws-network-flow-monitor-agent-service- account,roleArn=IAM ROLE ARN The result should be similar to the following: { "addon": { "addonName": "aws-network-flow-monitoring-agent", "clusterName": "ExampleClusterName", "status": "CREATING", "addonVersion": "v1.0.0-eksbuild.1", "health": { "issues": [] }, "addonArn": "arn:aws:eks:us-west-2:000000000000:addon/ExampleClusterName/ aws-network-flow-monitoring-agent/eec11111-bbbb-EXAMPLE", Install agents 2120 Amazon CloudWatch User Guide "createdAt": "2024-10-25T16:38:07.213000+00:00", "modifiedAt": "2024-10-25T16:38:07.240000+00:00", "tags": {}, "podIdentityAssociations": [ "arn:aws:eks:us-west-2:000000000000:podidentityassociation/ ExampleClusterName/a-3EXAMPLE5555555" ] } } 4. Make sure that the add-on is active Review the installed AWS Network Flow Monitor Agent add-on to ensure that it's active for your cluster. Run the following command to verify that the status is ACTIVE: aws eks describe-addon --cluster-name CLUSTER NAME --addon-name aws- network-flow-monitoring-agent --region AWS REGION The result should be similar to the following: { "addon": { "addonName": "aws-network-flow-monitoring-agent", "clusterName": "ExampleClusterName", "status": "ACTIVE", "addonVersion": "v1.0.0-eksbuild.1", "health": { "issues": [] }, "addonArn": "arn:aws:eks:us-west-2:000000000000:addon/ExampleClusterName/ aws-network-flow-monitoring-agent/eec11111-bbbb-EXAMPLE", "createdAt": "2024-10-25T16:38:07.213000+00:00", "modifiedAt": "2024-10-25T16:38:07.240000+00:00", "tags": {}, "podIdentityAssociations": [ "arn:aws:eks:us-west-2:000000000000:podidentityassociation/ ExampleClusterName/a-3EXAMPLE5555555" ] } } Install agents 2121 Amazon CloudWatch User Guide Initialize Network Flow Monitor Before you can view performance metrics for network flows, you must initialize Network Flow Monitor, which grants required permissions and creates an initial topology for your account or accounts. If you plan to monitor resources for multiple accounts, you must also configure AWS Organizations with Amazon CloudWatch. Then, you specify accounts for your Network Flow Monitor scope, so that Network Flow Monitor can create an initial topology for all the accounts that you'll be tracking performance metrics for. In addition, you must install agents on your instances, to send performance metrics to the Network Flow Monitor backup ingestion server. For more information, see Install Network Flow Monitor agents on instances. The steps that you take to initialize Network Flow Monitor vary depending on whether you are measuring performance metrics for resources in a single account, or you want to monitor metrics from resources that are owned by multiple accounts in your organization. • Single account monitoring initialization • Multi-account monitoring initialization Initialize Network Flow Monitor for single account monitoring To initialize Network Flow Monitor to monitor network performance metrics, you must grant permissions and Network Flow Monitor must create the initial topology for your account. When you monitor resources in just one account, Network Flow Monitor sets your account as the scope for network monitoring and creates a topology for that scope. Initializing Network Flow Monitor does the following: • Grants permissions for Network Flow Monitor to use required service-linked roles with your account.
acw-ug-576
acw-ug.pdf
576
are owned by multiple accounts in your organization. • Single account monitoring initialization • Multi-account monitoring initialization Initialize Network Flow Monitor for single account monitoring To initialize Network Flow Monitor to monitor network performance metrics, you must grant permissions and Network Flow Monitor must create the initial topology for your account. When you monitor resources in just one account, Network Flow Monitor sets your account as the scope for network monitoring and creates a topology for that scope. Initializing Network Flow Monitor does the following: • Grants permissions for Network Flow Monitor to use required service-linked roles with your account. Network Flow Monitor requires you to grant it specific permissions so that the feature can send metrics to Amazon CloudWatch on your behalf, as well as create topologies of network flows. For more information, see Service-linked roles for Network Flow Monitor. • Sets your monitoring scope for Network Flow Monitor to the AWS account that you're signed in with. For more information, see Scope in Components and features of Network Flow Monitor. • Creates an initial topology for your scope. Initialize Network Flow Monitor 2122 Amazon CloudWatch User Guide To initialize Network Flow Monitor by setting up the service-linked roles that provide the required permissions, setting the scope to your account, and creating a topology for network flow performance monitoring, follow these steps. To initialize Network Flow Monitor 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the left navigation pane, under Network Monitoring, choose Flow monitors. 3. In the Getting started with Network Flow Monitor section, under Step 1, choose Start initialization. 4. On the Configure Network Flow Monitor page, scroll down, and then choose Initialize Network Flow Monitor. Completing the initialization can take 20-30 minutes. After you initialize Network Flow Monitor for your account, before you can view network flow performance metrics, you must also install Network Flow Monitor agents for your resources that send performance metrics to the Network Flow Monitor backed ingestion server. For more information, see Install Network Flow Monitor agents on instances. Initialize Network Flow Monitor for multi-account monitoring If you want to monitor network flows in Network Flow Monitor for resources that are owned by different accounts, you must first configure Amazon CloudWatch with AWS Organizations. To use multiple accounts in Network Flow Monitor, you're required to turn on trusted access for CloudWatch, and it's a best practice to also register a delegated administrator. In addition, if you plan to create monitors for network flows from the console, you must add a Network Flow Monitor policy to the role that is attached to your resources. The policy enables you to view resources from other accounts in the console, so that you can add the resources in multiple accounts to a monitor. To monitor network flows for resources that are owned by different accounts, there are additional configuration steps to take. First, as the management account, you must configure CloudWatch with AWS Organizations to turn on trusted access, and, typically, you'll also register a delegated administrator account. Then, using the delegated administrator account, you can add more accounts in your organization, to set the scope for your network observability to include resources in those accounts. (You can also add multiple accounts with a management account, but it's a best practice in Organizations to use the delegated administrator account when you work with Initialize Network Flow Monitor 2123 Amazon CloudWatch User Guide resources in a service. We provide steps that follow that guidance in the instructions here for Network Flow Monitor.) Note that if you don’t need to monitor network flows for instances from multiple accounts, you can use Network Flow Monitor with a single account. The scope for Network Flow Monitor is automatically set to the AWS account that you sign in with. Use the guidance in the following sections to complete these steps. Contents • Overview of steps for using multiple accounts in Network Flow Monitor • Configure AWS Organizations in CloudWatch • Add multiple accounts to your scope • Set up permissions for multi-account resource access (console only) Overview of steps for using multiple accounts in Network Flow Monitor To get started with Network Flow Monitor, any account that has not used Network Flow Monitor before must initialize Network Flow Monitor. When you initialize Network Flow Monitor for an account, Network Flow Monitor adds the required service-linked role permissions and creates a scope of the account or accounts to be included in network observability. To work with multiple accounts in Network Flow Monitor, there are additional steps, to integrate with AWS Organizations, and then add the accounts to work with. In summary, you take the following steps: 1. Sign in to the AWS Management Console as the management account, and then do the following: • Complete the required steps for integrating with
acw-ug-577
acw-ug.pdf
577
Network Flow Monitor before must initialize Network Flow Monitor. When you initialize Network Flow Monitor for an account, Network Flow Monitor adds the required service-linked role permissions and creates a scope of the account or accounts to be included in network observability. To work with multiple accounts in Network Flow Monitor, there are additional steps, to integrate with AWS Organizations, and then add the accounts to work with. In summary, you take the following steps: 1. Sign in to the AWS Management Console as the management account, and then do the following: • Complete the required steps for integrating with AWS Organizations in CloudWatch. 2. Sign in to the AWS Management Console as the delegated administrator account, and then do the following: • Initialize Network Flow Monitor, including adding accounts to include in your scope. • Add the required permissions for accessing resources that are in other accounts from the console. If you're setting up Network Flow Monitor to work with multiple accounts and you’re not familiar with AWS Organizations, review the following resources to learn about concepts such as the Initialize Network Flow Monitor 2124 Amazon CloudWatch User Guide management account, trusted access, and the delegated administrator account, and to learn how to integrate Organizations with CloudWatch. • Managing accounts in an organization with AWS Organizations in the AWS Organizations User Guide. • Amazon CloudWatch and AWS Organizations in the AWS Organizations User Guide. Follow the steps in the following sections for specific guidance in configuring Network Flow Monitor for multiple accounts. Configure AWS Organizations in CloudWatch To configure Network Flow Monitor with AWS Organizations, sign in to the management account, and turn on trusted access for CloudWatch. Then, register a delegated administrator account to use for initializing Network Flow Monitor and adding multiple accounts. If you’ve already configured Organizations in CloudWatch to turn on trusted access for Organizations in CloudWatch and register a delegated administrator account, you don’t need to configure anything more for Organizations that is specific to Network Flow Monitor. You can sign in with the delegated administrator account for CloudWatch, and then initialize Network Flow Monitor, including adding multiple accounts for your network observability scope. If you haven’t yet configured Organizations in CloudWatch, follow the steps here to turn on trusted access and register a delegated administrator account. Turn on trusted access in CloudWatch Before you can use Network Flow Monitor with more than one account in your organization, you must turn on trusted access for AWS Organizations in Amazon CloudWatch. Use the following steps to turn on trusted access in the CloudWatch console. To turn on trusted access 1. 2. Sign in to the console with your organization’s management account. In the CloudWatch console, in the navigation pane, choose Settings. 3. Choose the Organizations tab. 4. In Organizational Management Settings, choose Turn on. The Enable trusted access page appears. 5. To review the role policy, choose View permission details to see the role policy. Initialize Network Flow Monitor 2125 Amazon CloudWatch User Guide 6. Choose Enable trusted access. Now, as CloudWatch discovers resources, it automatically updates information about accounts that you have permission to access the resources for in Network Flow Monitor. Register a delegated administrator account As a best practice with AWS Organizations, the management account for your organization should register a member account as a delegated administrator account for CloudWatch. After you register a delegated administrator account in CloudWatch, members of your organization can sign in with the delegated administrator account to monitor the network performance for resources in multiple accounts in Network Flow Monitor. Using the delegated administrator account, you can add multiple accounts for your network observability scope in Network Flow Monitor. Although the management account can also create a scope that includes multiple accounts, we recommend that you follow the best practices for AWS Organizations and use a delegated administrator account for adding multiple accounts in Network Flow Monitor. For member accounts that are not the delegated administrator account, the scope is limited to the signed-in account, which is automatically set for the scope. A delegated administrator account for Organizations is a member account that shares administrator access for service-managed permissions. The account that you choose to register as a delegated administrator account must be a member account in your organization. A delegated administrator account for your organization can be used outside of CloudWatch, so make sure that you understand this account type before following this procedure. For more information, see Amazon CloudWatch and AWS Organizations in the AWS Organizations User Guide. To register a delegated administrator account 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Settings. 3. Choose the Organization tab. 4. Choose Register delegated administrator. 5. In the Register delegated administrator window, in the Delegated administrator account ID field, enter the 12-digit
acw-ug-578
acw-ug.pdf
578
a delegated administrator account must be a member account in your organization. A delegated administrator account for your organization can be used outside of CloudWatch, so make sure that you understand this account type before following this procedure. For more information, see Amazon CloudWatch and AWS Organizations in the AWS Organizations User Guide. To register a delegated administrator account 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Settings. 3. Choose the Organization tab. 4. Choose Register delegated administrator. 5. In the Register delegated administrator window, in the Delegated administrator account ID field, enter the 12-digit Organization member account ID. 6. Choose Register delegated administrator. At the top of the page, a message appears indicating the account was registered successfully. The Organization Settings page appears. Initialize Network Flow Monitor 2126 Amazon CloudWatch User Guide To see information about the delegated administrator account, hover over the number below Delegated administrators. To remove or change the delegated administrator account, deregister the account first. For more information, see Deregistering a delegated administrator account. Add multiple accounts to your scope To add accounts to your Network Flow Monitor scope, sign in with the delegated administrator account. (You can add accounts to a scope if you're signed in with the management account, but it's a best practice in AWS Organizations to use the delegated administrator account to work with resources.) After you sign in with the delegated administrator account, initialize Network Flow Monitor to authorize the required service-linked role permissions, set the scope for your network observability by adding accounts, and create an initial topology for the accounts in your scope. The account that you sign in with—in this case, the delegated administrator account—is automatically included in your Network Flow Monitor scope. To add accounts to your scope so that you can monitor network flows for resources in multiple accounts, follow the steps here. To add accounts to your scope 1. 2. Sign in to the console with your organization’s management account. In the navigation pane for the CloudWatch console, under Network Monitoring, choose Flow monitors. 3. Under Getting started with Network Flow Monitor, in Step 1, choose Start initialization. 4. On the Network Flow Monitor page, under Add accounts, choose Add. The account that you're signed in with is automatically included in the scope and already appears in the Accounts in scope table as (this account). 5. On the Add accounts dialog page, optionally filter the accounts, and then select up to 99 additional accounts to add to your scope. The maximum number of accounts in a scope is 100. 6. Choose Add. 7. Choose Initialize Network Flow Monitor. Network Flow Monitor adds the required service- linked role permissions, creates a scope that includes all the accounts you specified, and then creates an initial topology of the resources in the accounts in your scope. Initialize Network Flow Monitor 2127 Amazon CloudWatch User Guide Set up permissions for multi-account resource access (console only) If you plan to create monitors for network flows from the console, a specific policy is required for each member account in your scope. This policy enables you to view resources from other accounts when you add local and remote resources to a monitor. For each of the account in your scope, create a role, NetworkFlowMonitorAccountResourceAccess, and attach the AmazonEC2ReadOnlyAccess policy. To see permission details for the policy, see AmazonEC2ReadOnlyAccess in the AWS Managed Policy Reference Guide. This policy is in addition to the policy that you must add to each instance so that the Network Flow Monitor agent can send performance metrics from the instance to the Network Flow Monitor ingestion backend server. For more information about requirements for agents, see Install Network Flow Monitor agents on instances. The following procedure provides a summary of the steps to create the required role for accessing resources in your scope in the Network Flow Monitor console. For general guidance on how to create a role in IAM, see Create a role to give permissions to an IAM user in the AWS Identity and Access Management User Guide. To create a role for resource access in the Network Flow Monitor console 1. 2. 3. Sign in to the AWS Management Console and open the IAM console. In the navigation pane of the console, choose Roles, and then choose Create role. Specify the AWS account trusted entity. This trusted entity type enables principals in other AWS accounts to assume the role and access resources in other accounts. 4. Choose Next. 5. In the list of AWS managed policies, choose the AmazonEC2ReadOnlyAccess policy. 6. Choose Next. 7. For role name, enter NetworkFlowMonitorAccountResourceAccess. 8. Review the role, and then choose Create role. Install agents on instances To track network performance with Network Flow Monitor, you must initialize the service, but you must also
acw-ug-579
acw-ug.pdf
579
Console and open the IAM console. In the navigation pane of the console, choose Roles, and then choose Create role. Specify the AWS account trusted entity. This trusted entity type enables principals in other AWS accounts to assume the role and access resources in other accounts. 4. Choose Next. 5. In the list of AWS managed policies, choose the AmazonEC2ReadOnlyAccess policy. 6. Choose Next. 7. For role name, enter NetworkFlowMonitorAccountResourceAccess. 8. Review the role, and then choose Create role. Install agents on instances To track network performance with Network Flow Monitor, you must initialize the service, but you must also install Network Flow Monitor agents on your workload's EC2 instances and add Initialize Network Flow Monitor 2128 Amazon CloudWatch User Guide permissions for the agents to send networking performance metrics to Network Flow Monitor. After you install the agents, wait a short period of time (about 20 minutes), for data to begin being sent to the Network Flow Monitor backend. Then, you can view network performance metrics, on the Workload insights tab, and also create monitors, to view detailed information. For example, you can view the top contributor performance metrics for data transferred and retransmission timeouts, for network flows between your local and remote resources, collected by Network Flow Monitor agents. By viewing and analyzing these metrics, you can choose specific flows that you want to see more details for and track more closely with a monitor. By creating a monitor for specific flows, you can see detailed information about them, including metrics, sorted by the top contributors for each metric type and topologies for each network flow. With a monitor, Network Flow Monitor also provides a network health indicator (NHI), which you can use to see if there have been AWS network impairments for network flows that you're tracking in the monitor, during a time period that you've selected. That information can help you decide where to focus your network troubleshooting efforts. For more information, and instructions for how to install agents, see Install Network Flow Monitor agents on instances. Monitor and analyze network flows in Network Flow Monitor With Network Flow Monitor, you can learn about network flows and performance for traffic that you're monitoring with your scope. You can get workload insights about top contributors, by each metric type, and then create monitors to explore network performance in detail, over different time frames, for the network flows that you select. After you initialize Network Flow Monitor and install agents on your instances, you can view performance metrics for the network flows from those instances. Review the sections here to learn more about how to use Network Flow Monitor to evaluate network performance in Network Flow Monitor, create monitors for more in-depth information, and learn about the specific metrics provided by Network Flow Monitor. The steps provided in these sections use the AWS Management Console. You can also use Network Flow Monitor API operations with the AWS Command Line Interface (AWS CLI) or AWS SDKs to create and configure a monitor. For detailed information about working with Network Flow Monitor API operations, see the following resources: Monitor network flows 2129 Amazon CloudWatch User Guide • If you plan to work with Network Flow Monitor with the CLI, see Examples of using the CLI with Network Flow Monitor. • For detailed information about working with Network Flow Monitor API operations, see the Network Flow Monitor API Reference Guide. Contents • Evaluate network flows with workload insights • Create and work with monitors in Network Flow Monitor • Monitor and analyze network flows using Network Flow Monitor performance metrics • Delete scope for Network Flow Monitor Evaluate network flows with workload insights Network Flow Monitor provides workload insights for the network flows for top contributors in the scope (account) that you enable monitoring for. Top contributors are network flows that have the highest values for each network performance metric. Top contributors are determined for workload insights, which includes all the network flows that you're receiving performance information about, as well as for the network flows you specify for each monitor that you create. For example, Network Flow Monitor determines the network flows that have the highest values for retransmissions, retransmission timeouts, and data transferred. These network flows are the top contributors for each metric type. On the Workload insights page in the Network Flow Monitor console, Network Flow Monitor displays the top contributor network performance statistics for the network flows between all the resources in your monitoring scope where you've deployed agents. Note that if you have multiple accounts in your scope that each have resources that you want to monitor network flows between, you must configure AWS Organizations integration with CloudWatch before you can view performance metrics gathered by the Network Flow Monitor agents that you've installed. When you
acw-ug-580
acw-ug.pdf
580
timeouts, and data transferred. These network flows are the top contributors for each metric type. On the Workload insights page in the Network Flow Monitor console, Network Flow Monitor displays the top contributor network performance statistics for the network flows between all the resources in your monitoring scope where you've deployed agents. Note that if you have multiple accounts in your scope that each have resources that you want to monitor network flows between, you must configure AWS Organizations integration with CloudWatch before you can view performance metrics gathered by the Network Flow Monitor agents that you've installed. When you configure Organizations with Network Flow Monitor, you can add accounts to the scope for your Network Flow Monitor coverage. Performance metrics on Workload insights are shown in separate tables for each metric type: Retransmissions, retransmission timeouts, and data transferred. The data provided is for the top contributors for each type. Note that after you first install Network Flow Monitor agents, there is a waiting period (about 20 minutes) before you can view performance metrics, while agents gather and send data to the Network Flow Monitor backend. Monitor network flows 2130 Amazon CloudWatch User Guide As you review performance metrics, when you see specific resources or network flows that you want to explore more details for, you can create a monitor that includes just those flows. Create and work with monitors in Network Flow Monitor You create a monitor to see details about the network performance for one or several network flows for a workload. For each monitor, Network Flow Monitor publishes end-to-end performance metrics and a network health indicator (NHI), and generates topologies of individual network flows. After you create a monitor, you can view information provided by the monitor in the console on the Monitors page. After you create a monitor, you can edit the monitor to make changes or delete the monitor at any time. The following sections includes procedures for creating, editing, and deleting monitors in the Network Flow Monitor console. Contents • Create a monitor in Network Flow Monitor • Edit a monitor in Network Flow Monitor • Delete a monitor in Network Flow Monitor Create a monitor in Network Flow Monitor You create a monitor by providing the local and remote resources to monitor flows between. You can select network flows on the Workload insights page, and then choose to create a monitor. When you create a monitor in this way, the Create monitor wizard pre-populates local and remote resources for you. Alternatively, you can choose Create monitor, and then select local and remote resources for the monitor from drop-down menus. By reviewing the top contributors on Workload insights on an ongoing basis, you can regularly evaluate if you have the monitors that you need, or if creating new monitors would be helpful. Important These steps are designed to be completed all at once. You won't be able to save any in- process work to continue later. Monitor network flows 2131 Amazon CloudWatch User Guide To create a monitor using the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the left navigation pane, under Network Monitoring, choose Flow monitors. 3. Choose Create monitor. 4. 5. For Monitor name, enter the name you want to use for this monitor in Network Flow Monitor. Select the local resources (one or more) for the network flows that you want to monitor. If your scope includes multiple accounts, choose an account for the resources that you want to specify for your local resources. Then, choose Subnet, VPC, or Availability Zone, and then choose a resource. If you started by choosing specific network flows that you wanted to monitor on the Workload insights page before starting the Create monitor process, network flows are pre-populated for you. If you like, modify your original choices by selecting resources to add or remove in this step. 6. Select the remote resources for the network flows that you want to monitor. To monitor all network flows that originate with the local resources that you chose, select Everywhere. If you want to select specific resources for your remote resources and your scope includes multiple accounts, choose an account for the resources that you want to specify. Then, choose Subnet, VPC, or Availability Zone, and then choose a resource. 7. Optionally, you can add a tag for your monitor. 8. When you're finished adding remote and local resources, choose Next to review and confirm the network flows to monitor. 9. Choose Create monitor. After you create a monitor, you can edit the monitor at any time, to add or remove network flows, or add or edit tags. You can also delete the monitor. Select a monitor, and then choose Edit. Note that you can’t change the name of a monitor. To view the Network
acw-ug-581
acw-ug.pdf
581
want to specify. Then, choose Subnet, VPC, or Availability Zone, and then choose a resource. 7. Optionally, you can add a tag for your monitor. 8. When you're finished adding remote and local resources, choose Next to review and confirm the network flows to monitor. 9. Choose Create monitor. After you create a monitor, you can edit the monitor at any time, to add or remove network flows, or add or edit tags. You can also delete the monitor. Select a monitor, and then choose Edit. Note that you can’t change the name of a monitor. To view the Network Flow Monitor dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Network monitoring, then Flow monitors. The Monitors tab displays a list of the monitors that you have created. Monitor network flows 2132 Amazon CloudWatch User Guide To see more information about a specific monitor, choose a monitor. Edit a monitor in Network Flow Monitor You can edit a monitor at any time, to add or remove network flows, or add or edit tags. Note that you can't change the name of a monitor after you create it. Important These steps are designed to be completed all at once. You won't be able to save any in- process work to continue later. To edit a monitor using the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the left navigation pane, under Network Monitoring, choose Flow monitors. 3. On the Monitors tab, select a monitor, and then choose Edit. 4. Select the local or remote resources that you want add or remove for the monitor. If you have multiple accounts in your scope, specify the account where the resources are located, and then choose resources. 5. Optionally, you can add or remove a tag for your monitor. 6. When you're finished updating the monitor, choose Next to review and confirm the network flows to monitor. 7. Choose Save monitor. Delete a monitor in Network Flow Monitor To delete a monitor in Network Flow Monitor, follow the steps here. To delete a monitor 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. 4. In the left navigation pane, under Network Monitoring, choose Flow monitors. Select a monitor, and then choose Delete. In the dialog that appears, enter confirmation text, and then choose Delete. Monitor network flows 2133 Amazon CloudWatch User Guide Monitor and analyze network flows using Network Flow Monitor performance metrics Network Flow Monitor data and graphs help you to visualize and track network issues. You can create monitors to see detailed information about specific network segments for your AWS workloads, including a view of the topology for individual network flows. After you create one or more monitors in Network Flow Monitor, you can observe performance and metrics, and explore historical data, to find anomalies. To see the information provided by a monitor, on the Monitors tab, choose a monitor in the Monitors table. Then, choose one of the following tabs for more information: Overview, Historical explorer, or Monitor details. Overview tab On the Overview tab, you can review the following, for time periods that you specify. To see a broader or narrower range of historical information, including the NHI and traffic summary data, adjust the time period selection at the top of the page. Metrics are shown only for traffic flows that Network Flow Monitor classifies into designated destination categories. Metrics are displayed for flows between AZs (INTER_AZ), within AZs (INTRA_AZ), between VPCs (INTER_VPC), toward Amazon S3 buckets (AMAZON_S3), and toward Amazon DynamoDB (AMAZON_DYNAMODB). Flows are not classified into a destination category for scenarios such as the following: when traffic goes to another Region or to the internet, or when traffic goes through a shared resource in another account. • Network health indicator (NHI): NHI alerts you to whether there there were AWS network issues for one or more of the network flows tracked by your monitor, during the time frame that you've selected for viewing performance metrics. NHI is a binary value, that is, 1 or 0, which is shown in the console as Degraded or Healthy. • NHI is shown as Degraded if there were issues with the portion of the AWS network that any network flow in the monitor traversed, at any time during the time frame that you select. • Otherwise, NHI is shown as Healthy. If the NHI is Degraded, you can view the Network health indicator bar graph for more information. The graph shows you when, during the selected time frame, there were AWS network issues for the network flows tracked by your monitor. Monitor network flows 2134 Amazon CloudWatch User Guide • Traffic summary: Observe overall metrics for the flows tracked by this monitor, for the time period that you've selected. You can see average round-trip
acw-ug-582
acw-ug.pdf
582
AWS network that any network flow in the monitor traversed, at any time during the time frame that you select. • Otherwise, NHI is shown as Healthy. If the NHI is Degraded, you can view the Network health indicator bar graph for more information. The graph shows you when, during the selected time frame, there were AWS network issues for the network flows tracked by your monitor. Monitor network flows 2134 Amazon CloudWatch User Guide • Traffic summary: Observe overall metrics for the flows tracked by this monitor, for the time period that you've selected. You can see average round-trip time, sums (totals) of transmission timeouts and retransmissions, and the average amount of data transferred for the flows in the monitor. Be aware that RTT data can be sparse because RTT is not always calculated. Historical explorer tab On the Historical explorer tab, you can dive deep into information about specific flows. You can review metrics and topologies for top contributor network flows for specified time frames. In the tables of metrics, you can filter the data by different categories of flows, such as flows between Availability Zones (INTER-AZ). • Metrics: View detailed information for the top contributors for each metric type that Network Flow Monitor aggregates data for. Separate tables of top contributors are provided for retransmission timeouts, retransmissions, round-trip time, and data transferred. • Topologies: To get an idea about where anomalies are occurring, you can view the path or topologyof a network flow. When you choose a specific metric in a metrics table, the topology for that flow is displayed below the table. Monitor details tab On the Monitor details tab, you can see details about the monitor, including the monitor state, the ARN, when it was created and last updated, and the flows that are included. As part of your regular use of Network Flow Monitor, we recommend that you periodically review the data on the Workload insights page to determine if there are new flows that show metrics anomalies that you want to track more closely over time. When you see a set of flows on the Workload insights page that you want to see details about, select the flows and create a monitor for them. Delete scope for Network Flow Monitor If you decide that you no longer want to monitor network flows using Network Flow Monitor, you can delete your Network Flow Monitor scope. When you delete your scope, you can no longer see network performance information. Before you can delete your scope, you must delete all monitors. Be aware that it can take about 15 minutes to complete removing monitors after you request to delete them. For more information, see Delete a monitor in Network Flow Monitor. Monitor network flows 2135 Amazon CloudWatch To delete your scope User Guide 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the left navigation pane, under Network Monitoring, choose Flow monitors. 3. On the Settings tab, choose Delete scope. 4. In the dialog box, enter confirmation text, and then choose Delete scope. View Network Flow Monitor metrics in CloudWatch Network Flow Monitor publishes the following network flow performance metrics to your account: round-trip time, TCP retransmissions, TCP retransmission timeouts, data transferred, and network health indicator. You can view these metrics in CloudWatch Metrics in the Amazon CloudWatch console. To find all metrics for your monitor, in the CloudWatch Metrics dashboard, see the custom namespace AWS/NetworkFlowMonitor. Metrics are aggregated for each monitor that is deployed and active. Network Flow Monitor provides the following metrics. Be aware that RoundTripTime data can be sparse, as this metric is not always calculated. Metric DataTransferred Retransmissions Timeouts Description The number of bytes transferred for all flows for a monitor. Total number of retransmissions for a monitor. Retransmissions occur when the sender needs to resend packets that have been either damaged or lost. Total retransmission timeouts for a monitor. This occurs when the sender is missing too many acknowledgments, and therefore decides to take a time out and stop sending altogether. View CloudWatch metrics 2136 Amazon CloudWatch Metric RoundTripTime HealthIndicator User Guide Description Average round-trip time for network flows for a monitor. This metric, measured in microseco nds, is a measure of performance. It records the time it takes for traffic to be transmitted from a local resource to a remote IP address, and for the associated response to be received. The time is an average over the aggregation period. Data can be sparse, as this metric is not always calculated. Network health indicator (NHI) for a monitor overall. Network health indicator (NHI) i s a value that surfaces an AWS network impairment. The NHI value is 1 (degraded) if there was an AWS network issue during a specified time frame. It's set to 0 (healthy) if no AWS network issues
acw-ug-583
acw-ug.pdf
583
of performance. It records the time it takes for traffic to be transmitted from a local resource to a remote IP address, and for the associated response to be received. The time is an average over the aggregation period. Data can be sparse, as this metric is not always calculated. Network health indicator (NHI) for a monitor overall. Network health indicator (NHI) i s a value that surfaces an AWS network impairment. The NHI value is 1 (degraded) if there was an AWS network issue during a specified time frame. It's set to 0 (healthy) if no AWS network issues were detected. Observing the NHI can help you to prioritize troubleshooting for either your workload or the AWS network. Create alarms with Network Flow Monitor You can create Amazon CloudWatch alarms based on Network Flow Monitor metrics, just as you can for other CloudWatch metrics. For example, you can create an alarm based on the Network Flow Monitor metric Retransmissions, and configure it to send a notification when the metric is higher than a value that you choose. You configure alarms for Network Flow Monitor metrics following the same guidelines as for other CloudWatch metrics. Following are example Network Flow Monitor metrics that you might choose to create an alarm for: • Retransmissions Create alarms 2137 Amazon CloudWatch • Timeouts • RoundTripTime User Guide To see all the metrics available for Network Flow Monitor see Create a CloudWatch alarm based on a static threshold. The following procedure provides an example of setting an alarm on Retransmissions by navigating to the metric in the CloudWatch dashboard. Then, you follow the standard CloudWatch steps to create an alarm based on a threshold that you choose, and set up a notification or choose other options. To create an alarm for Retransmissions in CloudWatch Metrics 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. Choose Metrics, and then choose All metrics. 3. Filter for Network Flow Monitor by choosing AWS/NetworkFlowMonitor. 4. Choose MeasurementSource, MonitorName. 5. In the list, select Retransmissions. 6. On the GraphedMetrics tab, under Actions, choose the bell icon to create an alarm based on a static threshold. Now, follow the standard CloudWatch steps to choose options for the alarm. For example, you can choose to be notified by an Amazon SNS message if Retransmissions is below a specific threshold number. Alternatively, or in addition, you can add the alarm to a dashboard. Keep in mind the following: • Network Flow Monitor metrics are typically aggregated and sent to the Network Flow Monitor backend every 30 seconds, with a 5 second potential jitter (in other words, 25 to 35 seconds). • When you create an alarm based on Network Flow Monitor metrics, make sure that you take into account the short delay before publication when you set an alarm’s lookback period. We recommend that you configure Evaluation Periods with lookback period that is a minimum of 25 minutes. For more information about options when you create a CloudWatch alarm, see Create a CloudWatch alarm based on a static threshold. Create alarms 2138 Amazon CloudWatch User Guide AWS CloudTrail for Network Flow Monitor Monitoring a service is an important part of maintaining reliability, availability, and performance. of Network Flow Monitor and your other AWS solutions. AWS CloudTrail captures API calls and related events made by or on behalf of your AWS account and delivers the log files to an Amazon S3 bucket that you specify. You can identify which users and accounts called AWS, the source IP address from which the calls were made, and when the calls occurred. For more information, see the AWS CloudTrail User Guide. For more information about Network Flow Monitor CloudTrail logging, see Network Flow Monitor in CloudTrail. Troubleshoot issues in Network Flow Monitor This section provides guidance for troubleshooting errors with Network Flow Monitor, including solving issues with installing agents. Troubleshoot issues in EKS agents installation When you try to upgrade the AWS Network Flow Monitor Agent add-on for EKS from v1.0.0 to v1.0.1 in AWS Management Console, you might receive the following error message: "Service account aws-network-flow-monitoring-agent-service-account in pod identity configuration is not supported for addon aws-network-flow-monitoring-agent." This error is returned because a resource was renamed. The EKS add-on v1.0.1 changes the service account name from aws-network-flow-monitoring-agent-service-account to aws- network-flow-monitor-agent-service-account. Then, if Not set is not selected in the console, the pod identity association is not reset to the new resource name. To fix this issue, do the following when you upgrade to the new version by using the console: 1. Under Pod Identity IAM role for service account, select Not set. 2. Select New version (v1.0.1). 3. Select Upgrade. 4. Choose Save changes. CloudTrail 2139 Amazon CloudWatch User Guide Data security and data protection in Network Flow Monitor Cloud security at AWS is the highest priority.
acw-ug-584
acw-ug.pdf
584
EKS add-on v1.0.1 changes the service account name from aws-network-flow-monitoring-agent-service-account to aws- network-flow-monitor-agent-service-account. Then, if Not set is not selected in the console, the pod identity association is not reset to the new resource name. To fix this issue, do the following when you upgrade to the new version by using the console: 1. Under Pod Identity IAM role for service account, select Not set. 2. Select New version (v1.0.1). 3. Select Upgrade. 4. Choose Save changes. CloudTrail 2139 Amazon CloudWatch User Guide Data security and data protection in Network Flow Monitor 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 Network Flow Monitor, 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 Network Flow Monitor. The following topics show you how to configure Network Flow Monitor to meet your security and compliance objectives. You also learn how to use other AWS services that help you to monitor and secure your Network Flow Monitor resources. Topics • Data protection in Network Flow Monitor • Infrastructure Security in Network Flow Monitor • Identity and Access Management for Network Flow Monitor Data protection in Network Flow Monitor The AWS shared responsibility model applies to data protection in Network Flow Monitor. 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. Security 2140 Amazon CloudWatch User Guide 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. • 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 Network Flow Monitor 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. Infrastructure Security in Network Flow Monitor As a managed service, Network Flow Monitor is protected by the AWS global network security procedures that are described in the Amazon Web Services: Overview of Security Processes whitepaper. You use AWS published API calls to access Network Flow Monitor through the network. Clients must support Transport Layer Security (TLS) 1.0 or later. We recommend
acw-ug-585
acw-ug.pdf
585
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. Infrastructure Security in Network Flow Monitor As a managed service, Network Flow Monitor is protected by the AWS global network security procedures that are described in the Amazon Web Services: Overview of Security Processes whitepaper. You use AWS published API calls to access Network Flow Monitor through the network. Clients must support Transport Layer Security (TLS) 1.0 or later. We recommend TLS 1.2 or later. Clients must also support 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. Security 2141 Amazon CloudWatch User Guide 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. Identity and Access Management for Network Flow Monitor 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 Network Flow Monitor resources. IAM is an AWS service that you can use with no additional charge. Contents • How Network Flow Monitor works with IAM • AWS managed policies for Network Flow Monitor • Service-linked roles for Network Flow Monitor How Network Flow Monitor works with IAM Before you use IAM to manage access to Network Flow Monitor, learn what IAM features are available to use with Network Flow Monitor. To see tables showing a similar high-level view of how AWS services work with most IAM features, see AWS services that work with IAM in the IAM User Guide. IAM features you can use with Network Flow Monitor IAM feature Network Flow Monitor support Identity-based policies Resource-based policies Policy actions Policy resources Policy condition keys (service-specific) ACLs Security Yes No Yes Yes Yes No 2142 Amazon CloudWatch IAM feature ABAC (tags in policies) Temporary credentials Principal permissions Service roles Service-linked roles Network Flow Monitor support User Guide Yes Yes Yes No Yes Identity-based policies for Network Flow Monitor 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 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. Resource-based policies within Network Flow Monitor 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. Policy actions for Network Flow Monitor Supports policy actions: Yes Security 2143 Amazon CloudWatch 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. 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 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 Network Flow Monitor actions, see Actions defined by Network Flow Monitor in the Service Authorization Reference. Policy actions in Network Flow Monitor use the following prefix before the action: networkflowmonitor To specify multiple actions in a single statement, separate them with commas. "Action": [ "networkflowmonitor:action1", "networkflowmonitor:action2" ] You can specify multiple actions using wildcards (*). For example, to specify all actions that begin with the word Describe, include the following action: "Action": "networkflowmonitor:Describe*" Policy resources for Network
acw-ug-586
acw-ug.pdf
586
actions are called dependent actions. Include actions in a policy to grant permissions to perform the associated operation. To see a list of Network Flow Monitor actions, see Actions defined by Network Flow Monitor in the Service Authorization Reference. Policy actions in Network Flow Monitor use the following prefix before the action: networkflowmonitor To specify multiple actions in a single statement, separate them with commas. "Action": [ "networkflowmonitor:action1", "networkflowmonitor:action2" ] You can specify multiple actions using wildcards (*). For example, to specify all actions that begin with the word Describe, include the following action: "Action": "networkflowmonitor:Describe*" Policy resources for Network Flow Monitor Supports policy resources: Yes In the Service Authorization Reference, you can see the following information related to Network Flow Monitor: • To see a list of Network Flow Monitor resource types and their ARNs, see Resources defined by Network Flow Monitor. • To learn the actions that you can specify with the ARN of each resource, see Actions defined by Network Flow Monitor. Security 2144 Amazon CloudWatch 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. 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": "*" Policy condition keys for Network Flow Monitor Supports service-specific policy condition keys: 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 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 Network Flow Monitor condition keys, see Condition keys for Network Flow Monitor in the Service Authorization Reference. To learn with which actions and resources you can use a condition key, see Actions defined by Network Flow Monitor. Security 2145 Amazon CloudWatch ACLs in Network Flow Monitor Supports ACLs: No User Guide 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. ABAC with Network Flow Monitor Supports ABAC (tags in policies): Yes Network Flow Monitor has partial support for tags in policies. It supports tagging for one resource, monitors. To use tags with Network Flow Monitor, use the AWS Command Line Interface or an AWS SDK. Tagging for Network Flow Monitor is not supported with the AWS Management Console. To learn more about using tags in policies in general, review the following information. 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
acw-ug-587
acw-ug.pdf
587
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. Security 2146 Amazon CloudWatch User Guide Using temporary credentials with Network Flow Monitor 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. 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 keys. For more information, see Temporary security credentials in IAM. Cross-service principal permissions for Network Flow Monitor Supports forward access sessions (FAS): Yes 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 Network Flow Monitor 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. Security 2147 Amazon CloudWatch User Guide Service-linked role for Network Flow Monitor 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 more information about the service-linked role for Network Flow Monitor, see Service-linked roles for Network Flow Monitor. For details about creating or managing service-linked roles in general in AWS, see AWS services that work with IAM. Find a service in the table that includes a Yes in the Service-linked role column. Choose the Yes link to view the service-linked role documentation for that service. AWS managed policies for Network Flow Monitor 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
acw-ug-588
acw-ug.pdf
588
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. AWS managed policy: CloudWatchNetworkFlowMonitorServiceRolePolicy You can't attach CloudWatchNetworkFlowMonitorServiceRolePolicy to your IAM entities. This policy is attached to a service-linked role named AWSServiceRoleForNetworkFlowMonitor, which publishes network telemetry aggregation results, collected by Network Flow Monitor agents, to CloudWatch. It also allows the service to use AWS Organizations to get information for multi- account scenarios. Security 2148 Amazon CloudWatch User Guide To view the permissions for this policy, see CloudWatchNetworkFlowMonitorServiceRolePolicy in the AWS Managed Policy Reference. For more information, see Service-linked roles for Network Flow Monitor. AWS managed policy: CloudWatchNetworkFlowMonitorTopologyServiceRolePolicy You can't attach CloudWatchNetworkFlowMonitorTopologyServiceRolePolicy to your IAM entities. This policy is attached to a service-linked role named AWSServiceRoleForNetworkFlowMonitor_Topology. Using these permissions, as well as internal meta data information gathering (for performance efficiencies), this service-linked role gathers meta data about resource network configurations, such as describing route tables and gateways, for resources that this service monitors network traffic for. This meta data enables Network Flow Monitor to generate topology snapshots of the resources. When there is network degradation, Network Flow Monitor uses the topologies to provide insights into the location of issues in the network and to help determine attribution for issues. To view the permissions for this policy, see CloudWatchNetworkFlowMonitorTopologyServiceRolePolicy in the AWS Managed Policy Reference. For more information, see Service-linked roles for Network Flow Monitor. AWS managed policy: CloudWatchNetworkFlowMonitorAgentPublishPolicy You can use this policy in IAM roles that are attached to Amazon EC2 and Amazon EKS instance resources to send telemetry reports (metrics) to a Network Flow Monitor endpoint. To view the permissions for this policy, see CloudWatchNetworkFlowMonitorAgentPublishPolicy in the AWS Managed Policy Reference. Updates to the Network Flow Monitor service-linked roles For updates to the AWS managed policies for the Network Flow Monitor service-linked roles, see the AWS managed policies updates table for CloudWatch. You can also subscribe to automatic RSS alerts on the CloudWatch Document history page. Service-linked roles for Network Flow Monitor Network Flow Monitor 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 Network Flow Monitor. The Security 2149 Amazon CloudWatch User Guide service-linked role is predefined by Network Flow Monitor and includes all the permissions that the service requires to call other AWS services on your behalf. Network Flow Monitor defines the permissions of the service-linked roles, and unless defined otherwise, only Network Flow Monitor can assume the roles. The defined permissions include the trust policies and the permissions policies, and the permissions policies cannot be attached to any other IAM entity. You can delete the roles only after first deleting their related resources. This restriction protects your Network Flow Monitor resources because you can't inadvertently remove permissions to access the resources. 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 role column. Choose a Yes with a link to view the service-linked role documentation for that service. Service-linked role permissions for Network Flow Monitor Network Flow Monitor uses the following service-linked roles: • AWSServiceRoleForNetworkFlowMonitor • AWSServiceRoleForNetworkFlowMonitor_Topology Service-linked role permissions for AWSServiceRoleForNetworkFlowMonitor Network Flow Monitor uses the service-linked role named AWSServiceRoleForNetworkFlowMonitor. This role allows Network Flow Monitor to publish CloudWatch aggregated telemetry metrics gathered for network traffic between instances, and between instances and AWS locations. It also allows the service to use AWS Organizations to get information for multi-account scenarios. This service-linked role uses the managed policy CloudWatchNetworkFlowMonitorServiceRolePolicy. To view the permissions for this policy, see CloudWatchNetworkFlowMonitorServiceRolePolicy in the AWS Managed Policy Reference. The AWSServiceRoleForNetworkFlowMonitor service-linked role trusts the following service to assume the role: Security 2150 Amazon CloudWatch User Guide • networkflowmonitor.amazonaws.com Service-linked role permissions for AWSServiceRoleForNetworkFlowMonitor_Topology Network Flow Monitor uses the service-linked role named AWSServiceRoleForNetworkFlowMonitor_Topology. This role allows Network Flow Monitor to generate a topology snapshot of the resources that you use with Network Flow Monitor. This service-linked role uses the managed policy CloudWatchNetworkFlowMonitorTopologyServiceRolePolicy. To view the permissions for this policy, see CloudWatchNetworkFlowMonitorTopologyServiceRolePolicy in the AWS Managed Policy Reference. The AWSServiceRoleForNetworkFlowMonitor_Topology service-linked role trusts the following service to assume the role: • topology.networkflowmonitor.amazonaws.com Creating a service-linked role for Network Flow Monitor You
acw-ug-589
acw-ug.pdf
589
AWSServiceRoleForNetworkFlowMonitor service-linked role trusts the following service to assume the role: Security 2150 Amazon CloudWatch User Guide • networkflowmonitor.amazonaws.com Service-linked role permissions for AWSServiceRoleForNetworkFlowMonitor_Topology Network Flow Monitor uses the service-linked role named AWSServiceRoleForNetworkFlowMonitor_Topology. This role allows Network Flow Monitor to generate a topology snapshot of the resources that you use with Network Flow Monitor. This service-linked role uses the managed policy CloudWatchNetworkFlowMonitorTopologyServiceRolePolicy. To view the permissions for this policy, see CloudWatchNetworkFlowMonitorTopologyServiceRolePolicy in the AWS Managed Policy Reference. The AWSServiceRoleForNetworkFlowMonitor_Topology service-linked role trusts the following service to assume the role: • topology.networkflowmonitor.amazonaws.com Creating a service-linked role for Network Flow Monitor You do not need to manually create the service-linked roles for Network Flow Monitor. The first time that you initialize Network Flow Monitor, Network Flow Monitor creates AWSServiceRoleForNetworkFlowMonitor and AWSServiceRoleForNetworkFlowMonitor_Topology for you. For more information, see Creating a service-linked role in the IAM User Guide. Editing a service-linked role for Network Flow Monitor After Network Flow Monitor creates a service-linked role in your account, you cannot change the name of the role because various entities might reference the role. 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 Network Flow Monitor If you no longer need to use a feature or service that requires a service-linked role, we recommend that you delete the role. That way you don’t have an unused entity that is not actively monitored or maintained. However, you must clean up the resources for the service-linked role before you can manually delete it. Security 2151 Amazon CloudWatch Note User Guide If the Network Flow Monitor service is using the role when you try to delete it, then the deletion might fail. If that happens, wait for a few minutes and then try again. To manually delete the service-linked role using IAM Use the IAM console, the AWS CLI, or the AWS API to delete the AWSServiceRoleForNetworkFlowMonitor or the AWSServiceRoleForNetworkFlowMonitor_Topology service-linked role. For more information, see Deleting a service-linked role in the IAM User Guide. Updates to the Network Flow Monitor service-linked role For updates to CloudWatchNetworkFlowMonitorServiceRolePolicy or CloudWatchNetworkFlowMonitorTopologyServiceRolePolicy, the AWS managed policies for the Network Flow Monitor service-linked roles, see CloudWatch updates to AWS managed policies. For automatic alerts about managed policy changes in CloudWatch, subscribe to the RSS feed on the CloudWatch Document history page. Network Flow Monitor quotas Network Flow Monitor has the following quotas. Resource Default quota Adjustable? Scopes per account per AWS Region Monitors per account per AWS Region Local resources per monitor Remote resources per monitor 1 50 25 25 No Yes No No Quotas 2152 Amazon CloudWatch User Guide Using Internet Monitor Internet Monitor provides visibility into how internet issues impact the performance and availability between your applications hosted on AWS and your end users. It can reduce the time it takes for you to diagnose internet issues from days to minutes. Internet Monitor uses the connectivity data that AWS captures from its global networking footprint to calculate a baseline of performance and availability for internet-facing traffic. This is the same data that AWS uses to monitor internet uptime and availability. With those measurements as a baseline, Internet Monitor raises awareness for you when there are significant problems for your end users (clients) in the different geographic locations where your application runs. In the Amazon CloudWatch console, you can see a global view of traffic patterns and health events, and easily drill down into information about events, at different geographic granularities (locations). You can clearly visualize impact, and pinpoint the client locations and networks (ASNs, typically internet service providers or ISPs) that are affected. If Internet Monitor determines that an internet availability or performance issue is caused by a specific ASN or by the AWS network, it provides that information. To get started, create a monitor that includes one or more resources, so Internet Monitor can create a traffic profile for your AWS application. Then, view information in the Internet Monitor dashboard to visualize data and get insights and suggestions about your application's internet traffic. For information about Regional support, pricing, how Internet Monitor works, and other overview content, see What is Internet Monitor?. To begin working with Internet Monitor, see Getting started with Internet Monitor using the console. What is Internet Monitor? With Internet Monitor, you can monitor your application's internet performance and availability, so that you can visualize data and get insights and suggestions about your AWS application's internet traffic. You can also get suggestions for ways to reduce latency for your application, by using different Regions or AWS services, like Amazon CloudFront. Key features of Internet Monitor • Internet Monitor suggests insights and recommendations that can help you improve your end users' experience. You can explore, in near real-time, how
acw-ug-590
acw-ug.pdf
590
Monitor?. To begin working with Internet Monitor, see Getting started with Internet Monitor using the console. What is Internet Monitor? With Internet Monitor, you can monitor your application's internet performance and availability, so that you can visualize data and get insights and suggestions about your AWS application's internet traffic. You can also get suggestions for ways to reduce latency for your application, by using different Regions or AWS services, like Amazon CloudFront. Key features of Internet Monitor • Internet Monitor suggests insights and recommendations that can help you improve your end users' experience. You can explore, in near real-time, how to improve the projected latency of your application by switching to use other services, or by rerouting traffic to your workload through different AWS Regions. Using Internet Monitor 2153 Amazon CloudWatch User Guide • Internet Monitor stores internet measurements for pairs of your client locations and ASNs, or city-networks. Internet Monitor also creates aggregated CloudWatch metrics for traffic to your application, and to each AWS Region and edge location. With the Internet Monitor dashboard, you can quickly identify what's impacting your application's performance and availability, so that you can track down and address issues. • Internet Monitor also publishes internet measurements to CloudWatch Logs and CloudWatch Metrics, to support using CloudWatch tools to explore data for city-networks that are specific to your monitored application traffic. Optionally, you can also publish internet measurements to Amazon S3. • Internet Monitor sends overall (global) health events to Amazon EventBridge so that you can set up notifications. (Local health events are not published to EventBridge.) If an issue is caused by the AWS network, you also automatically receive an AWS Health Dashboard notification with the steps that AWS is taking to mitigate the problem. How to use Internet Monitor To use Internet Monitor, you create a monitor and associate your application's resources with it— VPCs, Network Load Balancers, CloudFront distributions, or WorkSpaces directories—to enable Internet Monitor to know where your application's internet-facing traffic is. Internet Monitor then publishes internet measurements from AWS that are specific to the city-networks, that is, the client locations and ASNs (typically internet service providers or ISPs), where clients access your application. For more information, see How Internet Monitor works. To begin working with Internet Monitor, see Getting started with Internet Monitor using the console. Contents • Supported AWS Regions for Internet Monitor • Components and terms for Internet Monitor • How Internet Monitor works • Internet Monitor example use cases • Global internet weather map in Internet Monitor • Internet Monitor cross-account observability • Pricing for Internet Monitor What is Internet Monitor? 2154 Amazon CloudWatch User Guide Supported AWS Regions for Internet Monitor The AWS Regions and AWS Local Zones where Amazon CloudWatch Internet Monitor is supported are listed in this section. For more information about Regions that Internet Monitor is supported in, including opt-in Regions, see Amazon CloudWatch Internet Monitor endpoints and quotas in the Amazon Web Services General Reference. Note that Internet Monitor stores data for a monitor in only the AWS Region in which you create the monitor, although a monitor can include resources in multiple Regions. Region name (Opt-in support) Region Africa (Cape Town) Asia Pacific (Hong Kong) Asia Pacific (Hyderabad) af-south-1 ap-east-1 ap-south-2 Asia Pacific (Jakarta) ap-southeast-3 Asia Pacific (Melbourne) ap-southeast-4 Europe (Milan) Europe (Spain) Europe (Zurich) Middle East (Bahrain) Middle East (UAE) eu-south-1 eu-south-2 eu-central-2 me-south-1 me-central-1 Region name (Default support) Region US East (Ohio) US East (N. Virginia) US West (N. California) us-east-2 us-east-1 us-west-1 What is Internet Monitor? 2155 Amazon CloudWatch User Guide Region name (Default support) Region US West (Oregon) Asia Pacific (Mumbai) Asia Pacific (Osaka) Asia Pacific (Seoul) Asia Pacific (Singapore) Asia Pacific (Sydney) Asia Pacific (Tokyo) Canada (Central) Europe (Frankfurt) Europe (Ireland) Europe (London) Europe (Paris) Europe (Stockholm) South America (São Paulo) us-west-2 ap-south-1 ap-northeast-3 ap-northeast-2 ap-southeast-1 ap-southeast-2 ap-northeast-1 ca-central-1 eu-central-1 eu-west-1 eu-west-2 eu-west-3 eu-north-1 sa-east-1 For Local Zones support, you must enable the Local Zone and attach it to the VPC that you want to monitor internet traffic for. Internet Monitor does not support Local Zones for other resources types. The Local Zones that are supported are listed in the following table. Local Zone Parent Region Type us-east-1-dfw-2a us-east-1 Availability Zone us-east-1-mia-2a us-east-1 Availability Zone What is Internet Monitor? 2156 Amazon CloudWatch User Guide Local Zone Parent Region Type us-east-1-qro-1a us-east-1 us-east-1-lim-1a us-east-1 Frontier Zone Frontier Zone us-east-1-atl-2a us-east-1 Availability Zone us-east-1-bue-1a us-east-1 us-east-1-mci-1a us-east-1 Frontier Zone Frontier Zone us-west-2-lax-1a us-west-2 Availability Zone us-west-2-lax-1b us-west-2 Availability Zone af-south-1-los-1a af-south-1 Frontier Zone Components and terms for Internet Monitor Internet Monitor uses or references the following concepts. Monitor A monitor includes the resources for a single application that you want to view internet performance and availability measurements for, and that you want to get health event alerts about. When
acw-ug-591
acw-ug.pdf
591
us-east-1-dfw-2a us-east-1 Availability Zone us-east-1-mia-2a us-east-1 Availability Zone What is Internet Monitor? 2156 Amazon CloudWatch User Guide Local Zone Parent Region Type us-east-1-qro-1a us-east-1 us-east-1-lim-1a us-east-1 Frontier Zone Frontier Zone us-east-1-atl-2a us-east-1 Availability Zone us-east-1-bue-1a us-east-1 us-east-1-mci-1a us-east-1 Frontier Zone Frontier Zone us-west-2-lax-1a us-west-2 Availability Zone us-west-2-lax-1b us-west-2 Availability Zone af-south-1-los-1a af-south-1 Frontier Zone Components and terms for Internet Monitor Internet Monitor uses or references the following concepts. Monitor A monitor includes the resources for a single application that you want to view internet performance and availability measurements for, and that you want to get health event alerts about. When you create a monitor for an application, you add resources for the application to define the cities (locations) for Internet Monitor to monitor. Internet Monitor uses the traffic patterns from the application resources that you add so that it can publish internet performance and availability measurements specific to just the locations and ASNs (typically, internet service providers or ISPs) that communicate with your application. In other words, the resources that you add create a scope of the city-networks that you want Internet Monitor to monitor and that you want it to publish measurements for. Resource added to monitor ("monitored resource") A resource that you add to a monitor is a "monitored resource" in Internet Monitor. That is: • Each VPC that you add in a Region is a monitored resource. When you add a VPC, Internet Monitor monitors the traffic for any internet-facing application in the VPC, for example, an What is Internet Monitor? 2157 Amazon CloudWatch User Guide application hosted on an Amazon EC2 instance, behind a Network Load Balancer, or an AWS Fargate container. • Each Network Load Balancer that you add in a Region is a monitored resource. • Each WorkSpaces directory that you add in a Region is a monitored resource. • Each CloudFront distribution that you add is a monitored resource. Autonomous System Number (ASN) In Internet Monitor, an ASN typically refers to an internet service provider (ISP), such as Verizon or Comcast. An ASN is a network provider that a client uses to access your internet application. An Autonomous System (AS) is a set of internet routable internet protocol (IP) prefixes that belong to a network or a collection of networks that are all managed, controlled, and supervised by one organization. City-network (location and ASN) A city-network is the location (such as a city) that clients access your application resources from and the ASN, typically an internet service provider (ISP), that clients access the resources through. To help control your bill, you can set a limit for the maximum number of city-networks for Internet Monitor to monitor for each monitor. You pay only for the actual number of city- networks that you monitor, up to the maximum number. For more information, see Choosing a city-network maximum limit. Internet measurements Internet Monitor also publishes internet measurements to log files in CloudWatch Logs every five minutes for the top 500 city-networks for your monitored application traffic. These measurements quantify the performance score, availability score, bytes transferred (bytes in and bytes out), and round-trip time for your application's city-networks. These are measurements for the city-networks specific to your VPCs, Network Load Balancers, CloudFront distributions, or WorkSpaces directories. Optionally, you can choose to publish internet measurements and events for all monitored city-networks (up to the 500,000 city- networks service limit) to an Amazon S3 bucket. Metrics Internet Monitor generates aggregated metrics for CloudWatch metrics, for global traffic to your application and global traffic to each AWS Region. For more information, see View Internet Monitor metrics or set alarms in CloudWatch Metrics. What is Internet Monitor? 2158 Amazon CloudWatch Health event User Guide Internet Monitor creates a health event to alert you to a specific problem that affects your application. Internet Monitor detects internet issues, such as increased network latency, across the world. It then uses its historical internet measurements from across the AWS global infrastructure footprint to calculate the impact of current issues on your application, and creates health events. Internet Monitor, by default, creates health events based on both overall impact and local impact thresholds. To learn more about health events, see When Internet Monitor creates and resolves health events. The default health event threshold, for both performance scores and availability scores, is 95%. If you like, you can specify your own custom thresholds for when Internet Monitor creates health events. For more information about configuring thresholds, see Change health event thresholds. Each health event includes information about the impacted city-networks. You can view health events in the CloudWatch console, or by using an AWS SDK or AWS CLI with Internet Monitor API actions. Internet Monitor also sends Amazon EventBridge notifications for health events. For more information, see When Internet Monitor creates and resolves health events. Internet
acw-ug-592
acw-ug.pdf
592
resolves health events. The default health event threshold, for both performance scores and availability scores, is 95%. If you like, you can specify your own custom thresholds for when Internet Monitor creates health events. For more information about configuring thresholds, see Change health event thresholds. Each health event includes information about the impacted city-networks. You can view health events in the CloudWatch console, or by using an AWS SDK or AWS CLI with Internet Monitor API actions. Internet Monitor also sends Amazon EventBridge notifications for health events. For more information, see When Internet Monitor creates and resolves health events. Internet event Internet Monitor displays information about recent global health events, called internet events, on an internet weather map that is available to all AWS customers. You don't need to create a monitor in Internet Monitor to view the internet weather map. Unlike health events, internet events are not specific to individual customers or their application traffic. For more information, see Global internet weather map in Internet Monitor. Thresholds Internet Monitor creates health events based on both overall thresholds and local thresholds. You can change the default thresholds and configure other options, such as turning off local thresholds. For more information about configuring thresholds, see Change health event thresholds. Performance and availability scores By analyzing the data that AWS collects, Internet Monitor can detect when the performance and availability for your application has dropped, compared to estimated baselines that Internet Monitor calculates. To make it easier to see those drops, Internet Monitor reports the information to you as scores. A performance score represents the estimated percentage What is Internet Monitor? 2159 Amazon CloudWatch User Guide of traffic that is not seeing a performance drop. Similarly, an availability score represents the estimated percentage of traffic that is not seeing a availability drop. For more information, see How AWS calculates performance and availability scores. Bytes transferred and monitored bytes transferred Bytes transferred is the total number of bytes of ingress and egress traffic between an application in AWS and the city-network (that is, the location and the ASN, typically the internet service provider) where clients access an application. Monitored bytes transferred is a similar metric, but includes only bytes for monitored traffic. Round-trip time Round-trip time (RTT) is how long it takes for a request from a client user to return a response to the user. When RTT is aggregated across client locations (cities or other geographies), the value is weighted by how much of your application traffic is driven by each client location. How Internet Monitor works This section provides information about how Internet Monitor works. This includes descriptions of how AWS collects the data that it uses to help detect connectivity issues across the internet, and how performance and availability scores are calculated. Contents • How Internet Monitor focuses on just your application traffic footprint • How AWS measures connectivity issues and calculates measurements • Geolocation accuracy in Internet Monitor • When Internet Monitor creates and resolves health events • Health event report timing • How Internet Monitor works with IPv4 and IPv6 traffic • How Internet Monitor selects the subset of city-networks to include • How the global internet weather map is created (Frequently Asked Questions) How Internet Monitor focuses on just your application traffic footprint Internet Monitor focuses monitoring on just the subset of the internet that's accessed by the users of your AWS resources, instead of broadly monitoring your website from every Region What is Internet Monitor? 2160 Amazon CloudWatch User Guide in the world as other tools do. It’s also a cost effective solution, affordable for large and small companies. Internet Monitor uses the same powerful probes and issue-detection algorithms that AWS takes advantage of internally and alerts you to connectivity issues that affect your application by creating health events in Internet Monitor. Internet Monitor then gives you access to the resulting performance and availability map, by overlaying the traffic profile that it creates from your active viewers, based on your application resources. Using this information, Internet Monitor shows you just relevant events (that is, the events from places where you have active viewers), and just the impact those events have on your overall viewer volume. So, how much impact an event has, percentage-wise, is based on your total traffic worldwide. Internet Monitor stores internet measurements for pairs of your client locations and ASNs, or city-networks. Internet Monitor also creates aggregated CloudWatch metrics for traffic to your application, and to each AWS Region and edge location. In addition, Internet Monitor publishes internet measurements to CloudWatch Logs internet every five minutes for the top 500 city-networks that send traffic to each monitor, to support using CloudWatch tools and other methods with your data. Optionally, you can choose to publish internet measurements for all monitored city-networks (up to the
acw-ug-593
acw-ug.pdf
593
how much impact an event has, percentage-wise, is based on your total traffic worldwide. Internet Monitor stores internet measurements for pairs of your client locations and ASNs, or city-networks. Internet Monitor also creates aggregated CloudWatch metrics for traffic to your application, and to each AWS Region and edge location. In addition, Internet Monitor publishes internet measurements to CloudWatch Logs internet every five minutes for the top 500 city-networks that send traffic to each monitor, to support using CloudWatch tools and other methods with your data. Optionally, you can choose to publish internet measurements for all monitored city-networks (up to the 500,000 city- networks service limit) to an Amazon S3 bucket. For more information, see Publish internet measurements to Amazon S3 in Internet Monitor. The benefits of Internet Monitor include the following: • Using Internet Monitor doesn't place additional load or cost on your application that's hosted on AWS. • You don't need to include performance measurement code in your client-side resources, or in your application. • You can get visibility into performance and availability across the internet that your application is connected to, including "last mile" information. Note that because Internet Monitor creates measurements based on your AWS resources, Internet Monitor only creates events that are specific to your application traffic. Global internet issues in general are not reported. In addition, when the service location is an AWS Region, the measurements and events emitted are designed to represent connectivity at a Regional level and don’t accurately represent connectivity between an end user location and an Availability Zone. What is Internet Monitor? 2161 Amazon CloudWatch User Guide How AWS measures connectivity issues and calculates measurements Internet Monitor uses internet connectivity data between different AWS Regions and Amazon CloudFront points of presence (POPs) to different client locations through Autonomous System Numbers (ASNs), typically internet service providers (ISPs). This is the connectivity data that is used internally by AWS operators, on a daily basis, to proactively detect connectivity issues across the global internet. For every AWS Region, we know which portions of the internet communicate with the Region and do the following: • We actively monitor those portions of the internet, with a rolling 30-day window. • We use both network and higher-level protocol probes, including both inbound and outbound probing. AWS has active and passive probes that measure the latency (performance) at the 90th percentile and reachability (availability) from every AWS Region and from the CloudFront service to the entire internet. Abnormal patterns in connectivity between a service and a customer location are monitored, and then reported as alerts to the customer. See the following sections for details: • Calculating availability and RTT • Calculating performance and availability scores • Calculating TTFB and RTT (latency) • Regional and Availability Zone measurements and aggregation Calculating availability and RTT Round-trip time (RTT) is how long it takes for a request from the user to return a response to the user. When round-trip time is aggregated across end user locations, the value is weighted by the amount of your traffic that is driven by each end user location. As an example, with two end user locations, one serving 90% of traffic with a 5 ms RTT, and the other serving 10% of traffic with a 10 ms RTT, the result is an aggregated RTT of 5.5 ms (which comes from 5 ms * 0.9 + 10 ms * 0.1). Note that there are differences for resources about measuring last-mile latency. For Internet Monitor latency measurements, VPCs, Network Load Balancers, and WorkSpaces directories do not include last-mile latency. What is Internet Monitor? 2162 Amazon CloudWatch User Guide Calculating performance and availability scores AWS has substantial historical data about internet performance and availability between AWS services and different city-networks (locations and ASNs). By applying statistical analysis to the data, Internet Monitor can detect when the performance and availability for your application has dropped, compared to an estimated baseline that it has calculated. To make it easier to see those drops, that information is reported to you in the form of health scores: a performance score and an availability score. Health scores are calculated at different granularities. At the finest granularity, we compute the health score for a geographic region, such as a city or a metro area, and an ASN (a city- network). We also roll up the individual health scores to overall health score numbers for an application in a monitor. If you view performance or availability scores without filtering for any specific geography or service provider, Internet Monitor provides overall health scores. Overall health scores span your whole application for the specified time period. When the performance or availability score for your application's city-network pairs across your application reaches or drops below the corresponding health event threshold for performance or availability Internet Monitor triggers a
acw-ug-594
acw-ug.pdf
594
geographic region, such as a city or a metro area, and an ASN (a city- network). We also roll up the individual health scores to overall health score numbers for an application in a monitor. If you view performance or availability scores without filtering for any specific geography or service provider, Internet Monitor provides overall health scores. Overall health scores span your whole application for the specified time period. When the performance or availability score for your application's city-network pairs across your application reaches or drops below the corresponding health event threshold for performance or availability Internet Monitor triggers a health event. By default, the threshold is 95% for both overall performance and availability. Internet Monitor also creates health events based on local thresholds—if the option is enabled, as it is by default—based on values that you configure. To learn more about configuring health event thresholds, see Change health event thresholds. When you explore information in the monitor and log files to investigate issues and learn more, you can filter by specific cities (locations), networks (ASNs or internet service providers), or both. So, you can use filters to see health scores for different cities, ASNs, or city-network pairs, depending on the filters that you choose. • An availability score represents the estimated percentage of traffic that is not seeing an availability drop. Internet Monitor estimates the percentage of traffic experiencing a drop from the total traffic seen and availability metrics measurements. For example, an availability score of 99% for an end user and service location pair is equivalent to 1% of the traffic experiencing an availability drop for that pair. • A performance score represents the percentage of traffic that is not seeing a performance drop. For example, a performance score of 99% for an end user and service location pair is equivalent to 1% of the traffic experiencing a performance drop for that pair. What is Internet Monitor? 2163 Amazon CloudWatch User Guide Calculating TTFB and RTT (latency) Time to first byte (TTFB) refers to the time between when a client makes a request and when it receives the first byte of information from the server. AWS calculations for TTFB measure the time elapsed from Amazon EC2 or Amazon CloudFront to the Internet Monitor measurement node (including the last mile of the node). That is, Internet Monitor measures time from the user to the Amazon EC2 Region for TTFB for EC2, and from the user to CloudFront for TTFB for CloudFront. For round-trip time (RTT), Internet Monitor includes the time from the city-network (that is, the client location and ASN, typically an internet service provider), as mapped by the public IP address, to the AWS Region. This means that Internet Monitor does not have last mile visibility for users who access the internet from behind a gateway or VPN. Note that there are differences for resources about measuring last-mile latency. For Internet Monitor latency measurements, VPCs, Network Load Balancers, and WorkSpaces directories do not include last-mile latency. Internet Monitor includes average TTFB information in the Traffic optimization suggestions section of the Traffic insights tab on the CloudWatch dashboard, to help you evaluate options for different setups for your application that can improve performance. Regional and Availability Zone measurements and aggregation Although Internet Monitor aggregates measurements and shares impact at a Regional level, it calculates impact at an Availability Zone (AZ) level. This means that, if, for an event, only one AZ is impacted and most of your traffic flows through that AZ, you do see impact for your traffic. However, for the same event, if your application traffic does not flow through an impacted AZ, you do not see impact. Note that this applies only to resources that aren't WorkSpaces directories. WorkSpaces directories are measured only on a Regional level. Geolocation accuracy in Internet Monitor For location information, Internet Monitor uses IP-geolocation data supplied by MaxMind. The accuracy of the location information in Internet Monitor measurements depends on the accuracy of MaxMind's data. Be aware that Metro level measurements might not be accurate for locations outside of the United States. What is Internet Monitor? 2164 Amazon CloudWatch User Guide When Internet Monitor creates and resolves health events Internet Monitor creates and closes health events for the application traffic that you monitor based on the current thresholds that are set. Internet Monitor has a default threshold configuration, and you can also set your own configuration for thresholds. Internet Monitor determines the overall impact that connectivity issues are having on your application, and the impact on local areas where your application has clients, and creates health events when the thresholds are crossed. Internet Monitor calculates the impact of connectivity issues on a client location based on the historical data about internet performance and availability for network traffic that's available to the
acw-ug-595
acw-ug.pdf
595
creates and closes health events for the application traffic that you monitor based on the current thresholds that are set. Internet Monitor has a default threshold configuration, and you can also set your own configuration for thresholds. Internet Monitor determines the overall impact that connectivity issues are having on your application, and the impact on local areas where your application has clients, and creates health events when the thresholds are crossed. Internet Monitor calculates the impact of connectivity issues on a client location based on the historical data about internet performance and availability for network traffic that's available to the service through AWS. It applies the information relevant to your application, based on the geographic locations for ASNs and services where clients use your application: the city- network pairs that are affected. The locations are determined from the resources that you add to your monitor. Then Internet Monitor uses statistical analysis to detect when performance and availability has dropped, affecting the client experience for your application. The performance and availability scores that Internet Monitor calculates are represented as the percentage of traffic that is not seeing a drop. Impact is the opposite of this: it's a representation of how much an issue is problematic for a customer's end users. So if there is a global availability drop of 93%, for example, the corresponding impact would be 7%. When the performance or availability score for your application's city-network pairs globally reaches or drops below the corresponding health event threshold for performance or availability, this triggers Internet Monitor to generate a health event. By default, the threshold is 95% for both performance and availability. The values to meet, or drop below, the threshold are cumulative, so it could mean several smaller events combine to meet the threshold percentage, or that a single event meets or falls below the threshold level. As long as performance or availability scores that triggered the event are at or below the corresponding health event threshold percentage for overall impact, the health event stays active. When the score or combined scores that triggered the event rise above the threshold, Internet Monitor resolves the health event. Internet Monitor also creates health events based on local thresholds and the percentage of overall traffic that an issue has an impact on. You can configure options for local thresholds, or turn off local thresholds altogether. The default health event threshold, for both performance scores and availability scores, is 95%. If you like, you can specify your own custom thresholds for when Internet Monitor creates What is Internet Monitor? 2165 Amazon CloudWatch User Guide health events. For more information about configuring thresholds, see Change health event thresholds. Health event report timing Internet Monitor uses an aggregator to gather all signals about internet issues, to create health events in monitors within minutes. When possible, Internet Monitor analyzes the origin of a health event, to determine whether it was caused by AWS or an ASN. Health event analysis continues after an event is resolved. Internet Monitor can update events with new information for up to an hour. How Internet Monitor works with IPv4 and IPv6 traffic Internet Monitor measures health toward a network over only IPv4, and shows you health events, and availability and performance metrics, if you serve traffic to that network over any IP family (IPv4 or IPv6). If you serve traffic from a dual-stack resource, such as a dual- stack CloudFront distribution, Internet Monitor raises a health event and shows a drop in a performance score or availability score only if IPv4 traffic has the same issues for the resource as IPv6 traffic does. Note that the Internet Monitor metrics for overall bytes in and bytes out accurately reflect all internet traffic (IPv4 and IPv6). How Internet Monitor selects the subset of city-networks to include When you set a maximum limit for the number of city-networks monitored by your monitor or choose a percentage of traffic to monitor, Internet Monitor chooses the city-networks to include (monitor) based on highest recent traffic volume. For example, if you set a maximum city-networks limit of 100, Internet Monitor monitors (up to) 100 city-networks based on your application traffic during a recent one hour period. Specifically, Internet Monitor monitors the top 100 city-networks that have had the most traffic in the most recent one hour window before the latest one hour window. To illustrate this, say that the current time is 2:30 PM. In this scenario, the traffic that you see in your monitor was captured between 1:00 PM and 2:00 PM, and the traffic volume measurement that Internet Monitor uses to determine the top 100 city-networks was captured between 12:00 PM and 1:00 PM. What is Internet Monitor? 2166 Amazon CloudWatch User Guide How the global internet weather map is created (Frequently Asked Questions) The
acw-ug-596
acw-ug.pdf
596
Internet Monitor monitors the top 100 city-networks that have had the most traffic in the most recent one hour window before the latest one hour window. To illustrate this, say that the current time is 2:30 PM. In this scenario, the traffic that you see in your monitor was captured between 1:00 PM and 2:00 PM, and the traffic volume measurement that Internet Monitor uses to determine the top 100 city-networks was captured between 12:00 PM and 1:00 PM. What is Internet Monitor? 2166 Amazon CloudWatch User Guide How the global internet weather map is created (Frequently Asked Questions) The Internet Monitor internet weather map is available on the Internet Monitor console to all authenticated AWS customers. This section includes details about how the internet weather map is created and how to use it. What is the Internet Monitor internet weather map? The internet weather map provides a visual representation of internet issues across the world. It highlights impacted client locations, that is, cities plus ASN (typically internet service providers). The map shows a combination of availability and performance issues that have recently impacted clients' internet experience for top client locations and AWS services globally. Where does data for the map come from? The data is based on a combination of active and passive probing of the internet. To learn more about how Internet Monitor measures data you can read the section How AWS measures connectivity issues. How often is the map updated? The internet weather map is updated every 15 minutes. Which networks are tracked for outages? AWS tracks networks all around the world that represent important IP prefixes used by customers for making internet connections to AWS. We scope outages to client locations that are top talkers for volume of traffic sent to and received from the AWS network. What determines whether an internet event is included on the map? Here are some high level criteria that we use to determine whether an internet event is included on the internet weather map: • AWS detects that there is an availability or performance event. • If the event is short lived, for example, it lasts less than 5 minutes, we ignore it. • Then, if the event is in a client location that is classified as a top talker, it's considered an outage. What thresholds are used for the internet weather map? Thresholds for determining outages are not static for the internet weather map. Internet Monitor determines what constitutes an event based on detecting a deviation from expected values. You can learn more about how this works by reviewing how Internet Monitor What is Internet Monitor? 2167 Amazon CloudWatch User Guide determines when to create health events for monitors that you create with the service. When you create a monitor, Internet Monitor generates internet traffic health measurements that are specific to your own application traffic. Internet Monitor also alerts you to health events for issues that affect your application's internet traffic. What can I do with this data? The internet weather map provides a quick summary of key internet events that happened around the world in the last 24 hours. It helps you to get a sense of the internet monitoring experience, without needing to onboard your own internet traffic to Internet Monitor. To leverage the full potential of the internet monitoring capabilities of AWS and to personalize it for your applications and services hosted on AWS, you can create a monitor in Internet Monitor. When you create a monitor, you enable Internet Monitor to identify the specific internet paths that affect your application clients, and you get access to features and capabilities that can help you improve your client experience. You'll also be proactively notified of new internet issues that specifically impact your application traffic and clients. How can I get more details about events? Click an outage on the map to see details that include when an event started and ended, the impacted city and ASN, and what type of issue it was (that is, a performance issue or an availability issue). To get more detailed information about events, and to get custom measurements for your application traffic, create a monitor in Internet Monitor. Internet Monitor example use cases This section describes several specific examples of use cases for Internet Monitor, with links to blog posts with more details. These examples illustrate how you can use the capabilities of Internet Monitor to monitor your application health and improve latency to enhance your users' experience. Set up alerts and decide on actions to take You can use Internet Monitor to get insights about average internet performance metrics over time, and about health events by city-network (client location and ASN, typically an internet service provider). Using Internet Monitor, you can identify the events that are impacting end user experience
acw-ug-597
acw-ug.pdf
597
use cases This section describes several specific examples of use cases for Internet Monitor, with links to blog posts with more details. These examples illustrate how you can use the capabilities of Internet Monitor to monitor your application health and improve latency to enhance your users' experience. Set up alerts and decide on actions to take You can use Internet Monitor to get insights about average internet performance metrics over time, and about health events by city-network (client location and ASN, typically an internet service provider). Using Internet Monitor, you can identify the events that are impacting end user experience for applications hosted on Amazon Virtual Private Clouds (VPCs), Network Load Balancers, Amazon WorkSpaces, or Amazon CloudFront. What is Internet Monitor? 2168 Amazon CloudWatch User Guide After you create a monitor, you have several options for how to be alerted about Internet Monitor health events. These include notifications based on CloudWatch Alarms using event metrics or Amazon EventBridge rules to filter for health events. You can choose different options for notifications or actions based on alarms, including, for example, AWS SMS notifications or updates to a CloudWatch log group. To see an example with detailed guidance, see the following blog post: Introducing Internet Monitor. Identify latency issues and improve TTFB to improve multiplayer gameplay experience Use Internet Monitor to help you to quickly identify where game players in global cloud gaming apps are experiencing latency issues globally, and provide insights into improving performance. By identifying where the most players currently have the slowest time to first byte (TTFB), you know how to improve latency to make your biggest player base happier. Now, when you're ready to deploy the next EC2 server for your game, choose the AWS Region that Internet Monitor suggests will lower TTFB in the area with the high latency and large group of players. For details about setting up and using Internet Monitor for this use case, see the following blog post: Using Internet Monitor for a Better Gaming Experience. Identify potential performance and internet connection issues for users on Amazon WorkSpaces Internet Monitor provides you with the IP prefixes and ASN (typically, the internet service provider or ISP) for your users, which can be helpful to diagnose performance and internet connection issues for users to their WorkSpaces. You can also use this data to view your fleet as a whole and monitor your WorkSpaces user connections. For more information about how to use Internet Monitor for this use case, see the following blog post: Using Internet Monitor with Amazon WorkSpaces Personal. Global internet weather map in Internet Monitor Internet Monitor displays a global internet weather map that is available to all AWS customers. To view the map, in the Amazon CloudWatch console, navigate to Network Monitoring, and then choose Internet monitors. What is Internet Monitor? 2169 Amazon CloudWatch User Guide The internet weather map highlights internet events ("outages") all over the world that affect AWS customers, with the specific cities and networks (ASNs, typically internet service providers) where there are issues with performance or availability. The map includes internet events from the past 24 hours. You don't need to create a monitor in Internet Monitor to view the internet weather map. Unlike health events in Internet Monitor, internet events are not specific to individual customers or their application traffic. On the internet weather map, you can choose an internet event to learn details about it. For an internet event, you can see the start time, end time (if the event is over), the current status (Active or Resolved), and the outage issue type (Availability or Performance). To learn more about how the internet weather map is created and what is included, see the global internet weather map FAQ. To view and work with detailed information that is specific to your application traffic and client locations, you can create a monitor in Internet Monitor for your application. Then, you'll see performance and availability patterns and events, current and historical, as well as get health event alerts, tailored to just your application footprint and customers. The internet weather map gives you an overall view, while a specific monitor filters the information to just the measurements and details that are relevant to your application. With a monitor, you can also explore historical metrics and get recommendations for improving client experience for your application. To learn more, see Getting started with Internet Monitor using the console. Internet Monitor cross-account observability With Internet Monitor cross-account observability, you can monitor your applications that span multiple AWS accounts within a single AWS Region. You can use Amazon CloudWatch Observability Access Manager to set up one or more of your AWS accounts as a monitoring account. You’ll provide the monitoring account with the ability to view data in your source account by creating a
acw-ug-598
acw-ug.pdf
598
are relevant to your application. With a monitor, you can also explore historical metrics and get recommendations for improving client experience for your application. To learn more, see Getting started with Internet Monitor using the console. Internet Monitor cross-account observability With Internet Monitor cross-account observability, you can monitor your applications that span multiple AWS accounts within a single AWS Region. You can use Amazon CloudWatch Observability Access Manager to set up one or more of your AWS accounts as a monitoring account. You’ll provide the monitoring account with the ability to view data in your source account by creating a sink in your monitoring account. A sink is a resource that represents an attachment point in a monitoring account. For Internet Monitor, the resource attachment point is a monitor. You use the sink to create a link from your source account to your monitoring account. For more information, see CloudWatch cross-account observability. Required resources For proper functionality of CloudWatch Application Insights cross-account observability, ensure that the following telemetry types are shared through the CloudWatch Observability Access Manager. What is Internet Monitor? 2170 Amazon CloudWatch • Monitors in Internet Monitor • Metrics in Amazon CloudWatch • Log groups in Amazon CloudWatch Logs Pricing for Internet Monitor User Guide With Internet Monitor, there are no upfront costs or long-term commitments. Pricing for Internet Monitor has two components: a per monitored resource fee and a per city-network fee. A city- network is the location where clients access your application resources from and the network (ASN, such as an internet service provider or ISP) that clients access the resources through. Note that you are also charged standard CloudWatch prices for logs and any additional metrics, dashboards, alarms, or insights that you create. You choose a percentage of traffic to monitor when you create a monitor. To help control your bill, you can also set a limit for the maximum number of city-networks to monitor. You can update the percentage of traffic to monitor or the maximum city-networks limit at any time by editing your monitor. The first 100 city-networks (across all monitors per account) are included. After that, you only pay for the actual additional number of city-networks that you monitor, up to the maximum number. You pay only the actual additional number of city-networks that you monitor, up to the maximum number, with no charge for the first 100 city-networks (across all monitors per account). A flat amount equivalent to the cost of 100 city-networks is deducted from your monthly bill. For example, a large global company could choose to monitor 100% of its internet-facing traffic, and set a city-networks maximum of 50,000, for one monitor with one resource. Assuming the traffic reached 50,000 city-networks, that portion of its bill would be around 2,700 USD/month. For another company, in fewer geographic areas, with one monitor with one resource and 200 city-networks, this portion of the bill would be around 13 USD/month. For more information, see Choose a city-networks maximum limit. You can try out different options with the pricing calculator. To explore pricing options, on the Pricing calculator for CloudWatch page, scroll down to Internet Monitor. For more information about Internet Monitor and CloudWatch pricing, see the Amazon CloudWatch pricing page. What is Internet Monitor? 2171 Amazon CloudWatch User Guide Getting started with Internet Monitor using the console To help you get started with Internet Monitor, this chapter provides the steps for creating and configuring a monitor. You create a monitor in Internet Monitor for your application by naming it, and then adding AWS resources that your application uses. You create a monitor in Internet Monitor for your application by adding AWS resources that it uses, and then setting several configuration options. The resources that you add, Amazon Virtual Private Cloud VPCs, Network Load Balancers (NLBs), CloudFront distributions, or WorkSpaces directories, provide the information for Internet Monitor to map internet traffic information for your application. After you create your monitor, wait 15-30 minutes to generate the traffic profile specific to where your application is used. Then, use the Internet Monitor dashboard, or other tools, to visualize and explore performance and availability about your client usage. These tools provide insights for you using your application traffic's measurements gathered for you by the monitor. The steps here walk you through setting up your monitor by using the console. To see examples of using the AWS Command Line Interface with the Internet Monitor API actions, to create a monitor, view events, and so on, see Examples of using the CLI with Internet Monitor. Tasks • Step 1: Create a monitor • Step 2: Configure the monitor • Step 3: View metrics and explore history • Step 4: Get suggestions to improve latency • Step 5 (Optional): Delete the monitor Step 1: Create a monitor To create
acw-ug-599
acw-ug.pdf
599
application traffic's measurements gathered for you by the monitor. The steps here walk you through setting up your monitor by using the console. To see examples of using the AWS Command Line Interface with the Internet Monitor API actions, to create a monitor, view events, and so on, see Examples of using the CLI with Internet Monitor. Tasks • Step 1: Create a monitor • Step 2: Configure the monitor • Step 3: View metrics and explore history • Step 4: Get suggestions to improve latency • Step 5 (Optional): Delete the monitor Step 1: Create a monitor To create a monitor using the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the left navigation pane, under Network Monitoring, choose Internet monitors. 3. Choose Create monitor. 4. For Monitor name, enter the name you want to use for this monitor in Internet Monitor. Getting started 2172 Amazon CloudWatch User Guide 5. Choose Add resources, and then select the resources to set the monitoring boundaries for Internet Monitor to use for this monitor. Note Be aware of the following: • To generate meaningful output with Internet Monitor, VPCs that you add must be connected to the internet by having an Internet Gateway configured. • You can add only one type of resource to a single monitor. For example, VPCs or CloudFront distributions or WorkSpaces directories, but not a combination of different types. 6. Leave the default percentage of traffic as 100%, or choose another percentage of your internet traffic to monitor. 7. Choose Create monitor. Step 2: Configure the monitor After you create a monitor, you can edit the monitor at any time, for example, to change the application traffic percentage, update the maximum city-networks limit or add or remove resources. To make updates in the Internet Monitor console, follow the procedure in this section. Note that you can’t change the name of a monitor. For more information about configuring a monitor, see Edit a monitor in Internet Monitor. To configure a monitor using the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the left navigation pane, under Network Monitoring, choose Internet monitors. 3. Choose your monitor, and then choose the Action menu. 4. Choose Update monitor. 5. Make the desired updates. For example, to change the percentage of traffic to monitor, under Application traffic to monitor, select or enter a percentage. 6. Choose Update. Getting started 2173 Amazon CloudWatch User Guide Step 3: View metrics and explore history Visualize data about your internet traffic, from an overview perspective or by drilling down into details. To visualize data and get insights for application traffic using the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the left navigation pane, under Network Monitoring, choose Internet monitors. 3. Choose a monitor to work with. 4. Choose from the following tabs: • Overview — Review a general summary of your monitor and your application traffic performance. • Health events — View current and historical health events that currently impact, or previously impacted, locations where clients access your application. • Analyze — See information about top monitored traffic in client locations (by traffic volume), summarized in several customizable ways. Visualize metrics and historical trends for health scores and metrics. In the next section, learn about how Internet Monitor provides suggestions for improving latency for your application traffic. Step 4: Get suggestions to improve latency Get suggestions for how to optimize latency, so that your clients experience the best internet performance for your application. Internet Monitor evaluates your monitored application traffic, and then makes suggestion about whether you can reduce latency, for example, by changing the AWS Regions that you've configured for your application. For more information, see Get suggestions to optimize application performance in Internet Monitor (Optimize page). To get suggestions for improving application latency using the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. Getting started 2174 Amazon CloudWatch User Guide 2. In the left navigation pane, under Network Monitoring, choose Internet monitors. 3. Choose a monitor to work with. 4. Choose Optimize, and then view the top suggestions. Step 5 (Optional): Delete the monitor If you created a monitor as a test or if you're no longer using a monitor, you can delete it. Before you can delete a monitor, you must disable it. To delete a monitor 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the left navigation pane, under Network Monitoring, choose Internet monitors. 3. Choose your monitor, and then choose the Action menu. 4. Choose Disable. 5. Choose the Action menu again, and then choose Delete. 6. Follow the guidance in the modal dialog to confirm deleting the monitor. Configure a monitor using the console This chapter includes procedures and recommendations for creating and configuring monitors in Internet Monitor. The steps provided in these
acw-ug-600
acw-ug.pdf
600
a monitor, you can delete it. Before you can delete a monitor, you must disable it. To delete a monitor 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the left navigation pane, under Network Monitoring, choose Internet monitors. 3. Choose your monitor, and then choose the Action menu. 4. Choose Disable. 5. Choose the Action menu again, and then choose Delete. 6. Follow the guidance in the modal dialog to confirm deleting the monitor. Configure a monitor using the console This chapter includes procedures and recommendations for creating and configuring monitors in Internet Monitor. The steps provided in these sections primarily use the AWS Management Console. You can also use Internet Monitor API operations with the AWS Command Line Interface (AWS CLI) or AWS SDKs to create and configure a monitor. For detailed information about working with Internet Monitor API operations, see the following resources: • If you plan to work with Internet Monitor with the CLI, see Examples of using the CLI with Internet Monitor. • For detailed information about working with Internet Monitor API operations, see the Internet Monitor API Reference. Contents • Create a monitor in Internet Monitor using the console Configure a monitor 2175 Amazon CloudWatch • Add resources to your monitor • Choose a percentage of traffic to monitor for your application User Guide • Use a monitor in Internet Monitor • Edit a monitor in Internet Monitor • Delete a monitor in Internet Monitor • Advanced configuration options for a monitor Create a monitor in Internet Monitor using the console You create a monitor in Internet Monitor to visualize and explore performance and availability data about your application's client traffic. You create a monitor by adding AWS resources that your application uses, and then setting several configuration options. The resources that you add to the monitor provide the information — for example, through resource flow logs — for Internet Monitor to learn which internet traffic is specific to your AWS application. After you create your monitor, wait 15 to 30 minutes before reviewing the monitor dashboard. Internet Monitor needs a few minutes to generate a traffic profile for where your application is used by your end users, and then to begin publishing data for your traffic. Typically, it's simplest to create one monitor in Internet Monitor for one application. Within the same monitor, you can search through and sort measurements and metrics by different locations and ASNs, or other information. You don't need to create separate monitors for applications in different areas. The steps provided here walk you through setting up your monitor by using the console. To work with Internet Monitor API actions using the AWS Command Line Interface, see Examples of using the CLI with Internet Monitor. To create a monitor using the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the left navigation pane, under Network Monitoring, choose Internet monitors. 3. Choose Create monitor. 4. For Monitor name, enter the name that you want to use for this monitor. 5. Choose Add resources, and then select the resources that will determine the internet traffic profile for this monitor. Configure a monitor 2176 Amazon CloudWatch User Guide Note Be aware of the following: • To generate meaningful output with Internet Monitor, VPCs that you add must be connected to the internet by having an Internet Gateway configured. • You can specify only one type of resource for each monitor. 6. Choose a percentage of your application's internet traffic to monitor. 7. Optionally, under Advanced settings, specify one or more of the following additional options. • City-networks maximum — The default city-networks maximum value is 500000. If you like, you can lower this limit, to restrict the number of city-networks (locations and ASNs) that Internet Monitor will monitor traffic for. You can change the city-networks maximum at any time by editing your monitor. For more information, see Choose a city-networks maximum limit. • Amazon S3 bucket storage — You can specify an Amazon S3 bucket name and custom prefix to publish internet measurements for your application's internet traffic to Amazon S3, for all monitored city-networks. Internet Monitor stores internet measurements for pairs of your client locations and ASNs, or city-networks. Internet Monitor also creates aggregated CloudWatch metrics for traffic to your application, and to each AWS Region and edge location. In addition, Internet Monitor publishes internet measurements for your application traffic to CloudWatch Logs every five minutes, to support using CloudWatch tools and other methods with your data. If you choose to publish measurements to S3, measurements are still published to CloudWatch Logs. For more information, see Publish internet measurements to Amazon S3 in Internet Monitor. • Tags — Add one or more tags for your monitor. 8. Choose Create monitor. After you create a monitor, wait about 15-30 minutes
acw-ug-601
acw-ug.pdf
601
Internet Monitor also creates aggregated CloudWatch metrics for traffic to your application, and to each AWS Region and edge location. In addition, Internet Monitor publishes internet measurements for your application traffic to CloudWatch Logs every five minutes, to support using CloudWatch tools and other methods with your data. If you choose to publish measurements to S3, measurements are still published to CloudWatch Logs. For more information, see Publish internet measurements to Amazon S3 in Internet Monitor. • Tags — Add one or more tags for your monitor. 8. Choose Create monitor. After you create a monitor, wait about 15-30 minutes for Internet Monitor to create a traffic profile and begin publishing your data. Then, you can view information about your application's internet traffic performance by navigating to the monitor dashboard in the console. Configure a monitor 2177 Amazon CloudWatch User Guide To view the Internet Monitor dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Network Monitoring, then Internet monitors. To see more information about a specific monitor, on the Monitors tab, choose a monitor. Add resources to your monitor When you create a monitor, you must associate your application's resources with it: Amazon Virtual Private Clouds (VPCs), Network Load Balancers, Amazon CloudFront distributions, Network Load Balancers (NLBs), or Amazon WorkSpaces directories. Then, Internet Monitor knows where your application's internet-facing traffic and clients are located, and it can create and maintain a traffic profile that determines the relevant measurements to publish for your monitor. You can add the following types of resources to a monitor in Internet Monitor as monitored resources. • VPCs: Each VPC that you add in a Region is a monitored resource. When you add a VPC, Internet Monitor monitors the traffic for any internet-facing application in the VPC, for example, an application hosted on an Amazon EC2 instance, behind a Network Load Balancer, or in an AWS Fargate container. • Network Load Balancers: Each NLB that you add is a monitored resource. • CloudFront distributions: Each CloudFront distribution that you add is a monitored resource. • WorkSpaces directories: Each WorkSpaces directory that you add in a Region is a monitored resource. When you monitor traffic for VPCs, traffic for applications that are hosted on load balancers behind the VPC is monitored. You can choose to monitor traffic for individual Network Load Balancer load balancers instead of monitoring a VPC with multiple load balancers. This can be helpful, for example, if you need to understand and configure features for better performance or efficiencies at the load balancer level. Or, you might need compliance information at the Network Load Balancer level. When you add resources to a monitor in Internet Monitor, be aware of the following: • Internet Monitor doesn't support adding different types of resources together in one monitor. Configure a monitor 2178 Amazon CloudWatch User Guide • To generate meaningful output with Internet Monitor, VPCs that you add must be connected to the internet by having an Internet Gateway configured. • Internet Monitor doesn't support adding different types of resources together in one monitor. • There are Regional differences for opt-in Regions to keep in mind when you add VPCs or NLBs as resources. For more information, see Supported AWS Regions for Internet Monitor. • In addition, there are differences for resources about measuring last-mile latency. For Internet Monitor latency measurements, VPCs, NLBs, and WorkSpaces directories do not include last-mile latency. Choose a percentage of traffic to monitor for your application The coverage that you choose for the percentage of application traffic to monitor determines how many city-networks (client locations and ASNs, typically internet service providers) for your application are monitored, up to an optional city-networks maximum limit that you can also set. You can choose the percentage of traffic to monitor when you create a monitor, or, with an existing monitor, by choosing Edit monitor on any Internet Monitor dashboard page in the console. If you choose to monitor less than 100% of your application traffic, you might have an observability gap in with your monitor. That's because if there are health events that Internet Monitor creates where you aren't monitoring traffic, you won't be aware of those issues. With a traffic percentage set to less than 100%, you might also have less coverage for the performance and availability score information about client access to your application. The following sections describe options to explore traffic percentage settings and coverage, and to get an idea about the impact of increasing or decreasing coverage. • Explore changing your application traffic percentage • View the number of city-networks monitored at different traffic percentage settings Explore changing your application traffic percentage You can explore values that you might want to change your application traffic percentage to, by viewing the number of city-networks monitored
acw-ug-602
acw-ug.pdf
602
With a traffic percentage set to less than 100%, you might also have less coverage for the performance and availability score information about client access to your application. The following sections describe options to explore traffic percentage settings and coverage, and to get an idea about the impact of increasing or decreasing coverage. • Explore changing your application traffic percentage • View the number of city-networks monitored at different traffic percentage settings Explore changing your application traffic percentage You can explore values that you might want to change your application traffic percentage to, by viewing the number of city-networks monitored when you change the percentage. The procedure in this section provides step-by-step information. In the Internet Monitor console, you can try increasing or decreasing the application traffic percentage for your monitor, and view the estimated number of your city-networks that would Configure a monitor 2179 Amazon CloudWatch User Guide be covered as a result. With this option, you can quickly see how changing your traffic percentage affects the number of city-monitors are monitored. This can help you to get a feel for what a good application traffic percentage to choose might be, for your application. To explore monitoring coverage and update percentage of traffic monitored 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the left navigation pane, under Network Monitoring, choose Internet monitors. In your list of monitors, choose a monitor. 4. On the Configure tab, in the View and evaluate traffic coverage section, you can evaluate the impact on the total number of city-networks that are monitored, depending on a traffic percentage that you choose. You can also update the percentage of traffic that you monitor or change the city-networks limit for your monitor. • Explore traffic percentage options: Under Compare options for traffic coverage, in the drop-down menu, choose one or more traffic percentages to graph and compare. For each traffic percentage that you choose, you can see the number of city-networks that will be monitored when you set that traffic percentage coverage. To learn more, see View number of city-networks monitored at different percentages. • Change monitoring coverage: Under Explore other traffic coverage options, choose Update monitoring coverage. In the Explore and set traffic monitoring coverage dialog, click the arrows to increase or decrease the percentage of traffic to monitor. By choosing 100% traffic, you can see how many city-networks are monitored with full coverage for monitoring your application. Note: To learn more about how the number of city-networks monitored (estimated here) might affect your costs, choose the link to the CloudWatch Pricing calculator, and then scroll down to Internet Monitor. To set a new percentage of traffic to monitor, choose Update monitor coverage. Or, to keep the current coverage level, choose Cancel. Configure a monitor 2180 Amazon CloudWatch User Guide View the number of city-networks monitored at different traffic percentage settings You can view the number of city-networks that would be monitored for your application at different application traffic percentages. The procedure in this section provides step-by-step information. In the Internet Monitor console, you can view graphs that show how coverage for your city- networks would change at different of application traffic percentages, over a time interval that you specify. This is a quick way to visualize and compare the monitoring coverage for your application at specific traffic percentages, all on one graph. To view graphs of application traffic percentage and corresponding city-networks coverage 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the left navigation pane, under Network Monitoring, choose Internet monitors. In your list of monitors, choose a monitor. 4. Choose the Configure page, and scroll down to Traffic coverage. 5. Under Compare options for traffic coverage, in the drop-down list, select one or more percentages. You can choose one or more application traffic percentages, and the graph of Total monitored city-networks is updated to display the monitoring coverage Internet Monitor provides for that traffic percentage. By choosing City-networks at 100% traffic, you can see how many city-networks are monitored with full coverage for monitoring your application. Keep in mind the following: • Traffic coverage is computed based on the number of city-networks in the previous hour of your application traffic. This means that, after you choose a specific percentage of traffic to monitor, fewer city-networks might be monitored for your application than is shown here in a traffic coverage comparison graph. • To make sure that all your application traffic is monitored, set TrafficPercentageToMonitor to 100 and don’t set MaxCityNetworksToMonitor. Alternatively, you can set MaxCityNetworksToMonitor to 500,000, the upper limit in Internet Monitor. • If you set a city-networks maximum limit, the total number of monitored city-networks never exceeds that limit, regardless of the application traffic percentage option that you select. • You can learn more about how the number
acw-ug-603
acw-ug.pdf
603
This means that, after you choose a specific percentage of traffic to monitor, fewer city-networks might be monitored for your application than is shown here in a traffic coverage comparison graph. • To make sure that all your application traffic is monitored, set TrafficPercentageToMonitor to 100 and don’t set MaxCityNetworksToMonitor. Alternatively, you can set MaxCityNetworksToMonitor to 500,000, the upper limit in Internet Monitor. • If you set a city-networks maximum limit, the total number of monitored city-networks never exceeds that limit, regardless of the application traffic percentage option that you select. • You can learn more about how the number of city-networks monitored might affect your costs. On the Pricing calculator for CloudWatch page, scroll down to Internet Monitor. Configure a monitor 2181 Amazon CloudWatch User Guide To set a new percentage of traffic to monitor, under Explore other traffic coverage options, choose Update monitoring coverage. In the dialog, choose a percentage of traffic, and then choose Update monitor coverage. Use a monitor in Internet Monitor There are several ways to use an Internet Monitor monitor after you create it: for example, you can view information in the CloudWatch dashboard, get information by using the AWS Command Line Interface, and set health alerts. Your monitor provides information about your application and configuration preferences so that Internet Monitor can customize measurements and metrics to publish in events for you. Internet Monitor collects measurements from the global infrastructure footprint for AWS. These measurements are a tremendous amount of network performance and availability information, from all over the world. By using information from the resources that you add for your application, Internet Monitor publishes performance and availability measurements for you that is scoped to the city-networks (that is, client locations and ASNs, typically internet service providers or ISPs) where your application is active. So, the measurements and metrics in the Internet Monitor dashboard and in CloudWatch Logs —about availability, performance, monitored bytes transferred, and round-trip time—are specific to your client locations and ASNs. Internet Monitor also determines when there are anomalies in performance and availability. By default, Internet Monitor overlays your traffic with the availability and performance measurements that AWS has collected for each source-destination pair in your client locations, to determine when there are notable drops in performance or availability. When there's significant degradation for your application's locations and scope, Internet Monitor generates a health event, and publishes information about the issue to your monitor. After you create a monitor, you can use it to access or be alerted to the information that Internet Monitor provides, in the following ways: • Use the CloudWatch dashboard to view and explore performance, availability, and health events; explore your application's historical data; and get insights into new ways to configure your application for better performance. To learn more, see the following: • Track real-time performance and availability in Internet Monitor (Overview page) • Analyze historical data in Internet Monitor (Analyze page) • Get suggestions to optimize application performance in Internet Monitor (Optimize page) Configure a monitor 2182 Amazon CloudWatch User Guide • Configure health event thresholds to change what triggers Internet Monitor to create a health event for your application. You can configure overall thresholds and local (city-network) thresholds. To learn more, see Change health event thresholds. • Use AWS CLI commands with Internet Monitor API actions to view traffic profile information, view measurements, list health events, and so on. To learn more, see Examples of using the CLI with Internet Monitor. • Use standard CloudWatch tools, such as CloudWatch Contributor Insights, CloudWatch Metrics explorer, and CloudWatch Logs Insights to visualize the data in CloudWatch. To learn more, see Exploring your data with CloudWatch tools and the Internet Monitor query interface. • Use Athena with S3 logs to access and analyze Internet Monitor internet measurements for your application, if you turned on publishing measurements to S3. • Create Amazon EventBridge notifications to alert you when Internet Monitor determines there is a health event. To learn more, see Using Internet Monitor with Amazon EventBridge. • Receive an AWS Health Dashboard notification automatically, when Internet Monitor determines that an issue is caused by the AWS network. The notification includes the steps that AWS is taking to mitigate the problem. Edit a monitor in Internet Monitor Using the Action menu, you can edit a monitor in Amazon CloudWatch Internet Monitor after you create it. For example, you can edit a monitor to do the following: • Change the percentage of application traffic to monitor • Set or update the city-networks maximum limit • Change health event thresholds for availability or performance scores • Add or remove resources • Enable or update publishing events to Amazon S3 Note that you can't change the name of a monitor after you create it. To make changes to a monitor, use the
acw-ug-604
acw-ug.pdf
604
the problem. Edit a monitor in Internet Monitor Using the Action menu, you can edit a monitor in Amazon CloudWatch Internet Monitor after you create it. For example, you can edit a monitor to do the following: • Change the percentage of application traffic to monitor • Set or update the city-networks maximum limit • Change health event thresholds for availability or performance scores • Add or remove resources • Enable or update publishing events to Amazon S3 Note that you can't change the name of a monitor after you create it. To make changes to a monitor, use the following procedure. To edit a monitor 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. Configure a monitor 2183 Amazon CloudWatch User Guide 2. In the left navigation pane, under Network Monitoring, choose Internet monitors. 3. Choose your monitor, and then choose the Action menu. 4. Choose Update monitor. 5. Make the desired updates. For example, to change the percentage of traffic to monitor, under Application traffic to monitor, select or enter a percentage. 6. Choose Update. For more information about the options that you can update, see the following: • To learn more about resources that you add in Internet Monitor, see Add resources to your monitor. • To learn more about the application traffic percentage, see Choose a percentage of traffic to monitor for your application. • To learn more about changing the threshold for health events, see Change health event thresholds. • To learn more about the city-networks maximum limit, see Choose a city-networks maximum limit. • To learn more about opting to publish events to S3, see Publish internet measurements to Amazon S3 in Internet Monitor. Delete a monitor in Internet Monitor Using the Action menu, you can delete a monitor in Amazon CloudWatch Internet Monitor. You first disable the monitor, and then delete it. To delete a monitor 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the left navigation pane, under Network monitoring, choose Internet Monitor. 3. Choose your monitor, and then choose the Action menu. 4. Choose Disable. 5. Choose the Action menu again, and then choose Delete. Configure a monitor 2184 Amazon CloudWatch User Guide Advanced configuration options for a monitor This section provides the steps for configuring advanced options for a monitor in Internet Monitor. These configuration options are optional but can be useful in some scenarios. For example, you might choose to set a city-network maximum limit if traffic for the application that you monitor with Internet Monitor occasionally spikes, and you want to help make sure that your bill for Internet Monitor is predictable. Or, you might want to set custom or local thresholds for health events, because you want to pay close attention to issues in specific geographies where you have a concentration of clients. The topics in this section provide detailed descriptions of each feature, and list the steps to configure options for your needs. Contents • Choose a city-networks maximum limit • Change health event thresholds for a monitor • Publish internet measurements to Amazon S3 in Internet Monitor Choose a city-networks maximum limit In addition to setting a traffic percentage for your monitor in Internet Monitor, you can also set a maximum limit for the number of city-networks monitored. This section describes how the city- networks limit can help you manage billing costs, and provides information and an example to help you determine a limit to set, if you choose to set one. Internet Monitor can monitor traffic for some or all of the locations where clients access your AWS application resources. You can set a monitoring limit for the number of city-networks, that is, the client locations and the ASNs (typically internet service providers) that clients access your application through. You choose a percentage of application traffic to monitor when you create your monitor. The default percentage is 100%. You can update the percentage at any time, by editing the monitor. The maximum limit that you set for the number of city-networks helps to make sure that your bill is predictable. For more information, see Amazon CloudWatch Pricing. You can also learn how different values for the number of city-networks actually monitored can affect your bill by using Configure a monitor 2185 Amazon CloudWatch User Guide the CloudWatch price calculator. To explore options, on the Pricing calculator for CloudWatch page, scroll down to Internet Monitor. To update your monitor and change the maximum city-networks limit, see Edit a monitor in Internet Monitor. How billing works with city-networks maximum limits Setting a maximum limit for the number of city-networks monitored can help prevent unexpected costs in your bill. This is useful, for example, if your traffic patterns vary widely. Billing costs increase for each city-network that is monitored after the first 100 city-networks, which are included (across
acw-ug-605
acw-ug.pdf
605
by using Configure a monitor 2185 Amazon CloudWatch User Guide the CloudWatch price calculator. To explore options, on the Pricing calculator for CloudWatch page, scroll down to Internet Monitor. To update your monitor and change the maximum city-networks limit, see Edit a monitor in Internet Monitor. How billing works with city-networks maximum limits Setting a maximum limit for the number of city-networks monitored can help prevent unexpected costs in your bill. This is useful, for example, if your traffic patterns vary widely. Billing costs increase for each city-network that is monitored after the first 100 city-networks, which are included (across all monitors per account). If you set a city-networks maximum limit, it caps the number of city-networks that Internet Monitor monitors for your application, regardless of the percentage of traffic that you choose to monitor. You only pay for the number of city-networks that are actually monitored. The city-network maximum limit that you choose lets you set a cap on the total that can be included when Internet Monitor monitors traffic with your monitor. You can change the maximum limit at any time by editing your monitor. To explore options, on the Pricing calculator for CloudWatch page, scroll down to Internet Monitor. For more information on Internet Monitor pricing, see the Internet Monitor section on the Amazon CloudWatch Pricing page. How to choose a city-networks maximum limit Optionally, you can set a city-networks maximum limit. To help you decide on a maximum limit that you might want to select, consider how much traffic you want to monitor for your application. Be aware that if you choose 100% for the traffic percentage to monitor for your monitor, and then specify a city-networks maximum limit, depending on the limit that you choose, you might not monitor 100% of your application traffic. The city-networks maximum that you set takes precedence over the traffic percentage to monitor that you set. To view how the percentage of traffic to monitor that you choose affects the number of city- monitors that are included for your application monitoring, which can help you decide whether to set a city-networks maximum limit, follow the steps in View the number of city-networks monitored at different traffic percentage settings. To explore your options in more detail, you can use Internet Monitor metrics, as described in the following examples. These examples show how to select a maximum city-networks limit that is best for you, depending on the breadth of application internet traffic coverage you want. Using the Configure a monitor 2186 Amazon CloudWatch User Guide queries for Internet Monitor metrics in CloudWatch Metrics can help you understand more about your application internet traffic coverage. Example of determining a city-networks maximum limit As an example, say that you've set a monitoring maximum limit of 100 city-networks and that your application is accessed by clients across 2637 city-networks. In CloudWatch Metrics, you'd see the following Internet Monitor metrics returned: CityNetworksMonitored 100 TrafficMonitoredPercent 12.5 CityNetworksFor90PercentTraffic 2143 CityNetworksFor100PercentTraffic 2637 From this example, you can see that you're currently monitoring 12.5% of your internet traffic, with the maximum limit set to 100 city-networks. If you want to monitor 90% of your traffic, the next metric provides information about that: CityNetworksFor90PercentTraffic indicates that you would need to monitor 2,143 city-networks for 90% coverage. To do that, you would update your monitor and set the maximum city-networks limit to 2,143. Similarly, say you'd like to have 100% internet traffic monitoring for your application. The next metric, CityNetworksFor100PercentTraffic, indicates that to do this, you should update your monitor to set the maximum city-networks limit to 2,637. If you now set the maximum to 5,000 city-networks, since that's greater than 2,637, you see the following metrics returned: CityNetworksMonitored 2637 TrafficMonitoredPercent 100 CityNetworksFor90PercentTraffic 2143 CityNetworksFor100PercentTraffic 2637 From these metrics, you can see that with the higher limit, you monitor all 2,637 city-networks, which is 100% of your internet traffic. Change health event thresholds for a monitor Internet Monitor uses a default threshold to determine when to create a health event for your monitor. Optionally, you can change that default global threshold, to set another value. You can also set local threshold. This section describes how global and local thresholds work together, and provides steps for setting custom thresholds. Configure a monitor 2187 Amazon CloudWatch User Guide You can change the overall threshold that triggers Internet Monitor to create a health event. The default health event threshold, for both performance scores and availability scores, is 95%. That is, when the overall performance or availability score for your application falls to 95% or below, Internet Monitor creates a health event. For the overall threshold, the health event can be triggered by a single large issue, or by the combination of multiple smaller issues. You can also change the local—that is, city-network—threshold, combined with a
acw-ug-606
acw-ug.pdf
606
provides steps for setting custom thresholds. Configure a monitor 2187 Amazon CloudWatch User Guide You can change the overall threshold that triggers Internet Monitor to create a health event. The default health event threshold, for both performance scores and availability scores, is 95%. That is, when the overall performance or availability score for your application falls to 95% or below, Internet Monitor creates a health event. For the overall threshold, the health event can be triggered by a single large issue, or by the combination of multiple smaller issues. You can also change the local—that is, city-network—threshold, combined with a percentage of the overall level of impact, that—in combination—will trigger a health event. By setting a threshold that creates a health event when a score drops below the threshold for one or more city- networks (locations and ASNs, typically ISPs), you can get insights into when there are issues in locations with lower traffic, for example. An additional local threshold option works together with the local threshold for availability or performance scores. The second factor is the percentage of your overall traffic that must be impacted before Internet Monitor creates a health event based on the local threshold. By configuring the threshold options for overall traffic and local traffic, you can fine-tune how frequently health events are created, to align with your application usage and your needs. Be aware that when you set the local threshold to be lower, typically more health events are created, depending on your application and the other threshold configuration values that you set. In summary, you can configure health event thresholds—for performance scores, availability scores, or both—in the following ways: • Choose different global thresholds for triggering a health event. • Choose different local thresholds for triggering a health event. With this option, you can also change the percentage of impact on your overall application that must be exceeded before Internet Monitor creates an event. • Choose to turn off triggering a health event based on local thresholds, or enable local threshold options. To update health event thresholds for performance scores, availability scores, or both, follow these steps. To change threshold configuration options 1. In the AWS Management Console, navigate to CloudWatch, and then, in the left navigation pane, choose Internet Monitor. Configure a monitor 2188 Amazon CloudWatch User Guide 2. On the Configure page, in the Health event thresholds section, choose Update thresholds. 3. On the Set health event thresholdpage, choose the new values and options that you want for thresholds and other options that trigger Internet Monitor to create a health event. You can do any of the following: • Choose a new value for Availability score threshold, Performance score threshold, or both. The graphs in the sections for each setting display the current threshold setting and the actual recent health event scores, for availability or performance, for your application. By viewing the typical values, you can get an idea of values that you might want to change a threshold to. Tip: To view a larger graph and change the timeframe, choose the expander in the upper right corner of the graph. • Choose to turn on or off a local threshold for availability or performance, or both. When an option is enabled, you can set the threshold and impact level for when you want Internet Monitor to create a health event. 4. After you configure threshold options, save your updates by choosing Update health event thresholds. To learn more about how health events work, see When Internet Monitor creates and resolves health events. Publish internet measurements to Amazon S3 in Internet Monitor You can choose to have Internet Monitor publish internet measurements to Amazon S3 for your internet-facing traffic to the monitored city-networks (client locations and ASNs, typically internet service providers) in your monitor, up to the 500,000 city-networks service limit. Internet Monitor automatically publishes internet measurements to CloudWatch Logs every five minutes for the top 500 (by traffic volume) city-networks for each monitor. Measurements that it publishes to S3 include the top 500 that are published to CloudWatch Logs. You can choose the option to publish to S3, and specify the bucket to publish the measurements, to when you create or update your monitor. The bucket must already be created in S3 before you can specify it in Internet Monitor. There's a service limit of 500,000 city-networks for internet measurements published to S3. Internet Monitor publishes internet measurements to S3 as events, a series of compressed log file objects that are stored in the bucket. Configure a monitor 2189 Amazon CloudWatch User Guide When you create the S3 bucket for Internet Monitor to publish measurements to, make sure that you follow the permissions guidance provided by CloudWatch Logs. Doing so ensures that Internet Monitor can publish logs directly to S3, and
acw-ug-607
acw-ug.pdf
607
update your monitor. The bucket must already be created in S3 before you can specify it in Internet Monitor. There's a service limit of 500,000 city-networks for internet measurements published to S3. Internet Monitor publishes internet measurements to S3 as events, a series of compressed log file objects that are stored in the bucket. Configure a monitor 2189 Amazon CloudWatch User Guide When you create the S3 bucket for Internet Monitor to publish measurements to, make sure that you follow the permissions guidance provided by CloudWatch Logs. Doing so ensures that Internet Monitor can publish logs directly to S3, and that AWS can, if needed, create and change the resource policies associated with the log group receiving the logs. For more information, see Logs sent to CloudWatch Logs in the Amazon CloudWatch Logs User Guide. The published log files are compressed. If you open the log files using the Amazon S3 console, they are decompressed and the internet measurement events are displayed. If you download the files, you must decompress them to view the events. You can also query the internet measurements in the log files using Amazon Athena. Amazon Athena is an interactive query service that makes it easier to analyze data in Amazon S3, by using standard SQL. For more information, see Use Amazon Athena to query internet measurements in Amazon S3 log files. Examples of using the CLI with Internet Monitor This section includes examples for using the AWS Command Line Interface with Internet Monitor operations. Before you begin, make sure that you log in to use the AWS CLI with the same AWS account that has the Amazon VPC VPCs, Network Load Balancers, Amazon CloudFront distributions, or Amazon WorkSpaces directories that you want to monitor. Internet Monitor doesn't support accessing resources across accounts. For more information about using the AWS CLI, see the AWS CLI Command Reference. For more information about using API actions with Internet Monitor, see the Internet Monitor API Reference Guide. Topics • Create a monitor • View monitor details • List health events • View specific health event • View monitor list • Edit monitor • Delete monitor Examples with the CLI 2190 Amazon CloudWatch Create a monitor User Guide When you create a monitor in Internet Monitor, you provide a name and associate resources with the monitor to show where your application's internet traffic is. You specify a traffic percentage that defines how much of your application traffic is monitored. That also determines the number of city-networks, that is, client locations and ASNs, typically internet service providers or ISPs, that are monitored. You can also opt to set a limit for the maximum number of city-networks to monitor for your application resources, to help control your bill. For more information, see Choose a city- networks maximum limit. Finally, you can choose if you want to publish all internet measurements for your application to Amazon S3. Internet measurements for the top 500 city-networks (by traffic volume) are automatically published to CloudWatch Logs by Internet Monitor, but you can choose to publish all measurements to S3 as well. To create a monitor with the AWS CLI, you use the create-monitor command. The following command creates a monitor that monitors 100% of traffic but sets a maximum city-networks limit of 10,000, adds a VPC resource, and opts to publish internet measurements to Amazon S3. Note Internet Monitor publishes to CloudWatch Logs internet measurements every five minutes for the top 500 city-networks (client locations and ASNs, typically internet service providers or ISPs) that send traffic to each monitor. Optionally, you can choose to publish internet measurements for all monitored city-networks (up to the 500,000 city-networks service limit) to an Amazon S3 bucket. For more information, see Publish internet measurements to Amazon S3 in Internet Monitor. aws internetmonitor create-monitor --monitor-name "TestMonitor" \ --traffic-percentage-to-monitor 100 \ --max-city-networks-to-monitor 10000 \ --resources "arn:aws:ec2:us-east-1:111122223333:vpc/vpc-11223344556677889" \ --internet-measurements-log-delivery S3Config="{BucketName=amzn-s3-demo- bucket,LogDeliveryStatus=ENABLED}" { "Arn": "arn:aws:internetmonitor:us-east-1:111122223333:monitor/TestMonitor", "Status": "ACTIVE" Examples with the CLI 2191 Amazon CloudWatch } Note You can't change the name of a monitor. View monitor details User Guide To view information about a monitor with the AWS CLI, you use the get-monitor command. aws internetmonitor get-monitor --monitor-name "TestMonitor" { "ClientLocationType": "city", "CreatedAt": "2022-09-22T19:27:47Z", "ModifiedAt": "2022-09-22T19:28:30Z", "MonitorArn": "arn:aws:internetmonitor:us-east-1:111122223333:monitor/TestMonitor", "MonitorName": "TestMonitor", "ProcessingStatus": "OK", "ProcessingStatusInfo": "The monitor is actively processing data", "Resources": [ "arn:aws:ec2:us-east-1:111122223333:vpc/vpc-11223344556677889" ], "MaxCityNetworksToMonitor": 10000, "Status": "ACTIVE" } List health events When performance degrades for your application's internet traffic, Internet Monitor creates health events in your monitor. To see a list of current health events with the AWS CLI, use the list- health-events command. aws internetmonitor list-health-events --monitor-name "TestMonitor" { "HealthEvents": [ { "EventId": "2022-06-20T01-05-05Z/latency", Examples with the CLI 2192 Amazon CloudWatch User Guide "Status": "RESOLVED", "EndedAt": "2022-06-20T01:15:14Z", "ServiceLocations": [ { "Name": "us-east-1" } ], "PercentOfTotalTrafficImpacted": 1.21, "ClientLocations": [ { "City": "Lockport", "PercentOfClientLocationImpacted": 60.370000000000005,
acw-ug-608
acw-ug.pdf
608
"ModifiedAt": "2022-09-22T19:28:30Z", "MonitorArn": "arn:aws:internetmonitor:us-east-1:111122223333:monitor/TestMonitor", "MonitorName": "TestMonitor", "ProcessingStatus": "OK", "ProcessingStatusInfo": "The monitor is actively processing data", "Resources": [ "arn:aws:ec2:us-east-1:111122223333:vpc/vpc-11223344556677889" ], "MaxCityNetworksToMonitor": 10000, "Status": "ACTIVE" } List health events When performance degrades for your application's internet traffic, Internet Monitor creates health events in your monitor. To see a list of current health events with the AWS CLI, use the list- health-events command. aws internetmonitor list-health-events --monitor-name "TestMonitor" { "HealthEvents": [ { "EventId": "2022-06-20T01-05-05Z/latency", Examples with the CLI 2192 Amazon CloudWatch User Guide "Status": "RESOLVED", "EndedAt": "2022-06-20T01:15:14Z", "ServiceLocations": [ { "Name": "us-east-1" } ], "PercentOfTotalTrafficImpacted": 1.21, "ClientLocations": [ { "City": "Lockport", "PercentOfClientLocationImpacted": 60.370000000000005, "PercentOfTotalTraffic": 2.01, "Country": "United States", "Longitude": -78.6913, "AutonomousSystemNumber": 26101, "Latitude": 43.1721, "Subdivision": "New York", "NetworkName": "YAHOO-BF1" } ], "StartedAt": "2022-06-20T01:05:05Z", "ImpactType": "PERFORMANCE", "EventArn": "arn:aws:internetmonitor:us-east-1:111122223333:monitor/ TestMonitor/health-event/2022-06-20T01-05-05Z/latency" }, { "EventId": "2022-06-20T01-17-56Z/latency", "Status": "RESOLVED", "EndedAt": "2022-06-20T01:30:23Z", "ServiceLocations": [ { "Name": "us-east-1" } ], "PercentOfTotalTrafficImpacted": 1.29, "ClientLocations": [ { "City": "Toronto", "PercentOfClientLocationImpacted": 75.32, "PercentOfTotalTraffic": 1.05, "Country": "Canada", "Longitude": -79.3623, "AutonomousSystemNumber": 14061, Examples with the CLI 2193 Amazon CloudWatch User Guide "Latitude": 43.6547, "Subdivision": "Ontario", "CausedBy": { "Status": "ACTIVE", "Networks": [ { "AutonomousSystemNumber": 16509, "NetworkName": "Amazon.com" } ], "NetworkEventType": "AWS" }, "NetworkName": "DIGITALOCEAN-ASN" }, { "City": "Lockport", "PercentOfClientLocationImpacted": 22.91, "PercentOfTotalTraffic": 2.01, "Country": "United States", "Longitude": -78.6913, "AutonomousSystemNumber": 26101, "Latitude": 43.1721, "Subdivision": "New York", "NetworkName": "YAHOO-BF1" }, { "City": "Hangzhou", "PercentOfClientLocationImpacted": 2.88, "PercentOfTotalTraffic": 0.7799999999999999, "Country": "China", "Longitude": 120.1612, "AutonomousSystemNumber": 37963, "Latitude": 30.2994, "Subdivision": "Zhejiang", "NetworkName": "Hangzhou Alibaba Advertising Co.,Ltd." } ], "StartedAt": "2022-06-20T01:17:56Z", "ImpactType": "PERFORMANCE", "EventArn": "arn:aws:internetmonitor:us-east-1:111122223333:monitor/ TestMonitor/health-event/2022-06-20T01-17-56Z/latency" }, { "EventId": "2022-06-20T01-34-20Z/latency", Examples with the CLI 2194 Amazon CloudWatch User Guide "Status": "RESOLVED", "EndedAt": "2022-06-20T01:35:04Z", "ServiceLocations": [ { "Name": "us-east-1" } ], "PercentOfTotalTrafficImpacted": 1.15, "ClientLocations": [ { "City": "Lockport", "PercentOfClientLocationImpacted": 39.45, "PercentOfTotalTraffic": 2.01, "Country": "United States", "Longitude": -78.6913, "AutonomousSystemNumber": 26101, "Latitude": 43.1721, "Subdivision": "New York", "NetworkName": "YAHOO-BF1" }, { "City": "Toronto", "PercentOfClientLocationImpacted": 29.770000000000003, "PercentOfTotalTraffic": 1.05, "Country": "Canada", "Longitude": -79.3623, "AutonomousSystemNumber": 14061, "Latitude": 43.6547, "Subdivision": "Ontario", "CausedBy": { "Status": "ACTIVE", "Networks": [ { "AutonomousSystemNumber": 16509, "NetworkName": "Amazon.com" } ], "NetworkEventType": "AWS" }, "NetworkName": "DIGITALOCEAN-ASN" }, { "City": "Hangzhou", "PercentOfClientLocationImpacted": 2.88, Examples with the CLI 2195 Amazon CloudWatch User Guide "PercentOfTotalTraffic": 0.7799999999999999, "Country": "China", "Longitude": 120.1612, "AutonomousSystemNumber": 37963, "Latitude": 30.2994, "Subdivision": "Zhejiang", "NetworkName": "Hangzhou Alibaba Advertising Co.,Ltd." } ], "StartedAt": "2022-06-20T01:34:20Z", "ImpactType": "PERFORMANCE", "EventArn": "arn:aws:internetmonitor:us-east-1:111122223333:monitor/ TestMonitor/health-event/2022-06-20T01-34-20Z/latency" } ] } View specific health event To see a more detailed information about a specific health event with the CLI, run the get- health-event command with your monitor name and a health event ID. aws internetmonitor get-monitor --monitor-name "TestMonitor" --event-id "health-event/ TestMonitor/2021-06-03T01:02:03Z/latency" { "EventId": "2022-06-20T01-34-20Z/latency", "Status": "RESOLVED", "EndedAt": "2022-06-20T01:35:04Z", "ServiceLocations": [ { "Name": "us-east-1" } ], "EventArn": "arn:aws:internetmonitor:us-east-1:111122223333:monitor/TestMonitor/ health-event/2022-06-20T01-34-20Z/latency", "LastUpdatedAt": "2022-06-20T01:35:04Z", "ClientLocations": [ { "City": "Lockport", "PercentOfClientLocationImpacted": 39.45, "PercentOfTotalTraffic": 2.01, Examples with the CLI 2196 Amazon CloudWatch User Guide "Country": "United States", "Longitude": -78.6913, "AutonomousSystemNumber": 26101, "Latitude": 43.1721, "Subdivision": "New York", "NetworkName": "YAHOO-BF1" }, { "City": "Toronto", "PercentOfClientLocationImpacted": 29.770000000000003, "PercentOfTotalTraffic": 1.05, "Country": "Canada", "Longitude": -79.3623, "AutonomousSystemNumber": 14061, "Latitude": 43.6547, "Subdivision": "Ontario", "CausedBy": { "Status": "ACTIVE", "Networks": [ { "AutonomousSystemNumber": 16509, "NetworkName": "Amazon.com" } ], "NetworkEventType": "AWS" }, "NetworkName": "DIGITALOCEAN-ASN" }, { "City": "Shenzhen", "PercentOfClientLocationImpacted": 4.07, "PercentOfTotalTraffic": 0.61, "Country": "China", "Longitude": 114.0683, "AutonomousSystemNumber": 37963, "Latitude": 22.5455, "Subdivision": "Guangdong", "NetworkName": "Hangzhou Alibaba Advertising Co.,Ltd." }, { "City": "Hangzhou", "PercentOfClientLocationImpacted": 2.88, "PercentOfTotalTraffic": 0.7799999999999999, "Country": "China", Examples with the CLI 2197 Amazon CloudWatch User Guide "Longitude": 120.1612, "AutonomousSystemNumber": 37963, "Latitude": 30.2994, "Subdivision": "Zhejiang", "NetworkName": "Hangzhou Alibaba Advertising Co.,Ltd." } ], "StartedAt": "2022-06-20T01:34:20Z", "ImpactType": "PERFORMANCE", "PercentOfTotalTrafficImpacted": 1.15 } View monitor list To see a list of all monitors in your account with the CLI, run the list-monitors command. aws internetmonitor list-monitors { "Monitors": [ { "MonitorName": "TestMonitor", "ProcessingStatus": "OK", "Status": "ACTIVE" } ], "NextToken": " zase12" } Edit monitor To update information about your monitor by using the CLI, use the update-monitor command and specify the name of the monitor to update. For example, you can update the percentage of traffic to monitor, the limit of the maximum number of city-networks to monitor, add or remove the resources that Internet Monitor uses to monitor traffic, and change the monitor status from ACTIVE to INACTIVE, or vice versa. Note that you can't change the name of the monitor. The response for an update-monitor call returns just the MonitorArn and the Status. The following example shows how to use the update-monitor command to change the maximum number of city-networks to monitor to 50000: Examples with the CLI 2198 Amazon CloudWatch User Guide aws internetmonitor update-monitor --monitor-name "TestMonitor" --max-city-networks-to- monitor 50000 { "MonitorArn": "arn:aws:internetmonitor:us-east-1:111122223333:monitor/TestMonitor", "Status": " ACTIVE " } The following example shows how to add and remove resources: aws internetmonitor update-monitor --monitor-name "TestMonitor" \ --resources-to-add "arn:aws:ec2:us-east-1:111122223333:vpc/vpc-11223344556677889" \ --resources-to-remove "arn:aws:ec2:us-east-1:111122223333:vpc/vpc-2222444455556666" { "MonitorArn": "arn:aws:internetmonitor:us-east-1:111122223333:monitor/TestMonitor", "Status": "ACTIVE" } The following example shows how to use the update-monitor command to change the monitor status to INACTIVE: aws internetmonitor update-monitor --monitor-name "TestMonitor" --status "INACTIVE" { "MonitorArn": "arn:aws:internetmonitor:us-east-1:111122223333:monitor/TestMonitor", "Status": "INACTIVE" } Delete monitor You
acw-ug-609
acw-ug.pdf
609
use the update-monitor command to change the maximum number of city-networks to monitor to 50000: Examples with the CLI 2198 Amazon CloudWatch User Guide aws internetmonitor update-monitor --monitor-name "TestMonitor" --max-city-networks-to- monitor 50000 { "MonitorArn": "arn:aws:internetmonitor:us-east-1:111122223333:monitor/TestMonitor", "Status": " ACTIVE " } The following example shows how to add and remove resources: aws internetmonitor update-monitor --monitor-name "TestMonitor" \ --resources-to-add "arn:aws:ec2:us-east-1:111122223333:vpc/vpc-11223344556677889" \ --resources-to-remove "arn:aws:ec2:us-east-1:111122223333:vpc/vpc-2222444455556666" { "MonitorArn": "arn:aws:internetmonitor:us-east-1:111122223333:monitor/TestMonitor", "Status": "ACTIVE" } The following example shows how to use the update-monitor command to change the monitor status to INACTIVE: aws internetmonitor update-monitor --monitor-name "TestMonitor" --status "INACTIVE" { "MonitorArn": "arn:aws:internetmonitor:us-east-1:111122223333:monitor/TestMonitor", "Status": "INACTIVE" } Delete monitor You can delete a monitor with the CLI by using the delete-monitor command. First, you must set the monitor to be inactive. To do that, use the update-monitor command to change the status to INACTIVE. Confirm that the monitor is inactive by using the get-monitor command and checking the status. When the monitor status is INACTIVE, then you can use the CLI to run the delete-monitor command to delete the monitor. The response for a successful delete-monitor call is empty. Examples with the CLI 2199 Amazon CloudWatch User Guide aws internetmonitor delete-monitor --monitor-name "TestMonitor" {} Monitor and optimize with the Internet Monitor dashboard Using the Internet Monitor dashboard in the AWS Management Console, you can visualize data and get insights and suggestions about your AWS application's internet traffic, and configure options for your monitor. After you create a monitor to monitor your application's internet performance and availability, Internet Monitor stores internet measurements for pairs of your client locations and ASNs, or city-networks. Internet Monitor also creates aggregated CloudWatch metrics for traffic to your application, and to each AWS Region and edge location. You can filter, explore, and get action- oriented suggestions from your monitor's information in several different ways. The Internet Monitor dashboard guides you through viewing and getting insights about the data for your monitored traffic. To get started, on the CloudWatch console, under Network Monitoring, choose Internet monitors. Then, select a monitor to work with. Note This section primarily describes how to filter and view Internet Monitor metrics using the AWS Management Console. Alternatively, you can use Internet Monitor API operations with the AWS CLI or an SDK to work directly with Internet Monitor events stored in CloudWatch Logs files. For more information, see Using your monitor and measurements information. For more information about using API operations, see Examples of using the CLI with Internet Monitor and the Internet Monitor API Reference. There are five pages (tabs) in the Internet Monitor dashboard: • On the Overview page, you can get an overall view of your monitored traffic, including current performance and availability information, a summary of recent and current health events, and the top suggestion for potentially improving performance for your clients. • On the Health events page, you can see current and historical health events that currently impact, or previously impacted, locations where clients access your application. Internet Monitor dashboard 2200 Amazon CloudWatch User Guide • On the Analyze page, you can view information about top monitored traffic in client locations (by traffic volume), summarized in several customizable ways. You can also see historical trends for health scores and metrics. You can filter by location, ASN, date, and so on, and visualize metrics for your internet traffic over time. • On the Optimize page, Internet Monitor predicts your application's performance improvement for top AWS Regions (or Amazon CloudFront), based on your traffic patterns and past performance. For each top configuration, associated tables provide a breakdown of reduced latency by client location. On a second page, you can select multiple Regions (and, if you like, include CloudFront configurations) to compare latency reductions. For each configuration (Region) that you selected, the page displays an associated table of latency details, listed by city location. • On the Configure page, you can see monitor details and configure options, such as the percentage of traffic to monitor. In addition to these dashboard options, you can use tools for deeper dives into details of the metrics that Internet Monitor collects with your monitor. Internet Monitor generates and publishes log files with the measurements about your traffic, so you can use other CloudWatch tools in the console to further visualize the data published by Internet Monitor, including CloudWatch Contributor Insights, CloudWatch Metrics, and CloudWatch Logs Insights. For more information, see Exploring your data with CloudWatch tools and the Internet Monitor query interface. Learn about using Internet Monitor to explore your performance and availability measurements in the following sections. Topics • Track real-time performance and availability in Internet Monitor (Overview page) • View health events and metrics in Internet Monitor (Health events page) • Analyze historical data in Internet Monitor (Analyze page) • Get suggestions to optimize application performance in Internet Monitor (Optimize page) • Monitoring
acw-ug-610
acw-ug.pdf
610
the console to further visualize the data published by Internet Monitor, including CloudWatch Contributor Insights, CloudWatch Metrics, and CloudWatch Logs Insights. For more information, see Exploring your data with CloudWatch tools and the Internet Monitor query interface. Learn about using Internet Monitor to explore your performance and availability measurements in the following sections. Topics • Track real-time performance and availability in Internet Monitor (Overview page) • View health events and metrics in Internet Monitor (Health events page) • Analyze historical data in Internet Monitor (Analyze page) • Get suggestions to optimize application performance in Internet Monitor (Optimize page) • Monitoring details in Internet Monitor (Configure page) Track real-time performance and availability in Internet Monitor (Overview page) The Overview page in the Internet Monitor console shows you a high-level view of performance and availability for the traffic that your monitor tracks, and a timeline of when health events have Internet Monitor dashboard 2201 Amazon CloudWatch User Guide impacted your monitored traffic. The page also provides the top suggestion for a configuration change that could reduce latency for clients who use your application in your top client location (by traffic volume). Traffic overview and Status The Traffic overview section provides an overall look at your application's availability and performance. Note that this section shows aggregated overall performance and availability scores that consider all of the traffic for applications towards all end users and service locations. You can see health scores for specific client locations and service locations by searching and filtering measurements information on the Analyze tab. Under Status, you can see if your monitor is actively creating data for your monitor or is waiting for data to be available. You can also see the percentage of your application's traffic that you're monitoring. If you want to change the percentage, see the Configure page. Internet Monitor uses a statistical process to create availability and performance scores for your monitored traffic. AWS has substantial historical data about internet performance and availability for network traffic between geographic locations for different ASNs and AWS services. Internet Monitor uses the connectivity data that AWS has captured from its global networking footprint to calculate a baseline of availability and performance for internet traffic. This is the same data that we use at AWS to monitor our own internet uptime and availability. With those measurements as a baseline, Internet Monitor can detect when the performance and availability for your application has dropped, compared to the baseline. To make it easier to see those drops, we report that information to you as a performance score and an availability score. For more information, see How AWS calculates performance and availability scores. Health events timeline The Health events timeline graph displays health events that have occurred during the past 24 hours. A summary below the graph shows your application's current and recent impact. For details, you can choose See more health events. To change the thresholds for health events, go to the Configure page. Reduce latency for your top Region Internet Monitor automatically evaluates the AWS Region that your current application configuration uses most (that is, the Region with the highest client volume), and determines if another Region could provide a better aggregate time to first byte (TTFB) for your clients. Internet Monitor dashboard 2202 Amazon CloudWatch User Guide Note that because this is the aggregate TTFB, if you move traffic from one Region to another, TTFB for most locations is expected to improve but clients in some Regions could see no change or reduced performance.. To explore more latency improvement suggestions, including details at more granular levels (such as by client location), see the Optimize page. View health events and metrics in Internet Monitor (Health events page) The Health events page in the Internet Monitor console provides a map of health events that impact the client locations and ASNs for your application. You can click circles on the map for more details about an event. The Health events tables lists locations that have been impacted by an event, and specifics about the impact. Internet traffic overview The Internet traffic overview map shows you the internet traffic and health events that are specific to the locations and ASNs that your clients access your application from. The countries that are gray on the map are those that include traffic for your application. Each circle on the map indicates a health event in an area, for a time period that you select. Internet Monitor creates health events when it detects a problem, at a specific (but customizable) threshold, with connectivity between one of your resources hosted in AWS and a city-network where a client is accessing your application. Choose a circle on the map to display more details about the health event for that location. In addition, for clusters that have health events,
acw-ug-611
acw-ug.pdf
611
access your application from. The countries that are gray on the map are those that include traffic for your application. Each circle on the map indicates a health event in an area, for a time period that you select. Internet Monitor creates health events when it detects a problem, at a specific (but customizable) threshold, with connectivity between one of your resources hosted in AWS and a city-network where a client is accessing your application. Choose a circle on the map to display more details about the health event for that location. In addition, for clusters that have health events, you can see detailed information in the Health events table below the map. Note that Internet Monitor creates health events in a monitor when it determines that an event has significant impact on your application. The map is blank if there aren't any health events that exceed the threshold for impact on traffic for your client locations in the time period that you've selected. For more information, see When Internet Monitor creates and resolves health events. Health events The Health events table lists client locations that have been affected by health events, along with information about the events. The following columns are included in the table. Internet Monitor dashboard 2203 Amazon CloudWatch User Guide Column Event type Client location ISP name (ASN) Service location Traffic impact Impact type Description Specifies whether current events are overall health events or local health events, or if the health event is in the past. The location of the end users who were impacted by the event, who experienced increased latency or reduced availability. To learn more about client location accuracy in Internet Monitor, see Geolocation information and accuracy in Internet Monitor. The network that the traffic traveled over. Typically, this is the internet service provider (ISP) or Autonomous System Number (ASN) for the network traffic. The AWS location for the network traffic, which can be an AWS Region or an internet edge location. How much impact was caused by the event, in increased latency or reduced availabil ity. For latency, this is the percentage of how much latency increased during the event compared to typical performance for traffic, from this client location to this AWS location using this client network. The type of impact for the health event. Health events are typically caused by latency increases (performance issues) or reachabil ity (availability issues). Internet Monitor dashboard 2204 Amazon CloudWatch Column User Guide Description You might also be able to click on the impact type to see the cause of the impairment. When possible, Internet Monitor analyzes the origin of a health event, to determine whether it was caused by AWS or an ASN (internet service provider). Note that this analysis continues after the event is resolved. Internet Monitor can update events with new information for up to an hour. If you choose one of the client locations in the Health events table, you can see more details about the health event at that location. For example, you can see when the event started, when it ended, and the local traffic impact. Network path visualization If Internet Monitor has finished impairment analysis for an event, you can view Network path visualization to see the full network path for traffic to a client location. The full path shows you each node along the network path for your application for the health event, between the AWS location and the client, for a client-location pair. When Internet Monitor has determined the cause of an impairment, Internet Monitor adds a dashed red circle around the node. Impairments can be caused by ASNs, typically internet service providers (ISPs), or the cause can be AWS. If there were multiple causes for an impairment, multiple nodes are circled. Analyze historical data in Internet Monitor (Analyze page) On the Analyze page in the Internet Monitor console, you can view your application's the top client locations for the traffic that you monitor, by traffic volume. You can also view graphs showing performance and availability scores for your traffic over time, as well as graphs of other internet traffic metrics for your application's monitored traffic. To start exploring Internet Monitor data for your application traffic, select a time period. Then, choose a specific geographical location, such a city, and (optionally) other filters. Internet Monitor Internet Monitor dashboard 2205 Amazon CloudWatch User Guide applies the filters to your data, and then you can see graphs of the data that show measurements for your application. The graphs included on the Analyze page include your application's performance score, availability score, monitored bytes transferred (for VPCs, Network Load Balancers, and CloudFront distributions) or client connection counts (for WorkSpaces directories), and round-trip time (RTT) for your application over time. The options at the top of the Analyze page determine the
acw-ug-612
acw-ug.pdf
612
select a time period. Then, choose a specific geographical location, such a city, and (optionally) other filters. Internet Monitor Internet Monitor dashboard 2205 Amazon CloudWatch User Guide applies the filters to your data, and then you can see graphs of the data that show measurements for your application. The graphs included on the Analyze page include your application's performance score, availability score, monitored bytes transferred (for VPCs, Network Load Balancers, and CloudFront distributions) or client connection counts (for WorkSpaces directories), and round-trip time (RTT) for your application over time. The options at the top of the Analyze page determine the timeframe and types of traffic shown in the graphs on the page. You can filter by client locations or ASN, or choose to show traffic graphs at a specific granularity (the default is city level). Top client locations The Top client locations graph displays your top monitored traffic locations, by default. You can choose another field to sort the graph by, or you can sort the graph in other ways, for example, by lowest traffic locations. The filters that you choose for the page determine the Regions, timeframe, and so on for the locations. Traffic health scores This section shows you graphs of traffic health scores and metrics for your monitored traffic. These graphs reflect data for the filters that you choose at the top of the page. The Traffic health scores graph shows you performance and availability information for your local and overall traffic by calling out health events that have impacted your monitored client traffic. AWS has substantial historical data about internet performance and availability for network traffic between geographic locations for different ASNs and AWS services. Internet Monitor uses the connectivity data that AWS has captured from its global networking footprint to calculate a baseline of performance and availability for internet traffic. This is the same data that we use at AWS to monitor our own internet uptime and availability. With those measurements as a baseline, Internet Monitor can detect when the performance and availability for your application has dropped, compared to the baseline. To make it easier to see those drops, we report that information to you as a performance score and an availability score. For more information, see How AWS calculates performance and availability scores. Additional graphs show the monitored bytes transferred (for VPCs, Network Load Balancers, and CloudFront distributions) or client connection counts (for WorkSpaces directories), and round-trip time (RTT) for your application traffic. Internet Monitor dashboard 2206 Amazon CloudWatch User Guide Note that when round-trip time (RTT) is aggregated across end-user locations, the value is weighted by the amount of your traffic that is driven by each client location. For example, with two client locations, one serving 90% of traffic with a 5 ms RTT, and the other serving 10% of traffic with a 10 ms RTT, the result is an aggregated RTT of 5.5 ms (which comes from 5 ms * 0.9 + 10 ms * 0.1). You can also explore the internet measurements that Internet Monitor stores for your monitored traffic by using CloudWatch tools or other methods. For more information, see Exploring your data with CloudWatch tools and the Internet Monitor query interface. In addition, you can create CloudWatch alarms based on Internet Monitor data, for example, to notify you of health events. For more information, see Create alarms with Internet Monitor. Get suggestions to optimize application performance in Internet Monitor (Optimize page) Use the Optimize page in the Internet Monitor console to get suggestions for how to optimize application performance for your clients. Internet Monitor evaluates your monitored application traffic, and determines if you can reduce latency by changing the AWS Regions that you've configured for your application. Optionally, you can also view latency changes if you choose to include Amazon CloudFront in the suggestions. You can review suggestions for your application's top Regions by traffic volume, or for top client locations, also by traffic volume. Suggestions to reduce latency for top Regions To help you quickly understand your best options for reducing latency for your clients, Internet Monitor automatically provides suggestions for improving latency in your application for your top Regions (by traffic volume). You can also explore configuration changes for all the Regions where your application serves clients. This includes getting details about each suggested change at deeper levels of granularity, for example, by specific client location. To explore all Regional configurations and expected latency changes for your application, choose Optimization suggestions for all Regions. Suggestions to reduce latency for all Regions To explore suggestions for reducing latency for all Regions where clients access your application, choose Optimization suggestions for all Regions to open a new dashboard Internet Monitor dashboard 2207 Amazon CloudWatch User Guide page. On this page, you can select different Regions to configure, with
acw-ug-613
acw-ug.pdf
613
configuration changes for all the Regions where your application serves clients. This includes getting details about each suggested change at deeper levels of granularity, for example, by specific client location. To explore all Regional configurations and expected latency changes for your application, choose Optimization suggestions for all Regions. Suggestions to reduce latency for all Regions To explore suggestions for reducing latency for all Regions where clients access your application, choose Optimization suggestions for all Regions to open a new dashboard Internet Monitor dashboard 2207 Amazon CloudWatch User Guide page. On this page, you can select different Regions to configure, with the option of including CloudFront as a configuration comparison, and then compare the times to first byte (TTFBs) for each selected configuration. Then, for each comparison, you can also see a table with at a more granular level (by client location), with the average expected TTFB for each one. Suggestions to reduce latency for top locations Internet Monitor also provides suggestions for reducing application latency for your clients by specific location. When the table lists multiple suggestions for the same location, expand the city location for that row to see details. Be aware that if you change a configuration to use a different Region or to use CloudFront, latency improvements can vary by client location. For example, latency might improve for some locations, but stay the same or worsen for others. Suggestions to reduce latency by updating routing configurations Note: These suggestions are only relevant for application traffic to Regional load balancers. The table is not shown for monitors that you create for CloudFront distributions or WorkSpaces resources. With Internet Monitor, you can view information about latency toward AWS locations for IPv4 IP prefixes that access your application using different DNS resolvers (typically ISPs). Using this information, you can take steps to reduce latency for specific groups of users by routing a set of IP address prefixes, specified by a CIDR collection, to your endpoints in a Region that results in lower latency for your users. If you don't already have a CIDR collection for the prefixes, you can go to Amazon Route 53 to create one. Then, you can update your routing in Route 53 to route IP addresses in the collection to a specific Region. If you want to create a CIDR collection for a set of IP address prefixes, you can easily do so by selecting a row or rows that includes the IP prefixes that you want, and then choosing Add to CIDR collection. Then, in the Route 53 console, you can configure a routing policy that routes IP addresses in the collection to the Region with lower latency for your application. To learn more about IP-based routing in Route 53, see IP-based routing. By viewing the suggestions on this page, you can start planning configurations and deployments that can improve performance for your clients. Note that you might see a dash (-) instead of a value in a column, when data is not available to display. Internet Monitor dashboard 2208 Amazon CloudWatch User Guide For more information about TTFB calculations, see AWS calculations for TTFB and latency. To review a specific example of how to improve performance, see Using Internet Monitor for a Better Gaming Experience. Monitoring details in Internet Monitor (Configure page) On the Configure page, you can see details about your monitor, including a list of resources that you monitor traffic for and the thresholds for when health events are triggered. You can also explore and compare values for the traffic percentage for your monitor, and its impact on how many city-networks are included for (monitored by) your monitor. Finally, you can view information about measurements that are published to an Amazon S3 bucket. You can configure a monitor to change most options, such as the percentage of traffic to monitor. For more information, see Configure your monitor. Monitor details The Monitor details section includes basic information about your monitor, including the name, the percentage of traffic currently being monitored for your application, a city-networks maximum limit (if you've set one), and status information about the monitor. The following explains the values that you might see for Status and Status info (data processing status). Status Active Pending Inactive Error Description Monitor is created and active. Monitor is currently being created and is not yet active. Monitor is created but has been set to inactive. Monitor is in an error state. Status details (Data processing status) Description Internet Monitor dashboard 2209 Amazon CloudWatch User Guide Status details (Data processing status) Description OK Inactive Monitor is actively processing data. Monitor is inactive and is not processing data. Collecting data Monitor is actively collecting data. Insufficient data Monitor is actively processing data, but there aren't enough datapoints to produce insights. Fault access CloudWatch Monitor has encountered
acw-ug-614
acw-ug.pdf
614
status). Status Active Pending Inactive Error Description Monitor is created and active. Monitor is currently being created and is not yet active. Monitor is created but has been set to inactive. Monitor is in an error state. Status details (Data processing status) Description Internet Monitor dashboard 2209 Amazon CloudWatch User Guide Status details (Data processing status) Description OK Inactive Monitor is actively processing data. Monitor is inactive and is not processing data. Collecting data Monitor is actively collecting data. Insufficient data Monitor is actively processing data, but there aren't enough datapoints to produce insights. Fault access CloudWatch Monitor has encountered a problem delivering CloudWatch metrics data and log events. Health event thresholds In this section, you can see the current thresholds for health events that are configured for this monitor. If you haven't configured any custom thresholds, the values shown here are the default values. By default, health events are not triggered based on local thresholds. If local health event thresholds would be useful for your Internet Monitor scenario, you can enable the option and specify the thresholds to use. You can learn more about how health event thresholds work, and review the potential impact of adding local thresholds or changing existing thresholds. For more information, see Change health event thresholds. Traffic coverage In this section, you can explore options for the traffic coverage for your monitor. When you change the traffic percentage for a monitor, Internet Monitor monitors different amounts of application traffic. If you set a traffic percentage to less than 100% (100% is the default value), some portion of the city-networks that your clients use to access your application might not be monitored. By exploring the impact of different traffic percentage values, you can see how different values that you might set would impact your city-networks coverage. Internet Monitor dashboard 2210 Amazon CloudWatch User Guide The Total monitored city-networks graph shows you how many city-networks are currently monitored, and how many would be monitored if you set the traffic percentage to 100%. To view different traffic percentage values on the graph, select percentages in the drop-down menu. After you explore the options, you can change the traffic percentage to monitor by choosing Update monitoring coverage. If you want to set a maximum city-networks limit, at the top of the page, choose Edit monitor. Then, under Advanced options, set a maximum city-networks value. Configure your monitor As on every page in the Internet Monitor dashboard, you can choose Edit monitor to change options for your monitor, including adding or removing resources. For details about how to update the following configuration options, see the provided links. View health event thresholds In this section, you can see the current thresholds for health events that are configured for this monitor. To update health thresholds, see Change health event thresholds. View and evaluate traffic coverage In this section, you can compare the effect of changing the percentage of traffic that you monitor for your application on the number of city-networks that are included (for monitoring) when you choose different percentage values. You can also change the percentage of traffic that you monitor, or change the limit for the number of city-networks your monitor includes. To change the percentage of traffic, choose Update monitoring coverage. For detailed steps and information, see Explore changing your application traffic percentage. Configuration details for publishing internet measurements to Amazon S3 If you have configured Internet Monitor to publish internet measurements for your monitor to an Amazon S3 bucket, the information about your configuration is shown here. To configure this option, see Publishing internet measurements to S3. Internet Monitor dashboard 2211 Amazon CloudWatch User Guide Exploring your data with CloudWatch tools and the Internet Monitor query interface In addition to visualizing your performance and availability for your application with the Internet Monitor dashboard, there are several methods that you can use to dive deeper into the data that Internet Monitor generates for you. These methods include using CloudWatch tools with Internet Monitor data stored in CloudWatch Log files and using the Internet Monitor query interface. The tools that you can use include CloudWatch Logs Insights, CloudWatch Metrics, CloudWatch Contributor Insights, and Amazon Athena. You can use some or all these tools, as well as the dashboard, to explore Internet Monitor data, depending on your needs. Internet Monitor aggregates CloudWatch metrics about traffic to your application and to each AWS Region, and includes data such as total traffic impact, availability, and round-trip time. This data is published to CloudWatch Logs and is also available to use with the Internet Monitor query interface. Details about geo-granularity and other aspects of the information available to explore for each one varies. Internet Monitor publishes data for your monitor at 5 minute intervals, and then makes the data available in several ways. The
acw-ug-615
acw-ug.pdf
615
all these tools, as well as the dashboard, to explore Internet Monitor data, depending on your needs. Internet Monitor aggregates CloudWatch metrics about traffic to your application and to each AWS Region, and includes data such as total traffic impact, availability, and round-trip time. This data is published to CloudWatch Logs and is also available to use with the Internet Monitor query interface. Details about geo-granularity and other aspects of the information available to explore for each one varies. Internet Monitor publishes data for your monitor at 5 minute intervals, and then makes the data available in several ways. The following table lists scenarios for accessing Internet Monitor data, and describes features of the data that is collected for each one. Feature CloudWatch Logs Export to S3 Query interface CloudWatch dashboard Enabled by default Yes Number of city- networks that data is collected for Top 500 (see note below) No All Yes All Yes All Data retention User controlled User controlled 30 days 30 days Geo-granu larities that data is collected for All (city-net work, metro+net work, subdivisi on+networ City-network All (city-net work, metro+net work, subdivisi All (city-net work, metro+net work, subdivisi on+networ on+networ Explore data using tools 2212 Amazon CloudWatch Feature CloudWatch Logs k, country+n etwork) Export to S3 Query interface User Guide CloudWatch dashboard k, country+n k, country+n etwork) etwork) How to query and filter data Use CloudWatc h Logs Insights Use Amazon Athena to Use the Internet Monitor query Monitor and optimize with to explore query internet interface the Internet Internet Monitor measurements measurements in Amazon S3 log files Monitor dashboard Note: Top 500 measurements are captured for city-networks; top 250 for metro+networks, top 100 for subdivision+networks, top 50 for country+networks. This chapter describes how to query and explore your data by using CloudWatch tools or the Internet Monitor query interface, together with examples for each method. Contents • Use CloudWatch Logs Insights to explore Internet Monitor measurements • Use Contributor Insights to identify top locations and ISPs • View Internet Monitor metrics or set alarms in CloudWatch Metrics • Use Amazon Athena to query internet measurements in Amazon S3 log files • Use the Internet Monitor query interface Use CloudWatch Logs Insights to explore Internet Monitor measurements You can use CloudWatch Logs Insights queries to filter a subset of logs for a specific city or geography (client location), client ASN (ISP), and AWS source location. Internet Monitor publishes granular measurements of availability and round-trip time to CloudWatch Logs that you can explore using CloudWatch Logs Insights. To learn more about client location accuracy in Internet Monitor, see Geolocation information and accuracy in Internet Monitor. Explore data using tools 2213 Amazon CloudWatch User Guide The examples in this section can help you create CloudWatch Logs Insights queries to learn more about your own application traffic measurements and metrics. If you use these examples in CloudWatch Logs Insights, replace monitorName with your own monitor name. View traffic optimization suggestions On the Traffic insights tab in Internet Monitor, you can view traffic optimization suggestions, filtered by a location. To see the same information that is displayed in the Traffic optimization suggestions section on that tab, but without the location granularity filter, you can use the following CloudWatch Logs Insights query. 1. 2. In the AWS Management Console, navigate to CloudWatch Logs Insights. For Log Group, select /aws/internet-monitor/monitorName/byCity and /aws/ internet-monitor/monitorName/byCountry, and then specify a time range. 3. Add the following query, and then run the query. fields @timestamp, clientLocation.city as @city, clientLocation.subdivision as @subdivision, clientLocation.country as @country, `trafficInsights.timeToFirstByte.currentExperience.serviceName` as @serviceNameField, concat(@serviceNameField, ` (`, `serviceLocation`, `)`) as @currentExperienceField, concat(`trafficInsights.timeToFirstByte.ec2.serviceName`, ` (`, `trafficInsights.timeToFirstByte.ec2.serviceLocation`, `)`) as @ec2Field, `trafficInsights.timeToFirstByte.cloudfront.serviceName` as @cloudfrontField, concat(`clientLocation.networkName`, ` (AS`, `clientLocation.asn`, `)`) as @networkName | filter ispresent(`trafficInsights.timeToFirstByte.currentExperience.value`) | stats avg(`trafficInsights.timeToFirstByte.currentExperience.value`) as @averageTTFB, avg(`trafficInsights.timeToFirstByte.ec2.value`) as @ec2TTFB, avg(`trafficInsights.timeToFirstByte.cloudfront.value`) as @cloudfrontTTFB, sum(`bytesIn` + `bytesOut`) as @totalBytes, latest(@ec2Field) as @ec2, latest(@currentExperienceField) as @currentExperience, latest(@cloudfrontField) as @cloudfront, count(*) by @networkName, @city, @subdivision, @country | display @city, @subdivision, @country, @networkName, @totalBytes, @currentExperience, @averageTTFB, @ec2, @ec2TTFB, @cloudfront, @cloudfrontTTFB | sort @totalBytes desc View internet availability and RTT (p50, p90, and p95) Explore data using tools 2214 Amazon CloudWatch User Guide To view the internet availability and round-trip time (p50, p90, and p95) for traffic, you can use the following CloudWatch Logs Insights query. End user geography: Chicago, IL, United States End user network (ASN): AS7018 AWS service location: US East (N. Virginia) Region To view the logs, do the following: 1. 2. In the AWS Management Console, navigate to CloudWatch Logs Insights. For Log Group, select /aws/internet-monitor/monitorName/byCity and /aws/ internet-monitor/monitorName/byCountry, and then specify a time range. 3. Add the following query, and then run the query. The query returns all the performance data for users connecting from AS7018 in Chicago, IL towards US East (N. Virginia) Region over the selected time period. fields @timestamp, internetHealth.availability.experienceScore as
acw-ug-616
acw-ug.pdf
616
use the following CloudWatch Logs Insights query. End user geography: Chicago, IL, United States End user network (ASN): AS7018 AWS service location: US East (N. Virginia) Region To view the logs, do the following: 1. 2. In the AWS Management Console, navigate to CloudWatch Logs Insights. For Log Group, select /aws/internet-monitor/monitorName/byCity and /aws/ internet-monitor/monitorName/byCountry, and then specify a time range. 3. Add the following query, and then run the query. The query returns all the performance data for users connecting from AS7018 in Chicago, IL towards US East (N. Virginia) Region over the selected time period. fields @timestamp, internetHealth.availability.experienceScore as availabilityExperienceScore, internetHealth.availability.percentageOfTotalTrafficImpacted as percentageOfTotalTrafficImpacted, internetHealth.performance.experienceScore as performanceExperienceScore, internetHealth.performance.roundTripTime.p50 as roundTripTimep50, internetHealth.performance.roundTripTime.p90 as roundTripTimep90, internetHealth.performance.roundTripTime.p95 as roundTripTimep95 | filter clientLocation.country == `United States` and clientLocation.city == `Chicago` and serviceLocation == `us-east-1` and clientLocation.asn == 7018 For more information, see Analyzing log data with CloudWatch Logs Insights. Use Contributor Insights to identify top locations and ISPs CloudWatch Contributor Insights can help you identify top client locations and ASNs (typically, internet service providers or ISPs) for your AWS application. Use the following sample Contributor Insights rules to get started with rules that are useful with Internet Monitor. For more information, see Create a Contributor Insights rule in CloudWatch. Explore data using tools 2215 Amazon CloudWatch User Guide To learn more about client location accuracy in Internet Monitor, see Geolocation information and accuracy in Internet Monitor. Note Internet Monitor stores internet measurements data every five minutes, so after you set up a Contributor Insights rule, you must adjust the period to five minutes to see a graph. View top locations and ASNs impacted by an availability impact To view top client locations and ASNs impacted by a drop in availability, you can use the following Contributor Insights rule in the Syntax editor. Replace monitor-name with your own monitor name. { "Schema": { "Name": "CloudWatchLogRule", "Version": 1 }, "AggregateOn": "Sum", "Contribution": { "Filters": [ { "Match": "$.clientLocation.city", "IsPresent": true } ], "Keys": [ "$.clientLocation.city", "$.clientLocation.networkName" ], "ValueOf": "$.awsInternetHealth.availability.percentageOfTotalTrafficImpacted" }, "LogFormat": "JSON", "LogGroupNames": [ "/aws/internet-monitor/monitor-name/byCity" ] } View top client locations and ASNs impacted by a latency impact Explore data using tools 2216 Amazon CloudWatch User Guide To view top client locations and ASNs impacted by an increase in round-trip time (latency), you can use the following Contributor Insights rule in the Syntax editor. Replace monitor-name with your own monitor name. { "Schema": { "Name": "CloudWatchLogRule", "Version": 1 }, "AggregateOn": "Sum", "Contribution": { "Filters": [ { "Match": "$.clientLocation.city", "IsPresent": true } ], "Keys": [ "$.clientLocation.city", "$.clientLocation.networkName" ], "ValueOf": "$.awsInternetHealth.performance.percentageOfTotalTrafficImpacted" }, "LogFormat": "JSON", "LogGroupNames": [ "/aws/internet-monitor/monitor-name/byCity" ] } View top client locations and ASNs impacted by total percentage of traffic To view top client locations and ASNs impacted by total percentage of traffic, you can use the following Contributor Insights rule in the Syntax editor. Replace monitor-name with your own monitor name. { "Schema": { "Name": "CloudWatchLogRule", "Version": 1 }, "AggregateOn": "Sum", "Contribution": { "Filters": [ Explore data using tools 2217 User Guide Amazon CloudWatch { "Match": "$.clientLocation.city", "IsPresent": true } ], "Keys": [ "$.clientLocation.city", "$.clientLocation.networkName" ], "ValueOf": "$.percentageOfTotalTraffic" }, "LogFormat": "JSON", "LogGroupNames": [ "/aws/internet-monitor/monitor-name/byCity" ] } View Internet Monitor metrics or set alarms in CloudWatch Metrics You can view or set alarms on Internet Monitor metrics by using CloudWatch alarms and CloudWatch Metrics in the CloudWatch console. Internet Monitor publishes metrics to your account, including metrics for performance, availability, round-trip time, and throughput (bytes per second). To find all metrics for your monitor, in the CloudWatch Metrics dashboard, see the custom namespace AWS/InternetMonitor. To see examples for using several of these metrics to help determine values to choose for a city- networks maximum limit for your monitor, see Choosing a city-network maximum value. To learn more about setting alarms for Internet Monitor, see Create alarms with Internet Monitor. Metrics are aggregated across all internet traffic to your VPCs, Network Load Balancers, CloudFront distributions, or WorkSpaces directories in the monitor, and to all traffic to each AWS Region and internet edge location that is monitored. Regions are defined by the service location, which can either be all locations or a specific Region, such as us-east-1. Note: city-networks are pairs of client locations and the ASNs the clients use (typically internet service providers or ISPs). Internet Monitor provides the following metrics. Explore data using tools 2218 Amazon CloudWatch Metric PerformanceScore AvailabilityScore BytesIn BytesOut BytesInMonitored BytesOutMonitored Round-trip time (RTT) CityNetworksMonitored TrafficMonitoredPercent User Guide Description A performance score represents the estimated percentage of traffic that is not seeing a performance drop. An availability score represents the estimated percentage of traffic that is not seeing an availability drop. Bytes transferred in for your application internet traffic at all application city-networks. Bytes transferred out for your application internet traffic at all application city-networks. Bytes transferred in for your application internet traffic at
acw-ug-617
acw-ug.pdf
617
use (typically internet service providers or ISPs). Internet Monitor provides the following metrics. Explore data using tools 2218 Amazon CloudWatch Metric PerformanceScore AvailabilityScore BytesIn BytesOut BytesInMonitored BytesOutMonitored Round-trip time (RTT) CityNetworksMonitored TrafficMonitoredPercent User Guide Description A performance score represents the estimated percentage of traffic that is not seeing a performance drop. An availability score represents the estimated percentage of traffic that is not seeing an availability drop. Bytes transferred in for your application internet traffic at all application city-networks. Bytes transferred out for your application internet traffic at all application city-networks. Bytes transferred in for your application internet traffic at monitored city-networks. Bytes transferred out for your application internet traffic at monitored city-networks. Round-trip time between the AWS Regions, ASNs (typically internet service providers or ISPs), and locations (such as cities) specific to your VPCs, Network Load Balancers, CloudFront distributions, or WorkSpaces directories. The number of city-networks Internet Monitor monitored for your application internet traffic. This is never more than the upper limit that you set as the maximum city-networks for the monitor. The percentage of total application internet traffic for this monitor that is represented (included) by the city-networks that Internet Monitor is monitoring. This is less than 100 Explore data using tools 2219 Amazon CloudWatch Metric CityNetworksFor100PercentTraffic CityNetworksFor99PercentTraffic CityNetworksFor95PercentTraffic CityNetworksFor90PercentTraffic CityNetworksFor75PercentTraffic CityNetworksFor50PercentTraffic User Guide Description (that is, less than 100%) if clients access your application in more city-networks than the maximum city-networks limit that you have set for the monitor. The number that you should set your city- networks maximum limit to if you want to monitor 100% of your application internet traffic in Internet Monitor. The number that you should set your city- networks maximum limit to if you want to monitor 99% of your application internet traffic in Internet Monitor. The number that you should set your city- networks maximum limit to if you want to monitor 95% of your application internet traffic in Internet Monitor. The number that you should set your city- networks maximum limit to if you want to monitor 90% of your application internet traffic in Internet Monitor. The number that you should set your city- networks maximum limit to if you want to monitor 75% of your application internet traffic in Internet Monitor. The number that you should set your city- networks maximum limit to if you want to monitor 50% of your application internet traffic in Internet Monitor. Explore data using tools 2220 Amazon CloudWatch Metric CityNetworksFor25PercentTraffic User Guide Description The number that you should set your city- networks maximum limit to if you want to monitor 25% of your application internet traffic in Internet Monitor. For more information, see Metrics in Amazon CloudWatch. Use Amazon Athena to query internet measurements in Amazon S3 log files You can use Amazon Athena to query and view the internet measurements that Internet Monitor publishes to an Amazon S3 bucket. There's an option in Internet Monitor to publish internet measurements for your application to an S3 bucket for internet-facing traffic for your monitored city-networks (client locations and ASNs, typically internet service providers or ISPs). Regardless of whether you choose to publish measurements to S3, Internet Monitor automatically publishes internet measurements to CloudWatch Logs every five minutes for the top 500 (by traffic volume) city-networks for each monitor. This chapter includes steps for how to create a table in Athena for internet measurements located in an S3 log file, and then provides example queries to see different views of the measurements. For example, you can query for your top 10 impacted city-networks by latency impact. Using Amazon Athena to create a table for internet measurements in Internet Monitor To start using Athena with your Internet Monitor S3 log files, you first create a table for the internet measurements. Follow the steps in this procedure to create a table in Athena based on the S3 log files. Then, you can run Athena queries on the table, such as these example internet measurements queries, to get information about your measurements. To create an Athena table 1. Open the Athena console at https://console.aws.amazon.com/athena/. 2. In the Athena query editor, enter a query statement to generate a table with Internet Monitor internet measurements. Replace the value for the LOCATION parameter with the location of S3 bucket where your Internet Monitor internet measurements are stored. Explore data using tools 2221 Amazon CloudWatch User Guide CREATE EXTERNAL TABLE internet_measurements ( version INT, timestamp INT, clientlocation STRING, servicelocation STRING, percentageoftotaltraffic DOUBLE, bytesin INT, bytesout INT, clientconnectioncount INT, internethealth STRING, trafficinsights STRING ) PARTITIONED BY (year STRING, month STRING, day STRING) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' LOCATION 's3://amzn-s3-demo-bucket/bucket_prefix/AWSLogs/account_id/ internetmonitor/AWS_Region/' TBLPROPERTIES ('skip.header.line.count' = '1'); 3. Enter a statement to create a partition to read the data. For example, the following query creates a single partition for a specified date and location: ALTER TABLE internet_measurements
acw-ug-618
acw-ug.pdf
618
LOCATION parameter with the location of S3 bucket where your Internet Monitor internet measurements are stored. Explore data using tools 2221 Amazon CloudWatch User Guide CREATE EXTERNAL TABLE internet_measurements ( version INT, timestamp INT, clientlocation STRING, servicelocation STRING, percentageoftotaltraffic DOUBLE, bytesin INT, bytesout INT, clientconnectioncount INT, internethealth STRING, trafficinsights STRING ) PARTITIONED BY (year STRING, month STRING, day STRING) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' LOCATION 's3://amzn-s3-demo-bucket/bucket_prefix/AWSLogs/account_id/ internetmonitor/AWS_Region/' TBLPROPERTIES ('skip.header.line.count' = '1'); 3. Enter a statement to create a partition to read the data. For example, the following query creates a single partition for a specified date and location: ALTER TABLE internet_measurements ADD PARTITION (year = 'YYYY', month = 'MM', day = 'dd') LOCATION 's3://amzn-s3-demo-bucket/bucket_prefix/AWSLogs/account_id/ internetmonitor/AWS_Region/YYYY/MM/DD'; 4. Choose Run. Example Athena statements for internet measurements The following is an example of a statement to generate a table: CREATE EXTERNAL TABLE internet_measurements ( version INT, timestamp INT, clientlocation STRING, servicelocation STRING, percentageoftotaltraffic DOUBLE, bytesin INT, bytesout INT, Explore data using tools 2222 Amazon CloudWatch User Guide clientconnectioncount INT, internethealth STRING, trafficinsights STRING ) PARTITIONED BY (year STRING, month STRING, day STRING) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' LOCATION 's3://internet-measurements/TestMonitor/AWSLogs/1111222233332/internetmonitor/ us-east-2/' TBLPROPERTIES ('skip.header.line.count' = '1'); The following is an example of a statement to create a partition to read the data: ALTER TABLE internet_measurements ADD PARTITION (year = '2023', month = '04', day = '07') LOCATION 's3://internet-measurements/TestMonitor/AWSLogs/1111222233332/internetmonitor/ us-east-2/2023/04/07/' Sample Amazon Athena queries to use with internet measurements in Internet Monitor This section includes example queries that you can use with Amazon Athena to get information about your application's internet measurements published to Amazon S3. Query your top 10 impacted (by total percentage of traffic) client locations and ASNs Run this Athena query to return your top 10 impacted (by total percentage of traffic) city-networks —that is, client locations and ASNs, typically internet service providers. SELECT json_extract_scalar(clientLocation, '$.city') as city, json_extract_scalar(clientLocation, '$.networkname') as networkName, sum(percentageoftotaltraffic) as percentageoftotaltraffic FROM internet_measurements GROUP BY json_extract_scalar(clientLocation, '$.city'), json_extract_scalar(clientLocation, '$.networkname') ORDER BY percentageoftotaltraffic desc limit 10 Query your top 10 impacted (by availability) client locations and ASNs Run this Athena query to return your top 10 impacted (by total percentage of traffic) city-networks —that is, client locations and ASNs, typically internet service providers. SELECT json_extract_scalar(clientLocation, '$.city') as city, Explore data using tools 2223 Amazon CloudWatch User Guide json_extract_scalar(clientLocation, '$.networkname') as networkName, sum( cast( json_extract_scalar( internetHealth, '$.availability.percentageoftotaltrafficimpacted' ) as double ) ) as percentageOfTotalTrafficImpacted FROM internet_measurements GROUP BY json_extract_scalar(clientLocation, '$.city'), json_extract_scalar(clientLocation, '$.networkname') ORDER BY percentageOfTotalTrafficImpacted desc limit 10 Query your top 10 impacted (by latency) client locations and ASNs Run this Athena query to return your top 10 impacted (by latency impact) city-networks—that is, client locations and ASNs, typically internet service providers. SELECT json_extract_scalar(clientLocation, '$.city') as city, json_extract_scalar(clientLocation, '$.networkname') as networkName, sum( cast( json_extract_scalar( internetHealth, '$.performance.percentageoftotaltrafficimpacted' ) as double ) ) as percentageOfTotalTrafficImpacted FROM internet_measurements GROUP BY json_extract_scalar(clientLocation, '$.city'), json_extract_scalar(clientLocation, '$.networkname') ORDER BY percentageOfTotalTrafficImpacted desc limit 10 Query traffic highlights for your client locations and ASNs Run this Athena query to return traffic highlights, including availability score, performance score, and time to first byte for your city-networks—that is, client locations and ASNs, typically internet service providers. . Explore data using tools 2224 Amazon CloudWatch User Guide SELECT json_extract_scalar(clientLocation, '$.city') as city, json_extract_scalar(clientLocation, '$.subdivision') as subdivision, json_extract_scalar(clientLocation, '$.country') as country, avg(cast(json_extract_scalar(internetHealth, '$.availability.experiencescore') as double)) as availabilityScore, avg(cast(json_extract_scalar(internetHealth, '$.performance.experiencescore') as double)) performanceScore, avg(cast(json_extract_scalar(trafficinsights, '$.timetofirstbyte.currentexperience.value') as double)) as averageTTFB, sum(bytesIn) as bytesIn, sum(bytesOut) as bytesOut, sum(bytesIn + bytesOut) as totalBytes FROM internet_measurements where json_extract_scalar(clientLocation, '$.city') != 'N/A' GROUP BY json_extract_scalar(clientLocation, '$.city'), json_extract_scalar(clientLocation, '$.subdivision'), json_extract_scalar(clientLocation, '$.country') ORDER BY totalBytes desc limit 100 For more information about using Athena, see the Amazon Athena User Guide. Use the Internet Monitor query interface An option for understanding more about internet traffic for your AWS application is to use the Internet Monitor query interface. To use the query interface, you create a query with data filters that you choose, and then run the query to return a subset of your Internet Monitor data. Exploring the data that the query returns can give you insights into how your application is performing on the internet. You can query and explore all the metrics that Internet Monitor captures with your monitor, including availability and performance scores, bytes transferred, round-trip times, and time to first byte (TTFB). Internet Monitor uses the query interface to provide the data that you can explore in the Internet Monitor console dashboard. By using search options in the dashboard—on the Analyze page or the Optimize page—you can query and filter internet data for your application. If you'd like more flexibility to explore and filter your data than the dashboard provides, you can use the query interface yourself, by using Internet Monitor API operations with the AWS Command Line Interface or with an AWS SDK. This section introduces the types of queries that you can use Explore data using tools 2225
acw-ug-619
acw-ug.pdf
619
byte (TTFB). Internet Monitor uses the query interface to provide the data that you can explore in the Internet Monitor console dashboard. By using search options in the dashboard—on the Analyze page or the Optimize page—you can query and filter internet data for your application. If you'd like more flexibility to explore and filter your data than the dashboard provides, you can use the query interface yourself, by using Internet Monitor API operations with the AWS Command Line Interface or with an AWS SDK. This section introduces the types of queries that you can use Explore data using tools 2225 Amazon CloudWatch User Guide with the query interface, and the filters that you can specify to create a subset of data, to get insights about internet traffic for your application. Topics • How to use the query interface • Query examples • Get query results • Troubleshooting How to use the query interface You create a query with the query interface by choosing a query type, and then specifying filter values, to return a specific desired subset of your log file data. Then, you can work with the data subset, to further filter and sort, create reports, and so on. The query process works like this: 1. When you run a query, Internet Monitor returns a query ID that is unique to the query. This section describes the query types that are available, and options for filtering data in queries. To understand how this works, you can also review the section on query examples. 2. You specify the query ID with your monitor name with the GetQueryResults API operation to return data results for the query. Each query type returns a different set of data fields. To learn more, see Get query results. The query interface provides the following query types. Each query type returns a different set of information about your traffic from the log files, as shown. • Measurements: Provides availability score, performance score, total traffic, and round-trip times, at 5 minute intervals. • Top locations: Provides availability score, performance score, total traffic, and time to first byte (TTFB) information, for the top location and ASN combinations that you're monitoring, by traffic volume. • Top locations details: Provides TTFB for Amazon CloudFront, your current configuration, and the best performing Amazon EC2 configuration, at 1 hour intervals. • Overall traffic suggestions: Provides TTFB, using a 30-day weighted average, for all traffic in each AWS location that is monitored. Explore data using tools 2226 Amazon CloudWatch User Guide • Overall traffic suggestions details: Provides TTFB, using a 30-day weighted average, for each top location, for a proposed AWS location. • Routing suggestions: Provides the predicted average round-trip time (RTT) from an IP prefix toward an AWS location for a DNS resolver. The RTT is calculated at one hour intervals, over a one hour period. You can filter the data more by using specific criteria. With most query types, except routing suggestions, you can filter by specifying one or more of the following criteria: • AWS location: For AWS location, you can specify CloudFront or an AWS Region, such as us- east-2. • ASN: Specify the autonomous system number (ASN) of a DNS resolver (typically, an ISP), for example, 4225. • Client location: For location, specify a city, metro, subdivision, or country. • Proposed AWS location: Specify an AWS Region, such as us-east-2, or an AWS Local Zone. You can use this filter with the overall traffic suggestions details query type. • Geo: Specify geo for some queries. This is required for queries that use the Top locations query type, but not allowed for other query types. To understand when to specify geo for filter parameters, see the query examples section. For the routing suggestions query type, you can filter the data more by specifying one or more of the following criteria: • Current AWS location: Specify an AWS Region, such as us-east-2. • Proposed AWS location: Specify an AWS Region, such as us-east-2, or an AWS Local Zone. • IPv4 prefix: Specify an IPv4 prefix in the standard format, similar to 192.0.2.0/24. • Monitor ARN: Specify the ARN for a specific monitor. • DNS resolver IP: Specify the IP address of a DNS resolver. • DNS resolver ISP: Specify the name of a DNS resolver (typically an ISP), for example, Cloudflare. • DNS resolver ASN: Specify the autonomous system number (ASN) of a DNS resolver, for example, 4225. Explore data using tools 2227 Amazon CloudWatch User Guide The operators that you can use for filtering your data are EQUALS and NOT_EQUALS. For details about filtering parameters, see the FilterParameter API operation. To see details about the query interface operations, see the following API operations in the Internet Monitor API Reference Guide: • To create and run a query, see the
acw-ug-620
acw-ug.pdf
620
of a DNS resolver. • DNS resolver ISP: Specify the name of a DNS resolver (typically an ISP), for example, Cloudflare. • DNS resolver ASN: Specify the autonomous system number (ASN) of a DNS resolver, for example, 4225. Explore data using tools 2227 Amazon CloudWatch User Guide The operators that you can use for filtering your data are EQUALS and NOT_EQUALS. For details about filtering parameters, see the FilterParameter API operation. To see details about the query interface operations, see the following API operations in the Internet Monitor API Reference Guide: • To create and run a query, see the StartQuery API operation. • To stop a query, see the StopQuery API operation. • To return data for a query that you've created, see the GetQueryResults API operation. • To retrieve the status of a query, see the GetQueryStatus API operation. Query examples To create a query that you can use to retrieve a filtered set of data from your monitor's log file, you use the StartQuery API operation. You specify a query type and filter parameters for the query. Then, when you use the Internet Monitor query interface API operation to get query results using the query, it will retrieve the subset of your data that you want to work with. To illustrate how query types and filter parameters work, let's look at some examples. Example 1 Let's say that you want to retrieve all of your monitor's log file data for a specific country, except for one city. The following example shows filter parameters for a query that you could create with the StartQuery operation for this scenario. { MonitorName: "TestMonitor" StartTime: "2023-07-12T20:00:00Z" EndTime: "2023-07-12T21:00:00Z" QueryType: "MEASUREMENTS" FilterParameters: [ { Field: "country", Operator: "EQUALS", Values: ["Germany"] }, { Field: "city", Operator: "NOT_EQUALS", Values: ["Berlin"] Explore data using tools 2228 Amazon CloudWatch }, ] } Example 2 User Guide As another example, let's say that you want to see your top locations by metropolitan area. You could use the following example query for this scenario. { MonitorName: "TestMonitor" StartTime: "2023-07-12T20:00:00Z" EndTime: "2023-07-12T21:00:00Z" QueryType: "TOP_LOCATIONS" FilterParameters: [ { Field: "geo", Operator: "EQUALS", Values: ["metro"] }, ] } Example 3 Now, let's say that you want to see the top city-network combinations in the Los Angeles metro area. To do this, specify geo=city, and then set metro to Los Angeles. Now, the query returns the top city-networks in the Los Angeles metro area instead of the top metro+networks overall. Here's the example query that you could use: { MonitorName: "TestMonitor" StartTime: "2023-07-12T20:00:00Z" EndTime: "2023-07-12T21:00:00Z" QueryType: "TOP_LOCATIONS" FilterParameters: [ { Field: "geo", Operator: "EQUALS", Values: ["city"] }, { Explore data using tools 2229 Amazon CloudWatch User Guide Field: "metro", Operator: "EQUALS", Values: ["Los Angeles"] } ] } Example 4 Next, let's say that you want to retrieve TTFB data for a specific subdivision (for example, a U.S. state). The following is an example query for this scenario: { MonitorName: "TestMonitor" StartTime: "2023-07-12T20:00:00Z" EndTime: "2023-07-12T21:00:00Z" QueryType: "TOP_LOCATION_DETAILS" FilterParameters: [ { Field: "subdivision", Operator: "EQUALS", Values: ["California"] }, ] } Example 5 Now, let's say that you want to retrieve TTFB data for every location where your application has client traffic. The following is an example query for this scenario: { MonitorName: "TestMonitor" StartTime: "2023-07-12T20:00:00Z" EndTime: "2023-07-12T21:00:00Z" QueryType: "OVERALL_TRAFFIC_SUGGESTIONS" FilterParameters: [] } Explore data using tools 2230 User Guide Amazon CloudWatch Results: [us-east-1, 40, us-west-2, 30], [us-east-1, 40, us-west-1, 35], [us-east-1, 40, us-east-1, 44], [us-east-1, 40, CloudFront, 22], ... [us-east-2, 44, us-west-2, 30], [us-east-2, 44, us-west-1, 35], ... Example 6 Let's say that you want to retrieve TTFB data for a specific new AWS Region. The following is an example query for this scenario: { MonitorName: "TestMonitor" StartTime: "2023-07-12T20:00:00Z" EndTime: "2023-07-12T21:00:00Z" QueryType: "OVERALL_TRAFFIC_SUGGESTIONS_DETAILS" FilterParameters: [ { Field: "proposed_aws_location", Operator: "EQUALS", Values: ["us-west-2"] }, ] } Results: [San Jose, San Jose-Santa Clara, California, United States, 7922, us-east-1, 40, 350, 350, us-west-2, 45] [San Jose, San Jose-Santa Clara, California, United States, 7922, us-west-1, 35, 450, 450, us-west-2, 45] Example 7 A final example is to retrieve data for specific DNS resolvers. The following is an example query for this scenario: { MonitorName: "TestMonitor" Explore data using tools 2231 Amazon CloudWatch User Guide StartTime: "2023-07-12T20:00:00Z" EndTime: "2023-07-12T21:00:00Z" QueryType: "ROUTING_SUGGESTIONS" FilterParameters: [ { Field: "proposed_aws_location", Operator: "EQUALS", Values: ["us-east-1"] }, ] } Results: [162.158.180.245, 13335, Cloudflare, [5.4.0.0/14], us-east-2, 200.0, us-east-1, 160.0] [162.158.180.243, 13313, Cloudflare, [5.4.0.0/10], us-east-2, 150.0, us-east-1, 125.0] Get query results After you define a query, you can return a set of results with the query by running another Internet Monitor API operation, GetQueryResults. When you run GetQueryResults, you specify the query ID for the query that you've defined, along with the name of your monitor. GetQueryResults retrieves data for the specified query into a result set. When you run a query, make sure that the query
acw-ug-621
acw-ug.pdf
621
QueryType: "ROUTING_SUGGESTIONS" FilterParameters: [ { Field: "proposed_aws_location", Operator: "EQUALS", Values: ["us-east-1"] }, ] } Results: [162.158.180.245, 13335, Cloudflare, [5.4.0.0/14], us-east-2, 200.0, us-east-1, 160.0] [162.158.180.243, 13313, Cloudflare, [5.4.0.0/10], us-east-2, 150.0, us-east-1, 125.0] Get query results After you define a query, you can return a set of results with the query by running another Internet Monitor API operation, GetQueryResults. When you run GetQueryResults, you specify the query ID for the query that you've defined, along with the name of your monitor. GetQueryResults retrieves data for the specified query into a result set. When you run a query, make sure that the query has finished running before you use GetQueryResults to look at the results. You can determine if the query has completed by using the GetQueryStatus API operation. When the Status for the query is SUCCEEDED, you can go ahead with reviewing the results. When your query completes, you can use the following information to help you review the results. Each query type that you use to create a query includes a unique set of data fields from the log files, as described in the following list: Measurements The measurements query type returns the following data: timestamp, availability, performance, bytes_in, bytes_out, rtt_p50, rtt_p90, rtt_p95 Top locations The top locations query type groups data by location, and provides the data averaged over the time period. The data that it returns includes the following: Explore data using tools 2232 Amazon CloudWatch User Guide aws_location, city, metro, subdivision, country, asn, availability, performance, bytes_in, bytes_out, current_fbl, best_ec2, best_ec2_region, best_cf_fbl Note that city, metro, and subdivision are only returned if you choose that location type for the geo field. The following location fields are returned, depending on the location type that you specify for geo: city = city, metro, subdivision, country metro = metro, subdivision, country subdivision = subdivision, country country = country Top locations details The top locations details query type returns data grouped hour by hour. The query returns the following data: timestamp, current_service, current_fbl, best_ec2_fbl, best_ec2_region, best_cf_fbl Overall traffic suggestions The overall traffic suggestions query type returns data grouped hour by hour. The query returns the following data: current_aws_location, proposed_aws_location, average_fbl, traffic, optimized_traffic_excluding_cf, optimized_traffic_including_cf Overall traffic suggestions details The overall traffic suggestions details query type returns data grouped hour by hour. The query returns the following data: aws_location, city, metro, subdivision, country, asn, traffic, current_aws_location, fbl_data Routing suggestions The routing suggestions query type returns data grouped hour by hour. The query returns the following data: Explore data using tools 2233 Amazon CloudWatch User Guide dns_resolver_ip, dns_resolver_asn, dns_resolver_isp, ipv4_prefixes, current_aws_location, current_latency, proposed_aws_location, proposed_latency When you run the GetQueryResults API operation, Internet Monitor returns the following in the response: • A data string array that contains the results that the query returns. The information is returned in arrays that are aligned with the Fields field, also returned by the API call. Using the Fields field, you can parse the information from the Data repository and then further filter or sort it for your purposes. • An array of fields that lists the fields that the query returned data for (in the Data field response). Each item in the array is a name-datatype pair, such as availability_score-float. Troubleshooting If errors are returned when you use query interface API operations, verify that you have the required permissions to use Internet Monitor. Specifically, make sure that you have the following permissions: internetmonitor:StartQuery internetmonitor:GetQueryStatus internetmonitor:GetQueryResults internetmonitor:StopQuery These permissions are included in the recommended AWS Identity and Access Management policy to use the Internet Monitor dashboard in the console. For more information, see AWS managed policies for Internet Monitor. Add a monitor using other AWS services A simple way to add monitoring with Internet Monitor is to choose to create a monitor when you add a supported resource when you create a resource—or use monitoring for the resource—in console. Resources with an integrated option for adding Internet Monitor include the following: Add a monitor with another AWS service 2234 Amazon CloudWatch • VPCs • Network Load Balancers • Amazon CloudFront distributions User Guide The following sections provide more information about Internet Monitor integrations in the service consoles for supported resources. Contents • Add a monitor with a Network Load Balancer • Add an Internet Monitor monitor with Amazon VPC • Add an Internet Monitor monitor with CloudFront Add a monitor with a Network Load Balancer When you create a Network Load Balancer in the AWS Management Console, you can optionally choose to also set up monitoring for traffic to and from the Network Load Balancer using a monitor in Internet Monitor. You can add the Network Load Balancer to an existing monitor, or you can opt to create a new monitor for your Network Load Balancer traffic. By using Internet Monitor with your Network Load Balancer, you can view and evaluate
acw-ug-622
acw-ug.pdf
622
Add an Internet Monitor monitor with Amazon VPC • Add an Internet Monitor monitor with CloudFront Add a monitor with a Network Load Balancer When you create a Network Load Balancer in the AWS Management Console, you can optionally choose to also set up monitoring for traffic to and from the Network Load Balancer using a monitor in Internet Monitor. You can add the Network Load Balancer to an existing monitor, or you can opt to create a new monitor for your Network Load Balancer traffic. By using Internet Monitor with your Network Load Balancer, you can view and evaluate measurements and metrics about availability, performance, monitored bytes transferred, and round-trip times that are specific to your application's client locations and ASNs (typically, internet service providers). Internet Monitor also determines when there are anomalies in performance and availability, and then creates health events in your monitor, which you can choose to be notified about. To learn more about how you can use a monitor to manage and improve your clients' experience with your application, see Use a monitor in Internet Monitor. Important To create a monitor, or add a Network Load Balancer to an existing monitor, you must have the correct permissions in place. For more information, see Identity and Access Management for Internet Monitor. Add a monitor with another AWS service 2235 Amazon CloudWatch User Guide Add a Network Load Balancer to an existing monitor When you create the Network Load Balancer in the AWS Management Console, you can choose to have Internet Monitor add the new Network Load Balancer to an existing monitor. Under Integrations, choose Internet Monitor, and then choose Add monitor. Choose Select an existing monitor, and then enter a monitor name. Or choose View monitors to go to the Internet Monitor console, and then scroll down to see a list of available monitors. After you add the Network Load Balancer to a monitor, wait a few minutes, and then metrics for traffic to and from the load balancer will start being shown on the Internet Monitor console. To learn more about the Status and Data processing status values, see Monitoring details in Internet Monitor (Configure page). You can edit the monitor at any time, to remove the load balancer or add another Network Load Balancer, or other resources. You can also change the percentage of traffic that you're monitoring, or make other changes. If you choose to remove the Network Load Balancer from the monitor, traffic from clients to that load balancer is no longer monitored by Internet Monitor. To learn more about updating a monitor, see Edit a monitor in Internet Monitor. Create a monitor for a Network Load Balancer Under Integrations, choose Internet Monitor, and then choose Monitor resource traffic. Choose Create a new monitor, and then enter a monitor name. Leave the default traffic percentage to monitor, 100%, or specify a custom percentage, and then choose Create monitor. After you create the monitor, wait a few minutes, and then metrics for traffic to and from the Network Load Balancer will start being shown on the Internet Monitor console. If you like, you can also choose a percentage of client traffic that you want to monitor for your application (the default is 100%). You can learn more by reviewing the information in Step 1: Create a monitor. Pricing With Internet Monitor, you pay only for what you use. Pricing for Internet Monitor has two components: a per monitored resource fee and a per city-network fee. A city-network is the location that clients access your application resources from and the network (an ASN, such as an internet service provider or ISP) that clients access the resources through. Add a monitor with another AWS service 2236 Amazon CloudWatch User Guide For more information, including pricing examples, see Pricing for Internet Monitor. Stop monitoring a Network Load Balancer If you'd like to stop monitoring your Network Load Balancer resource with Internet Monitor, do the following in the Internet Monitor console: To remove a resource from a monitor 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the left navigation pane, under Network Monitoring, choose Internet monitors. 3. Choose your monitor, and then choose the Action menu. 4. Choose Update monitor. 5. Under Added resources, choose Remove resources. 6. Choose the Network Load Balancer to remove, and then choose Remove. 7. Choose Update. Add an Internet Monitor monitor with Amazon VPC When you create a Amazon Virtual Private Cloud VPC in the AWS Management Console, you can optionally choose to also set up monitoring for it in Internet Monitor. You can add the VPC to an existing monitor, or you can opt to create a new monitor for the VPC in the Amazon VPC console. By using Internet Monitor with your VPC, you can view and evaluate
acw-ug-623
acw-ug.pdf
623
4. Choose Update monitor. 5. Under Added resources, choose Remove resources. 6. Choose the Network Load Balancer to remove, and then choose Remove. 7. Choose Update. Add an Internet Monitor monitor with Amazon VPC When you create a Amazon Virtual Private Cloud VPC in the AWS Management Console, you can optionally choose to also set up monitoring for it in Internet Monitor. You can add the VPC to an existing monitor, or you can opt to create a new monitor for the VPC in the Amazon VPC console. By using Internet Monitor with your VPC, you can view and evaluate measurements and metrics about availability, performance, monitored bytes transferred, and round-trip times that are specific to your application's client locations and ASNs (typically internet service providers). Internet Monitor also determines when there are anomalies in performance and availability and creates health events in your monitor, which you can choose to be notified about. To learn more about how you can use a monitor to manage and improve your clients' experience with your application, see Use a monitor in Internet Monitor. Important To create a monitor, or add a VPC to an existing monitor, you must have the correct permissions in place. For more information, see Identity and Access Management for Internet Monitor. Add a monitor with another AWS service 2237 Amazon CloudWatch Add a VPC to an existing monitor User Guide You can choose to have Internet Monitor add a new VPC to an existing monitor for you when you create the VPC in the AWS Management Console. After you add the VPC, wait a few minutes, and then metrics for the VPC will start being shown on the Internet Monitor console. You can edit the monitor at any time, to remove the VPC or add another VPC or other resources. You can also change the percentage of traffic that you're monitoring, or make other changes. If you choose to remove the VPC from the monitor, traffic from clients to that VPC is no longer monitored by Internet Monitor. To learn more about updating a monitor, see Edit a monitor in Internet Monitor. Create a monitor for a VPC If you opt to create a monitor for a VPC, the Create monitor wizard walks you through the steps. You add the VPC as a monitored resource when you create the monitor. If you like, you can also choose a percentage of client traffic that you want to monitor for your application (the default is 100%). You can learn more by reviewing the information in Step 1: Create a monitor. Pricing With Internet Monitor, you pay only for what you use. Pricing for Internet Monitor has two components: a per monitored resource fee and a per city-network fee. A city-network is the location that clients access your application resources from and the network (an ASN, such as an internet service provider or ISP) that clients access the resources through. For more information, including pricing examples, see Pricing for Internet Monitor Stop monitoring a VPC If you'd like to stop monitoring your VPC resource with Internet Monitor, do the following in the Internet Monitor console: To remove a resource from a monitor 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the left navigation pane, under Network Monitoring, choose Internet monitors. 3. Choose your monitor, and then choose the Action menu. Add a monitor with another AWS service 2238 Amazon CloudWatch 4. Choose Update monitor. 5. Under Added resources, choose Remove resources. 6. Choose the VPC to remove, and then choose Remove. 7. Choose Update. Add an Internet Monitor monitor with CloudFront User Guide On the metrics dashboard for a distribution in Amazon CloudFront console, you can set up additional monitoring for a distribution in Internet Monitor. You can add the distribution to an existing monitor, or you can create a new monitor for the distribution. By using Internet Monitor with your CloudFront distribution, you can view and evaluate measurements and metrics about availability, performance, monitored bytes transferred, and round-trip times that are specific to your application's client locations and ASNs (typically internet service providers). Internet Monitor also determines when there are anomalies in performance and availability and creates health events in your monitor, which you can choose to be notified about. To learn more about how you can use a monitor to manage and improve your clients' experience with your application, see Use a monitor in Internet Monitor. Important To create a monitor, or add a distribution to an existing monitor, you must have the correct permissions in place. For more information, see Identity and Access Management for Internet Monitor. Add a distribution to an existing monitor You can choose to have Internet Monitor add a distribution to an existing monitor directly from the CloudFront metrics dashboard in the AWS Management
acw-ug-624
acw-ug.pdf
624
your monitor, which you can choose to be notified about. To learn more about how you can use a monitor to manage and improve your clients' experience with your application, see Use a monitor in Internet Monitor. Important To create a monitor, or add a distribution to an existing monitor, you must have the correct permissions in place. For more information, see Identity and Access Management for Internet Monitor. Add a distribution to an existing monitor You can choose to have Internet Monitor add a distribution to an existing monitor directly from the CloudFront metrics dashboard in the AWS Management Console. After you add the distribution, wait a few minutes, and then metrics for the distribution will start being shown on the Internet Monitor console. You can edit the monitor at any time, to remove the distribution or add another distribution or other resources. You can also change the percentage of traffic that you're monitoring, or make other changes. If you choose to remove the distribution from the monitor, traffic from clients to that distribution is no longer monitored by Internet Monitor. Add a monitor with another AWS service 2239 Amazon CloudWatch User Guide To learn more about updating a monitor, see Edit a monitor in Internet Monitor. Create a monitor for a distribution If you opt to create a monitor for a distribution, the Create monitor wizard walks you through the steps. You add the distribution as a monitored resource when you create the monitor. If you like, you can also choose a percentage of client traffic that you want to monitor for your application (the default is 100%). You can learn more by reviewing the information in Step 1: Create a monitor. Pricing With Internet Monitor, you pay only for what you use. Pricing for Internet Monitor has two components: a per monitored resource fee and a per city-network fee. A city-network is the location that clients access your application resources from and the network (an ASN, such as an internet service provider or ISP) that clients access the resources through. For more information, including pricing examples, see Pricing for Internet Monitor. Stop monitoring a distribution If you'd like to stop monitoring your distribution resource with Internet Monitor, do the following in the Internet Monitor console: To remove a resource from a monitor 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the left navigation pane, under Network Monitoring, choose Internet monitors. 3. Choose your monitor, and then choose the Action menu. 4. Choose Update monitor. 5. Under Added resources, choose Remove resources. 6. Choose the distribution to remove, and then choose Remove. 7. Choose Update. Create alarms with Internet Monitor You can create Amazon CloudWatch alarms based on Internet Monitor metrics, just as you can for other Amazon CloudWatch metrics. Create alarms 2240 Amazon CloudWatch User Guide For example, you can create an alarm based on the Internet Monitor metric PerformanceScore, and configure it to send a notification when the metric is lower than a value that you choose. You configure alarms for Internet Monitor metrics following the same guidelines as for other CloudWatch metrics. Following are the example Internet Monitor metrics that you might choose to create an alarm for: • PerformanceScore • AvailabilityScore • RoundtripTime To see all the metrics available for Internet Monitor, see View Internet Monitor metrics or set alarms in CloudWatch Metrics. The following procedure provides an example of setting an alarm on PerformanceScore by navigating to the metric in the CloudWatch dashboard. Then, you follow the standard CloudWatch steps to create an alarm based on a threshold that you choose, and set up a notification or choose other options. To create an alarm for PerformanceScore in CloudWatch Metrics 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. Choose Metrics, and then choose All metrics. 3. Filter for Internet Monitor by choosing AWS/InternetMonitor. 4. Choose MeasurementSource, MonitorName. 5. In the list, select PerformanceScore. 6. On the GraphedMetrics tab, under Actions, choose the bell icon to create an alarm based on a static threshold. Now, follow the standard CloudWatch steps to choose options for the alarm. For example, you can choose to be notified by an Amazon SNS message if PerformanceScore is below a specific threshold number. Alternatively, or in addition, you can add the alarm to a dashboard. Keep in mind the following: • Internet Monitor metrics are typically calculated and published within 20 minutes. Create alarms 2241 Amazon CloudWatch User Guide • When you create an alarm based on Internet Monitor metrics, make sure that you take into account the short delay before publication when you set an alarm’s lookback period. We recommend that you configure Evaluation Periods with lookback period that is a minimum of 25 minutes. To learn more about using CloudWatch alarms with Internet Monitor, see the following blog
acw-ug-625
acw-ug.pdf
625
specific threshold number. Alternatively, or in addition, you can add the alarm to a dashboard. Keep in mind the following: • Internet Monitor metrics are typically calculated and published within 20 minutes. Create alarms 2241 Amazon CloudWatch User Guide • When you create an alarm based on Internet Monitor metrics, make sure that you take into account the short delay before publication when you set an alarm’s lookback period. We recommend that you configure Evaluation Periods with lookback period that is a minimum of 25 minutes. To learn more about using CloudWatch alarms with Internet Monitor, see the following blog post: Using Internet Monitor for enhanced internet observability. For more information about options when you create a CloudWatch alarm, see Create a CloudWatch alarm based on a static threshold. Using Internet Monitor with Amazon EventBridge Overall (global) health events that Internet Monitor creates for networking issues are published with Amazon EventBridge, so that you can send notifications about a degradation in end users' experience for your application due to a global health event. Note Local health events are not published with EventBridge. To use EventBridge to work with Internet Monitor health events, follow the guidance here. To set up a rule for Internet Monitor in EventBridge 1. 2. In the AWS Management Console, in EventBridge, choose Rules, then enter a name and a description. Create the rule on the Default event bus. In Step 2, select Other for the event source, and then, under Event pattern, match the following source. { "source": ["aws.internetmonitor"] } 3. In Step 3, for the target, select AWS Service and CloudWatch Logs Group, then select an existing log group or create a new one. 4. Add any desired tags, and then create the rule. This should populate your selected CloudWatch Logs Group with events from EventBridge. EventBridge integration 2242 Amazon CloudWatch User Guide For more information about how EventBridge rules work with event patterns, see Amazon EventBridge event patterns in the Amazon EventBridge User Guide. Troubleshoot CloudWatch logs and metrics access errors To support some features, Internet Monitor must interact with certain Amazon CloudWatch resources, including logs and metrics. If Internet Monitor can't access the CloudWatch resources that it requires access to, Internet Monitor sets a status code of FAULT_ACCESS_CLOUDWATCH for the monitor. There are several reasons that your monitor might have the state FAULT_ACCESS_CLOUDWATCH. The following sections list possible causes for these errors, and suggested troubleshooting steps. Internet Monitor couldn't access CloudWatch logs in your account Internet Monitor publishes diagnostic logs about your monitored application traffic. It publishes these logs to log groups in CloudWatch Logs in the following location: /aws/internet- monitor/monitor_name/[byCity|byMetro|bySubdivision|byCountry]. Internet Monitor was unable to access these log groups. Error states and potential solutions: • PutLogEvents throttling error: The Internet Monitor service might have been throttled when it tried to publish your monitor's logs to CloudWatch. Review the throttling limits for your account, and, if necessary, request an increase in the limit. • Log group not found: Disable, and then re-enable your monitor. Enabling a monitor restarts log group creation, which might correct the problem. • PutLogEvents access denied error: Contact AWS support for assistance. • PutLogEvents unknown or general error: Contact AWS support for assistance. Internet Monitor couldn't access CloudWatch metrics in your account Internet Monitor delivers specific CloudWatch metrics about the application traffic that is tracked by a monitor. An error occurred when Internet Monitor tried to deliver these metrics to CloudWatch. Error states and potential solutions: Logs and metrics access errors 2243 Amazon CloudWatch User Guide • PutMetricData throttling error: The Internet Monitor service might have been throttled when it tried to publish your monitor's metrics to CloudWatch. Review the throttling limits for your account, and, if necessary, request an increase in the limit. • PutMetricData access denied error: Contact AWS support for assistance. • PutMetricData unknown or general error: Contact AWS support for assistance. Data protection and data privacy with Internet Monitor The AWS shared responsibility model applies to data protection and data privacy in Internet Monitor. 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. 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 more resources about complying with GDPR requirements, see the General Data Protection Regulation (GDPR) Center. We strongly recommend that you never put sensitive identifying information, such as your end users’ account numbers, email addresses, or other personal information, into free-form fields. Any data that you enter into Internet Monitor or other services might be included in diagnostic logs. Identity and Access Management
acw-ug-626
acw-ug.pdf
626
hosted on this infrastructure. 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 more resources about complying with GDPR requirements, see the General Data Protection Regulation (GDPR) Center. We strongly recommend that you never put sensitive identifying information, such as your end users’ account numbers, email addresses, or other personal information, into free-form fields. Any data that you enter into Internet Monitor or other services might be included in diagnostic logs. Identity and Access Management for Internet Monitor 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 Internet Monitor resources. IAM is an AWS service that you can use with no additional charge. Important Internet Monitor resource changes on July 8, 2024 If you created IAM policies that included Internet Monitor resources before July 8, 2024, be aware of the following change to Internet Monitor resources and resource types: • Resource-level permissions for the GetHealthEvent action are now supported only on the Monitor resource type. The permissions are not supported on the HealthEvent resource. Data protection and data privacy 2244 Amazon CloudWatch User Guide To see more information about the actions, resources, and condition keys that you can specify in policies to manage access to AWS resources in Internet Monitor, see Actions, resources, and condition keys for Internet Monitor. Contents • Upgrade IAM policies to IPv6 • How Internet Monitor works with IAM • AWS managed policies for Internet Monitor • Service-linked role for Internet Monitor Upgrade IAM policies to IPv6 Internet Monitor customers use IAM policies to set an allowed range of IP addresses, to prevent any IP addresses outside the configured range from being able to access Internet Monitor APIs. The internetmonitor.region.api.aws endpoint, where you access Internet Monitor APIs, is being upgraded to support dual-stack (IPv4 and IPv6). IP address filtering policies that are not updated to handle IPv6 addresses might result in clients losing access to Internet Monitor APIs. Customers impacted by the upgrade to include IPv6 Customers who are using dual-stack with policies that contain the aws:sourceIp filter are impacted by this upgrade. Dual-stack means that the network supports both IPv4 and IPv6. If you use dual-stack, you must update your IAM policies that are currently configured with IPv4 format addresses to include IPv6 format addresses. The following summarizes recommended actions, depending on your scenario. To confirm the endpoint that your SDK uses, see Identify the Internet Monitor endpoint used by your code. Endpoint Using IAM policy with aws:sourc eIp condition? Recommended action Identity and Access Management 2245 Amazon CloudWatch Endpoint Using IAM policy with aws:sourc eIp condition? internetmonitor.re Yes gion.amazonaws.com dual-stack) (not User Guide Recommended action To restrict access to IPv4 only, take no further action. Or, if you anticipate that you will need IPv6 support in the future, you can take action to ensure compatibi lity with both IPv4 and IPv6. To ensure future compatibi lity, on or after November 1, 2024, update your SDK, and then update your application to use the dual-stack endpoint by setting useDualstackEndpoi nt=true . For more informati on, see Dual-stack and FIPS endpoints. If you choose to use both IPv4 and IPv6, you must also update the IP address filtering condition (aws:sourceIp ) in your IAM policies to include IPv6 addresses. Identity and Access Management 2246 Amazon CloudWatch Endpoint User Guide Recommended action Using IAM policy with aws:sourc eIp condition? internetmonitor.re No gion.amazonaws.com dual-stack) (not To restrict access to IPv4 only, take no further action. Or, if you anticipate that you will need IPv6 support in the future, you can take action to ensure compatibi lity with both IPv4 and IPv6. To ensure future compatibi lity, on or after November 1, 2024, update your SDK, and then update your application to use the dual-stack endpoint by setting useDualstackEndpoi nt=true . For more informati on, see Dual-stack and FIPS endpoints. Identity and Access Management 2247 Amazon CloudWatch Endpoint User Guide Recommended action Using IAM policy with aws:sourc eIp condition? internetmonitor.re Yes gion.api.aws Currently, this endpoint supports only IPV4. On November 1, 2024, IPv6 will be enabled on this endpoint. To ensure future compatibility with both IPv4 and IPv6, on or after November 1, 2024, update your SDK, and then update your application to use the dual-stack endpoint by setting useDualst . For more ackEndpoint=true information, see Dual-stack and FIPS endpoints. When you make the change to use both IPv4 and IPv6, you must also update the IP address filtering condition (aws:sourc eIp ) in your IAM policies to include IPv6 addresses. If you instead want to restrict access
acw-ug-627
acw-ug.pdf
627
condition? internetmonitor.re Yes gion.api.aws Currently, this endpoint supports only IPV4. On November 1, 2024, IPv6 will be enabled on this endpoint. To ensure future compatibility with both IPv4 and IPv6, on or after November 1, 2024, update your SDK, and then update your application to use the dual-stack endpoint by setting useDualst . For more ackEndpoint=true information, see Dual-stack and FIPS endpoints. When you make the change to use both IPv4 and IPv6, you must also update the IP address filtering condition (aws:sourc eIp ) in your IAM policies to include IPv6 addresses. If you instead want to restrict access to IPv4 only, set useDualstackEndpoi nt=false . For more informati on, see Dual-stack and FIPS endpoints. Identity and Access Management 2248 Amazon CloudWatch Endpoint User Guide Recommended action Using IAM policy with aws:sourc eIp condition? internetmonitor.re No gion.api.aws Currently, this endpoint supports only IPV4. On November 1, 2024, IPv6 will be enabled on this endpoint. To ensure future compatibility with both IPv4 and IPv6, on or after November 1, 2024, update your SDK, and then update your application to use the dual-stack endpoint by setting useDualst . For more ackEndpoint=true information, see Dual-stack and FIPS endpoints. If you instead want to restrict access to IPv4 only, set useDualstackEndpoi nt=false . For more informati on, see Dual-stack and FIPS endpoints. For help with access issues, contact Support. What is IPv6? IPv6 is the next generation IP standard intended to eventually replace IPv4. IPv4 uses a 32-bit addressing scheme, to support 4.3 billion devices. IPv6 instead uses 128-bit addressing, to support approximately 340 trillion trillion trillion (or 2 to the 128th power) devices. The following are examples of IPv6 addresses: 2001:cdba:0000:0000:0000:0000:3257:9652 2001:cdba:0:0:0:0:3257:9652 Identity and Access Management 2249 Amazon CloudWatch 2001:cdba::3257:965 User Guide IPv6 offers a larger address space, improved routing efficiency, and better support for new internet services. By updating to dual-stack and supporting IPv6, Internet Monitor enables improved performance and scalability. Follow the steps in this section to update your configurations and take advantage of dual-stack support. Identify the Internet Monitor endpoint used by your code If you use an Internet Monitor SDK, start by verifying which endpoint your code is using: the IPv4 endpoint or the dual-stack (IPv4 and IPv6) endpoint. If you don’t use an SDK with Internet Monitor, you can skip this section. You can run the following code example to determine the Internet Monitor endpoint that you're using. For this example, we’re using the Internet Monitor SDK for Go in the US East (N. Virginia) Region. package main import ( "fmt" "log" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/internetmonitor" ) func main() { // Create a new session with the default configuration sess := session.Must(session.NewSession(&aws.Config{ Region: aws.String("us-east-1"), })) // Create a new Internet Monitor client internetMonitorClient := internetmonitor.New(sess) // Get the endpoint URL endpoint := internetMonitorClient.Endpoint fmt.Printf("Internet Monitor endpoint URL: %s\n", endpoint) } Identity and Access Management 2250 Amazon CloudWatch User Guide When you run this code, it returns the Internet Monitor endpoint. If you see the following response, you’re using the Internet Monitor domain that supports only IPv4. You can tell because the format of the endpoint URL includes amazonaws.com. Internet Monitor endpoint URL: https://internetmonitor.us-east-1.amazonaws.com If you see the following response instead, then you’re using the domain which is being upgraded to support dual-stack (IPv4 and IPv6). Here, you can tell because the endpoint URL includes api.aws. However, note that until the upgrade is complete, this endpoint supports only IPv4. Internet Monitor endpoint URL: https://internetmonitor.us-east-1.api.aws Update an IAM policy for IPv6 IAM policies use the aws:SourceIp filter to set an allowed range of IP addresses. Dual-stack supports both IPv4 and IPV6 traffic. If your network uses dual-stack, you must ensure that any IAM polices that are used for IP address filtering are updated to include IPv6 address ranges. For example, this policy allows IPv4 address ranges 192.0.2.0.* and 203.0.113.0.*, identified in the Condition element. # https://docs.aws.amazon.com/IAM/latest/UserGuide/ reference_policies_examples_aws_deny-ip.html { "Version": "2012-10-17", "Statement": { "Effect": "Deny", "Action": "*", "Resource": "*", "Condition": { "NotIpAddress": { "*aws:SourceIp*": [ "*192.0.2.0/24*", "*203.0.113.0/24*" ] }, "Bool": { "aws:ViaAWSService": "false" Identity and Access Management 2251 Amazon CloudWatch } } } } User Guide To update this policy, we'll change the policy's Condition element to add IPv6 address ranges, as shown in the following example: "Condition": { "NotIpAddress": { "*aws:SourceIp*": [ "*192.0.2.0/24*", <<Existing IPv4 address - DO NOT REMOVE>> "*203.0.113.0/24*", <<Existing IPv4 address - DO NOT REMOVE>> "*2001:DB8:1234:5678::/64*", <<New IPv6 IP address>> "*2001:cdba:3257:8593::/64*" <<New IPv6 IP address>> ] }, "Bool": { "aws:ViaAWSService": "false" } } Important Do not remove the existing IPv4 addresses in the policy. They are required for backward compatibility. For more information about managing access permissions with IAM, see Managed policies and inline policies in the AWS Identity and Access Management User Guide. Test the network after updating policies After you update your IAM policies to
acw-ug-628
acw-ug.pdf
628
as shown in the following example: "Condition": { "NotIpAddress": { "*aws:SourceIp*": [ "*192.0.2.0/24*", <<Existing IPv4 address - DO NOT REMOVE>> "*203.0.113.0/24*", <<Existing IPv4 address - DO NOT REMOVE>> "*2001:DB8:1234:5678::/64*", <<New IPv6 IP address>> "*2001:cdba:3257:8593::/64*" <<New IPv6 IP address>> ] }, "Bool": { "aws:ViaAWSService": "false" } } Important Do not remove the existing IPv4 addresses in the policy. They are required for backward compatibility. For more information about managing access permissions with IAM, see Managed policies and inline policies in the AWS Identity and Access Management User Guide. Test the network after updating policies After you update your IAM policies to include support for IPv6 addresses, we recommend that you test that your network can access an IPv6 endpoint. This section provides several examples, depending on the operating system that you use. Test network with Linux/Unix or Mac OS X If you use Linux/Unix or Mac OS X, you can test that your network can access the IPv6 endpoint by using the following curl command. Identity and Access Management 2252 Amazon CloudWatch User Guide curl -v -s -o /dev/null http://ipv6.ec2-reachability.amazonaws.com/ If you are connected over IPv6, the connected IP address displays information similar to the following: * About to connect() to aws.amazon.com port 443 (#0) * Trying IPv6 address... connected * Connected to aws.amazon.com (IPv6 address) port 443 (#0) > GET / HTTP/1.1 > User-Agent: curl/7.18.1 (x86_64-unknown-linux-gnu) libcurl/7.18.1 OpenSSL/1.0.1t zlib/1.2.3 > Host: aws.amazon.com Test network with Windows If you use Windows, you can test that your network can access a dual-stack endpoint over IPv6 or IPv4 by using a ping command, such as the following: ping aws.amazon.com If ping accesses the endpoint over IPv6, the command returns IPv6 addresses. Verify that clients can support IPv6 We recommend that before you switch to using the internetmonitor.{region}.api.aws endpoint, that you first verify that your clients can access other AWS service endpoints that are already IPv6- enabled. The following steps describe how to verify this by using an existing IPv6 endpoint. This example uses Linux and curl version 8.6.0, and uses the Amazon Athena service, which has IPv6-enabled endpoints located at the api.aws domain. Note Switch your AWS Region to the same Region where the client is located. In this example, we use the US East (N. Virginia) – us-east-1 endpoint. Use the following example to verify that your clients can access an IPv6-enabled AWS endpoint. 1. Verify that the Athena endpoint resolves with an IPv6 address by using the following command. Identity and Access Management 2253 Amazon CloudWatch User Guide dig +short AAAA athena.us-east-1.api.aws 2600:1f18:e2f:4e05:1a8a:948e:7c08:d2d6 2600:1f18:e2f:4e03:4a1e:83b0:8823:4ce5 2600:1f18:e2f:4e04:34c3:6e9a:2b0d:dc79 2. Now, determine if your client network can make a connection using IPv6 by using the following command: curl --ipv6 -o /dev/null --silent -w "\nremote ip: %{remote_ip}\nresponse code: %{response_code}\n" https://athena.us-east-1.api.aws remote ip: 2600:1f18:e2f:4e05:1a8a:948e:7c08:d2d6 response code: 404 If the remote IP address was identified and the response code is not 0, a network connection was successfully made to the endpoint using IPv6. If the remote IP address is blank or the response code is 0, the client network or the network path to the endpoint is IPv4-only. You can verify this with the following curl command: curl -o /dev/null --silent -w "\nremote ip: %{remote_ip}\nresponse code: %{response_code}\n" https://athena.us-east-1.api.aws remote ip: 3.210.103.49 response code: 404 If you run this command, and a remote IP address was identified and the response code is not 0, a network connection was successfully made to the endpoint using IPv4. How Internet Monitor works with IAM Before you use IAM to manage access to Internet Monitor, learn what IAM features are available to use with Internet Monitor. To see tables showing a similar high-level view of how AWS services work with most IAM features, see AWS services that work with IAM in the IAM User Guide. Identity and Access Management 2254 Amazon CloudWatch User Guide IAM features you can use with Internet Monitor IAM feature Internet Monitor support Identity-based policies Resource-based policies Policy actions Policy resources Policy condition keys (service-specific) ACLs Yes No Yes Yes Yes No ABAC (tags in policies) Partial Temporary credentials Principal permissions Service roles Service-linked roles Yes Yes No Yes Identity-based policies for Internet Monitor 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 identity-based policy because it applies to the user or role to which it is attached. To
acw-ug-629
acw-ug.pdf
629
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 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 and Access Management 2255 Amazon CloudWatch User Guide Resource-based policies within Internet Monitor 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. Policy actions for Internet Monitor 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 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 Internet Monitor actions, see Actions defined by Internet Monitor in the Service Authorization Reference. Policy actions in Internet Monitor use the following prefix before the action: internetmonitor To specify multiple actions in a single statement, separate them with commas. "Action": [ "internetmonitor:action1", "internetmonitor:action2" ] You can specify multiple actions using wildcards (*). For example, to specify all actions that begin with the word Describe, include the following action: Identity and Access Management 2256 Amazon CloudWatch User Guide "Action": "internetmonitor:Describe*" Policy resources for Internet Monitor Supports policy resources: Yes In the Service Authorization Reference, you can see the following information related to Internet Monitor: • To see a list of Internet Monitor resource types and their ARNs, see Resources defined by Internet Monitor. • To learn the actions that you can specify with the ARN of each resource, see Actions defined by Internet Monitor. 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": "*" Policy condition keys for Internet Monitor Supports service-specific policy condition keys: 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 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. Identity and Access Management 2257 Amazon CloudWatch User Guide 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 Internet Monitor condition keys, see Condition
acw-ug-630
acw-ug.pdf
630
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 Internet Monitor condition keys, see Condition keys for Internet Monitor in the Service Authorization Reference. To learn with which actions and resources you can use a condition key, see Actions defined by Internet Monitor. ACLs in Internet Monitor 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. ABAC with Internet Monitor Supports ABAC (tags in policies): Partial Internet Monitor has partial support for tags in policies. It supports tagging for one resource, monitors. To use tags with Internet Monitor, use the AWS Command Line Interface or an AWS SDK. Tagging for Internet Monitor is not supported with the AWS Management Console. To learn more about using tags in policies in general, review the following information. 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. Identity and Access Management 2258 Amazon CloudWatch User Guide 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 Internet Monitor 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. 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 keys. For more information, see Temporary security credentials in IAM. Cross-service principal permissions for Internet Monitor Supports forward access sessions (FAS): Yes 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 Identity and Access Management 2259 Amazon CloudWatch User Guide 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 Internet Monitor 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. Service-linked role for Internet Monitor Supports service-linked roles:
acw-ug-631
acw-ug.pdf
631
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 Internet Monitor 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. Service-linked role for Internet Monitor 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 more information about the service-linked role for Internet Monitor, see Service-linked role for Internet Monitor. For details about creating or managing service-linked roles in general in AWS, see AWS services that work with IAM. Find a service in the table that includes a Yes in the Service-linked role column. Choose the Yes link to view the service-linked role documentation for that service. AWS managed policies for Internet Monitor 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, Identity and Access Management 2260 Amazon CloudWatch User Guide 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. AWS managed policy: CloudWatchInternetMonitorServiceRolePolicy This policy is attached to the service-linked role named AWSServiceRoleForInternetMonitor to allow Internet Monitor to access resources in your account, such as Amazon Virtual Private Cloud resources or Network Load Balancers, so that you can select them when you create a monitor. For more information, see Service-linked role for Internet Monitor. AWS managed policy: CloudWatchInternetMonitorReadOnlyAccess You can attach CloudWatchInternetMonitorReadOnlyAccess to your IAM entities. This policy grants access to read-only actions to work with monitors and data in with Internet Monitor. Attach it to IAM users and other principals who need access to only read-only actions. Specifically, the scope of this policy includes internetmonitor: so that users can use read- only Internet Monitor actions and resources. It includes some cloudwatch: policies to retrieve information on CloudWatch metrics. It includes some logs: policies to manage log queries. To view the permissions for this policy, see CloudWatchInternetMonitorReadOnlyAccess in the AWS Managed Policy Reference. AWS managed policy: CloudWatchInternetMonitorFullAccess You can attach CloudWatchInternetMonitorFullAccess to your IAM entities. This policy grants full access to Actions for Internet Monitor for working with Internet Monitor. Attach it to IAM users and other principals who need full access to Internet Monitor actions. Specifically, scope of this policy includes internetmonitor: so that users can use Internet Monitor actions and resources. It includes some cloudwatch: policies to retrieve information on CloudWatch alarms and metrics. It includes some logs: policies to manage log queries. It includes some ec2:, cloudfront:, elasticloadbalancing:, and workspaces: policies to work with resources that you add to monitors so that Internet Monitor can create a traffic profile for your application. It contains some iam: policies to manage IAM roles. To view the permissions for this policy, see CloudWatchInternetMonitorFullAccess in the AWS Managed Policy Reference. Identity and Access Management 2261 Amazon CloudWatch User Guide Internet Monitor updates to AWS managed policies To view details about updates to AWS managed policies for Internet Monitor since this service began tracking these changes, see CloudWatch updates to AWS managed policies. For automatic alerts about managed policy changes in CloudWatch, subscribe to the RSS feed on the CloudWatch Document history page. Service-linked role for Internet Monitor Internet Monitor uses an AWS Identity and Access Management (IAM) service-linked role. A service- linked role is a unique type of IAM role that is linked directly to Internet Monitor. The service-linked role is predefined by Internet Monitor and includes all the permissions that the service requires to call
acw-ug-632
acw-ug.pdf
632
To view details about updates to AWS managed policies for Internet Monitor since this service began tracking these changes, see CloudWatch updates to AWS managed policies. For automatic alerts about managed policy changes in CloudWatch, subscribe to the RSS feed on the CloudWatch Document history page. Service-linked role for Internet Monitor Internet Monitor uses an AWS Identity and Access Management (IAM) service-linked role. A service- linked role is a unique type of IAM role that is linked directly to Internet Monitor. The service-linked role is predefined by Internet Monitor and includes all the permissions that the service requires to call other AWS services on your behalf. Internet Monitor defines the permissions of the service-linked role, and unless defined otherwise, only Internet Monitor can assume the role. The defined permissions include the trust policy and the permissions policy, and that permissions policy cannot be attached to any other IAM entity. You can delete the role only after first deleting its related resources. This restriction protects your Internet Monitor resources because you can't inadvertently remove permissions to access the resources. 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 role column. Choose a Yes with a link to view the service-linked role documentation for that service. Service-linked role permissions for Internet Monitor Internet Monitor uses the service-linked role named AWSServiceRoleForInternetMonitor. This role allows Internet Monitor to access resources in your account, such as Amazon Virtual Private Cloud resources, Amazon CloudFront distributions, Amazon WorkSpaces directories, and Network Load Balancers, so that you can select them when you create a monitor. This service-linked role uses the managed policy CloudWatchInternetMonitorServiceRolePolicy. The AWSServiceRoleForInternetMonitor service-linked role trusts the following service to assume the role: • internetmonitor.amazonaws.com Identity and Access Management 2262 Amazon CloudWatch User Guide To view the permissions for this policy, see CloudWatchInternetMonitorServiceRolePolicy in the AWS Managed Policy Reference. Creating a service-linked role for Internet Monitor You do not need to manually create the service-linked role for Internet Monitor. The first time that you create a monitor, Internet Monitor creates AWSServiceRoleForInternetMonitor for you. For more information, see Creating a service-linked role in the IAM User Guide. Editing a service-linked role for Internet Monitor After Internet Monitor creates a service-linked role in your account, you cannot change the name of the role because various entities might reference the role. 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 Internet Monitor If you no longer need to use a feature or service that requires a service-linked role, we recommend that you delete the role. That way you don’t have an unused entity that is not actively monitored or maintained. However, you must clean up the resources for the service-linked role before you can manually delete it. After you've removed your resources from your monitors in Internet Monitor and then deleted the monitors, you can delete the service-linked role AWSServiceRoleForInternetMonitor. Note If the Internet Monitor service is using the role when you try to delete it, then the deletion might fail. If that happens, wait for a few minutes and then try again. To manually delete the service-linked role using IAM Use the IAM console, the AWS CLI, or the AWS API to delete the AWSServiceRoleForInternetMonitor service-linked role. For more information, see Deleting a service-linked role in the IAM User Guide. Updates to the Internet Monitor service-linked role For updates to AWSServiceRoleForInternetMonitor, the AWS managed policy for the Internet Monitor service-linked role, see CloudWatch updates to AWS managed policies. For automatic Identity and Access Management 2263 Amazon CloudWatch User Guide alerts about managed policy changes in CloudWatch, subscribe to the RSS feed on the CloudWatch Document history page. Quotas in Internet Monitor Internet Monitor has the following quotas. Resource Default quota Monitors per Region Resources per monitor Days that resolved Internet Monitor health events are retained 50 50 400 Using Network Synthetic Monitor Network Synthetic Monitor provides visibility into the performance of the network connecting your AWS hosted applications to your on-premises destinations, and allows you to identify the source of any network performance degradation within minutes. Network Synthetic Monitor is fully managed by AWS, and doesn't require separate agents on monitored resources. Use Network Synthetic Monitor to visualize packet loss and latency of your hybrid network connections, and set alerts and thresholds. Then, based on this information, you can take action to improve your end users’ experience. Network Synthetic Monitor is intended for network operators and application developers who want real-time insights into network performance. Network Synthetic Monitor key features • Use Network Synthetic Monitor to benchmark your changing hybrid network environment with continuous real-time packet loss and latency metrics. •
acw-ug-633
acw-ug.pdf
633
network performance degradation within minutes. Network Synthetic Monitor is fully managed by AWS, and doesn't require separate agents on monitored resources. Use Network Synthetic Monitor to visualize packet loss and latency of your hybrid network connections, and set alerts and thresholds. Then, based on this information, you can take action to improve your end users’ experience. Network Synthetic Monitor is intended for network operators and application developers who want real-time insights into network performance. Network Synthetic Monitor key features • Use Network Synthetic Monitor to benchmark your changing hybrid network environment with continuous real-time packet loss and latency metrics. • When you connect by using AWS Direct Connect, Network Synthetic Monitor can help you to rapidly diagnose network degradation within the AWS network with the network health indicator (NHI), which Network Synthetic Monitor writes to your Amazon CloudWatch account. The NHI metric is a binary value, based on a probabilistic score about whether network degradation is within AWS. Quotas 2264 Amazon CloudWatch User Guide • Network Synthetic Monitor provides a fully-managed agent approach to monitoring, so you don’t need to install agents either on VPCs or on-premises. To get started, you just need to specify a VPC subnet and an on-premises IP address. You can establish a private connection between your VPC and Network Synthetic Monitor resources by using AWS PrivateLink. For more information, see Using CloudWatch, CloudWatch Synthetics, and CloudWatch Network Monitoring with interface VPC endpoints. • Network Synthetic Monitor publishes metrics to CloudWatch Metrics. You can create dashboards to view your metrics, and also create actionable thresholds and alarms on the metrics that are specific to your application. For more information, see How Network Synthetic Monitor works. Network Synthetic Monitor terminology and components • Probes — A probe is the traffic that's sent from an AWS-hosted resource to an on-premises destination IP address. Network Synthetic Monitor metrics measured by the probe are written into your CloudWatch account for every probe that's configured in a monitor. • Monitor — A monitor displays network performance and other health information for traffic that you have created Network Synthetic Monitor probes for. You add probes as part of creating a monitor, and then you can view network performance metrics information using the monitor. When you create a monitor for an application, you add an AWS hosted resource as the network source. Network Synthetic Monitor then creates a list of all possible probes between the AWS hosted resource and your destination IP addresses. You select the destinations that you want to monitor traffic for. • AWS network source — An AWS network source is a monitor probe's originating AWS source, which is a subnet in one of your VPCs. • Destination — A destination is the target in your on-premises network for the AWS network source. A destination is a combination of your on-premises IP addresses, network protocols, ports, and network packet size. IPv4 and IPv6 addresses are both supported. Network Synthetic Monitor requirements and limitations The following summarizes requirements and limitations for Network Synthetic Monitor. For specific quotas (or limits), see Network Synthetic Monitor quotas. • Monitor subnets must be owned by the same account as the monitor. Terminology and components 2265 Amazon CloudWatch User Guide • Network Synthetic Monitor doesn't provide automatic network failover in the event of an AWS network issue. • There's a charge for each probe that you create. For pricing details, see Pricing for Network Synthetic Monitor. How Network Synthetic Monitor works Network Synthetic Monitor is fully managed by AWS, and doesn't require separate agents on monitored resources. Instead, you specify probes by providing a VPC subnet and on-premises IP addresses. When you create a monitor in Network Synthetic Monitor for AWS-hosted resources, AWS creates and manages the infrastructure in the background that is required to perform round-trip time and packet loss measurements. Because AWS manages the required configurations, you can scale your monitoring rapidly, without needing to install or uninstall agents within your AWS infrastructure. When probes are created, customized elastic network interfaces (ENIs) are created and attached to probe instances and customer subnets. If Network Synthetic Monitor replaces a probe instance, for example, if it becomes unhealthy, Network Synthetic Monitor detaches the ENIs and reattaches them to the probe replacement. This means that ENI IP addresses are not changed after they are created, unless you delete a probe and create a new one for the same source and destination. Network Synthetic Monitor focuses monitoring on the routes taken by flows from your AWS-hosted resources instead of broadly monitoring all flows from your AWS Region. If your workloads spread across multiple Availability Zones, Network Synthetic Monitor can monitor routes from each of your private subnets. Network Synthetic Monitor publishes round-trip time and packet loss metrics to your Amazon CloudWatch account, based on the aggregation interval that
acw-ug-634
acw-ug.pdf
634
them to the probe replacement. This means that ENI IP addresses are not changed after they are created, unless you delete a probe and create a new one for the same source and destination. Network Synthetic Monitor focuses monitoring on the routes taken by flows from your AWS-hosted resources instead of broadly monitoring all flows from your AWS Region. If your workloads spread across multiple Availability Zones, Network Synthetic Monitor can monitor routes from each of your private subnets. Network Synthetic Monitor publishes round-trip time and packet loss metrics to your Amazon CloudWatch account, based on the aggregation interval that you set when you create a monitor. You can also use CloudWatch to set individual latency and packet loss thresholds for each monitor. For example, you might create an alarm for a packet loss sensitive workload to notify you if the packet loss average is higher than a static 0.1% threshold. You can also use CloudWatch anomaly detection to alarm on packet loss or latency metrics that are outside your desired ranges. Availability and performance measurements Network Synthetic Monitor sends periodic active probes from your AWS resource to your on- premises destinations. When you create a monitor, you specify the following: How Network Synthetic Monitor works 2266 Amazon CloudWatch User Guide • Aggregation interval: The time, in seconds, that CloudWatch receives the measured results. This will be either every 30 or 60 seconds. The aggregation period you choose for the monitor applies to all probes in that monitor. • Probe sources (AWS resources): A source for a probe is a VPC and associated subnets, or just a VPC subnet, in the Regions where your network operates. • Probe destinations (customer resources): A destination for a probe is the combination of on- premises IP addresses, network protocols, ports, and network packet size. • Probe protocol: One of the supported protocols, ICMP or TCP. For more information, see Supported communication protocols. • Port (for TCP): The port that your network uses to connect. • Packet size (for TCP): The size, in bytes, of each packet transmitted between your AWS hosted resource and your destination on a single probe. You can specify a different packet size for each probe in a monitor. A monitor publishes the following metrics: • Round-trip time: This metric, measured in microseconds, is a measure of performance. It records the time it takes for the probe to be transmitted to the destination IP address and for the associated response to be received. The round-trip time is the average time observed during the aggregation interval. • Packet loss: This metric measures the percentage of total packets sent and records the number of transmissions that didn't receive an associated response. No response implies that the packets were lost along the network path. Supported communication protocols Network Synthetic Monitor supports two protocols for probes: ICMP and TCP. ICMP-based probes carry ICMP echo requests from your AWS hosted resources to the destination address, and expect an ICMP echo reply in response. Network Synthetic Monitor uses the information on the ICMP echo request and reply messages to calculate round-trip time and packet loss metrics. TCP-based probes carry TCP SYN packets from your AWS hosted resources to the destination address and port, and expect a TCP SYN+ACK packet in response. Network Synthetic Monitor uses the information on the TCP SYN and TCP SYN+ACK messages to calculate round-trip time and How Network Synthetic Monitor works 2267 Amazon CloudWatch User Guide packet loss metrics. Network Synthetic Monitor periodically switches source TCP ports to increase network coverage, which increases the probability of detecting packet loss. Network health indicator for AWS Network Synthetic Monitor publishes a network health indicator (NHI) metric that provides information on issues with the AWS network for paths that include destinations connected through AWS Direct Connect. NHI is not supported for AWS Direct Connect attachments that are created using Cloud WAN or that use AWS Transit Gateway. The NHI binary value is based on a statistical measure of the health of the AWS-controlled network path from the AWS hosted resource, where the monitor is deployed, to the Direct Connect location. Network Synthetic Monitor uses anomaly detection to calculate availability drops or lower performance along the network paths. Note Each time that you create a new monitor, add a probe, or re-activate a probe, the NHI for the monitor is delayed by a few hours while AWS collects data to perform anomaly detection. To provide the NHI value, Network Synthetic Monitor applies statistical correlation across AWS sample datasets, as well as to the packet loss and round-trip latency metrics for traffic simulating your network path. NHI can be one of two values: 1 or 0. A value of 1 indicates that Network Synthetic Monitor observed a network degradation within the AWS controlled network path. A value
acw-ug-635
acw-ug.pdf
635
network paths. Note Each time that you create a new monitor, add a probe, or re-activate a probe, the NHI for the monitor is delayed by a few hours while AWS collects data to perform anomaly detection. To provide the NHI value, Network Synthetic Monitor applies statistical correlation across AWS sample datasets, as well as to the packet loss and round-trip latency metrics for traffic simulating your network path. NHI can be one of two values: 1 or 0. A value of 1 indicates that Network Synthetic Monitor observed a network degradation within the AWS controlled network path. A value of 0 indicates that Network Synthetic Monitor did not observe any network degradation for the AWS network along the path. Using the NHI value enables you to more quickly gain awareness of the cause of network issues. For example, you can set alerts on the NHI metric so you're notified about ongoing issues with the AWS network along your network paths. Support for IPv4 and IPv6 addresses Network Synthetic Monitor provides availability and performance metrics over IPv4 or IPv6 networks, and can monitor either IPv4 or IPv6 addresses from dual-stack VPCs. Network Synthetic Monitor doesn’t allow both IPv4 and IPv6 destinations to be configured in the same monitor; you can create separate monitors for IPv4-only and IPv6-only destinations. How Network Synthetic Monitor works 2268 Amazon CloudWatch User Guide Supported AWS Regions for Network Synthetic Monitor The AWS Regions where Network Synthetic Monitor is supported are listed in this section. For more information about Regions that Network Synthetic Monitor is supported in, including opt-in Regions, see Network Synthetic Monitor endpoints and quotas in the Amazon Web Services General Reference. Region name Asia Pacific (Hong Kong) Asia Pacific (Mumbai) Asia Pacific (Seoul) Asia Pacific (Singapore) Asia Pacific (Sydney) Asia Pacific (Tokyo) Canada (Central) Europe (Frankfurt) Europe (Ireland) Europe (London) Europe (Paris) Europe (Stockholm) Middle East (Bahrain) South America (São Paulo) US East (N. Virginia) US East (Ohio) Region ap-east-1 ap-south-1 ap-northeast-2 ap-southeast-1 ap-southeast-2 ap-northeast-1 ca-central-1 eu-central-1 eu-west-1 eu-west-2 eu-west-3 eu-north-1 me-south-1 sa-east-1 us-east-1 us-east-2 Supported AWS Regions 2269 Amazon CloudWatch Region name US West (N. California) US West (Oregon) Region us-west-1 us-west-2 User Guide Pricing for Network Synthetic Monitor With Network Synthetic Monitor, there are no upfront costs or long-term commitments. Pricing for Network Synthetic Monitor has the following two components: • An hourly fee per monitored AWS resource • CloudWatch metrics fees When you create a monitor in Network Synthetic Monitor, you associate AWS resources (sources) with it to be monitored. For Network Synthetic Monitor, these resources are subnets in Amazon Virtual Private Cloud (VPC). For each resource, you can create up to four probes, each of which is for traffic from a subnet in the VPC to four of your destination IP addresses. To help control your bill, you can adjust your subnet coverage and on-premises IP address destination coverage by reducing the number of resources that you monitor. For more information about pricing, see the Amazon CloudWatch pricing page. Network Synthetic Monitor API operations The following table lists Network Synthetic Monitor API operations that you can use with Amazon CloudWatch. Refer to this table for links to relevant documentation. Action API reference More information Create a monitor between a source subnet and destination IP address. See CreateMonitor See Create a monitor Create a probe within a monitor. See CreateProbe See Activate or deactivate a probe Pricing 2270 Amazon CloudWatch User Guide Action API reference More information Remove a monitor. See DeleteMonitor See Delete a monitor Delete a specific probe. See DeleteProbe See Delete a probe Get information about a monitor. See GetMonitor Get information about a specific probe. See GetProbe Get a list of all your monitors. See ListMonitors See Working with monitors and probes in Network Synthetic Monitor See Working with monitors and probes in Network Synthetic Monitor See Working with monitors and probes in Network Synthetic Monitor List tags assigned to a resource. Add key-value pairs, or tags, to a monitor or probe. Remove a key-value pair, or tag, from a monitor or probe. Update an aggregation period for a monitor. See ListTagsForResource See Tag or untag resources See TagResource See Tag or untag resources See UntagResource See Tag or untag resources See UpdateMonitor See Edit a monitor Update a probe in a monitor. See UpdateProbe See Edit a probe Working with monitors and probes in Network Synthetic Monitor To get started, create a monitor with probes in Network Synthetic Monitor to measure network performance over a specified aggregation period. Then, you can update a monitor to make desired changes, for example, to change the aggregation period, deactivate or activate probes, or add or remove tags. Working with monitors and probes 2271 Amazon CloudWatch User Guide The following sections provide step-by-step instructions for completing these tasks for
acw-ug-636
acw-ug.pdf
636
See Tag or untag resources See UpdateMonitor See Edit a monitor Update a probe in a monitor. See UpdateProbe See Edit a probe Working with monitors and probes in Network Synthetic Monitor To get started, create a monitor with probes in Network Synthetic Monitor to measure network performance over a specified aggregation period. Then, you can update a monitor to make desired changes, for example, to change the aggregation period, deactivate or activate probes, or add or remove tags. Working with monitors and probes 2271 Amazon CloudWatch User Guide The following sections provide step-by-step instructions for completing these tasks for your monitors and probes by using the Amazon CloudWatch console. You can also make changes to your monitor by using the AWS Command Line Interface. Topics • Create a monitor • Edit a monitor • Delete a monitor • Activate or deactivate a probe • Add a probe to a monitor • Edit a probe • Delete a probe • Tag or untag resources Create a monitor The following sections describe how to create a monitor in Network Synthetic Monitor, including the required probes. When you create a monitor, you specify probes by choosing source subnets, and then adding up to four destinations for each one. Each source-destination pair is a probe. You can make changes to a monitor after you create it, for example, to add, remove, or deactivate probes. For more information, see Working with monitors and probes in Network Synthetic Monitor. You can work with monitors and probes by using either the Amazon CloudWatch console or the AWS Command Line Interface. To work with Network Synthetic Monitor programmatically, see the Network Synthetic Monitor API Reference and networkmonitor in the AWS Command Line Interface Command Reference. The following procedures provide step-by-step instructions for how to create a monitor by using the Amazon CloudWatch console. • Define monitor details • Choose sources and destinations • Confirm probes • Review and create monitor Working with monitors and probes 2272 Amazon CloudWatch Important User Guide These steps are designed to be completed all at once. You can't save in-process work to continue later. Define monitor details The first step to create a monitor is to define the basic details, by giving the monitor a name and defining the aggregation period. Optionally, you can also add tags. To define monitor details 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/, and then, under Network Monitoring, choose Synthetic monitors. 2. Choose Create monitor. 3. 4. For Monitor name, enter a name for the monitor. For Aggregation period, choose how often you want to send metrics to CloudWatch: 30 seconds or 60 seconds. Note A shorter aggregation period provides faster detection of network issues. However, the aggregation period that you choose can affect your billing costs. For more information about pricing, see the Amazon CloudWatch pricing page. 5. (Optional) For Tags, add Key and Value pairs to help identify this resource, so that you can search or filter on specific information. 1. Choose Add new tag. 2. Enter a Key name and associated Value. 3. Choose Add new tag to add the new tag. You can add multiple tags by choosing Add new tag, or you can remove a tag by choosing Remove. 4. If you want to associate your tags with the probes for the monitor, keep Add tags to probes created by monitor selected. This adds the tags to the monitor probes, which can be helpful for tag-based authentication or metering. Working with monitors and probes 2273 Amazon CloudWatch User Guide 6. Choose Next. On the next page, you'll specify sources and destinations, to create probes for the monitor. Choose sources and destinations For each monitor in Network Synthetic Monitor, you specify one or more probes, which are a combination of an AWS source and a destination. • A source for a probe is a VPC and associated subnets (or just a VPC subnet) in the Regions where your network operates. • A destination is the combination of on-premises IP addresses, network protocols, ports, and network packet size. Important These steps are designed to be completed all at once. You can't save in-process work to continue later. To choose sources and destinations 1. Prerequisite: Define monitor details. 2. Under AWS network source, choose one or more subnets to include in the monitor. To choose all subnets within a VPC, choose the VPC. Or, choose specific subnets within a VPC. The subnets that you choose are the monitor sources. 3. For Destination 1, enter a destination IP address of the on-premises network. IPv4 and IPv6 addresses are both supported. 4. Choose Advanced settings. 5. For Protocol, choose the network protocol for the on-premises destination. The protocol can be either ICMP or TCP. 6. If you choose TCP, enter the following information: 1. Enter the Port
acw-ug-637
acw-ug.pdf
637
Define monitor details. 2. Under AWS network source, choose one or more subnets to include in the monitor. To choose all subnets within a VPC, choose the VPC. Or, choose specific subnets within a VPC. The subnets that you choose are the monitor sources. 3. For Destination 1, enter a destination IP address of the on-premises network. IPv4 and IPv6 addresses are both supported. 4. Choose Advanced settings. 5. For Protocol, choose the network protocol for the on-premises destination. The protocol can be either ICMP or TCP. 6. If you choose TCP, enter the following information: 1. Enter the Port that your network uses to connect. The port must be a number from 1 to 65535. 2. Enter the Packet size. This is the size, in bytes, of each packet that's sent on the probe, between the source and destination. Packet size must be a number from 56 to 8500. Working with monitors and probes 2274 Amazon CloudWatch User Guide 7. Choose Add destination to add another on-premises destination to the monitor. Repeat these steps for each destination that you want to add. 8. When you're finished adding sources and destinations, choose Next to confirm the probes for the monitor. Confirm probes On the Confirm probes page, review all the probes that will be created for the monitor, to make sure that they're the correct set of sources and destinations. The Confirm probes page shows all the possible combinations of the sources and destinations for the probe specifications that you provided in the previous step. For example, if you have six source subnets and four destination IP addresses, there are 24 possible probe combinations, so 24 probes will be created. Important • These steps are intended to be completed in one session. You can't save in-process work to continue later. • The Confirm probes page does not indicate whether a probe is valid. We recommend that you review this page carefully, and then delete any probes that aren't valid. You might be charged for probes that aren't valid if you don't remove them. To confirm monitor probes 1. Prerequisite: Choose sources and destinations. 2. On the Confirm probes page, review the list of source and destination probe combinations. 3. Choose any probes that you want to remove from the monitor, and then choose Remove. Note You are not prompted to confirm deleting a probe. If you delete a probe and want to restore it, you must set it up again. You can add a probe to an existing monitor by following the steps in Add a probe to a monitor. 4. Choose Next, and then review the monitor details. Working with monitors and probes 2275 Amazon CloudWatch Review and create monitor User Guide The final step is to review the details of the monitor and the probes for the monitor, and then create the monitor. You can change any information about the monitor at this point. When you have finished reviewing and updating any information that isn't correct, create the monitor. As soon as you create the monitor, Network Synthetic Monitor begins tracking metrics and you'll start being charged for probes in the monitor. Important • This step is intended to be completed in one session. You can't save in-process work to continue later. • If you choose to edit a section, you must step through the process to create a monitor from the point that you make the edits. Earlier monitor creation pages maintain the information that you already entered. To review and create a monitor 1. On the Review and create probes page, choose Edit for any section where you want to make changes. 2. Make changes in that section, and then choose Next. 3. When you're finished making edits, choose Create monitor. The Network Synthetic Monitor page displays the current state of monitor creation in the Monitors section. When Network Synthetic Monitor is still creating the monitor, the State is Pending. When the State changes to Active, you can view CloudWatch metrics in the monitor dashboard. For information on working with the monitor dashboard, see Network Synthetic Monitor dashboards. Working with monitors and probes 2276 Amazon CloudWatch Note User Guide It can take several minutes for a newly-added monitor to begin collecting network metrics. Edit a monitor You can edit information for a Network Synthetic Monitor, including change the name, setting a new aggregation period, or adding or removing tags. Changing a monitor's information does not change any of its associated probes. You can work with monitors and probes by using either the Amazon CloudWatch console or the AWS Command Line Interface. To work with Network Synthetic Monitor programmatically, see the Network Synthetic Monitor API Reference and networkmonitor in the AWS Command Line Interface Command Reference. To edit a monitor using the console 1. Open the CloudWatch
acw-ug-638
acw-ug.pdf
638
newly-added monitor to begin collecting network metrics. Edit a monitor You can edit information for a Network Synthetic Monitor, including change the name, setting a new aggregation period, or adding or removing tags. Changing a monitor's information does not change any of its associated probes. You can work with monitors and probes by using either the Amazon CloudWatch console or the AWS Command Line Interface. To work with Network Synthetic Monitor programmatically, see the Network Synthetic Monitor API Reference and networkmonitor in the AWS Command Line Interface Command Reference. To edit a monitor using the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/, and then, under Network Monitoring, choose Synthetic monitors. 2. In the Monitors section, choose the monitor that you want to edit. 3. On the monitor dashboard page, choose Edit. 4. 5. For the Monitor name, enter the new name for the monitor. For the Aggregation period, choose how often you want to send metrics to CloudWatch. Valid periods are: • 30 seconds • 60 seconds Note A shorter aggregation period provides faster detection of network issues. However, the aggregation period that you choose can affect your billing costs. For more information about pricing, see the Amazon CloudWatch pricing page. Working with monitors and probes 2277 Amazon CloudWatch User Guide 6. (Optional) In the Tags section, add Key and Value pairs to further help identify this resource, allowing you to search or filter on specific information. You can also just change the Value of any current Key. 1. Choose Add new tag. 2. Enter a Key name and associated Value. 3. Choose Add new tag to add the new tag. You can add multiple tags by choosing Add new tag, or you can remove a tag by choosing Remove. 4. If you want to associate your tags with the monitor, keep Add tags to probes created by monitor checked. This adds the tags to the monitor probes, which can be helpful if you're using tag-based authentication or metering. 7. Choose Save changes. Delete a monitor Before you can delete a monitor in Network Synthetic Monitor, you must deactivate or delete all probes associated with the monitor, regardless of the monitor State. After a monitor is deleted, you are no longer be charged for probes in the monitor. Be aware that you can't restore a deleted monitor. You can work with monitors and probes by using either the Amazon CloudWatch console or the AWS Command Line Interface. To work with Network Synthetic Monitor programmatically, see the Network Synthetic Monitor API Reference and networkmonitor in the AWS Command Line Interface Command Reference. To delete a monitor using the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/, and then, under Network Monitoring, choose Synthetic monitors. 2. In the Monitors section, choose the monitor that you want to delete. 3. Choose Actions, and then choose Delete. 4. If you have any active probes for the monitor, you're prompted to deactivate them. Choose Deactivate probes. Working with monitors and probes 2278 Amazon CloudWatch Note User Guide You can't cancel or undo this action after you choose Deactivate probes. Deactivated probes, however, aren't removed from the monitor. If you like, you can reactivate them later. For more information, see Activate or deactivate a probe. 5. Enter confirm in the confirmation field, and then choose Delete. Alternatively, you can delete a monitor programmatically, for example, by using the AWS Command Line Interface. To delete a monitor by using the CLI 1. To delete a monitor, you need the monitor name. If you don't know the name, get a list of your monitors by running the list-monitors command. Note the name of the monitor that you want to delete. 2. Verify whether the monitor contains any active probes. Use get-monitor with the monitor name from the previous step. This returns a list of any probes associated with that monitor. 3. If the monitor contains active probes, you must first either set the probes to inactive or delete them. • To set a probe to inactive, use update-probe, and set the state to INACTIVE. • To delete a probe, use delete-probe. 4. After the probes are set to INACTIVE or deleted, you can delete the monitor by running the delete-monitor command. Inactive probes are not deleted when you delete the monitor. Activate or deactivate a probe You can activate or deactivate a probe in a monitor in Network Synthetic Monitor. You might want to deactivate a probe, for example, if you aren't currently using it but might want to use it again in the future. By deactivating a probe instead of deleting it, you won't need to spend time setting it up again. You are not billed for deactivated probes. You can work with monitors and probes by using either the Amazon CloudWatch console or the AWS
acw-ug-639
acw-ug.pdf
639
running the delete-monitor command. Inactive probes are not deleted when you delete the monitor. Activate or deactivate a probe You can activate or deactivate a probe in a monitor in Network Synthetic Monitor. You might want to deactivate a probe, for example, if you aren't currently using it but might want to use it again in the future. By deactivating a probe instead of deleting it, you won't need to spend time setting it up again. You are not billed for deactivated probes. You can work with monitors and probes by using either the Amazon CloudWatch console or the AWS Command Line Interface. To work with Network Synthetic Monitor programmatically, see Working with monitors and probes 2279 Amazon CloudWatch User Guide the Network Synthetic Monitor API Reference and networkmonitor in the AWS Command Line Interface Command Reference. To set a probe to active or inactive by using the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/, and then, under Network Monitoring, choose Synthetic monitors. 2. Choose the Monitor details tab. 3. In the Probes section, choose the probe that you want to activate or deactivate. 4. Choose Actions, and then choose Activate or Deactivate. Note When you reactivate a probe, you begin incurring billing charges on the probe again. Add a probe to a monitor You can add a probe to an existing monitor in Network Synthetic Monitor. Note that when you add probes to a monitor, your billing structure is updated to include the new probe. You can work with monitors and probes by using either the Amazon CloudWatch console or the AWS Command Line Interface. To work with Network Synthetic Monitor programmatically, see the Network Synthetic Monitor API Reference and networkmonitor in the AWS Command Line Interface Command Reference. To add a probe to a monitor using the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/, and then, under Network Monitoring, choose Synthetic monitors. 2. In the Monitors section, do one of the following: • Choose the Name link of the monitor that you want to add a probe to. Choose the Monitor details tab, and then in the Probes section, choose Add probe. • Choose the monitor check box, choose Actions, and then choose Add probe. 3. On the Add probe page, do the following: 1. Under AWS network source, choose a subnet to add to the monitor. Working with monitors and probes 2280 Amazon CloudWatch User Guide Note You can only add one probe at a time and up to four probes per monitor. 2. Enter the destination IP address of the on-premises network. Both IPv4 and IPv6 addresses are supported. 3. Choose Advanced settings. 4. Choose the network Protocol for the destination. It can be either ICMP or TCP. 5. If the Protocol is TCP, enter the following information. Otherwise, skip to the next step: • Enter the Port that your network uses to connect. The port must be a number from 1 to 65535. • Enter the Packet size. This is the size, in bytes, of each packet sent along the probe between the source and destination. Packet size must be a number from 56 to 8500. 4. (Optional) In the Tags section, add Key and Value pairs to further help identify this resource, allowing you to search or filter on specific information. 1. Choose Add new tag. 2. Enter a Key name and associated Value. 3. Choose Add new tag to add the new tag. You can add multiple tags by choosing Add new tag, or you can remove any tag by choosing Remove. 5. Choose Add probe. While the probe is being activated, the State shows Pending. It might take several minutes for the probe to become Active. Edit a probe You can change any information for an existing probe, regardless of whether that probe is active or inactive. You can work with monitors and probes by using either the Amazon CloudWatch console or the AWS Command Line Interface. To work with Network Synthetic Monitor programmatically, see the Network Synthetic Monitor API Reference and networkmonitor in the AWS Command Line Interface Command Reference. Working with monitors and probes 2281 Amazon CloudWatch User Guide To edit a probe by using the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/, and then, under Network Monitoring, choose Synthetic monitors. Under Name, choose a monitor link to open the monitor dashboard. 2. Choose the Monitor details tab. 3. In the Probes section, choose the link for the probe that you want to edit. 4. On the probe details page, choose Edit. 5. On the Edit probe page, enter the new destination IP address for the probe. IPv4 and IPv6 addresses are both supported. 6. Choose Advanced settings. 7. Choose a network Protocol, ICMP or TCP. 8. If the Protocol is TCP, enter the following information: •
acw-ug-640
acw-ug.pdf
640
Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/, and then, under Network Monitoring, choose Synthetic monitors. Under Name, choose a monitor link to open the monitor dashboard. 2. Choose the Monitor details tab. 3. In the Probes section, choose the link for the probe that you want to edit. 4. On the probe details page, choose Edit. 5. On the Edit probe page, enter the new destination IP address for the probe. IPv4 and IPv6 addresses are both supported. 6. Choose Advanced settings. 7. Choose a network Protocol, ICMP or TCP. 8. If the Protocol is TCP, enter the following information: • Enter the Port that your network uses to connect. The port must be a number from 1 to 65535. • Enter the Packet size. This is the size, in bytes, of each packet sent along the probe between the source and destination. Packet size must be a number from 56 to 8500. 9. (Optional) Add, change, or remove Tags for the probe. 10. Choose Save changes. Delete a probe You can delete a probe rather than deactivating it if you know that you won't need it again later. You can't recover a deleted probe; instead, you must recreate it. Billing charges end for a probe when the probe is deleted. You can work with monitors and probes by using either the Amazon CloudWatch console or the AWS Command Line Interface. To work with Network Synthetic Monitor programmatically, see the Network Synthetic Monitor API Reference and networkmonitor in the AWS Command Line Interface Command Reference. To delete a probe using the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/, and then, under Network Monitoring, choose Synthetic monitors. Working with monitors and probes 2282 Amazon CloudWatch User Guide 2. In the Monitors section, under Name, choose a monitor link to open the monitor dashboard. 3. Choose the Monitor details tab. 4. Choose the monitor check box, choose Actions, and then choose Delete. 5. In the Delete probe dialog box, do the following: 6. Choose Delete to confirm that you want to delete the probe. The State of the probe in the Probes section shows Deleting. After it's deleted, the probe is removed from the Probes section. Tag or untag resources You can work with resource tags in Network Synthetic Monitor, to add or remove tags. You can update tags by updating monitors or probes in the console. Or, you can work with tags programmatically, for example, by using the AWS Command Line Interface. To update monitor tags by using the CLI • To list resource tags, use list-tags-for-resources. • To tag a resource, use tag-resource. • To untag a resource, use untag-resource. Network Synthetic Monitor dashboards You can use dashboards in Network Synthetic Monitor to determine if a network issue is caused by AWS, by using the network health indicator (NHI), and view probe round-trip time and packet loss. You can view this information and metrics for monitors, as well as for individual probes. Network Synthetic Monitor creates several metrics that you can view in CloudWatch Metrics. You can specify alarms for the metrics that Network Synthetic Monitor returns. For more information, see Probe alarms. Topics • Monitor dashboards • Probe dashboards • Specify metrics time frame Network Synthetic Monitor dashboards 2283 Amazon CloudWatch Monitor dashboards User Guide You can use the monitor dashboard in Network Synthetic Monitor to view the network health indicator (NHI), as well as probe round-trip time and packet loss at a monitor level. That is, a monitor dashboard shows this information for all the probes created for the monitor. Network Synthetic Monitor also has dashboards for probes, to view the information at a probe level. For more information, see Probe dashboards. To access a monitor dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/, and then under Network Monitoring, choose Synthetic monitors. 2. In the Monitors section, choose the Name link to open the monitor dashboard. Overview page The Overview page displays the following information for a monitor: • Network health — Network health displays the network health indicator (NHI) value, which pertains to health of only the AWS network. The NHI status is displayed as Healthy or Degraded. A Healthy status indicates that Network Synthetic Monitor did not observe issues with the AWS network. A Degraded status indicates that Network Synthetic Monitor observed an issue with the AWS network. The status bar in this section shows the status of the network health indicator over a default time of one hour. Hover over any point in the status bar to view additional details. • Probe traffic summary — Displays the current state of the traffic between the source AWS subnets specified for the probes in the monitor and the probes' destination IP addresses. This summary displays the following: • Probes in alarm — This number indicates how many
acw-ug-641
acw-ug.pdf
641
not observe issues with the AWS network. A Degraded status indicates that Network Synthetic Monitor observed an issue with the AWS network. The status bar in this section shows the status of the network health indicator over a default time of one hour. Hover over any point in the status bar to view additional details. • Probe traffic summary — Displays the current state of the traffic between the source AWS subnets specified for the probes in the monitor and the probes' destination IP addresses. This summary displays the following: • Probes in alarm — This number indicates how many of your probes in this monitor are in a degraded state. An alarm is triggered when a metric that you've set up as an alarm is triggered. For information on creating alarms for metrics in Network Synthetic Monitor, see Probe alarms. • Packet loss — The number of packets that were lost from the source subnet to the destination IP address. This is represented as a percentage of the total packets sent. • Round-trip time — The time it takes, displayed in milliseconds, for a packet from the source subnet to reach the destination IP address, and then come back again. Round-trip time is the average RTT observed during the aggregation period. Network Synthetic Monitor dashboards 2284 Amazon CloudWatch User Guide The data is represented on an interactive graph, so you can explore to learn details. By default, data is displayed for a two-hour time frame, calculated from the current date and time. However, you can change the range to fit your needs. For more information, see Specify metrics time frame. Tracking metrics The Overview dashboard in Network Synthetic Monitor displays a graphical representation of a monitor and probes. The following graphs are shown: • Network health indicator — This represents the the NHI values over a specified period. NHI indicates whether a network issue is due to problems with the AWS network. NHI is displayed as Healthy (no issue with the AWS network) or Degraded (there is an issue with the AWS network). In the following example, you can see that from 15:00 UTC until 15:05 UTC, there was a network issue that was due to an AWS network issue (Degraded). After 15:05, the network issue with the AWS network ended, so the value returned to Healthy. You can hover over any section of the graph to see additional details. Note The NHI indicates that an issue is due to the AWS network. It does not describe the overall health of the AWS network nor the health of Network Synthetic Monitor probes. • Packet loss — This graph displays a line that shows the percentage of packet loss for each probe in a monitor. The legend at the bottom of the page displays each of the probes in the monitor, color-coded for uniqueness. You can hover over a probe in the chart to see the source subnet, the destination IP address, and the percentage of packet loss. Network Synthetic Monitor dashboards 2285 Amazon CloudWatch User Guide In the following example, a packet loss alarm was created for a probe from a subnet to IP address 127.0.0.1. The alarm was triggered when the packet loss threshold was exceeded for the probe. If you hover over the graph, you can see the probe source and destination, and that there was a 30.97% packet loss for this probe on November 21 at 02:41:30. • Round-trip time — This graph displays a line that shows the round-trip time for each probe. The legend at the bottom of the page displays each of the probes in the monitor, color-coded for uniqueness. You can hover over a probe in the chart to see the source subnet, the destination IP address, and the round-trip time. The following example shows that on Tuesday, Nov 21, at 21:45:30, the round-trip time for a probe from a subnet to IP address 127.0.0.1 was 0.075 seconds. Network Synthetic Monitor dashboards 2286 Amazon CloudWatch User Guide Monitor details The Monitor details page displays details about your monitor, including a list of the probes for the monitor. You can update or add tags, or add a probe. The page includes the following sections: • Monitor details — This page provides details about your monitor. You can't edit information in this section. However, you can view details of the Network Synthetic Monitor service-linked role: choose the Role name link to see details. • Probes — This section displays a list of all probes associated with the monitor. Choose a VPC or Subnet ID link to open the VPC or subnet details in the Amazon VPC Console. You can modify a probe, to activate or deactivate it. For more information, see Working with monitors and probes in Network Synthetic Monitor. The Probes section displays
acw-ug-642
acw-ug.pdf
642
sections: • Monitor details — This page provides details about your monitor. You can't edit information in this section. However, you can view details of the Network Synthetic Monitor service-linked role: choose the Role name link to see details. • Probes — This section displays a list of all probes associated with the monitor. Choose a VPC or Subnet ID link to open the VPC or subnet details in the Amazon VPC Console. You can modify a probe, to activate or deactivate it. For more information, see Working with monitors and probes in Network Synthetic Monitor. The Probes section displays information about each probe set up for that monitor, including the probe ID, the VPC ID, the Subnet ID, IP address, Protocol, and whether the probe is Active or Inactive. If you've created an alarm for a probe, the current Status of the alarm is shown. A status of OK indicates that there are no metrics events have triggered any alarms. A status of In alarm indicates that a metric that you created in CloudWatch triggered an alarm. If no status is displayed for a probe, then there isn't a CloudWatch alarm for it. For information on the types of Network Synthetic Monitor probe alarms that you can create, see Probe alarms. • Tags — View the current tags for a monitor. You can add or remove tags by choosing Manage tags. This opens the Edit probe page. For more information on editing tags, see Edit a monitor. Network Synthetic Monitor dashboards 2287 Amazon CloudWatch Probe dashboards User Guide You can use a Probe dashboard in Network Synthetic Monitor to view the network health indicator (NHI) for a probe, as well as information about round-trip time and packet loss for specific probes. There are two dashboards for probes: an Overview page and Probe details page. You can create CloudWatch alarms to set packet loss and round-trip time metric thresholds. When a threshold is reached for a metric, a CloudWatch alarm notifies you. For information on creating probe alarms, see Probe alarms. To access a probe dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/, and then, under Network Monitoring, choose Synthetic monitors. 2. 3. In the Monitors section, choose the Name link to open the dashboard for a specific monitor. To view the dashboard for a specific probe, choose the ID link for the probe. Overview page The Overview page displays the following information for a probe: • Network health — Network health displays the network health indicator (NHI) value, which pertains only to health of the AWS network. The NHI status is provided as Healthy or Degraded. A Healthy status indicates that Network Synthetic Monitor did not observe issues with the AWS network for a probe. A Degraded status indicates that Network Synthetic Monitor observed an issue with the AWS network. The status bar in this section shows the status of the network health indicator over a default time of one hour. Hover over any point in the status bar to view additional details. • Packet loss — The number of packets that were lost from the source subnet to the destination IP address for this probe. • Round-trip time — The time it takes, in milliseconds, for a packet from the source subnet to reach the destination IP address, and then come back again. Round-trip time (RTT) is the average RTT observed during the aggregation period. Network Synthetic Monitor dashboards 2288 Amazon CloudWatch Probe details User Guide The Probe details page displays information about a probe, including the source and destination. You can also edit the probe, for example, to activate or deactivate it. For more information, see Working with monitors and probes in Network Synthetic Monitor. • Probe details — This section provides general information about the probe, which can't be edited. • Probe source and destination — This section displays details about the probe. Choose a VPC or Subnet ID link to open the VPC or subnet details in the Amazon VPC Console. You can modify a probe, for example, to activate or deactivate it. • Tags — View the current tags for a monitor. You can add or remove tags by choosing Manage tags. This opens the Edit probe page. For more information on editing tags, see Edit a probe. Specify metrics time frame Metrics and events on the dashboards in Network Synthetic Monitor use a default time of two hours, calculated from the current time, but you can set a custom metrics default time frame to use. You can change the default to one of the following presets for the metrics time frame: • 1h — one hour • 2h — two hours • 1d — one day • 1w — one week You can also set a custom time frame. Choose Custom, choose an
acw-ug-643
acw-ug.pdf
643
the Edit probe page. For more information on editing tags, see Edit a probe. Specify metrics time frame Metrics and events on the dashboards in Network Synthetic Monitor use a default time of two hours, calculated from the current time, but you can set a custom metrics default time frame to use. You can change the default to one of the following presets for the metrics time frame: • 1h — one hour • 2h — two hours • 1d — one day • 1w — one week You can also set a custom time frame. Choose Custom, choose an Absolute or Relative time, and then set the time frame to a time of your own choosing. Relative time supports only 15 days back from today's date, following CloudWatch guidelines. Additionally, you can choose the time displayed in the charts to be based on either the UTC time zone or a local time zone. For more information, see Changing the time range or time zone format of a CloudWatch dashboard. Network Synthetic Monitor dashboards 2289 Amazon CloudWatch Probe alarms User Guide You can create Amazon CloudWatch alarms based on Network Synthetic Monitor metrics, just as you can for other Amazon CloudWatch metrics. Any alarm that you create will appear in the probe's Status column of the Monitor details section of the Network Synthetic Monitor dashboard when the alarm is triggered. The status will either be OK or In Alarm. If no status displays for a probe, then no alarm was created for that probe. For example, you can create an alarm based on the Network Synthetic Monitor metric PacketLoss, and configure it to send a notification when the metric is higher than a value that you choose. You configure alarms for Network Synthetic Monitor metrics following the same guidelines as for other CloudWatch metrics. The following metrics are available under AWS/NetworkMonitor when creating a CloudWatch alarm for Network Synthetic Monitor. • HealthIndicator • PacketLoss • RTT (Round-trip time) For the steps to create a Network Synthetic Monitor alarm in CloudWatch, see Create a CloudWatch alarm based on a static threshold. Data security and data protection in Network Synthetic Monitor 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 Network Synthetic Monitor, see AWS Services in Scope by Compliance Program. Probe alarms 2290 Amazon CloudWatch User Guide • 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 Network Synthetic Monitor. The following topics show you how to configure Network Synthetic Monitor to meet your security and compliance objectives. You also learn how to use other AWS services that help you to monitor and secure your Network Synthetic Monitor resources. Topics • Data protection in Network Synthetic Monitor • Infrastructure Security in Network Synthetic Monitor Data protection in Network Synthetic Monitor The AWS shared responsibility model applies to data protection in Network Synthetic Monitor. 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
acw-ug-644
acw-ug.pdf
644
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. • Use advanced managed security services such as Amazon Macie, which assists in discovering and securing sensitive data that is stored in Amazon S3. Security 2291 Amazon CloudWatch User Guide • 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 Network Synthetic Monitor 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. Infrastructure Security in Network Synthetic Monitor As a managed service, Network Synthetic Monitor is protected by the AWS global network security procedures that are described in the Amazon Web Services: Overview of Security Processes whitepaper. You use AWS published API calls to access Network Synthetic Monitor through the network. Clients must support Transport Layer Security (TLS) 1.0 or later. We recommend TLS 1.2 or later. Clients must also support 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. Identity and access management for Network Synthetic Monitor 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 Network Synthetic Monitor resources. IAM is an AWS service that you can use with no additional charge. You can use features of IAM to allow other users, services, and applications to use your AWS resources fully or in a limited way, without sharing your security credentials. By default, IAM users don't have permission to create, view, or modify AWS resources. To allow an IAM user to access resources, such as a global network, and perform tasks, you must: Identify and access management 2292 Amazon CloudWatch User Guide • Create an IAM policy that grants the user permission to use the specific resources and API actions they need • Attach the policy to the IAM user or to the group to which the user belongs When you attach a policy to a user or group of users, it allows or denies the user permissions to perform the specified tasks on the specified resources. Condition keys The Condition element (or Condition block) lets you specify conditions in which a statement is in effect. The Condition element is optional. You can build conditional expressions that use condition operators, such as equals or less than, to match the condition in the policy with values in the request. For more information, see IAM JSON policy elements: Condition operators in the AWS Identity and Access Management User Guide. 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
acw-ug-645
acw-ug.pdf
645
Condition operators in the AWS Identity and Access Management User Guide. 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. You can attach tags to Network Synthetic Monitor resources or pass tags in a request to Cloud WAN. 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. See IAM JSON policy elements: Condition in the AWS Identity and Access Management User Guide for more information. To see all AWS global condition keys, see AWS global condition context keys in the AWS Identity and Access Management User Guide. Tag core network resources A tag is a metadata label that either you or AWS assigns to an AWS resource. Each tag consists of a key and a value. For tags that you assign, you define the key and the value. For example, you might define the key as purpose and the value as test for one resource. Tags help you do the following: • 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. Identify and access management 2293 Amazon CloudWatch User Guide • Control access to your AWS resources. For more information, see Controlling access to AWS resources using tags in the AWS Identify and Access Management User Guide. How Network Synthetic Monitor works with IAM Before you use IAM to manage access to Network Synthetic Monitor, learn what IAM features are available to use with Network Synthetic Monitor. IAM features you can use with Network Synthetic Monitor IAM feature Network Synthetic Monitor support Identity-based policies Resource-based policies Policy actions Policy resources Policy condition keys ACLs Yes No Yes Yes Yes No ABAC (tags in policies) Partial Temporary credentials Principal permissions Service roles Service-linked roles Yes Yes No Yes To get a high-level view of how Network Synthetic Monitor 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 Network Synthetic Monitor Supports identity-based policies: Yes Identify and access management 2294 Amazon CloudWatch User Guide 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 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 Network Synthetic Monitor To view examples of Network Synthetic Monitor identity-based policies, see Identity-based policy examples for Amazon CloudWatch. Resource-based policies within Network Synthetic Monitor 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,
acw-ug-646
acw-ug.pdf
646
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 Network Synthetic Monitor Supports policy actions: Yes Identify and access management 2295 Amazon CloudWatch 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. 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 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 Network Synthetic Monitor actions, see Actions defined by Network Synthetic Monitor in the Service Authorization Reference. Policy actions in Network Synthetic Monitor use the following prefix before the action: networkmonitor To specify multiple actions in a single statement, separate them with commas. "Action": [ "networkmonitor:action1", "networkmonitor:action2" ] To view examples of Network Synthetic Monitor identity-based policies, see Identity-based policy examples for Amazon CloudWatch. Policy resources for Network Synthetic Monitor 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. Identify and access management 2296 Amazon CloudWatch User Guide 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": "*" To see a list of Network Synthetic Monitor resource types and their ARNs, see Resources defined by Network Synthetic Monitor in the Service Authorization Reference. To learn with which actions you can specify the ARN of each resource, see Actions defined by Network Synthetic Monitor. Policy condition keys for Network Synthetic Monitor Supports service-specific policy condition keys: 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 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 Network Synthetic Monitor condition keys, see Condition keys for Network Synthetic Monitor in the Service Authorization Reference. To learn with which actions and resources you can use a condition key, see Actions defined by Network Synthetic Monitor. ACLs in Network Synthetic Monitor Supports ACLs: No Identify and access management 2297 Amazon CloudWatch User Guide 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
acw-ug-647
acw-ug.pdf
647
global condition context keys in the IAM User Guide. To see a list of Network Synthetic Monitor condition keys, see Condition keys for Network Synthetic Monitor in the Service Authorization Reference. To learn with which actions and resources you can use a condition key, see Actions defined by Network Synthetic Monitor. ACLs in Network Synthetic Monitor Supports ACLs: No Identify and access management 2297 Amazon CloudWatch User Guide 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. ABAC with Network Synthetic Monitor Supports ABAC (tags in policies): Partial 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 Network Synthetic Monitor 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. 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 Identify and access management 2298 Amazon CloudWatch User Guide 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. Cross-service principal permissions for Network Synthetic Monitor Supports forward access sessions (FAS): Yes 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 Network Synthetic Monitor 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 Network Synthetic Monitor functionality. Edit service roles only when Network Synthetic Monitor provides guidance to do so. Using a service-linked role for Network Synthetic Monitor 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 Identify and access management 2299 Amazon CloudWatch User Guide 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 service-linked roles, see AWS services that work with IAM. Find a service in the table that includes a Yes in the Service-linked role column. Choose the Yes link to
acw-ug-648
acw-ug.pdf
648
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 Identify and access management 2299 Amazon CloudWatch User Guide 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 service-linked roles, see AWS services that work with IAM. Find a service in the table that includes a Yes in the Service-linked role column. Choose the Yes link to view the service-linked role documentation for that service. Identity-based policy examples for Network Synthetic Monitor By default, users and roles don't have permission to create or modify Network Synthetic Monitor 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 Network Synthetic Monitor, including the format of the ARNs for each of the resource types, see Actions, resources, and condition keys for Network Synthetic Monitor in the Service Authorization Reference. Topics • Policy best practices • Using the Network Synthetic Monitor console • Allow users to view their own permissions • Troubleshooting Network Synthetic Monitor identity and access Policy best practices Identity-based policies determine whether someone can create, access, or delete Network Synthetic Monitor 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: • 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 Identify and access management 2300 Amazon CloudWatch User Guide 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 Network Synthetic Monitor console To access the Network Synthetic Monitor console, you must have a minimum set of permissions. These permissions must allow you to list and view details about the Network Synthetic Monitor resources in your AWS account. If you create an identity-based policy that 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
acw-ug-649
acw-ug.pdf
649
practices in IAM in the IAM User Guide. Using the Network Synthetic Monitor console To access the Network Synthetic Monitor console, you must have a minimum set of permissions. These permissions must allow you to list and view details about the Network Synthetic Monitor resources in your AWS account. If you create an identity-based policy that 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. Identify and access management 2301 Amazon CloudWatch User Guide To ensure that users and roles can still use the Network Synthetic Monitor console, also attach the Network Synthetic Monitor 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", "iam:ListPolicyVersions", "iam:ListPolicies", "iam:ListUsers" ], "Resource": "*" } ] } Identify and access management 2302 Amazon CloudWatch User Guide Troubleshooting Network Synthetic Monitor identity and access Use the following information to help you diagnose and fix common issues that you might encounter when working with Network Synthetic Monitor and IAM. Topics • I am not authorized to perform an action in Network Synthetic Monitor • I am not authorized to perform iam:PassRole • I want to allow people outside of my AWS account to access my Network Synthetic Monitor resources I am not authorized to perform an action in Network Synthetic Monitor 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 networkmonitor:GetWidget permissions. User: arn:aws:iam::123456789012:user/mateojackson is not authorized to perform: networkmonitor: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 networkmonitor:GetWidget action. 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 Network Synthetic Monitor. 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 Network Synthetic Monitor. However, the action requires the service to Identify and access management 2303 Amazon CloudWatch User Guide 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 Network Synthetic Monitor 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 Network Synthetic Monitor supports these features, see How Amazon CloudWatch 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. • To learn how to provide access to your resources to third-party AWS accounts, see Providing access to AWS accounts owned by
acw-ug-650
acw-ug.pdf
650
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 Network Synthetic Monitor supports these features, see How Amazon CloudWatch 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. • 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. AWS managed policies for Network Synthetic Monitor To add permissions to users, groups, and roles, it is easier to use AWS managed policies than to write policies yourself. It takes time and expertise to create IAM customer managed policies that provide your team with only the permissions they need. To get started quickly, you can use our Identify and access management 2304 Amazon CloudWatch User Guide AWS managed policies. These policies cover common use cases and are available in your AWS account. For more information about AWS managed policies, see AWS managed policies in the IAM User Guide. AWS services maintain and update AWS managed policies. You can't change the permissions in AWS managed policies. Services occasionally add additional permissions to an AWS managed policy to support new features. This type of update affects all identities (users, groups, and roles) where the policy is attached. Services are most likely to update an AWS managed policy when a new feature is launched or when new operations become available. Services do not remove permissions from an AWS managed policy, so policy updates won't break your existing permissions. Additionally, AWS supports managed policies for job functions that span multiple services. For example, the ReadOnlyAccess AWS managed policy provides read-only access to all AWS services and resources. When a service launches a new feature, AWS adds read-only permissions for new operations and resources. For a list and descriptions of job function policies, see AWS managed policies for job functions in the IAM User Guide. AWS managed policy: CloudWatchNetworkMonitorServiceRolePolicy The CloudWatchNetworkMonitorServiceRolePolicy is attached to a service-linked role that allows the service to perform actions on your behalf and access resources associated with CloudWatch Network Synthetic Monitor. You cannot attach this policy to your IAM identities. For more information, see Using a service-linked role for Network Synthetic Monitor. Network Synthetic Monitor updates to AWS managed policies View details about updates to AWS managed policies for Network Synthetic Monitor since this service began tracking these changes in November 2023. Change Description Date CloudWatchNetworkM onitorServiceRolePolicy: New policy. the section called “AWSServiceRoleForN ”. New etworkMonitor role. New policy added to Network Synthetic Monitor. November 27, 2023 New role added to Network Synthetic Monitor. November 27, 2023 Identify and access management 2305 Amazon CloudWatch User Guide IAM permissions for Network Synthetic Monitor To use Network Synthetic Monitor users must have the correct permissions. For more information about security in Amazon CloudWatch, see Identity and access management for Amazon CloudWatch. Permissions required to view a monitor To view a monitor for Network Synthetic Monitor in the AWS Management Console, you must be signed in as a user or role that has the following permissions: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "cloudwatch:GetMetricData", "networkmonitor:Get*", "networkmonitor:List*" ], "Resource": "*" } ] } Permissions required to create a monitor To create a monitor in Network Synthetic Monitor, users must have permission to create a service- linked role that is associated with Network Synthetic Monitor. To learn more about the service- linked role, see Using a service-linked role for Network Synthetic Monitor. To create a monitor for Network Synthetic Monitor in the AWS Management Console, you must be signed in as a user or role that has the permissions included in the following policy. Note If you create an identity-based permissions policy that is more restrictive, users with that policy won't be able to create a monitor. Identify and access management 2306 Amazon CloudWatch User Guide { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "networkmonitor:*" ], "Resource": "*" }, { "Effect": "Allow", "Action": "iam:CreateServiceLinkedRole", "Resource": "arn:aws:iam::*:role/aws-service-role/ networkmonitor.amazonaws.com/AWSServiceRoleForNetworkMonitor", "Condition": { "StringLike": { "iam:AWSServiceName": "networkmonitor.amazonaws.com" } } }, { "Effect": "Allow", "Action": [ "iam:AttachRolePolicy", "iam:GetRole", "iam:PutRolePolicy" ], "Resource": "arn:aws:iam::*:role/aws-service-role/ networkmonitor.amazonaws.com/AWSServiceRoleForNetworkMonitor" }, { "Action": [ "ec2:CreateSecurityGroup", "ec2:CreateNetworkInterface", "ec2:CreateTags" ], "Effect": "Allow", "Resource": "*" } ] } Identify and access management 2307 Amazon CloudWatch User Guide Using
acw-ug-651
acw-ug.pdf
651
If you create an identity-based permissions policy that is more restrictive, users with that policy won't be able to create a monitor. Identify and access management 2306 Amazon CloudWatch User Guide { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "networkmonitor:*" ], "Resource": "*" }, { "Effect": "Allow", "Action": "iam:CreateServiceLinkedRole", "Resource": "arn:aws:iam::*:role/aws-service-role/ networkmonitor.amazonaws.com/AWSServiceRoleForNetworkMonitor", "Condition": { "StringLike": { "iam:AWSServiceName": "networkmonitor.amazonaws.com" } } }, { "Effect": "Allow", "Action": [ "iam:AttachRolePolicy", "iam:GetRole", "iam:PutRolePolicy" ], "Resource": "arn:aws:iam::*:role/aws-service-role/ networkmonitor.amazonaws.com/AWSServiceRoleForNetworkMonitor" }, { "Action": [ "ec2:CreateSecurityGroup", "ec2:CreateNetworkInterface", "ec2:CreateTags" ], "Effect": "Allow", "Resource": "*" } ] } Identify and access management 2307 Amazon CloudWatch User Guide Using a service-linked role for Network Synthetic Monitor Network Synthetic Monitor uses the following service-linked role for the permissions that it requires to call other AWS services on your behalf: • AWSServiceRoleForNetworkMonitor AWSServiceRoleForNetworkMonitor Network Synthetic Monitor uses the service-linked role named AWSServiceRoleForNetworkMonitor to update and manage monitors. The AWSServiceRoleForNetworkMonitor service-linked role trusts the following service to assume the role: • networkmonitor.amazonaws.com The CloudWatchNetworkMonitorServiceRolePolicy is attached to the service linked role and grants access for the service to access VPC and EC2 resources in your account, as well as manage the monitors that you create. Permissions groupings The policy is grouped into the following sets of permissions: • cloudwatch - This allows the service principal to publish network monitoring metrics to CloudWatch resources. • ec2 - This allows the service principal to describe VPCs and subnets in your account to create or update monitors and probes. This also allows the service principal to create, modify, and delete security groups, network interfaces, and their associated permissions to configure the monitor or probe to send monitoring traffic to your endpoints. To view the permissions for this policy, see CloudWatchNetworkMonitorServiceRolePolicy in the AWS Managed Policy Reference. Create the service-linked role AWSServiceRoleForNetworkMonitor Identify and access management 2308 Amazon CloudWatch User Guide You don't need to manually create the AWSServiceRoleForNetworkMonitor role. • Network Synthetic Monitor creates the AWSServiceRoleForNetworkMonitor role when you create your first monitor with the feature. This role then applies to all additional monitors that you create. To create a service-linked role on your behalf, you must have the required permissions. For more information, see Service-Linked Role Permissions in the IAM User Guide. Edit the service-linked role You can edit the AWSServiceRoleForNetworkMonitor descriptions using IAM. For more information, see Editing a Service-Linked Role in the IAM User Guide. Delete the service-linked role If you no longer need to use Network Synthetic Monitor, we recommend that you delete the AWSServiceRoleForNetworkMonitor role. You can delete these service-linked roles only after you delete your monitors. For more information, see Delete a monitor. You can use the IAM console, the IAM CLI, or the IAM API to delete service-linked roles. For more information, see Deleting a Service-Linked Role in the IAM User Guide. After you delete AWSServiceRoleForNetworkMonitor Network Synthetic Monitor will create the role again when you create a new monitor. Supported Regions for the Network Synthetic Monitor service-linked role Network Synthetic Monitor supports the service-linked role in all of AWS Regions where the service is available. For more information, see AWS endpoints in the AWS General Reference. Delete the service-linked role If you no longer need to use Network Synthetic Monitor, we recommend that you delete the AWSServiceRoleForNetworkMonitor role. You can delete these service-linked roles only after you delete your monitors. For more information, see Delete a monitor. Identify and access management 2309 Amazon CloudWatch User Guide You can use the IAM console, the IAM CLI, or the IAM API to delete service-linked roles. For more information, see Deleting a Service-Linked Role in the IAM User Guide. After you delete AWSServiceRoleForNetworkMonitor Network Synthetic Monitor will create the role again when you create a new monitor. Network Synthetic Monitor quotas The following are the Network Synthetic Monitor quotas: Quota Maximum number of monitors per account per AWS Region Default 100 Maximum number of probes per monitor Maximum number of probes per subnet per monitor 24 4 Adjustable Yes Yes Yes Quotas 2310 Amazon CloudWatch User Guide CloudWatch observability solutions CloudWatch observability solutions offer a catalog of readily available configurations to help you quickly implement monitoring for various AWS services and common workloads, such as Java Virtual Machines (JVM), Apache Kafka, Apache Tomcat, and NGINX. These solutions provide focused guidance on key monitoring tasks, including the installation and configuration of the CloudWatch agent, deployment of pre-defined custom dashboards, and setup of metric alarms. They are designed to assist developers and operations teams in leveraging AWS monitoring and observability tools more effectively. The solutions include guidance on when to use specific observability features like Detailed Monitoring metrics for infrastructure, Container Insights for container monitoring, and Application Signals for application monitoring. By providing working examples and practical configurations, these solutions aim to simplify the initial setup process, allowing you to establish functional
acw-ug-652
acw-ug.pdf
652
Kafka, Apache Tomcat, and NGINX. These solutions provide focused guidance on key monitoring tasks, including the installation and configuration of the CloudWatch agent, deployment of pre-defined custom dashboards, and setup of metric alarms. They are designed to assist developers and operations teams in leveraging AWS monitoring and observability tools more effectively. The solutions include guidance on when to use specific observability features like Detailed Monitoring metrics for infrastructure, Container Insights for container monitoring, and Application Signals for application monitoring. By providing working examples and practical configurations, these solutions aim to simplify the initial setup process, allowing you to establish functional monitoring more quickly and customize as needed for their specific requirements. To get started with observability solutions, visit the observability solutions page in the CloudWatch console. For open-source solutions that work with Amazon Managed Grafana, see Amazon Managed Grafana solutions Solutions that require CloudWatch agent are detailed below: Topics • CloudWatch solution: JVM workload on Amazon EC2 • CloudWatch solution: NGINX workload on Amazon EC2 • CloudWatch solution: NVIDIA GPU workload on Amazon EC2 • CloudWatch solution: Kafka workload on Amazon EC2 • CloudWatch solution: Tomcat workload on Amazon EC2 • CloudWatch solution: Amazon EC2 health How do solution dashboards work? The dashboards for CloudWatch solutions use search-powered variables (dropdowns) that allow you to explore and visualize different aspects of your workloads dynamically. 2311 Amazon CloudWatch User Guide By combining the flexibility of search-powered variables with the pre-configured metric widgets, the dashboard provides deep insights into your workloads, enabling proactive monitoring, troubleshooting, and optimization. This dynamic approach ensures that you can quickly adapt the dashboard to your specific monitoring needs, without the need for extensive customization or configuration. Do solutions support cross-Region observability? CloudWatch solution dashboards display metrics of the Region where the solution dashboard is created. However, the solution dashboard doesn’t display metrics across multiple Regions. If you have a use case to view data from multiple Regions in a single dashboard, you'll need to customize the dashboard JSON to add the Regions that you want to view. To do this, use the region attribute of the metric format to query the metrics from different Regions. For more information about modifying dashboard JSON, see Metric Widget: Format for Each Metric in the Array. Do solution dashboards support Cross-account cross-Region CloudWatch console? When using CloudWatch cross-account observability, solution dashboards in the central monitoring account display metrics from source accounts in the same Region. To differentiate metrics for similar workloads across accounts, provide unique grouping dimension values in agent configurations. For instance, assign distinct ClusterName values for Kafka brokers in different accounts for Kafka workload, enabling precise cluster selection and metric viewing in the dashboard. Do solution dashboards support CloudWatch cross-account observability? If you have enabled cross-account using Cross-account cross-Region CloudWatch console, you won't be able to use the solution dashboard created in the monitoring account to view metrics from source accounts. Instead, you'll need to create dashboards in the respective source accounts. However, you can create the dashboard in the source account and view it from the monitoring account by switching the account ID setting in the console. What are the limitations for a solution dashboard? Solution dashboards leverage Search expressions to filter and analyze metrics for the workloads. This enables dynamic views based on dropdown option selections. These search expressions might return more than 500 time series, but each dashboard widget can't display more than 500 time series. If a metric search in the solution dashboard results in more than 500 time series across all Amazon EC2; instances, the graph displaying the top contributors might show inaccurate results. For more information about search expressions, see CloudWatch search expression syntax. 2312 Amazon CloudWatch User Guide CloudWatch displays the metric information on the dashboards if you click the i icon on the dashboard widget. However, this currently doesn’t work for dashboard widgets that use search expressions. The solution dashboards use search expressions, so you won’t be able to see the metric description in the dashboard. Can I customize the agent configuration or the dashboard provided by a solution? You can customize the agent configuration and the dashboard. Be aware that if you customize the agent configuration, you must update the dashboard accordingly or it will display empty metric widgets. Also be aware that if CloudWatch releases a new version of a solution, you might have to repeat your customizations if you apply the newer version of the solution. How are solutions versioned? Each solution provides the most up-to-date instructions and resources. We always recommend using the latest version available. While the solutions themselves are not versioned, the associated artifacts (such as AWS CloudFormation templates for dashboards and agent installations) are versioned. You can identify the version of a previously deployed artifact by checking the AWS CloudFormation template's description field or the
acw-ug-653
acw-ug.pdf
653
accordingly or it will display empty metric widgets. Also be aware that if CloudWatch releases a new version of a solution, you might have to repeat your customizations if you apply the newer version of the solution. How are solutions versioned? Each solution provides the most up-to-date instructions and resources. We always recommend using the latest version available. While the solutions themselves are not versioned, the associated artifacts (such as AWS CloudFormation templates for dashboards and agent installations) are versioned. You can identify the version of a previously deployed artifact by checking the AWS CloudFormation template's description field or the filename of the template you downloaded. To determine if you're using the latest version, compare your deployed version with the one currently referenced in the solution documentation. CloudWatch solution: JVM workload on Amazon EC2 This solution helps you configure out-of-the-box metric collection using CloudWatch agents for JVM application running on EC2 instances. Additionally, it helps you set up a pre-configured CloudWatch dashboard. For general information about all CloudWatch observability solutions, see CloudWatch observability solutions. Topics • Requirements • Benefits • Costs • CloudWatch agent configuration for this solution • Deploy the agent for your solution • Create the JVM solution dashboard JVM workload on EC2 2313 Amazon CloudWatch Requirements This solution is relevant for the following conditions: • Supported versions: Java LTS versions 8, 11, 17, and 21 • Compute: Amazon EC2 • Supports up to 500 EC2 instances across all JVM workloads in a given AWS Region User Guide • Latest version of CloudWatch agent • SSM agent installed on EC2 instance Note AWS Systems Manager (SSM agent) is pre-installed on some Amazon Machine Images (AMIs) provided by AWS and trusted third-parties. If the agent isn't installed, you can install it manually using the procedure for your operating system type. • Manually installing and uninstalling SSM Agent on EC2 instances for Linux • Manually installing and uninstalling SSM Agent on EC2 instances for macOS • Manually installing and uninstalling SSM Agent on EC2 instances for Windows Server Benefits The solution delivers JVM monitoring, providing valuable insights for the following use cases: • Monitor JVM heap and non-heap memory usage. • Analyze thread and class loading for concurrency issues. • Track garbage collection to identify memory leaks. • Switch between different JVM applications configured via the solution under the same account. Below are the key advantages of the solution: • Automates metric collection for JVM using CloudWatch agent configuration, eliminating manual instrumentation. • Provides a pre-configured, consolidated CloudWatch dashboard for JVM metrics. The dashboard will automatically handle metrics from new JVM EC2 instances configured using the solution, Requirements 2314 Amazon CloudWatch User Guide even if those metrics don't exist when you first create the dashboard. It also allows you to group the metrics into logical applications for easier focus and management. The following image is an example of the dashboard for this solution. Costs This solution creates and uses resources in your account. You are charged for standard usage, including the following: Costs 2315 Amazon CloudWatch User Guide • All metrics collected by the CloudWatch agent are charged as custom metrics. The number of metrics used by this solution depends on the number of EC2 hosts. • Each JVM host configured for the solution publishes a total of 18 metrics plus one metric (disk_used_percent) for which the metric count depends on the number of paths for the host. • One custom dashboard. • API operations requested by the CloudWatch agent to publish the metrics. With the default configuration for this solution, the CloudWatch agent calls the PutMetricData once every minute for each EC2 host. This means the PutMetricData API will be called 30*24*60=43,200 in a 30- day month for each EC2 host. For more information about CloudWatch pricing, see Amazon CloudWatch Pricing. The pricing calculator can help you estimate approximate monthly costs for using this solution. To use the pricing calculator to estimate your monthly solution costs 1. Open the Amazon CloudWatch pricing calculator. 2. 3. 4. For Choose a Region, select the Region where you would like to deploy the solution. In the Metrics section, for Number of metrics, enter (18 + average number of disk paths per EC2 host) * number of EC2 instances configured for this solution. In the APIs section, for Number of API requests, enter 43200 * number of EC2 instances configured for this solution. By default, the CloudWatch agent performs one PutMetricData operation each minute for each EC2 host. 5. In the Dashboards and Alarms section, for Number of Dashboards, enter 1. 6. You can see your monthly estimated costs at the bottom of the pricing calculator. CloudWatch agent configuration for this solution The CloudWatch agent is software that runs continuously and autonomously on your servers and in containerized environments. It collects metrics, logs,
acw-ug-654
acw-ug.pdf
654
host) * number of EC2 instances configured for this solution. In the APIs section, for Number of API requests, enter 43200 * number of EC2 instances configured for this solution. By default, the CloudWatch agent performs one PutMetricData operation each minute for each EC2 host. 5. In the Dashboards and Alarms section, for Number of Dashboards, enter 1. 6. You can see your monthly estimated costs at the bottom of the pricing calculator. CloudWatch agent configuration for this solution The CloudWatch agent is software that runs continuously and autonomously on your servers and in containerized environments. It collects metrics, logs, and traces from your infrastructure and applications and sends them to CloudWatch and X-Ray. CloudWatch agent configuration for this solution 2316 Amazon CloudWatch User Guide For more information about the CloudWatch agent, see Collect metrics, logs, and traces with the CloudWatch agent. The agent configuration in this solution collects the foundational metrics for the solution. The CloudWatch agent can be configured to collect more JVM metrics than the dashboard displays by default. For a list of all JVM metrics that you can collect, see Collect JVM metrics. For general information about CloudWatch agent configuration, see Metrics collected by the CloudWatch agent. Expose JMX ports for the JVM application The CloudWatch agent relies on JMX to collect the metrics related to the JVM process. To make this possible, you must expose the JMX port from your JVM application. Instructions for exposing the JMX port depend on the workload type you are using for your JVM application. See the documentation for your application to find these instructions. In general, to enable a JMX port for monitoring and management, you would set the following system properties for your JVM application. Be sure to specify an unused port number. The following example sets up unauthenticated JMX. If your security policies/requirements require you to enable JMX with password authentication or SSL for remote access, refer to the JMX documentation to set the required property. -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=port-number -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false Review the starting scripts and configuration files of your application to find the best place to add these arguments. When you run a .jar file from the command line, this command could look like the following, where pet-search.jar is the name of the application jar. $ java -jar -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9999 - Dcom.sun.management.jmxremote.authenticate=false - Dcom.sun.management.jmxremote.ssl=false pet-search.jar Agent configuration for this solution The metrics collected by the agent are defined in the agent configuration. The solution provides agent configurations to collect the recommended metrics with suitable dimensions for the solution’s dashboard. CloudWatch agent configuration for this solution 2317 Amazon CloudWatch User Guide The steps for deploying the solution are described later in Deploy the agent for your solution. The following information is intended to help you understand how to customize the agent configuration for your environment. You must customize some parts of the following agent configuration for your environment: • The JMX port number is the port number that you configured in the previous section of this documentation. It is in the endpoint line in the configuration. • ProcessGroupName– Provide meaningful names for the ProcessGroupName dimension. These names should represent the cluster, application, or services grouping for EC2 instances running the same application or process. This helps you to group metrics from instances belonging to the same JVM process group, providing a unified view of cluster, application, and service performance in the solution dashboard. For example, if you have two Java applications running in the same account, one for the order- processing application and another for the inventory-management application, you should set the ProcessGroupName dimensions accordingly in the agent configuration of each instance. • For the order-processing application instances, set ProcessGroupName=order- processing. • For the inventory-management application instances, set ProcessGroupName=inventory- management. When you follow these guidelines, the solution dashboard will automatically group the metrics based on the ProcessGroupName dimension. The dashboard will include dropdown options to select and view metrics for a specific process group, allowing you to monitor the performance of individual process groups separately. Agent configuration for JVM hosts Use the following CloudWatch agent configuration on EC2 instances where your Java applications is deployed. Configuration will be stored as a parameter in SSM's Parameter Store, as detailed later in Step 2: Store the recommended CloudWatch agent configuration file in Systems Manager Parameter Store. Replace ProcessGroupName with the name of your process group. Replace port-number with the JMX port of your Java application. If JMX was enabled with password authentication or SSL CloudWatch agent configuration for this solution 2318 Amazon CloudWatch User Guide for remote access, see Collect Java Management Extensions (JMX) metrics for information about setting up TLS or authorization in agent configuration as required. The EC2 metrics shown in this configuration (configuration shown outside the JMX block) only work for Linux and macOS instances. If you
acw-ug-655
acw-ug.pdf
655
later in Step 2: Store the recommended CloudWatch agent configuration file in Systems Manager Parameter Store. Replace ProcessGroupName with the name of your process group. Replace port-number with the JMX port of your Java application. If JMX was enabled with password authentication or SSL CloudWatch agent configuration for this solution 2318 Amazon CloudWatch User Guide for remote access, see Collect Java Management Extensions (JMX) metrics for information about setting up TLS or authorization in agent configuration as required. The EC2 metrics shown in this configuration (configuration shown outside the JMX block) only work for Linux and macOS instances. If you are using Windows instances, you can choose to omit these metrics in the configuration. For information about metrics collected on Windows instances, see Metrics collected by the CloudWatch agent on Windows Server instances. { "metrics": { "namespace": "CWAgent", "append_dimensions": { "InstanceId": "${aws:InstanceId}" }, "metrics_collected": { "jmx": [ { "endpoint": "localhost:port-number", "jvm": { "measurement": [ "jvm.classes.loaded", "jvm.gc.collections.count", "jvm.gc.collections.elapsed", "jvm.memory.heap.committed", "jvm.memory.heap.max", "jvm.memory.heap.used", "jvm.memory.nonheap.committed", "jvm.memory.nonheap.max", "jvm.memory.nonheap.used", "jvm.threads.count" ] }, "append_dimensions": { "ProcessGroupName": "ProcessGroupName" } } ], "disk": { "measurement": [ "used_percent" ] }, "mem": { CloudWatch agent configuration for this solution 2319 Amazon CloudWatch User Guide "measurement": [ "used_percent" ] }, "swap": { "measurement": [ "used_percent" ] }, "netstat": { "measurement": [ "tcp_established", "tcp_time_wait" ] } } } } Deploy the agent for your solution There are several approaches for installing the CloudWatch agent, depending on the use case. We recommend using Systems Manager for this solution. It provides a console experience and makes it simpler to manage a fleet of managed servers within a single AWS account. The instructions in this section use Systems Manager and are intended for when you don’t have the CloudWatch agent running with existing configurations. You can check whether the CloudWatch agent is running by following the steps in Verify that the CloudWatch agent is running. If you are already running the CloudWatch agent on the EC2 hosts where the workload is deployed and managing the agent configurations, you can skip the instructions in this section and follow your existing deployment mechanism to update the configuration. Be sure to merge the agent configuration of JVM with your existing agent configuration, and then deploy the merged configuration. If you are using Systems Manager to store and manage the configuration for the CloudWatch agent, you can merge the configuration to the existing parameter value. For more information, see Managing CloudWatch agent configuration files. Note Using Systems Manager to deploy the following CloudWatch agent configurations will replace or overwrite any existing CloudWatch agent configuration on your EC2 instances. Deploy the agent for your solution 2320 Amazon CloudWatch User Guide You can modify this configuration to suit your unique environment or use case. The metrics defined in this solution are the minimum required for the recommended dashboard. The deployment process includes the following steps: • Step 1: Ensure that the target EC2 instances have the required IAM permissions. • Step 2: Store the recommended agent configuration file in the Systems Manager Parameter Store. • Step 3: Install the CloudWatch agent on one or more EC2 instances using an AWS CloudFormation stack. • Step 4: Verify the agent setup is configured properly. Step 1: Ensure the target EC2 instances have the required IAM permissions You must grant permission for Systems Manager to install and configure the CloudWatch agent. You must also grant permission for the CloudWatch agent to publish telemetry from your EC2 instance to CloudWatch. Make sure that the IAM role attached to the instance has the CloudWatchAgentServerPolicy and AmazonSSMManagedInstanceCore IAM policies attached. • To create a role, see Create IAM roles to use with the CloudWatch agent on Amazon EC2 instances. • After the role is created, attach the role to your EC2 instances. Follow the steps in Launch an instance with an IAM role to attach a role while launching a new EC2 instance. To attach a role to an existing EC2 instance, follow the steps in Attach an IAM role to an instance. Step 2: Store the recommended CloudWatch agent configuration file in Systems Manager Parameter Store Parameter Store simplifies the installation of the CloudWatch agent on an EC2 instance by securely storing and managing configuration parameters, eliminating the need for hard-coded values. This ensures a more secure and flexible deployment process, enabling centralized management and easier updates to configurations across multiple instances. Use the following steps to store the recommended CloudWatch agent configuration file as a parameter in Parameter Store. Deploy the agent for your solution 2321 Amazon CloudWatch User Guide To create the CloudWatch agent configuration file as a parameter 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. From the navigation pane, choose Application Management, Parameter Store. Follow these steps to create a new parameter for the configuration. a. b. c. d.
acw-ug-656
acw-ug.pdf
656
the need for hard-coded values. This ensures a more secure and flexible deployment process, enabling centralized management and easier updates to configurations across multiple instances. Use the following steps to store the recommended CloudWatch agent configuration file as a parameter in Parameter Store. Deploy the agent for your solution 2321 Amazon CloudWatch User Guide To create the CloudWatch agent configuration file as a parameter 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. From the navigation pane, choose Application Management, Parameter Store. Follow these steps to create a new parameter for the configuration. a. b. c. d. e. f. g. Choose Create parameter. In the Name box, enter a name that you'll use to reference the CloudWatch agent configuration file in later steps. For example, AmazonCloudWatch-JVM- Configuration. (Optional) In the Description box, type a description for the parameter. For Parameter tier, choose Standard. For Type, choose String. For Data type, choose text. In the Value box, paste the corresponding JSON block that was listed in Agent configuration for JVM hosts. Be sure to customize the grouping dimension value and port number as described. h. Choose Create parameter. Step 3: Install the CloudWatch agent and apply the configuration using an AWS CloudFormation template You can use AWS CloudFormation to install the agent and configure it to use the CloudWatch agent configuration that you created in the previous steps. To install and configure the CloudWatch agent for this solution 1. Open the AWS CloudFormation Quick create stack wizard using this link: https:// console.aws.amazon.com/cloudformation/home?#/stacks/quickcreate?templateURL=https:// aws-observability-solutions-prod-us-east-1.s3.us-east-1.amazonaws.com/CloudWatchAgent/ CFN/v1.0.0/cw-agent-installation-template-1.0.0.json . 2. Verify that the selected Region on the console is the Region where the JVM workload is running. 3. For Stack name, enter a name to identity this stack, such as CWAgentInstallationStack. Deploy the agent for your solution 2322 Amazon CloudWatch User Guide 4. In the Parameters section, specify the following: a. For CloudWatchAgentConfigSSM, enter the name of the Systems Manager parameter for the agent configuration that you created earlier, such as AmazonCloudWatch-JVM- Configuration. b. To select the target instances, you have two options. i. ii. For InstanceIds, specify a comma-delimited list of instance IDs list of instance IDs where you want to install the CloudWatch agent with this configuration. You can list a single instance or several instances. If you are deploying at scale, you can specify the TagKey and the corresponding TagValue to target all EC2 instances with this tag and value. If you specify a TagKey, you must specify a corresponding TagValue. (For an Auto Scaling group, specify aws:autoscaling:groupName for the TagKey and specify the Auto Scaling group name for the TagValue to deploy to all instances within the Auto Scaling group.) If you specify both the InstanceIds and the TagKeys parameters, the InstanceIds will take precedence and the tags will be ignored. 5. Review the settings, then choose Create stack. If you want to edit the template file first to customize it, choose the Upload a template file option under Create Stack Wizard to upload the edited template. For more information, see Creating a stack on AWS CloudFormation console. You can use the following link to download the template: https://aws-observability-solutions-prod-us-east-1.s3.us-east-1.amazonaws.com/ CloudWatchAgent/CFN/v1.0.0/cw-agent-installation-template-1.0.0.json . Note After this step is completed, this Systems Manager parameter will be associated with the CloudWatch agents running in the targeted instances. This means that: 1. If the Systems Manager parameter is deleted, the agent will stop. 2. If the Systems Manager parameter is edited, the configuration changes will automatically apply to the agent at the scheduled frequency which is 30 days by default. Deploy the agent for your solution 2323 Amazon CloudWatch User Guide 3. If you want to immediately apply changes to this Systems Manager parameter, you must run this step again. For more information about associations, see Working with associations in Systems Manager. Step 4: Verify the agent setup is configured properly You can verify whether the CloudWatch agent is installed by following the steps in Verify that the CloudWatch agent is running. If the CloudWatch agent is not installed and running, make sure you have set up everything correctly. • Be sure you have attached a role with correct permissions for the EC2 instance as described in Step 1: Ensure the target EC2 instances have the required IAM permissions. • Be sure you have correctly configured the JSON for the Systems Manager parameter. Follow the steps in Troubleshooting installation of the CloudWatch agent with AWS CloudFormation. If everything is set up correctly, then you should see the JVM metrics being published to CloudWatch. You can check the CloudWatch console to verify they are being published. To verify that JVM metrics are being published to CloudWatch 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. Choose Metrics, All metrics. 3. Make sure you've selected the Region where you deployed the solution, and choose Custom namespaces,
acw-ug-657
acw-ug.pdf
657
instances have the required IAM permissions. • Be sure you have correctly configured the JSON for the Systems Manager parameter. Follow the steps in Troubleshooting installation of the CloudWatch agent with AWS CloudFormation. If everything is set up correctly, then you should see the JVM metrics being published to CloudWatch. You can check the CloudWatch console to verify they are being published. To verify that JVM metrics are being published to CloudWatch 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. Choose Metrics, All metrics. 3. Make sure you've selected the Region where you deployed the solution, and choose Custom namespaces, CWAgent. 4. Search for the metrics mentioned in Agent configuration for JVM hosts, such as jvm.memory.heap.used. If you see results for these metrics, then the metrics are being published to CloudWatch. Create the JVM solution dashboard The dashboard provided by this solution presents metrics for the underlying Java Virtual Machine (JVM) for the server. It offers an overview of the JVM by aggregating and presenting metrics across all instances, providing a high-level summary of the overall health and operational state. Additionally, the dashboard shows a breakdown of the top contributors (top 10 per metric widget) Create the JVM solution dashboard 2324 Amazon CloudWatch User Guide for each metric. This helps you to quickly identify outliers or instances that significantly contribute to the observed metrics. The solution dashboard doesn't display EC2 metrics. To view EC2 metrics, you'll need to use the EC2 automatic dashboard to see EC2 vended metrics and use the EC2 console dashboard to see EC2 metrics that are collected by the CloudWatch agent. For more information about automatic dashboards for AWS services, see Viewing a CloudWatch dashboard for a single AWS service. To create the dashboard, you can use the following options: • Use CloudWatch console to create the dashboard. • Use AWS CloudFormation console to deploy the dashboard. • Download the AWS CloudFormation infrastructure as code and integrate it as part of your continuous integration (CI) automation. By using the CloudWatch console to create a dashboard, you can preview the dashboard before actually creating and being charged. Note The dashboard created with AWS CloudFormation in this solution displays metrics from the Region where the solution is deployed. Be sure to create the AWS CloudFormation stack in the Region where your JVM metrics are published. If CloudWatch agent metrics are getting published to a different namespace than CWAgent (for example, if you've provided a customized namespace), you'll have to change the CloudFormation configuration to replace CWAgent with the customized namespace you are using. To create the dashboard via CloudWatch Console Note Solution dashboards currently display garbage collection-related metrics only for the G1 Garbage Collector, which is the default collector for the latest Java versions. If you are using a different garbage collection algorithm, the widgets pertaining to garbage collection are empty. However, you can customize these widgets by changing the dashboard CloudFormation template and applying the appropriate garbage Create the JVM solution dashboard 2325 Amazon CloudWatch User Guide collection type to the name dimension of the garbage collection-related metrics. For example, if you are using parallel garbage collection, change the name=\"G1 Young Generation\" to name=\"Parallel GC\" of the garbage collection count metric jvm.gc.collections.count. 1. Open the CloudWatch Console Create Dashboard using this link: https://console.aws.amazon.com/cloudwatch/home?#dashboards? dashboardTemplate=JvmOnEc2&referrer=os-catalog . 2. Verify that the selected Region on the console is the Region where the JVM workload is running. 3. Enter the name of the dashboard, then choose Create Dashboard. To easily differentiate this dashboard from similar dashboards in other Regions, we recommend including the Region name in the dashboard name, such as JVMDashboard-us- east-1. 4. Preview the dashboard and choose Save to create the dashboard. To create the dashboard via AWS CloudFormation 1. Open the AWS CloudFormation Quick create stack wizard using this link: https:// console.aws.amazon.com/cloudformation/home?#/stacks/quickcreate?templateURL=https:// aws-observability-solutions-prod-us-east-1.s3.us-east-1.amazonaws.com/JVM_EC2/ CloudWatch/CFN/v1.0.0/dashboard-template-1.0.0.json . 2. Verify that the selected Region on the console is the Region where the JVM workload is running. 3. 4. For Stack name, enter a name to identity this stack, such as JVMDashboardStack. In the Parameters section, specify the name of the dashboard under the DashboardName parameter. To easily differentiate this dashboard from similar dashboards in other Regions, we recommend including the Region name in the dashboard name, such as JVMDashboard-us- east-1. 5. Acknowledge access capabilities for transforms under Capabilities and transforms. Note that CloudFormation doesn't add any IAM resources. 6. Review the settings, then choose Create stack. Create the JVM solution dashboard 2326 Amazon CloudWatch User Guide 7. After the stack status is CREATE_COMPLETE, choose the Resources tab under the created stack and then choose the link under Physical ID to go to the dashboard. You can also access the dashboard in the CloudWatch console by choosing Dashboards in the left navigation pane of the console, and finding the dashboard name under
acw-ug-658
acw-ug.pdf
658
name in the dashboard name, such as JVMDashboard-us- east-1. 5. Acknowledge access capabilities for transforms under Capabilities and transforms. Note that CloudFormation doesn't add any IAM resources. 6. Review the settings, then choose Create stack. Create the JVM solution dashboard 2326 Amazon CloudWatch User Guide 7. After the stack status is CREATE_COMPLETE, choose the Resources tab under the created stack and then choose the link under Physical ID to go to the dashboard. You can also access the dashboard in the CloudWatch console by choosing Dashboards in the left navigation pane of the console, and finding the dashboard name under Custom Dashboards. If you want to edit the template file to customize it for any purpose, you can use Upload a template file option under Create Stack Wizard to upload the edited template. For more information, see Creating a stack on AWS CloudFormation console. You can use this link to download the template: https://aws-observability-solutions-prod-us-east-1.s3.us- east-1.amazonaws.com/JVM_EC2/CloudWatch/CFN/v1.0.0/dashboard-template-1.0.0.json. Note Solution dashboards currently display garbage collection-related metrics only for the G1 Garbage Collector, which is the default collector for the latest Java versions. If you are using a different garbage collection algorithm, the widgets pertaining to garbage collection are empty. However, you can customize these widgets by changing the dashboard CloudFormation template and applying the appropriate garbage collection type to the name dimension of the garbage collection-related metrics. For example, if you are using parallel garbage collection, change the name=\"G1 Young Generation\" to name=\"Parallel GC\" of the garbage collection count metric jvm.gc.collections.count. Get started with the JVM dashboard Here are a few tasks that you can try out with the new JVM dashboard. These tasks allow you to validate that the dashboard is working correctly and provide you some hands-on experience using it to monitor a JVM process group. As you try these out, you'll get familiar with navigating the dashboard and interpreting the visualized metrics. Select a process group Use the JVM Process Group Name dropdown list to select the process group that you want to monitor. The dashboard automatically updates to display metrics for the selected process group. If you have multiple Java applications or environments, each might be represented as a separate process group. Selecting the appropriate process group ensures that you're viewing metrics specific to the application or environment that you want to analyze. Create the JVM solution dashboard 2327 Amazon CloudWatch Review memory usage User Guide From the dashboard overview section, find the Heap Memory Usage Percentage and Non-Heap Memory Usage Percentage widgets. These show the percentage of heap and non-heap memory being used across all JVMs in the selected process group. A high percentage indicates potential memory pressure that could lead to performance issues or OutOfMemoryError exceptions. You can also drill down to heap usage by host under Memory usage by host to check the hosts with high usage. Analyze threads and classes loaded In the Threads and Classes Loaded by Host section, find the Top 10 Threads Count and Top 10 Classes Loaded widgets. Look for any JVMs with an abnormally high number of threads or classes compared to others. Too many threads can indicate thread leaks or excessive concurrency, while a large number of loaded classes could point to potential class loader leaks or inefficient dynamic class generation. Identify garbage collection issues In the Garbage Collection section, find the Top 10 Garbage Collections Invocations Per Minute and Top 10 Garbage Collection Duration widgets for the different garbage collector types: Young, Concurrent, and Mixed. Look for any JVMs that have an unusually high number of collections or long collection durations compared to others. This could indicate configuration issues or memory leaks. CloudWatch solution: NGINX workload on Amazon EC2 This solution helps you configure out-of-the-box metric collection using CloudWatch agents for NGINX application running on EC2 instances. For general information about all CloudWatch observability solutions, see CloudWatch observability solutions. Topics • Requirements • Benefits • Costs • CloudWatch agent configuration for this solution • Deploy the agent for your solution • Create the NGINX solution dashboard NGINX workload on EC2 2328 Amazon CloudWatch Requirements This solution is relevant for the following conditions: • Supported versions: NGINX version 1.24 • Compute: Amazon EC2 User Guide • Supports up to 500 EC2 instances across all NGINX workloads in a given AWS Region • Latest version of CloudWatch agent • Prometheus Exporter: nginxinc/nginx-prometheus-exporter (Apache 2.0 license) • SSM agent installed on EC2 instance Note AWS Systems Manager (SSM agent) is pre-installed on some Amazon Machine Images (AMIs) provided by AWS and trusted third-parties. If the agent isn't installed, you can install it manually using the procedure for your operating system type. • Manually installing and uninstalling SSM Agent on EC2 instances for Linux • Manually installing and uninstalling SSM Agent on EC2 instances for macOS • Manually installing and uninstalling SSM
acw-ug-659
acw-ug.pdf
659
500 EC2 instances across all NGINX workloads in a given AWS Region • Latest version of CloudWatch agent • Prometheus Exporter: nginxinc/nginx-prometheus-exporter (Apache 2.0 license) • SSM agent installed on EC2 instance Note AWS Systems Manager (SSM agent) is pre-installed on some Amazon Machine Images (AMIs) provided by AWS and trusted third-parties. If the agent isn't installed, you can install it manually using the procedure for your operating system type. • Manually installing and uninstalling SSM Agent on EC2 instances for Linux • Manually installing and uninstalling SSM Agent on EC2 instances for macOS • Manually installing and uninstalling SSM Agent on EC2 instances for Windows Server Benefits The solution delivers NGINX monitoring, providing valuable insights for the following use cases: • Review connection metrics to identify potential bottlenecks, connection issues, or unexpected usage. • Analyze HTTP request volume to understand overall traffic load on the NGINX. Below are the key advantages of the solution: • Automates metric collection for NGINX using CloudWatch agent configuration, eliminating manual instrumentation. • Provides a pre-configured, consolidated CloudWatch dashboard for NGINX metrics. The dashboard will automatically handle metrics from new NGINX EC2 instances configured using the solution, even if those metrics don't exist when you first create the dashboard. Requirements 2329 Amazon CloudWatch User Guide The following image is an example of the dashboard for this solution. Costs This solution creates and uses resources in your account. You are charged for standard usage, including the following: • All metrics collected by the CloudWatch agent for this solution are published to CloudWatch Logs using the Embedded Metric Format (EMF). These CloudWatch logs are charged based on Costs 2330 Amazon CloudWatch User Guide their volume and retention period. Therefore, you will not be billed for any PutMetricData API calls for this solution. The metrics extracted and ingested from your logs are charged as custom metrics. The number of metrics used by this solution depends on the number of EC2 hosts. • Each NGINX EC2 host configured for the solution publishes a total of eight metrics. • One custom dashboard. For more information about CloudWatch pricing, see Amazon CloudWatch Pricing. The pricing calculator can help you estimate approximate monthly costs for using this solution. To use the pricing calculator to estimate your monthly solution costs 1. Open the Amazon CloudWatch pricing calculator. 2. 3. 4. 5. For Choose a Region, select the AWS Region where you would like to deploy the solution. In the Metrics section, for Number of metrics, enter 8 * number of EC2 instances configured for this solution. In the Logs section, for Standard Logs: Data Ingested, enter the estimated daily log volume generated by the CloudWatch Agent across all EC2 hosts. For example, five EC2 instances produce less than 1000 bytes per day. Once set up, you can check your byte usage using the IncomingBytes metric, vended by CloudWatch Logs. Be sure to select the appropriate log group. In the Logs section, for Log Storage/Archival (Standard and Vended Logs), select Yes to Store Logs: Assuming 1 month retention. Modify this value if you decide to make custom changes to the retention period. 6. In the Dashboards and Alarms section, for Number of Dashboards, enter 1. 7. You can see your monthly estimated costs at the bottom of the pricing calculator. CloudWatch agent configuration for this solution The CloudWatch agent is software that runs continuously and autonomously on your servers and in containerized environments. It collects metrics, logs, and traces from your infrastructure and applications and sends them to CloudWatch and X-Ray. For more information about the CloudWatch agent, see Collect metrics, logs, and traces with the CloudWatch agent. CloudWatch agent configuration for this solution 2331 Amazon CloudWatch User Guide The agent configuration in this solution collects a set of metrics to help you get started monitoring and observing your NGINX workload. The CloudWatch agent can be configured to collect more NGINX metrics than the dashboard displays by default. For a list of all NGINX metrics that you can collect, see Metrics for NGINX OSS. Before configuring the CloudWatch agent, you must first configure NGINX to expose its metrics. Secondly, you must install and configure the third party Prometheus metric exporter. Expose NGINX metrics Note The following commands are for Linux. Check NGINX for Windows page for equivalent commands in Windows Server. You must first enable the stub_status module. Add a new location block in your NGINX configuration file. Add the following lines in the server block of your nginx.conf to enable NGINX's stub_status module: location /nginx_status { stub_status on; allow 127.0.0.1; # Allow only localhost to access deny all; # Deny all other IPs } Before reloading NGINX, validate your NGINX configuration: sudo nginx -t This validation command helps to prevent any unforeseen errors, which can cause your website to gown down. The
acw-ug-660
acw-ug.pdf
660
Note The following commands are for Linux. Check NGINX for Windows page for equivalent commands in Windows Server. You must first enable the stub_status module. Add a new location block in your NGINX configuration file. Add the following lines in the server block of your nginx.conf to enable NGINX's stub_status module: location /nginx_status { stub_status on; allow 127.0.0.1; # Allow only localhost to access deny all; # Deny all other IPs } Before reloading NGINX, validate your NGINX configuration: sudo nginx -t This validation command helps to prevent any unforeseen errors, which can cause your website to gown down. The following example demonstrates a successful response: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful Once you've successfully validated the updated configuration, reload NGINX (no output is expected): CloudWatch agent configuration for this solution 2332 Amazon CloudWatch User Guide sudo systemctl reload nginx This command instructs the NGINX process to reload the configuration. Reloads are more graceful compared to a full restart. A reload starts the new worker process with a new configuration, gracefully shutting down old worker processes. Test the NGINX status endpoint: curl http://127.0.0.1/nginx_status The following example demonstrates a successful response: Active connections: 1 server accepts handled requests 6 6 6 Reading: 0 Writing: 1 Waiting: 0 The following example demonstrates a failure response (review the previous steps before proceeding): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/ xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>The page is not found</title> ... Configure Prometheus metric exporter Download the latest NGINX Prometheus exporter release from the official GitHub repository. You must download the relevant binary for your platform. The following example demonstrates commands for AMD64: cd /tmp wget https://github.com/nginxinc/nginx-prometheus-exporter/releases/download/v1.3.0/ nginx-prometheus-exporter_1.3.0_linux_amd64.tar.gz tar -xzvf nginx-prometheus-exporter_1.3.0_linux_amd64.tar.gz sudo cp nginx-prometheus-exporter /usr/local/bin/ rm /tmp/nginx-prometheus-exporter* CloudWatch agent configuration for this solution 2333 Amazon CloudWatch User Guide Run the Prometheus exporter and point it to the NGINX stub status page: nohup /usr/local/bin/nginx-prometheus-exporter -nginx.scrape-uri http://127.0.0.1/ nginx_status &>/dev/null & The following example demonstrates a response (background job ID and PID): [1] 74699 Test the NGINX Prometheus endpoint Validate that the NGINX Prometheus exporter has started to expose the relevant metrics: curl http://localhost:port-number/metrics The following example demonstrates a successful response: # HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles. # TYPE go_gc_duration_seconds summary go_gc_duration_seconds{quantile="0"} 0 go_gc_duration_seconds{quantile="0.25"} 0 ... # HELP nginx_connections_accepted Accepted client connections # TYPE nginx_connections_accepted counter nginx_connections_accepted 14 # HELP nginx_connections_active Active client connections # TYPE nginx_connections_active gauge nginx_connections_active 1 ... # TYPE promhttp_metric_handler_requests_total counter promhttp_metric_handler_requests_total{code="200"} 1 promhttp_metric_handler_requests_total{code="500"} 0 promhttp_metric_handler_requests_total{code="503"} 0 Agent configuration for this solution The metrics collected by the agent are defined in the agent configuration. The solution provides agent configurations to collect the recommended metrics with suitable dimensions for the solution's dashboard. CloudWatch agent configuration for this solution 2334 Amazon CloudWatch User Guide The steps for deploying the solution are described later in Deploy the agent for your solution. The following information is intended to help you understand how to customize the agent configuration for your environment. You must customize some parts of the agent and Prometheus configurations for your environment such as the port number used by the Prometheus exporter. The port used by the Prometheus exporter can be verified using the following command: sudo netstat -antp | grep nginx-prom The following example demonstrates a response (see port value 9113): tcp6 0 0 :::9113 :::* LISTEN 76398/nginx-prometh Agent configuration for NGINX hosts The CloudWatch agent with Prometheus monitoring needs two configurations to scrape the Prometheus metrics. Each configuration will be stored as a separate parameter in SSM's Parameter Store, as detailed later in Step 2: Store the recommended CloudWatch agent configuration file in Systems Manager Parameter Store. The first configuration is for the Prometheus exporter, as documented in Prometheus' scrape_config documentation. The second configuration is for the CloudWatch agent. Prometheus configuration Replace port-number with the port of your server. global: scrape_interval: 30s scrape_timeout: 10s scrape_configs: - job_name: 'nginx' metrics_path: /metrics static_configs: - targets: ['localhost:port-number'] ec2_sd_configs: - port: port-number relabel_configs: - source_labels: ['__meta_ec2_instance_id'] CloudWatch agent configuration for this solution 2335 Amazon CloudWatch User Guide target_label: InstanceId metric_relabel_configs: - source_labels: ['__name__'] regex: 'nginx_up|nginx_http_requests_total|nginx_connections_.*' action: keep CloudWatch agent configuration As per the previous CloudWatch agent configuration, these metrics are published via CloudWatch Logs using the embedded metric format (EMF). These logs are configured to use the log group nginx. You can customize the log_group_name with a different name that represents the CloudWatch logs. If you are using Windows Server, set prometheus_config_path in the following configuration to C:\\ProgramData\\Amazon\\AmazonCloudWatchAgent\\prometheus.yaml. { "agent": { "metrics_collection_interval": 60 }, "logs": { "metrics_collected": { "prometheus": { "log_group_name": "nginx", "prometheus_config_path": "/opt/aws/amazon-cloudwatch-agent/etc/ prometheus.yaml", "emf_processor": { "metric_declaration_dedup": true, "metric_namespace": "CWAgent", "metric_declaration":[ { "source_labels":["InstanceId"], "metric_selectors":["nginx_up", "nginx_http_requests_total", "nginx_connections*"], "dimensions": [["InstanceId"]] } ] } } } } } CloudWatch agent configuration for this solution 2336 Amazon CloudWatch User Guide Deploy the agent for
acw-ug-661
acw-ug.pdf
661
via CloudWatch Logs using the embedded metric format (EMF). These logs are configured to use the log group nginx. You can customize the log_group_name with a different name that represents the CloudWatch logs. If you are using Windows Server, set prometheus_config_path in the following configuration to C:\\ProgramData\\Amazon\\AmazonCloudWatchAgent\\prometheus.yaml. { "agent": { "metrics_collection_interval": 60 }, "logs": { "metrics_collected": { "prometheus": { "log_group_name": "nginx", "prometheus_config_path": "/opt/aws/amazon-cloudwatch-agent/etc/ prometheus.yaml", "emf_processor": { "metric_declaration_dedup": true, "metric_namespace": "CWAgent", "metric_declaration":[ { "source_labels":["InstanceId"], "metric_selectors":["nginx_up", "nginx_http_requests_total", "nginx_connections*"], "dimensions": [["InstanceId"]] } ] } } } } } CloudWatch agent configuration for this solution 2336 Amazon CloudWatch User Guide Deploy the agent for your solution There are several approaches for installing the CloudWatch agent, depending on the use case. We recommend using Systems Manager for this solution. It provides a console experience and makes it simpler to manage a fleet of managed servers within a single AWS account. The instructions in this section use Systems Manager and are intended for when you don't have the CloudWatch agent running with existing configurations. You can check whether the CloudWatch agent is running by following the steps in Verify that the CloudWatch agent is running. If you are already running the CloudWatch agent on the EC2 hosts where the workload is deployed and managing agent configurations, you can skip the instructions in this section and follow your existing deployment mechanism to update the configuration. Be sure to merge new CloudWatch agent and Prometheus configurations with your existing configurations, and then deploy the merged configurations. If you are using Systems Manager to store and manage the configuration for the CloudWatch agent, you can merge the configuration to the existing parameter value. For more information, see Managing CloudWatch agent configuration files. Note Using Systems Manager to deploy the following CloudWatch agent configurations will replace or overwrite any existing CloudWatch agent configuration on your EC2 instances. You can modify this configuration to suit your unique environment or use case. The metrics defined in configuration are the minimum required for the dashboard provided the solution. The deployment process includes the following steps: • Step 1: Ensure that the target EC2 instances have the required IAM permissions. • Step 2: Store the recommended agent configuration file in the Systems Manager Parameter Store. • Step 3: Install the CloudWatch agent on one or more EC2 instances using an AWS CloudFormation stack. • Step 4: Verify the agent setup is configured properly. Deploy the agent for your solution 2337 Amazon CloudWatch User Guide Step 1: Ensure the target EC2 instances have the required IAM permissions You must grant permission for Systems Manager to install and configure the CloudWatch agent. You must grant permission for the CloudWatch agent to publish telemetry from your EC2 instance to CloudWatch. You must also grant the CloudWatch agent EC2 read access. EC2 read access is required for the EC2 InstanceId to be added as a metric dimension. This additional requirement is driven by prometheus.yaml as detailed above because it uses __meta_ec2_instance_id via EC2 Service Discovery. Make sure that the IAM role attached to the instance has the CloudWatchAgentServerPolicy, AmazonSSMManagedInstanceCore, and AmazonEC2ReadOnlyAccess IAM policies attached. • To create a role, see Create IAM roles to use with the CloudWatch agent on Amazon EC2 instances. • After the role is created, attach the role to your EC2 instances. To attach a role to an EC2 instance, follow the steps in Attach an IAM role to an instance. Step 2: Store the recommended CloudWatch agent configuration file in Systems Manager Parameter Store Parameter Store simplifies the installation of the CloudWatch agent on an EC2 instance by securely storing and managing configuration parameters, eliminating the need for hard-coded values. This ensures a more secure and flexible deployment process, enabling centralized management and easier updates to configurations across multiple instances. Use the following steps to store the recommended CloudWatch agent configuration file as a parameter in Parameter Store. To create the CloudWatch agent configuration file as a parameter 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. Verify that the selected Region on the console is the Region where NGINX is running. 3. 4. From the navigation pane, choose Application Management, Parameter Store Follow these steps to create a new parameter for the configuration. a. Choose Create parameter. Deploy the agent for your solution 2338 Amazon CloudWatch User Guide b. c. d. e. f. g. In the Name box, enter a name that you'll use to reference the CloudWatch agent configuration file in later steps. For example, AmazonCloudWatch-NGINX- CloudWatchAgent-Configuration. (Optional) In the Description box, type a description for the parameter. For Parameter tier, choose Standard. For Type, choose String. For Data type, choose text. In the Value box, paste the corresponding JSON block that was listed in Agent configuration for NGINX hosts. Be sure to customize as required. For example, the
acw-ug-662
acw-ug.pdf
662
for the configuration. a. Choose Create parameter. Deploy the agent for your solution 2338 Amazon CloudWatch User Guide b. c. d. e. f. g. In the Name box, enter a name that you'll use to reference the CloudWatch agent configuration file in later steps. For example, AmazonCloudWatch-NGINX- CloudWatchAgent-Configuration. (Optional) In the Description box, type a description for the parameter. For Parameter tier, choose Standard. For Type, choose String. For Data type, choose text. In the Value box, paste the corresponding JSON block that was listed in Agent configuration for NGINX hosts. Be sure to customize as required. For example, the relevant log_group_name. h. Choose Create parameter. To create the Prometheus configuration file as a parameter 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. From the navigation pane, choose Application Management, Parameter Store Follow these steps to create a new parameter for the configuration. a. b. c. d. e. f. g. Choose Create parameter. In the Name box, enter a name that you'll use to reference the configuration file in later steps. For example, AmazonCloudWatch-NGINX-Prometheus-Configuration. (Optional) In the Description box, type a description for the parameter. For Parameter tier, choose Standard. For Type, choose String. For Data type, choose text. In the Value box, paste the corresponding YAML block that was listed in the Agent configuration for NGINX hosts. Be sure to customize as required. For example, the relevant port number as per targets. h. Choose Create parameter. Deploy the agent for your solution 2339 Amazon CloudWatch User Guide Step 3: Install the CloudWatch agent and apply the configuration using an AWS CloudFormation template You can use AWS CloudFormation to install the agent and configure it to use the CloudWatch agent configuration that you created in the previous steps. To install and configure the CloudWatch agent for this solution 1. Open the AWS CloudFormation Quick create stack wizard using this link: https:// console.aws.amazon.com/cloudformation/home?#/stacks/quickcreate?templateURL=https:// aws-observability-solutions-prod-us-east-1.s3.us-east-1.amazonaws.com/CloudWatchAgent/ CFN/v1.0.0/cw-agent-installation-template-with-prometheus-config-1.0.0.json . 2. Verify that the selected Region on the console is the Region where the NGINX workload is running. 3. 4. For Stack name, enter a name to identity this stack, such as CWAgentInstallationStack. In the Parameters section, specify the following: a. b. For CloudWatchAgentConfigSSM, enter the name of the AWS Systems Manager parameter for the agent configuration that you created earlier, such as AmazonCloudWatch-NGINX-CloudWatchAgent-Configuration. For PrometheusConfigSSM, enter the name of the AWS Systems Manager parameter for the agent configuration that you created earlier, such as AmazonCloudWatch-NGINX- Prometheus-Configuration. c. To select the target instances, you have two options. i. ii. For InstanceIds, specify a comma-delimited list of instance IDs list of instance IDs where you want to install the CloudWatch agent with this configuration. You can list a single instance or several instances. If you are deploying at scale, you can specify the TagKey and the corresponding TagValue to target all EC2 instances with this tag and value. If you specify a TagKey, you must specify a corresponding TagValue. (For an Auto Scaling group, specify aws:autoscaling:groupName for the TagKey and specify the Auto Scaling group name for the TagValue to deploy to all instances within the Auto Scaling group.) 5. Review the settings, then choose Create stack. Deploy the agent for your solution 2340 Amazon CloudWatch User Guide If you want to edit the template file first to customize it, choose the Upload a template file option under Create Stack Wizard to upload the edited template. For more information, see Creating a stack on AWS CloudFormation console. You can use the following link to download the template: https://aws-observability-solutions-prod-us-east-1.s3.us-east-1.amazonaws.com/ CloudWatchAgent/CFN/v1.0.0/cw-agent-installation-template-with-prometheus-config-1.0.0.json. Note After this step is completed, this Systems Manager parameter will be associated with the CloudWatch agents running in the targeted instances. This means that: 1. If the Systems Manager parameter is deleted, the agent will stop. 2. If the Systems Manager parameter is edited, the configuration changes will automatically apply to the agent at the scheduled frequency which is 30 days by default. 3. If you want to immediately apply changes to this Systems Manager parameter, you must run this step again. For more information about associations, see Working with associations in Systems Manager. Step 4: Verify the agent setup is configured properly You can verify whether the CloudWatch agent is installed by following the steps in Verify that the CloudWatch agent is running. If the CloudWatch agent is not installed and running, make sure you have set up everything correctly. • Be sure you have attached a role with correct permissions for the EC2 instance as described in Step 1: Ensure the target EC2 instances have the required IAM permissions. • Be sure you have correctly configured the JSON for the Systems Manager parameter. Follow the steps in Troubleshooting installation of the CloudWatch agent with AWS CloudFormation. If everything is set up correctly, then you should see the NGINX metrics being
acw-ug-663
acw-ug.pdf
663
by following the steps in Verify that the CloudWatch agent is running. If the CloudWatch agent is not installed and running, make sure you have set up everything correctly. • Be sure you have attached a role with correct permissions for the EC2 instance as described in Step 1: Ensure the target EC2 instances have the required IAM permissions. • Be sure you have correctly configured the JSON for the Systems Manager parameter. Follow the steps in Troubleshooting installation of the CloudWatch agent with AWS CloudFormation. If everything is set up correctly, then you should see the NGINX metrics being published to CloudWatch. You can check the CloudWatch console to verify they are being published. To verify that NGINX metrics are being published to CloudWatch 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. Choose Metrics, All metrics. Deploy the agent for your solution 2341 Amazon CloudWatch User Guide 3. Make sure you've selected the Region where you deployed the solution, and choose Custom namespaces, CWAgent. 4. Search for metrics such as nginx_http_requests_total. If you see results for these metrics, then the metrics are being published to CloudWatch. Create the NGINX solution dashboard The dashboard provided by this solution presents NGINX workload metrics by aggregating and presenting metrics across all instances. The dashboard shows a breakdown of the top contributors (top 10 per metric widget) for each metric. This helps you to quickly identify outliers or instances that significantly contribute to the observed metrics. To create the dashboard, you can use the following options: • Use CloudWatch console to create the dashboard. • Use AWS CloudFormation console to deploy the dashboard. • Download the AWS CloudFormation infrastructure as code and integrate it as part of your continuous integration (CI) automation. By using the CloudWatch console to create a dashboard, you can preview the dashboard before actually creating and being charged. Note The dashboard created with AWS CloudFormation in this solution displays metrics from the Region where the solution is deployed. Be sure to create the AWS CloudFormation stack in the Region where your NGINX metrics are published. If you've specified a custom namespace other than CWAgent in the CloudWatch agent configuration, you'll have to change the CloudFormation template for the dashboard to replace CWAgent with the customized namespace you are using. To create the dashboard via CloudWatch Console 1. Open the CloudWatch Console Create Dashboard using this link: https://console.aws.amazon.com/cloudwatch/home?#dashboards? dashboardTemplate=NginxOnEc2&referrer=os-catalog . Create the NGINX solution dashboard 2342 Amazon CloudWatch User Guide 2. Verify that the selected Region on the console is the Region where the NGINX workload is running. 3. Enter the name of the dashboard, then choose Create Dashboard. To easily differentiate this dashboard from similar dashboards in other Regions, we recommend including the Region name in the dashboard name, such as NGINXDashboard- us-east-1. 4. Preview the dashboard and choose Save to create the dashboard. To create the dashboard via AWS CloudFormation 1. Open the AWS CloudFormation Quick create stack wizard using this link: https:// console.aws.amazon.com/cloudformation/home?#/stacks/quickcreate?templateURL=https:// aws-observability-solutions-prod-us-east-1.s3.us-east-1.amazonaws.com/NGINX_EC2/ CloudWatch/CFN/v1.0.0/dashboard-template-1.0.0.json . 2. Verify that the selected Region on the console is the Region where the NGINX workload is running. 3. 4. 5. For Stack name, enter a name to identity this stack, such as NGINXDashboardStack. In the Parameters section, specify the name of the dashboard under the DashboardName parameter. To easily differentiate this dashboard from similar dashboards in other Regions, we recommend including the Region name in the dashboard name, such as NGINXDashboard- us-east-1. 6. Acknowledge access capabilities for transforms under Capabilities and transforms. Note that CloudFormation doesn't add any IAM resources. 7. Review the settings, then choose Create stack. 8. After the stack status is CREATE_COMPLETE, choose the Resources tab under the created stack and then choose the link under Physical ID to go to the dashboard. You can also access the dashboard in the CloudWatch console by choosing Dashboards in the left navigation pane of the console, and finding the dashboard name under Custom Dashboards. If you want to edit the template file first to customize it, choose the Upload a template file option under Create Stack Wizard to upload the edited template. For more information, see Creating a stack on AWS CloudFormation console. You can use the following link to download the template: Create the NGINX solution dashboard 2343 Amazon CloudWatch User Guide https://aws-observability-solutions-prod-us-east-1.s3.us-east-1.amazonaws.com/NGINX_EC2/ CloudWatch/CFN/v1.0.0/dashboard-template-1.0.0.json. Get started with the NGINX dashboard Here are a few tasks that you can try out with the new NGINX dashboard. These tasks allow you to validate that the dashboard is working correctly and provide you some hands-on experience using it to monitor a NGINX workload. As you try these out, you'll get familiar with navigating the dashboard and interpreting the visualized metrics. Review connection metrics In the Connections section, you can find several key metrics that provide insights into the client connection handling
acw-ug-664
acw-ug.pdf
664
to download the template: Create the NGINX solution dashboard 2343 Amazon CloudWatch User Guide https://aws-observability-solutions-prod-us-east-1.s3.us-east-1.amazonaws.com/NGINX_EC2/ CloudWatch/CFN/v1.0.0/dashboard-template-1.0.0.json. Get started with the NGINX dashboard Here are a few tasks that you can try out with the new NGINX dashboard. These tasks allow you to validate that the dashboard is working correctly and provide you some hands-on experience using it to monitor a NGINX workload. As you try these out, you'll get familiar with navigating the dashboard and interpreting the visualized metrics. Review connection metrics In the Connections section, you can find several key metrics that provide insights into the client connection handling of your NGINX server. Monitoring these connection metrics can help you identify potential bottlenecks, connection issues, or unexpected connection patterns. • Accepted client connections • Active client connections • Handled client connections • Connections reading requests • Idle client connections • Connections writing responses Analyze HTTP request volume The request metric in the HTTP Requests section shows the total number of HTTP requests handled by the NGINX server. Tracking this metric over time can help you understand the overall traffic load on your NGINX infrastructure and plan for resource allocation and scaling accordingly. CloudWatch solution: NVIDIA GPU workload on Amazon EC2 This solution helps you configure out-of-the-box metric collection using CloudWatch agents for NVIDIA GPU workloads running on EC2 instances. Additionally, it helps you set up a pre-configured CloudWatch dashboard. For general information about all CloudWatch observability solutions, see CloudWatch observability solutions. Topics • Requirements NVIDIA GPU workload on EC2 2344 User Guide Amazon CloudWatch • Benefits • CloudWatch agent configuration for this solution • Deploy the agent for your solution • Create the NVIDIA GPU solution dashboard Requirements This solution is relevant for the following conditions: • Compute: Amazon EC2 • Supports up to 500 GPUs across all EC2 instances in a given AWS Region • Latest version of CloudWatch agent • SSM agent installed on EC2 instance • The EC2 instance must have an NVIDIA driver installed. NVIDIA drivers are pre-installed on some Amazon Machine Images (AMIs). Otherwise, you can manually install the driver. For more information, see Install NVIDIA drivers on Linux instances. Note AWS Systems Manager (SSM agent) is pre-installed on some Amazon Machine Images (AMIs) provided by AWS and trusted third-parties. If the agent isn't installed, you can install it manually using the procedure for your operating system type. • Manually installing and uninstalling SSM Agent on EC2 instances for Linux • Manually installing and uninstalling SSM Agent on EC2 instances for macOS • Manually installing and uninstalling SSM Agent on EC2 instances for Windows Server Benefits The solution delivers NVIDIA monitoring, providing valuable insights for the following use cases: • Analyze GPU and memory usage for performance bottlenecks or the need for additional resources. • Monitor temperature and power draw to ensure GPUs operate within safe limits. Requirements 2345 Amazon CloudWatch User Guide • Evaluate encoder performance for GPU video workloads. • Verify PCIe connectivity for expected generation and width. • Monitor GPU clock speeds to detect scaling and throttling issues. Below are the key advantages of the solution: • Automates metric collection for NVIDIA using CloudWatch agent configuration, eliminating manual instrumentation. • Provides a pre-configured, consolidated CloudWatch dashboard for NVIDIA metrics. The dashboard will automatically handle metrics from new NVIDIA EC2 instances configured using the solution, even if those metrics don't exist when you first create the dashboard. The following image is an example of the dashboard for this solution. Benefits 2346 Amazon CloudWatch User Guide Benefits 2347 Amazon CloudWatch Costs User Guide This solution creates and uses resources in your account. You are charged for standard usage, including the following: • All metrics collected by the CloudWatch agent are charged as custom metrics. The number of metrics used by this solution depends on the number of EC2 hosts. • Each EC2 host configured for the solution publishes a total of 17 metrics per GPU. • One custom dashboard. • API operations requested by the CloudWatch agent to publish the metrics. With the default configuration for this solution, the CloudWatch agent calls the PutMetricData once every minute for each EC2 host. This means the PutMetricData API will be called 30*24*60=43,200 in a 30- day month for each EC2 host. For more information about CloudWatch pricing, see Amazon CloudWatch Pricing. The pricing calculator can help you estimate approximate monthly costs for using this solution. To use the pricing calculator to estimate your monthly solution costs 1. Open the Amazon CloudWatch pricing calculator. 2. 3. 4. For Choose a Region, select the Region where you would like to deploy the solution. In the Metrics section, for Number of metrics, enter 17 * average number of GPUs per EC2 host * number of EC2 instances configured for this solution. In the APIs section, for Number of
acw-ug-665
acw-ug.pdf
665
day month for each EC2 host. For more information about CloudWatch pricing, see Amazon CloudWatch Pricing. The pricing calculator can help you estimate approximate monthly costs for using this solution. To use the pricing calculator to estimate your monthly solution costs 1. Open the Amazon CloudWatch pricing calculator. 2. 3. 4. For Choose a Region, select the Region where you would like to deploy the solution. In the Metrics section, for Number of metrics, enter 17 * average number of GPUs per EC2 host * number of EC2 instances configured for this solution. In the APIs section, for Number of API requests, enter 43200 * number of EC2 instances configured for this solution. 5. By default, the CloudWatch agent performs one PutMetricData operation each minute for each EC2 host. 6. In the Dashboards and Alarms section, for Number of Dashboards, enter 1. 7. You can see your monthly estimated costs at the bottom of the pricing calculator. CloudWatch agent configuration for this solution The CloudWatch agent is software that runs continuously and autonomously on your servers and in containerized environments. It collects metrics, logs, and traces from your infrastructure and applications and sends them to CloudWatch and X-Ray. CloudWatch agent configuration for this solution 2348 Amazon CloudWatch User Guide For more information about the CloudWatch agent, see Collect metrics, logs, and traces with the CloudWatch agent. The agent configuration in this solution collects a set of metrics to help you get started monitoring and observing your NVIDIA GPU. The CloudWatch agent can be configured to collect more NVIDIA GPU metrics than the dashboard displays by default. For a list of all NVIDIA GPU metrics that you can collect, see Collect NVIDIA GPU metrics. Agent configuration for this solution The metrics collected by the agent are defined in the agent configuration. The solution provides agent configurations to collect the recommended metrics with suitable dimensions for the solution's dashboard. Use the following CloudWatch agent configuration on EC2 instances with NVIDIA GPUs. Configuration will be stored as a parameter in SSM's Parameter Store, as detailed later in Step 2: Store the recommended CloudWatch agent configuration file in Systems Manager Parameter Store. { "metrics": { "namespace": "CWAgent", "append_dimensions": { "InstanceId": "${aws:InstanceId}" }, "metrics_collected": { "nvidia_gpu": { "measurement": [ "utilization_gpu", "temperature_gpu", "power_draw", "utilization_memory", "fan_speed", "memory_total", "memory_used", "memory_free", "pcie_link_gen_current", "pcie_link_width_current", "encoder_stats_session_count", "encoder_stats_average_fps", "encoder_stats_average_latency", "clocks_current_graphics", "clocks_current_sm", CloudWatch agent configuration for this solution 2349 Amazon CloudWatch User Guide "clocks_current_memory", "clocks_current_video" ], "metrics_collection_interval": 60 } } }, "force_flush_interval": 60 } Deploy the agent for your solution There are several approaches for installing the CloudWatch agent, depending on the use case. We recommend using Systems Manager for this solution. It provides a console experience and makes it simpler to manage a fleet of managed servers within a single AWS account. The instructions in this section use Systems Manager and are intended for when you don't have the CloudWatch agent running with existing configurations. You can check whether the CloudWatch agent is running by following the steps in Verify that the CloudWatch agent is running. If you are already running the CloudWatch agent on the EC2 hosts where the workload is deployed and managing agent configurations, you can skip the instructions in this section and follow your existing deployment mechanism to update the configuration. Be sure to merge the agent configuration of NVIDIA GPU with your existing agent configuration, and then deploy the merged configuration. If you are using Systems Manager to store and manage the configuration for the CloudWatch agent, you can merge the configuration to the existing parameter value. For more information, see Managing CloudWatch agent configuration files. Note Using Systems Manager to deploy the following CloudWatch agent configurations will replace or overwrite any existing CloudWatch agent configuration on your EC2 instances. You can modify this configuration to suit your unique environment or use case. The metrics defined in configuration are the minimum required for the dashboard provided the solution. The deployment process includes the following steps: • Step 1: Ensure that the target EC2 instances have the required IAM permissions. Deploy the agent for your solution 2350 Amazon CloudWatch User Guide • Step 2: Store the recommended agent configuration file in the Systems Manager Parameter Store. • Step 3: Install the CloudWatch agent on one or more EC2 instances using an AWS CloudFormation stack. • Step 4: Verify the agent setup is configured properly. Step 1: Ensure the target EC2 instances have the required IAM permissions You must grant permission for Systems Manager to install and configure the CloudWatch agent. You must also grant permission for the CloudWatch agent to publish telemetry from your EC2 instance to CloudWatch. Make sure that the IAM role attached to the instance has the CloudWatchAgentServerPolicy and AmazonSSMManagedInstanceCore IAM policies attached. • To create a role, see Create IAM roles to use with
acw-ug-666
acw-ug.pdf
666
3: Install the CloudWatch agent on one or more EC2 instances using an AWS CloudFormation stack. • Step 4: Verify the agent setup is configured properly. Step 1: Ensure the target EC2 instances have the required IAM permissions You must grant permission for Systems Manager to install and configure the CloudWatch agent. You must also grant permission for the CloudWatch agent to publish telemetry from your EC2 instance to CloudWatch. Make sure that the IAM role attached to the instance has the CloudWatchAgentServerPolicy and AmazonSSMManagedInstanceCore IAM policies attached. • To create a role, see Create IAM roles to use with the CloudWatch agent on Amazon EC2 instances. • After the role is created, attach the role to your EC2 instances. To attach a role to an EC2 instance, follow the steps in Attach an IAM role to an instance. Step 2: Store the recommended CloudWatch agent configuration file in Systems Manager Parameter Store Parameter Store simplifies the installation of the CloudWatch agent on an EC2 instance by securely storing and managing configuration parameters, eliminating the need for hard-coded values. This ensures a more secure and flexible deployment process, enabling centralized management and easier updates to configurations across multiple instances. Use the following steps to store the recommended CloudWatch agent configuration file as a parameter in Parameter Store. To create the CloudWatch agent configuration file as a parameter 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. Verify that the selected Region on the console is the Region where the NVIDIA GPU workload is running. 3. From the navigation pane, choose Application Management, Parameter Store. Deploy the agent for your solution 2351 Amazon CloudWatch User Guide 4. Follow these steps to create a new parameter for the configuration. a. b. c. d. e. f. g. Choose Create parameter. In the Name box, enter a name that you'll use to reference the CloudWatch agent configuration file in later steps. For example, AmazonCloudWatch-NVIDIA-GPU- Configuration. (Optional) In the Description box, type a description for the parameter. For Parameter tier, choose Standard. For Type, choose String. For Data type, choose text. In the Value box, paste the corresponding JSON block that was listed in Agent configuration for this solution. h. Choose Create parameter. Step 3: Install the CloudWatch agent and apply the configuration using an AWS CloudFormation template You can use AWS CloudFormation to install the agent and configure it to use the CloudWatch agent configuration that you created in the previous steps. To install and configure the CloudWatch agent for this solution 1. Open the AWS CloudFormation Quick create stack wizard using this link: https:// console.aws.amazon.com/cloudformation/home?#/stacks/quickcreate?templateURL=https:// aws-observability-solutions-prod-us-east-1.s3.us-east-1.amazonaws.com/CloudWatchAgent/ CFN/v1.0.0/cw-agent-installation-template-1.0.0.json. 2. Verify that the selected Region on the console is the Region where the NVIDIA GPU workload is running. 3. 4. For Stack name, enter a name to identity this stack, such as CWAgentInstallationStack. In the Parameters section, specify the following: a. For CloudWatchAgentConfigSSM, enter the name of the Systems Manager parameter for the agent configuration that you created earlier, such as AmazonCloudWatch-NVIDIA- GPU-Configuration. b. To select the target instances, you have two options. Deploy the agent for your solution 2352 Amazon CloudWatch User Guide i. ii. For InstanceIds, specify a comma-delimited list of instance IDs list of instance IDs where you want to install the CloudWatch agent with this configuration. You can list a single instance or several instances. If you are deploying at scale, you can specify the TagKey and the corresponding TagValue to target all EC2 instances with this tag and value. If you specify a TagKey, you must specify a corresponding TagValue. (For an Auto Scaling group, specify aws:autoscaling:groupName for the TagKey and specify the Auto Scaling group name for the TagValue to deploy to all instances within the Auto Scaling group.) 5. Review the settings, then choose Create stack. If you want to edit the template file first to customize it, choose the Upload a template file option under Create Stack Wizard to upload the edited template. For more information, see Creating a stack on AWS CloudFormation console. Note After this step is completed, this Systems Manager parameter will be associated with the CloudWatch agents running in the targeted instances. This means that: 1. If the Systems Manager parameter is deleted, the agent will stop. 2. If the Systems Manager parameter is edited, the configuration changes will automatically apply to the agent at the scheduled frequency which is 30 days by default. 3. If you want to immediately apply changes to this Systems Manager parameter, you must run this step again. For more information about associations, see Working with associations in Systems Manager. Step 4: Verify the agent setup is configured properly You can verify whether the CloudWatch agent is installed by following the steps in Verify that the CloudWatch agent is running. If the CloudWatch agent is not
acw-ug-667
acw-ug.pdf
667
is deleted, the agent will stop. 2. If the Systems Manager parameter is edited, the configuration changes will automatically apply to the agent at the scheduled frequency which is 30 days by default. 3. If you want to immediately apply changes to this Systems Manager parameter, you must run this step again. For more information about associations, see Working with associations in Systems Manager. Step 4: Verify the agent setup is configured properly You can verify whether the CloudWatch agent is installed by following the steps in Verify that the CloudWatch agent is running. If the CloudWatch agent is not installed and running, make sure you have set up everything correctly. • Be sure you have attached a role with correct permissions for the EC2 instance as described in Step 1: Ensure the target EC2 instances have the required IAM permissions. Deploy the agent for your solution 2353 Amazon CloudWatch User Guide • Be sure you have correctly configured the JSON for the Systems Manager parameter. Follow the steps in Troubleshooting installation of the CloudWatch agent with AWS CloudFormation. If everything is set up correctly, then you should see the NVIDIA GPU metrics being published to CloudWatch. You can check the CloudWatch console to verify they are being published. To verify that NVIDIA GPU metrics are being published to CloudWatch 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. Choose Metrics, All metrics. 3. Make sure you've selected the Region where you deployed the solution, and choose Custom namespaces, CWAgent. 4. Search for the metrics mentioned in Agent configuration for this solution, such as nvidia_smi_utilization_gpu. If you see results for these metrics, then the metrics are being published to CloudWatch. Create the NVIDIA GPU solution dashboard The dashboard provided by this solution presents NVIDIA GPUs metrics by aggregating and presenting metrics across all instances. The dashboard shows a breakdown of the top contributors (top 10 per metric widget) for each metric. This helps you to quickly identify outliers or instances that significantly contribute to the observed metrics. To create the dashboard, you can use the following options: • Use CloudWatch console to create the dashboard. • Use AWS CloudFormation console to deploy the dashboard. • Download the AWS CloudFormation infrastructure as code and integrate it as part of your continuous integration (CI) automation. By using the CloudWatch console to create a dashboard, you can preview the dashboard before actually creating and being charged. Create the NVIDIA GPU solution dashboard 2354 Amazon CloudWatch Note User Guide The dashboard created with AWS CloudFormation in this solution displays metrics from the Region where the solution is deployed. Be sure to create the AWS CloudFormation stack in the Region where your NVIDIA GPU metrics are published. If you've specified a custom namespace other than CWAgent in the CloudWatch agent configuration, you'll have to change the AWS CloudFormation template for the dashboard to replace CWAgent with the customized namespace you are using. To create the dashboard via CloudWatch Console 1. Open the CloudWatch Console Create Dashboard using this link: https://console.aws.amazon.com/cloudwatch/home?#dashboards? dashboardTemplate=NvidiaGpuOnEc2&referrer=os-catalog . 2. Verify that the selected Region on the console is the Region where the NVIDIA GPU workload is running. 3. Enter the name of the dashboard, then choose Create Dashboard. To easily differentiate this dashboard from similar dashboards in other Regions, we recommend including the Region name in the dashboard name, such as NVIDIA-GPU- Dashboard-us-east-1. 4. Preview the dashboard and choose Save to create the dashboard. To create the dashboard via AWS CloudFormation 1. Open the AWS CloudFormation Quick create stack wizard using this link: https:// console.aws.amazon.com/cloudformation/home?#/stacks/quickcreate?templateURL=https:// aws-observability-solutions-prod-us-east-1.s3.us-east-1.amazonaws.com/NVIDIA_GPU_EC2/ CloudWatch/CFN/v1.0.0/dashboard-template-1.0.0.json. 2. Verify that the selected Region on the console is the Region where the NVIDIA GPU workload is running. 3. 4. For Stack name, enter a name to identity this stack, such as NVIDIA-GPU-DashboardStack. In the Parameters section, specify the name of the dashboard under the DashboardName parameter. Create the NVIDIA GPU solution dashboard 2355 Amazon CloudWatch User Guide 5. To easily differentiate this dashboard from similar dashboards in other Regions, we recommend including the Region name in the dashboard name, such as NVIDIA-GPU- Dashboard-us-east-1. 6. Acknowledge access capabilities for transforms under Capabilities and transforms. Note that AWS CloudFormation doesn't add any IAM resources. 7. Review the settings, then choose Create stack. 8. After the stack status is CREATE_COMPLETE, choose the Resources tab under the created stack and then choose the link under Physical ID to go to the dashboard. You can also access the dashboard in the CloudWatch console by choosing Dashboards in the left navigation pane of the console, and finding the dashboard name under Custom Dashboards. If you want to edit the template file to customize it for any purpose, you can use Upload a template file option under Create Stack Wizard to upload the edited template. For more information, see Creating
acw-ug-668
acw-ug.pdf
668
Review the settings, then choose Create stack. 8. After the stack status is CREATE_COMPLETE, choose the Resources tab under the created stack and then choose the link under Physical ID to go to the dashboard. You can also access the dashboard in the CloudWatch console by choosing Dashboards in the left navigation pane of the console, and finding the dashboard name under Custom Dashboards. If you want to edit the template file to customize it for any purpose, you can use Upload a template file option under Create Stack Wizard to upload the edited template. For more information, see Creating a stack on AWS CloudFormation console. You can use this link to download the template: https://aws-observability-solutions-prod-us- east-1.s3.us-east-1.amazonaws.com/NVIDIA_GPU_EC2/CloudWatch/CFN/v1.0.0/dashboard- template-1.0.0.json . Get started with the NVIDIA GPU dashboard Here are a few tasks that you can try out with the new NVIDIA GPU dashboard. These tasks allow you to validate that the dashboard is working correctly and provide you some hands-on experience using it to monitor your NVIDIA GPUs. As you try these out, you'll get familiar with navigating the dashboard and interpreting the visualized metrics. Review GPU utilization From the Utilization section, find the GPU Utilization and Memory Utilization widgets. These show the percentage of time the GPU is being actively used for computations and the percentage of global memory being read or written, respectively. High utilization could indicate potential performance bottlenecks or the need for additional GPU resources. Analyze GPU memory usage In the Memory section, find the Total Memory, Used Memory, and Free Memory widgets. These provide insights into the overall memory capacity of the GPUs and how much memory is currently being consumed or available. Memory pressure could lead to performance issues or out-of-memory Create the NVIDIA GPU solution dashboard 2356 Amazon CloudWatch User Guide errors, so it's important to monitor these metrics and ensure sufficient memory is available for your workloads. Monitor temperature and power draw In the Temperature / Power section, find the GPU Temperature and Power Draw widgets. These metrics are essential for ensuring that your GPUs are operating within safe thermal and power limits. Identify encoder performance In the Encoder section, find the Encoder Session Count, Average FPS, and Average Latency widgets. These metrics are relevant if you're running video encoding workloads on your GPUs. Monitor these metrics to ensure that your encoders are performing optimally and identify any potential bottlenecks or performance issues. Check PCIe link status In the PCIe section, find the PCIe Link Generation and PCIe Link Width widgets. These metrics provide information about the PCIe link connecting the GPU to the host system. Ensure that the link is operating at the expected generation and width to avoid potential performance limitations due to PCIe bottlenecks. Review GPU clocks In the Clock section, find the Graphics Clock, SM Clock, Memory Clock, and Video Clock widgets. These metrics show the current operating frequencies of various GPU components. Monitoring these clocks can help identify potential issues with GPU clock scaling or frequency throttling, which could impact performance. CloudWatch solution: Kafka workload on Amazon EC2 This solution helps you configure out-of-the-box metric collection using CloudWatch agents for Kafka workloads (brokers, producers, and consumers) running on EC2 instances. Additionally, it helps you set up a pre-configured CloudWatch dashboard. For general information about all CloudWatch observability solutions, see CloudWatch observability solutions. Topics • Requirements Kafka workload on EC2 2357 User Guide Amazon CloudWatch • Benefits • Costs • CloudWatch agent configuration for this solution • Deploy the agent for your solution • Create the Kafka solution dashboard • Configure the agent for multiple Kafka roles on the same instance Requirements This solution is relevant for the following conditions: • Workload: Kafka v0.8.2.x and later • Compute: Amazon EC2 • Supports up to 500 EC2 instances across all Kafka workloads in a given AWS Region • Latest version of CloudWatch agent • SSM agent installed on EC2 instance Note AWS Systems Manager (SSM agent) is pre-installed on some Amazon Machine Images (AMIs) provided by AWS and trusted third-parties. If the agent isn't installed, you can install it manually using the procedure for your operating system type. • Manually installing and uninstalling SSM Agent on EC2 instances for Linux • Manually installing and uninstalling SSM Agent on EC2 instances for macOS • Manually installing and uninstalling SSM Agent on EC2 instances for Windows Server Benefits The solution delivers Kafka server monitoring, providing valuable insights for the following use cases: • Monitor Kafka cluster health via replication and sync metrics. • Track broker performance through request failures and latencies along with network traffic. Requirements 2358 Amazon CloudWatch User Guide • Monitor producer/consumer errors, latencies, and consumer lag. • Analyze underlying JVM performance for Kafka clusters. • Switch between multiple Kafka clusters, producers, and consumers configured via the solution under the
acw-ug-669
acw-ug.pdf
669
• Manually installing and uninstalling SSM Agent on EC2 instances for macOS • Manually installing and uninstalling SSM Agent on EC2 instances for Windows Server Benefits The solution delivers Kafka server monitoring, providing valuable insights for the following use cases: • Monitor Kafka cluster health via replication and sync metrics. • Track broker performance through request failures and latencies along with network traffic. Requirements 2358 Amazon CloudWatch User Guide • Monitor producer/consumer errors, latencies, and consumer lag. • Analyze underlying JVM performance for Kafka clusters. • Switch between multiple Kafka clusters, producers, and consumers configured via the solution under the same account. Below are the key advantages of the solution: • Automates metric collection for Kafka and the underlying JVM using CloudWatch agent configuration, eliminating manual instrumentation. • Provides a pre-configured, consolidated CloudWatch dashboard for Kafka and JVM metrics. The dashboard will automatically handle metrics from new Kafka EC2 instances configured using the solution, even if those metrics don't exist when you first create the dashboard. It also allows you to group the metrics into logical applications for easier focus and management. The following image is an example of the dashboard for this solution. Benefits 2359 Amazon CloudWatch User Guide Benefits 2360 Amazon CloudWatch Costs User Guide This solution creates and uses resources in your account. You are charged for standard usage, including the following: • All metrics collected by the CloudWatch agent are charged as custom metrics. The number of metrics used by this solution depends on the number of EC2 hosts. • Each broker host configured for the solution publishes 33 metrics plus one metric (disk_used_percent) for which the metric count for each EC2 host depends on the number of disk paths for that host. • Each producer host configured for the solution publishes three metrics with the topic dimension and three metrics without the topic dimension. For the metrics with the topic dimension, each topic counts as a separate metric. • Each consumer host configured for the solution publishes two metrics with topic dimensions and three metrics without topic dimensions. For the metrics with topic dimensions, each topic counts as a separate metric. • One custom dashboard. • API operations requested by the CloudWatch agent to publish the metrics. With the default configuration for this solution, the CloudWatch agent calls the PutMetricData once every minute for each EC2 host. This means the PutMetricData API will be called 30*24*60=43,200 in a 30- day month for each EC2 host. For more information about CloudWatch pricing, see Amazon CloudWatch Pricing. The pricing calculator can help you estimate approximate monthly costs for using this solution. To use the pricing calculator to estimate your monthly solution costs 1. Open the Amazon CloudWatch pricing calculator. 2. In the Metrics section, for Number of metrics, enter broker_metrics_count + producer_metrics_count + consumer_metrics_count. Calculate these as follows: • broker_metrics_count = (33 + average number of disk paths per EC2 host) * number_of_ec2_broker_hosts • producer_metrics_count = (3 * average_number_of_topics_per_producer_host + 3) * number_of_ec2_producer_hosts Costs 2361 Amazon CloudWatch User Guide • consumer_metrics_count = (2 * average_number_of_topics_per_consumer_host + 3) * number_of_ec2_consumer_hosts 3. In the APIs section, for Number of API requests, enter 43200 * number of EC2 instances configured for this solution. By default, the CloudWatch agent performs one PutMetricData operation each minute for each EC2 host. 4. In the Dashboards and Alarms section, for Number of Dashboards, enter 1. 5. You can see your monthly estimated costs at the bottom of the pricing calculator. CloudWatch agent configuration for this solution The CloudWatch agent is software that runs continuously and autonomously on your servers and in containerized environments. It collects metrics, logs, and traces from your infrastructure and applications and sends them to CloudWatch and X-Ray. For more information about the CloudWatch agent, see Collect metrics, logs, and traces with the CloudWatch agent. The agent configuration in this solution collects the foundational metrics for Kafka, JVM, and EC2. The CloudWatch agent can be configured to collect more Kafka and JVM metrics than the dashboard displays by default. For a list of all Kafka metrics that you can collect, see Collect Kafka metrics. For a list of all JVM metrics that you can collect, see Collect JVM metrics. For a list of EC2 metrics, see Metrics collected by the CloudWatch agent on Linux and macOS instances. Expose JMX ports for the Kafka broker, producer, and consumer roles The CloudWatch agent relies on JMX to collect the metrics related to the Kafka brokers, producers, and consumers. To make this possible, you must expose the JMX port on your servers and applications. For Kafka brokers, you must use the JMX_PORT environment variable to set the port. You'll have to restart the brokers after you set this environment variable. Review the starting scripts and configuration files of your application to find the best
acw-ug-670
acw-ug.pdf
670
list of EC2 metrics, see Metrics collected by the CloudWatch agent on Linux and macOS instances. Expose JMX ports for the Kafka broker, producer, and consumer roles The CloudWatch agent relies on JMX to collect the metrics related to the Kafka brokers, producers, and consumers. To make this possible, you must expose the JMX port on your servers and applications. For Kafka brokers, you must use the JMX_PORT environment variable to set the port. You'll have to restart the brokers after you set this environment variable. Review the starting scripts and configuration files of your application to find the best place to add these arguments. For example, for Linux and macOS systems, you can use the following command to set the JMX port. Be sure to specify an unused port number. CloudWatch agent configuration for this solution 2362 Amazon CloudWatch User Guide export JMX_PORT=port-number For Kafka producers and consumers, instructions for exposing the JMX port depend on the workload type you are using for your producer or consumer JVM application. See the documentation for your application to find these instructions. In general, to enable a JMX port for monitoring and management, you would set the following system properties for your JVM application. The following example sets up unauthenticated JMX. If your security policies/requirements require you to enable JMX with password authentication or SSL for remote access, refer to the JMX documentation to set the required property. -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=port-number -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false To verify the JMX port, run ps aux | grep jmxremote.port. The results should show that the JMX port was set on the JVM processes. Agent configuration for this solution The metrics collected by the agent are defined in the agent configuration. The solution provides agent configurations to collect the recommended metrics with suitable dimensions for the solution’s dashboard. Each Kafka role, such as broker, producer, or consumer, has its own agent configuration that enables the collection of Kafka metrics and underlying JVM and EC2 metrics. The steps for deploying the solution are described later in Deploy the agent for your solution. The following information is intended to help you understand how to customize the agent configuration for your environment. You must customize some parts of the following agent configuration for your environment: • The JMX port number is the port number that you configured in the previous section of this documentation. The port number is in the endpoint line in the configuration. • ClusterName– This is used as a dimension for broker metrics collected. Provide a meaningful name that represents the cluster grouping for the instances that run the Kafka broker. • ProcessGroupName– This is used as a dimension for JVM metrics collected for brokers. Provide the same value as you provide for ClusterName. This enables viewing the JVM metrics of the same Kafka broker group as the broker metrics in the solution dashboard. CloudWatch agent configuration for this solution 2363 Amazon CloudWatch User Guide • ProducerGroupName– This is used as a dimension for producer metrics collected. Provide a meaningful name that represents the group of producer instances. For this value, you can specify your producer application or service that you want to use for a combined view of producer metrics in the solution dashboard. • ConsumerGroupName– This is used as a dimension for consumer metrics collected. Provide a meaningful name that represents the group of consumer instances This is not the same as the consumer group concept in Kafka. This is just a grouping dimension where you can specify your consumer application or service that you want to use for a combined view of consumer metrics in the solution dashboard For example, if you have two Kafka clusters running in the same account, one for the order- processing application and another for the inventory-management application, you should set the ClusterName and ProcessGroupName dimensions accordingly in the agent configuration of the broker instance. • For the order-processing cluster broker instances, set ClusterName=order-processing and ProcessGroupName=order-processing. • For the inventory-management cluster broker instances, set ClusterName=inventory- management and ProcessGroupName=inventory-management. • Similarly, set the ProducerGroupName for producer instances and ConsumerGroupName for consumer instances based on their respective applications. When you correctly set the above dimensions, the solution dashboard will automatically group the metrics based on the ClusterName, ProducerGroupName, and ConsumerGroupName dimensions. The dashboard will include dropdown options to select and view metrics for specific clusters and groups, allowing you to monitor the performance of individual clusters and groups separately. Be sure to deploy the relevant agent configuration to the correct EC2 instances. Each configuration will be stored as a separate Parameter in SSM's Parameter Store, as detailed later in Step 2: Store the recommended CloudWatch agent configuration file in Systems Manager Parameter Store. The following instructions describe the situation where the producer, consumer, and broker roles are deployed to separate EC2 instances, without