2

I have a user with role rds_iam so IAM DB Auth is required for the user to connect to my Aurora PostgreSQL server (server A). Which works as expected. I have added a role to Server B that has permissions to rds-db:connect to server A. Now I need to update FDW to connect to server A using the IAM-enabled user.

I don't understand what is suppose to be used for password for the following command:

CREATE USER MAPPING IF NOT EXISTS FOR <current user> SERVER <server name> 
OPTIONS (USER <username>, PASSWORD <password>);"

Currently, I am getting the following error:

[08001] ERROR: could not connect to server "XXXXXX" Detail: FATAL: PAM authentication failed for user "user-xxxxx"

I suspect because passsword was actually a token that I generated when setting up the user. But tokens expire afte 15 minutes. So how do setup an IAM-user with FDW?

kravb
  • 417
  • 4
  • 16

1 Answers1

1

Unless Amazon hacks postgres_fdw to add this capability, I think you would need to write some code that does ALTER USER MAPPING every 15 minutes, or give up on using IAM for this.

jjanes
  • 37,812
  • 5
  • 27
  • 34