Forked from beabetterdevv/gist:6739b536268343f83c9db6b58565a216
Created
October 7, 2024 12:40
-
-
Save ganeshan/59b27a6759dbb48264c7f2895032a55f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IAM Policy | |
--- | |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"rds-db:connect" | |
], | |
"Resource": [ | |
"arn:aws:rds-db:us-east-1:755314965794:dbuser:cluster-CE7YOPQHSJ5Q2LZ2NPTNSK6KJQ/michael_scott" | |
] | |
} | |
] | |
} | |
Resource format | |
--- | |
arn:aws:rds-db:region:account#:dbuser:clusterResource/username | |
Postgres User Creation | |
--- | |
CREATE USER michael_scott; | |
GRANT rds_iam TO michael_scott; | |
Certificate Download Link | |
--- | |
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html | |
Generate Token | |
--- | |
aws rds generate-db-auth-token --hostname database-1-instance-1.cate73txxgkb.us-east-1.rds.amazonaws.com --port 5432 --region us-east-1 --username michael_scott | |
See Postgres Users | |
--- | |
SELECT usename AS role_name, | |
CASE | |
WHEN usesuper AND usecreatedb THEN | |
CAST('superuser, create database' AS pg_catalog.text) | |
WHEN usesuper THEN | |
CAST('superuser' AS pg_catalog.text) | |
WHEN usecreatedb THEN | |
CAST('create database' AS pg_catalog.text) | |
ELSE | |
CAST('' AS pg_catalog.text) | |
END role_attributes | |
FROM pg_catalog.pg_user | |
ORDER BY role_name desc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment