Prerequisites for configuring AWS instance
This section describes the prerequisites that you must perform before you configure an AWS instance. The following topics are provided:
Creating a user with read-only access
If you want to monitor an AWS, create a user with read-only access.
- Log on to the Amazon Web Services console with valid user credentials.
- Select Policies > Create policy.
Click the JSON tab and enter the following JSON example:
JSON example{
"Version": "yyyy-mm-dd",
"Statement": [
{
"Sid": "Statement Id",
"Effect": "Allow",
"Action": [
"Service1:Permission1",
"Service2:Permission2"
],
"Resource": [
"*"
]
}
]
}JSON that you enter is validated and errors are displayed, if any.
Click Next: Tags.
For more information, see Creating a new policy- (Optional) Add tags (key–value pairs) that you can add to AWS resources to help identify, organize, or search for resources.
- Click Next: Review.
- Enter a name for the policy.
For example, aws-monitor-policy. - Review the policy details and click Create Policy.
- To create a user to use for monitoring, perform the following actions:
- Go to Users > Add Users.
- In the User name field, enter the user name for the new IAM account.
For example, aws-monitor-user. - Under Select AWS access type, select Programmatic access.
- Click Next: Permissions.
- Select Attach existing policies directly.
- In the Filter box, search for the policy that you created in the previous step (aws-monitor-policy) and select it.
- Click Next: Tags and then click Next: Review.
- Click Create User.
The policy (aws-monitor-policy) is associated with the newly created IAM user (aws-monitor-user). Note down the access key ID and the secret access key.
Monitoring multiple AWS accounts
You can configure monitoring of multiple AWS accounts by using one account as main account or trusted account. The main account is responsible for retrieving data from other accounts or trusting accounts.
Configure the main or trusted account as per the steps mentioned in the Monitoring single AWS account topic.
Perform these steps in all additional or trusting accounts from which you want the main, trusted account to retrieve data.
Step | Details | |
---|---|---|
1 | Obtain the account ID and note it down of the main account. You will need to enter this account ID when configuring a policy in the main, trusted AWS account to include the additional account details. You will also need to enter it while configuring the monitoring policy. | In the AWS Management Console header, click the account name and select My Account. The Account Settings information displays the Account ID. |
2 | In the main AWS account, configure a policy (aws-trusted-policy) to specify permissions for the user of the additional, trusted AWS account. |
|
3 | In the trusting accounts, create a cross-account access role (aws-cross-account-role). This step enables the main, trusted AWS account user (aws-monitor-user) to have federated read-only access to the AWS services in the additional, trusting account and to enable account switching. |
|
4 | In the main, trusted AWS account, configure a policy file (aws-assume-role-policy.json) to include the additional account details.If you are configuring the first additional AWS account, you need to create a policy file. Else, you need to update the existing file with the additional AWS account details. | To create a policy file
To update an existing policy file
|
5 | Enable the policy (aws-assume-role-policy.json) that includes additional AWS account details in the main AWS account. |
|
In a firewall or a proxy-enabled environment, the following AWS services endpoints must be allowed:
- http://monitoring.<region>.amazonaws.com/
- http://ec2.<region>.amazonaws.com/
- http://autoscaling.<region>.amazonaws.com/
- http://sts.<region>.amazonaws.com/
- http://ec2.amazonaws.com/
- http://iam.amazonaws.com/
where <region> is one of the regions in AWS. For more information about regions, see Regions and Availability Zones.
Enabling Elastic Kubernetes Service monitoring
To enable the Elastic Kubernetes service monitoring, do the following:
To enable metrics collections in CloudWatch, perform the steps mentioned on the following page as an administrator:
Container insights
If you skip this step, the Status attributes in the Amazon EKS Cluster and Amazon EKS Node Group container classes are still discovered and no attributes are discovered in the Namespace container class.To ensure that Kubernetes cluster is created, run the following command on Windows PowerShell:
kubectl get svc