Set up Dynatrace SaaS for AWS monitoring

You can integrate Dynatrace with Amazon Web Services (AWS) for intelligent monitoring of services running in the Amazon Cloud. AWS integration helps you stay on top of the dynamics of your data center in the cloud.

Important

Dynatrace can be deployed with or without an Environment ActiveGate. Configuring role-based access differs for Dynatrace deployments that use an Environment ActiveGate.

Overview

Follow these basic steps to integrate Dynatrace SaaS with Amazon Web Services (AWS):

Choose an access method:

Cost

Dynatrace makes Amazon API requests every 5 minutes. In addition to CloudWatch API calls, Dynatrace makes API calls to the monitored AWS services in order to learn about their instances, tags, etc. The list of called services and actions is available below in the Create the monitoring policy section. Here's a rough estimate of AWS monitoring costs:

AWS service Number of metrics Daily cost per instance (USD)
Elastic Compute Cloud (EC2) 7 $0.02016
Elastic Block Store (EBS) 8 $0.02304
Elastic Load Balancer (ELB) 11 $0.03168
Relational Database Service (RDS) 11 $0.03168
DynamoDB 15 $0.06912
Lambda 4 $0.01152
Amazon charges

Amazon will charge about $0.01 per 1,000 metrics requested from the CloudWatch API and include the cost in the bill for the AWS account you use with Dynatrace.

AWS monitoring policy

The AWS monitoring policy defines the minimum scope of permissions you need to give to Dynatrace to monitor the services running in your AWS account. Create it once and use anytime when enabling Dynatrace access to your AWS account.

Go to Identity and Access Management (IAM) in your Amazon Console.

Go to Policies and click Create policy.

Select the JSON tab, and paste the predefined policy from the box below.

Give the policy a name. For example Dynatrace_monitoring_policy. Type it in the Name field.

Click the Create policy button.

Access methods

To get the information required for comprehensive AWS cloud-computing monitoring, Dynatrace needs to identify all the virtualized infrastructure components in your AWS environment and collect performance metrics related to those components. We use this information to understand the context of your applications, services, and hosts. For this to happen, you need to authorize Dynatrace to access your Amazon metrics.

You can enable Dynatrace access to your AWS metrics by either using a private access key (key-based access) or defining a special role for Dynatrace (role-based access). In all the cases, make sure that your Environment ActiveGate has a working connection to AWS. Configure your proxy for ActiveGate, or whitelist *.amazonaws.com in your firewall settings.

As a best practice, use temporary security credentials (IAM roles) instead of access keys, and disable any AWS account root user access keys.

Key-based access

If you decide to use the key-based authentication, remember to rotate the keys periodically. Keep in mind that you need to perform this procedure each time you change the key.

What you need
  • Rights to create a new AWS user
  • Your AWS account ID
  • Your Amazon Access key ID and Secret access key

Enabling access to your Amazon account using key-based access

Dynatrace can use access keys to make secure REST or Query protocol requests to the AWS service API. You'll need to generate an Access key ID and a Secret access key that Dynatrace can use to get metrics from Amazon Web Services.

In your Amazon Console, go to Users and click Add User.

Enter a name for the key you want to create (for example, Dynatrace_monitoring_user). In Select AWS access type, select the Programmatic access option and click Next:Permissions button.

Click Attach existing policies directly and choose the monitoring policy you defined, for example Dynatrace_monitoring_policy. Click Next: Review.

Review the user details and click the Create user button.

Store the Access Key ID name (AKID) and Secret access key values.
You can either download the user credentials or copy the credentials displayed online (click Show).

Connecting your Amazon account to Dynatrace using key-based access

Once you've granted AWS access to Dynatrace, it's time to connect Dynatrace to your Amazon AWS account.

In Dynatrace, go to Settings > Cloud and virtualization > AWS and click Connect new instance.

Select Key based authentication method.

  • Create a name for this connection. This is mandatory. Dynatrace needs this name to identify and display the connection.
  • In the Access key ID field, paste the identifier of the key you created in Amazon for Dynatrace access.
  • In the Secret access key field, paste the value of the key you created in Amazon for Dynatrace access.
  • Click Connect to verify and save the connection.

Once the connection is successfully verified and saved, your AWS account will be listed in the Cloud and virtualization settings page. You should soon begin to see AWS cloud monitoring data.

Role-based access

Dynatrace SaaS deployments may vary. Integrating Dynatrace SaaS with AWS is different when deployment includes an Environment ActiveGate. Select the appropriate set up procedure for your Dynatrace SaaS deployment scenario.

Role-based access for SaaS deployments with Environment ActiveGate

In typical setup, you'll create and attach two roles, one for Dynatrace and one for your Environment ActiveGate hosted in your AWS infrastructure.

What you need
  • Environment ActiveGate installed on an AWS EC2 host. They must be able to assume a role within your AWS account that allows it to read the Dynatrace monitoring data.
  • Your Amazon Web Services source account ID, that is the account hosting your Dynatrace components.
  • The name of the role with which your Environment ActiveGate was started.
  • The Amazon Web Services target account ID, that is the account you want to monitor.
  • The External Id copied from Settings > Cloud and virtualization > AWS.

Enabling access to your Amazon account using role-based access

The steps described below apply both when the source and target accounts are the same and when they're different. If you want to monitor multiple target accounts, repeat Step 1 for each account and add them all to the Statement.Resource array in the policy in Step 2.4.

Step 1. Create a monitoring role for Dynatrace on your target account

In your browser, open a new tab and sign in to Dynatrace to get the External Id. Go to Settings > Cloud and virtualization > AWS, click Connect new instance, select Role based authentication method and click Copy next to the Token field.

Go to Identity and Access Management (IAM) in your Amazon Console.

Go to Roles and click Create role

Select the Another AWS account tile and establish trust with the Dynatrace account. Paste the External ID you copied in the first step. Paste the 12-digit source account ID used to access the target account. Click Next: Permissions.

In the Attach permissions policies section, choose the monitoring policy you created, for example Dynatrace_monitoring_policy. Click Next: Review.

On the Review page, provide the role name, for example Dynatrace_monitoring_role. Remember it, you'll need it later to connect your Amazon account to Dynatrace. Click the Create Role button.

Step 2. Create a role for the ActiveGate host on your source account

Once the Dynatrace_monitoring_role is created on the target account, create a role for Environment ActiveGate that will be responsible for AWS monitoring.

In your Amazon Console, go to Roles, click Create role. Select AWS service and EC2 as the service that will use the role. Click Next: Permissions and skip to the Review page.

On the Review page, provide the role a name, for example Dynatrace_ActiveGate_role and click Create role.

Select Dynatrace_ActiveGate_role and click Add inline policy

Select the JSON and paste the predefined policy from below. Edit it and add:

  • The 12-digit target account number,
  • The role name created in previous steps, (for example Dynatrace_monitoring_role), that is used to assume a monitoring role.

Don't include the < and > characters.

When done, paste Update policy and then click Review policy.

Name the inline policy you've just created, for example Dynatrace_assume_policy and click Create policy.

Go back to the Dynatrace_monitoring_role you created earlier and select Trust relationships tab in the role summary page and click Edit Trust Relationships.

Paste the JSON sample below into a text editor. Edit it and add:

  • The 12-digit AWS source account number,
  • The role with which your Environment ActiveGate was started, and the external ID you copied in previous steps.

Don't include the < and > characters.

Paste the modified text and click Update Trust Policy button.

Go to EC2 console, right-click an instance hosting your Environment ActiveGate and select Instance settings > Attach/Replace IAM Role.

Select the role created earlier, Dynatrace_ActiveGate_role, and click Apply.

Step 3. Modify ActiveGate configuration

Edit the custom.properties file of your Environment ActiveGate.

Set the following properties as below:

[vertical.topology]
use_aws_proxy_role = false
[aws_monitoring]
aws_monitoring_enabled = true
There can only be one.
  • If you have multiple ActiveGates in your deployment, set the aws_monitoring_enabled property to true only on one ActiveGate. All other ActiveGates should have this property set to false.

  • Keep in mind that Dynatrace cluster nodes contain embedded ActiveGates. Make sure to set the aws_monitoring_enabled property to false on these ActiveGates as well.

If the ActiveGate is dedicated to AWS monitoring, you must also set the MSGrouter property to false:

[collector]
MSGrouter = false

Remove aws_proxy_account and aws_proxy_role properties.

Save the file and restart ActiveGate.

Connecting your Amazon account to Dynatrace using role-based access

Once you've granted AWS access to Dynatrace, it's time to connect Dynatrace to your Amazon AWS account.

In Dynatrace, go to Settings > Cloud and virtualization > AWS and click Connect new instance.

Select either the Role based authenticationmethod.

  • Create a name for this connection. If you leave this field empty, the name Role will be used on Dynatrace pages to define this connection.
  • In the Role field, type the name of the role you created in Amazon for Dynatrace, for example Dynatrace_monitoring_role.
  • Type your Account ID (the account you want us to pull metrics from).
  • Click Connect to verify and save the connection.

Once the connection is successfully verified and saved, your AWS account will be listed in the Cloud and virtualization settings page.
You should soon begin to see AWS cloud monitoring data.