Skip to content

Allow SSM parameter name as table name #280

@MarioArnt

Description

@MarioArnt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions