Skip to content

Commit d5b640f

Browse files
authored
Update README with information on how to query against the db (#50)
1 parent be1345d commit d5b640f

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ The infrastructure for this repository is located in the [CFA Tax-Benefits-Backe
2020
### CI/CD Integration
2121

2222
OpenTofu is integrated into our CI pipeline.
23+
2324
---
2425

2526
## Deployment to AWS Staging
@@ -71,3 +72,24 @@ To compile stylesheets locally:
7172
```bash
7273
bin/rake dartsass:build
7374
```
75+
76+
## Access to Database
77+
78+
Locally, you can use `bin/rails console`
79+
80+
On Heroku, you can use `heroku run rails c -a <review-app-name>`
81+
82+
On Staging and Production, you'll have to utilize AWS Query Editor or `aws rds-data` commands to access the database.
83+
84+
```
85+
AWS_PROFILE=<aws profile> \
86+
aws rds-data execute-statement \
87+
--resource-arn "arn:aws:rds:us-east-1:<account_id>:cluster:pya-<environment>-web" \
88+
--secret-arn "arn:aws:secretsmanager:us-east-1:<account_id>:secret:rds\!cluster-<secret>" \
89+
--database prior_year_access \
90+
--sql '<enter sql statement here>'
91+
```
92+
93+
- Your `AWS_PROFILE` should match the environment (Prior Year Access - Prod vs Non-Prod) you're trying to query
94+
- You can grab the `resource-arn` from AWS console > Aurora and RDS > Databases > pya-<environment>-web > Configuration > Amazon Resource Name (ARN).
95+
- `secret-arn` could be found in the AWS Secrets Manager (starts with `rds!cluster` -- grab the ARN)

0 commit comments

Comments
 (0)