# Error: Not connected to AWS

**URL:** <https://community.dynatrace.com/t/error-not-connected-to-aws/41607>\
**Category:** Cloud platforms\
**Tags:** aws\
**Created:** [September 12, 2023, 1:17pm UTC](https://community.dynatrace.com/t/error-not-connected-to-aws/41607 "2023-09-12T13:17:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pawel\_Zalewski](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pawel_zalewski/32/8101_2.png) [@Pawel\_Zalewski](https://community.dynatrace.com/u/Pawel_Zalewski)\
**Post date:** [September 12, 2023, 1:17pm UTC](https://community.dynatrace.com/t/error-not-connected-to-aws/41607/1 "2023-09-12T13:17:46Z")

</div>

Hi,

After successful connection to AWS by Role-based authentication I cannot add Amazon CloudWatch Logs Service. When I’m trying to do so this pop up comes out:

 ![Pawel_Zalewski_0-1694524218741.png](https://global.discourse-cdn.com/dynatrace/original/2X/a/acf5206aaae873f3c97e23c2137f48e57e80f074.png)

I added CloudWatch permissions policies in AWS account and used this docs to connect:

[https://www.dynatrace.com/support/help/setup-and-configuration/setup-on-cloud-platforms/amazon-web-services/amazon-web-services-integrations/cloudwatch-metrics/aws-monitoring-with-dynatrace-managed](https://www.dynatrace.com/support/help/setup-and-configuration/setup-on-cloud-platforms/amazon-web-services/amazon-web-services-integrations/cloudwatch-metrics/aws-monitoring-with-dynatrace-managed)

Also I can’t use alerting rules wich is most important for me to create

 ![Pawel_Zalewski_1-1694524428492.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/8/e83fc40883d1cb6232791b10de8ab249c23e38d9.png)

Appreciate your help 🙂

---

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [September 12, 2023, 6:22pm UTC](https://community.dynatrace.com/t/error-not-connected-to-aws/41607/2 "2023-09-12T18:22:36Z")

</div>

Hello [@Pawel\_Zalewski](https://community.dynatrace.com/user/66060) under role based auth you can monitor the “default” services without an ActiveGate:

 ![DanielS_0-1694542208370.png](https://global.discourse-cdn.com/dynatrace/original/1X/5111353aa5dc5e151e929b8e04de602fe7310b4d.png)

As you can see Amazon Cloudwatch Logs is non default so you must install and configure an Environment ActiveGate if you want to monitor either or both of the following:

- More than 2,000 AWS resources (AWS service instances)
- [Non-default AWS Cloud services](https://www.dynatrace.com/support/help/setup-and-configuration/setup-on-cloud-platforms/amazon-web-services/amazon-web-services-integrations/aws-service-metrics#aws-non-default)

You need an AG on your EC2 Account:

[Create a role for ActiveGate on the account that hosts ActiveGate](https://www.dynatrace.com/support/help/setup-and-configuration/setup-on-cloud-platforms/amazon-web-services/amazon-web-services-integrations/cloudwatch-metrics#create-role-ag)

1. Download the [YAML file with CloudFormation template](https://dt-url.net/pv0306t).
2. Create the stack in your Amazon Console:
  1. In your Amazon Console, go to CloudFormation.
  2. Go to Stacks and create a new stack with new resources.
  3. Select Template is ready, upload the template you created above, and then select Next.
  4. In Parameters, for Monitored Account ID, enter the ID of the account Dynatrace will monitor. Optionally, adapt other parameters as needed.
  5. Enter a name for your stack, and then select Next twice.
  6. Review your configuration, select I acknowledge that AWS CloudFormation might create IAM resources with custom names, and select Submit.

3. Go to the Amazon EC2 console, right-click an instance hosting your Environment ActiveGate, and select Security \> Modify IAM role.

4. Select the role you created in step 1 and select Update IAM role.

Part 2

[Create a monitoring role for Dynatrace on your monitored account](https://www.dynatrace.com/support/help/setup-and-configuration/setup-on-cloud-platforms/amazon-web-services/amazon-web-services-integrations/cloudwatch-metrics#create-role-dt)

After the Dynatrace\_ActiveGate\_role is created on the account hosting the ActiveGate, create a role for the account to be monitored.

1. Download a YAML file with CloudFormation template from [github role\_based\_access\_AG\_account\_template.yml](https://dt-url.net/f30301j).
2. Create the stack in your Amazon Console:
  1. In your Amazon Console, go to CloudFormation.
  2. Go to Stacks and create a new stack with new resources.
  3. Select Template is ready, upload the template you created above, and select Next.
  4. In Parameters, enter External ID, ActiveGateRoleName and ActiveGateAccountID from the stack created in Step 2.3.2.1. Optionally, adapt other parameters if needed.
  5. Enter a name for your stack, and then select Next twice.
  6. Review your configuration, enable I acknowledge that AWS CloudFormation might create IAM resources with custom names, and select Submit.

Hope it helps!!!

---

<div class="post-metadata">

**Author:** ![Pawel\_Zalewski](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pawel_zalewski/32/8101_2.png) [@Pawel\_Zalewski](https://community.dynatrace.com/u/Pawel_Zalewski)\
**Post date:** [September 13, 2023, 10:18am UTC](https://community.dynatrace.com/t/error-not-connected-to-aws/41607/3 "2023-09-13T10:18:47Z")

</div>

Thanks a lot! I missed this steps:

3. Go to the Amazon EC2 console, right-click an instance hosting your Environment ActiveGate, and select Security \> Modify IAM role.

4. Select the role you created in step 1 and select Update IAM role.

Now it’s working 🙂
