Prerequisites for configuring Amazon EC2 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. 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 | Configure a policy (aws-trusted-policy) to specify permissions for the user of the additional, trusted AWS account. |
|
3 | 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 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. |
|