Skip to content

Commit 4cce560

Browse files
authored
Merge pull request #102 from ModusCreateOrg/ADE-66
fix: Update Perplexity API key secret name across configuration files
2 parents 4ecc755 + 6067cbb commit 4cce560

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

backend/PERPLEXITY_INTEGRATION.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default () => ({
2828
aws: {
2929
// ... existing aws config
3030
secretsManager: {
31-
perplexityApiKeySecret: process.env.PERPLEXITY_API_KEY_SECRET_NAME || 'medical-reports-explainer/perplexity-api-key',
31+
perplexityApiKeySecret: process.env.PERPLEXITY_API_KEY_SECRET_NAME || 'med-ai-perplexity-key',
3232
},
3333
},
3434
perplexity: {
@@ -68,7 +68,7 @@ The `PerplexityController` exposes the following endpoints:
6868
1. Create a secret in AWS Secrets Manager:
6969
```
7070
aws secretsmanager create-secret \
71-
--name medical-reports-explainer/perplexity-api-key \
71+
--name med-ai-perplexity-key \
7272
--description "Perplexity API Key for Medical Reports Explainer" \
7373
--secret-string "your-perplexity-api-key"
7474
```
@@ -83,7 +83,7 @@ The `PerplexityController` exposes the following endpoints:
8383
"Action": [
8484
"secretsmanager:GetSecretValue"
8585
],
86-
"Resource": "arn:aws:secretsmanager:region:account-id:secret:medical-reports-explainer/perplexity-api-key-*"
86+
"Resource": "arn:aws:secretsmanager:region:account-id:secret:med-ai-perplexity-key-*"
8787
}
8888
]
8989
}
@@ -95,7 +95,7 @@ Configure the following environment variables:
9595

9696
| Variable | Description | Default Value |
9797
|----------|-------------|---------------|
98-
| `PERPLEXITY_API_KEY_SECRET_NAME` | Name of the secret in AWS Secrets Manager | `medical-reports-explainer/perplexity-api-key` |
98+
| `PERPLEXITY_API_KEY_SECRET_NAME` | Name of the secret in AWS Secrets Manager | `med-ai-perplexity-key` |
9999
| `PERPLEXITY_MODEL` | Perplexity model to use | `mixtral-8x7b-instruct` |
100100
| `PERPLEXITY_MAX_TOKENS` | Maximum tokens to generate | `2048` |
101101
| `AWS_REGION` | AWS region for Secrets Manager | `us-east-1` |

backend/src/config/configuration.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ export default () => ({
1111
clientId: process.env.AWS_COGNITO_CLIENT_ID,
1212
},
1313
secretsManager: {
14-
perplexityApiKeySecret:
15-
process.env.PERPLEXITY_API_KEY_SECRET_NAME ||
16-
'medical-reports-explainer/perplexity-api-key',
14+
perplexityApiKeySecret: process.env.PERPLEXITY_API_KEY_SECRET_NAME || 'med-ai-perplexity-key',
1715
},
1816
aws: {
1917
accessKeyId: process.env.AWS_ACCESS_KEY_ID,

backend/src/iac/backend-stack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ export class BackendStack extends cdk.Stack {
255255
DYNAMODB_REPORTS_TABLE: reportsTable.tableName,
256256

257257
// Perplexity related
258-
PERPLEXITY_API_KEY_SECRET_NAME: `medical-reports-explainer/${props.environment}/perplexity-api-key`,
258+
PERPLEXITY_API_KEY_SECRET_NAME: `med-ai-perplexity-key`,
259259
PERPLEXITY_MODEL: 'sonar',
260260
PERPLEXITY_MAX_TOKENS: '2048',
261261

backend/src/services/perplexity.service.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ export class PerplexityService {
7979
return this.apiKey;
8080
}
8181

82-
const secretName =
83-
this.configService.get<string>('aws.secretsManager.perplexityApiKeySecret') ||
84-
'medical-reports-explainer/perplexity-api-key';
82+
const secretName = this.configService.get<string>('aws.secretsManager.perplexityApiKeySecret');
8583

8684
if (!secretName) {
8785
throw new Error('Perplexity API key secret name is not configured');

0 commit comments

Comments
 (0)