# PMM ADD RDS Instance

**URL:** <https://forums.percona.com/t/pmm-add-rds-instance/15396>\
**Category:** Percona Monitoring and Management (PMM)\
**Tags:** pmm\
**Created:** [April 26, 2022, 7:28am UTC](https://forums.percona.com/t/pmm-add-rds-instance/15396 "2022-04-26T07:28:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![osysee](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/osysee/32/6400_2.png) [@osysee](https://forums.percona.com/u/osysee)\
**Post date:** [April 26, 2022, 7:28am UTC](https://forums.percona.com/t/pmm-add-rds-instance/15396/1 "2022-04-26T07:28:23Z")

</div>

Hi, I’m Leo.  
I’m going to do RDS discovery using IAM role. At this time, I want to add an instance of “assumeRole” in the role, but I don’t think it’s going to be able to discover the instances that “assumeRole” can import.  
I want to use “aws\_role\_arn” on rds\_exporter.  
Is there a way to do it manually?  
We are currently using 2.27 version based on docker.  
Please help me~

----- Added April 27

Yes, I read this.

> **[Amazon RDS - Percona Monitoring and Management](https://docs.percona.com/percona-monitoring-and-management/setting-up/client/aws.html)**
>
> Documentation

so, I got this results.

 ![스크린샷 2022-04-27 오전 8.08.12](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/6/6052789693d7ffe92d3ec6a15c318a06ec28cf2f.png)

I’ll explain it in more detail.

1. There are “A” account and “B” account.
2. PMM was setup in “A” account’s EC2 with role attached, and “assumeRole” “B” account’s role
3. I want to monitor both accounts with “A” account’s EC2 PMM.

but only “A” accounts rds instances are discovered. Can I use roles(a.k.a assumeRole) to import “B” account rds instances without using the user (access key/secret key)?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [April 26, 2022, 1:42pm UTC](https://forums.percona.com/t/pmm-add-rds-instance/15396/2 "2022-04-26T13:42:05Z")

</div>

Have you read over all of our official documentation for using IAM discovery?

> **[Amazon RDS - Percona Monitoring and Management](https://docs.percona.com/percona-monitoring-and-management/setting-up/client/aws.html)**
>
> Documentation

---

<div class="post-metadata">

**Author:** ![osysee](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/osysee/32/6400_2.png) [@osysee](https://forums.percona.com/u/osysee)\
**Post date:** [April 26, 2022, 11:29pm UTC](https://forums.percona.com/t/pmm-add-rds-instance/15396/3 "2022-04-26T23:29:30Z")

</div>

I revised the post contents in more detail.

---

<div class="post-metadata">

**Author:** ![browseman](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/browseman/32/98_2.png) [@browseman](https://forums.percona.com/u/browseman)\
**Post date:** [April 27, 2022, 9:11pm UTC](https://forums.percona.com/t/pmm-add-rds-instance/15396/4 "2022-04-27T21:11:27Z")

</div>

Hi Leo

The example in documentation page, does not cover your exact use case. In theory, the proposed approach it should work. If you have a valid setup on both accounts and use for PMM server the role ARN that you have from account B, it should give you access to instances that are running there.  
Simple way to validate if your setup is working as expected, is to install awscli inside the EC2 instance and check if using the role from acc. “B” will allow to list the RDS instances available in “B”.  
[Here](https://aws.amazon.com/premiumsupport/knowledge-center/s3-instance-access-bucket/) you can find an example from AWS documentation on how to use S3 resources from diff. account.

Please share back your results.

---

<div class="post-metadata">

**Author:** ![osysee](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/osysee/32/6400_2.png) [@osysee](https://forums.percona.com/u/osysee)\
**Post date:** [May 2, 2022, 2:52am UTC](https://forums.percona.com/t/pmm-add-rds-instance/15396/5 "2022-05-02T02:52:16Z")

</div>

Hi browseman  
Set the profile “aaa” in /.aws/config with role\_arn.  
And… I tried the command below.  
“aws rds describe-db-instances profile=aaa”  
The command displays the instance information created for that account.  
Now, how do I make sure that instances appear in the discovery list in the adds instance on the grafana dashboard?

---

<div class="post-metadata">

**Author:** ![browseman](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/browseman/32/98_2.png) [@browseman](https://forums.percona.com/u/browseman)\
**Post date:** [May 2, 2022, 7:34pm UTC](https://forums.percona.com/t/pmm-add-rds-instance/15396/6 "2022-05-02T19:34:54Z")

</div>

You can try to associate the roles with the EC2 instance. You can achieve this through out AWS UI and/or CLI. [Here](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#attach-iam-role) is an article that can guide you.  
Please keep in mind that at a given time only one IAM role can be associated with an EC2 instance, so because of this you may need to alter one of the existing IAM roles to include the two policies that are giving you access to the two accounts.

---

<div class="post-metadata">

**Author:** ![Abbas\_Hosseini](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/abbas_hosseini/32/16605_2.png) [@Abbas\_Hosseini](https://forums.percona.com/u/Abbas_Hosseini)\
**Post date:** [May 27, 2024, 11:18pm UTC](https://forums.percona.com/t/pmm-add-rds-instance/15396/7 "2024-05-27T23:18:06Z")

</div>

Hi Osysee,

Did you manage to make it work?

I have followed the instruction, the PMM server discovers instances of the regions with the least amount of instances.  
The issue has been reported [here](https://github.com/percona/pmm/blob/d1a13c9f4aecc77d1fb908dc06e8540071c4a232/managed/services/management/rds.go#L47). You may have the same problem is the IAM role and policy is correctly setup.
