Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: DBTP-1010 Readonly postgres user doesn't have read perms #140

Merged
merged 32 commits into from
May 30, 2024

Conversation

gabelton
Copy link
Contributor

@gabelton gabelton commented May 29, 2024

Currently the lambda runs ALTER DEFAULT PRIVILEGES FOR USER readonly_user IN SCHEMA public GRANT SELECT ON TABLES TO readonly_user;. This grants read permissions to the readonly user on future tables, but ONLY those created by the readonly_user. We're moving to use application_user to perform migrations, so the necessary command is now ALTER DEFAULT PRIVILEGES FOR USER application_user IN SCHEMA public GRANT SELECT ON TABLES TO readonly_user;

@gabelton gabelton requested a review from a team May 30, 2024 10:30
@@ -119,11 +119,11 @@ resource "aws_lambda_invocation" "create-readonly-user" {
CopilotApplication = var.application
CopilotEnvironment = var.environment
MasterUserSecretArn = aws_db_instance.default.master_user_secret[0].secret_arn
SecretDescription = "RDS application user secret for ${local.name}"
SecretDescription = "RDS readonly user secret for ${local.name}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot!

@gabelton gabelton merged commit 1628440 into main May 30, 2024
6 checks passed
@gabelton gabelton deleted the testing-postgres-lambda branch May 30, 2024 13:00
This was referenced May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants