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

Allow SSM parameter name as table name #280

Open
MarioArnt opened this issue Oct 12, 2023 · 0 comments
Open

Allow SSM parameter name as table name #280

MarioArnt opened this issue Oct 12, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@MarioArnt
Copy link
Contributor

MarioArnt commented Oct 12, 2023

Currently only a harcoded string is allowed as table name in Models definitons.

Add an option to source the table name from AWS Systems Manager (SSM) Parameter Store.

Instead of the table name, we pass a SSM ARN and the value is swapped on run-time.

Thus it would be possible to update the table name without redeployment (useful after a backup, for example).

export class MyModel extends Model<unknown> {
  tableName = 'arn:aws:ssm:<aws-region>:<aws-account-id>:database-name-prod';
}

The behavior to implement is the following:

  • Check if table name is a SSM ARN (using a regexp)
  • If not, use provided string as it
  • If it is a SSM parameter ARN, fetch its value at first request and cache this result for subsequent requests
@MarioArnt MarioArnt added enhancement New feature or request good first issue Good for newcomers labels Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant