[SVLS-10131] allow apiKey with encrypted key options #770
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.66) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.66 · 355 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.351
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.066
Real PR Conversation Timeline
1 comments
"Review active on #770"
general
weight: 0.35
joepeeples
What does this PR do?
Lets you keep the plaintext API key off your Lambda functions while still creating monitors.
apiKeycan now be set alongsideapiKeySecretArn,apiKeySsmArn, orapiKMSKey. When it is, the plugin doesn't addDD_API_KEYto the Lambda environment. Setting more than one of the encrypted options still errors.monitorscheck accepts the API key and app key from config or environment variables independently, matching howafterDeployalready reads them.apiKeyoverDATADOG_API_KEY, matching monitors and the Lambda environment.Motivation
Fixes #766 (SVLS-10131). Monitors need a plaintext API key at deploy time, but setting
apiKeyalso writes the key to the Lambda environment. PairingapiKeywithapiKeySsmArnerrored, so users had no way to configure both inserverless.yml.Testing Guidelines
I deployed a Node.js function with Serverless Framework v3 to the sandbox account, using the ddserverless org, then removed the stack, monitor, and SSM parameter.
| Config |
main| This branch ||---|---|---|
|
apiKey+apiKeySsmArn+appKey|apiKeyandapiKeySsmArnshould not be set at the same time. | Deploys; monitor created ||
DATADOG_API_KEYenv +apiKeySsmArn+appKey| Whenmonitorsis enabled,DATADOG_API_KEYandDATADOG_APP_KEYenvironment variables must be set. | Deploys; monitor updated |In both cases on this branch:
DD_API_KEY_SSM_ARNand noDD_API_KEY.Decrypt took 41 msandSuccessfully flushed, and traces for the service appeared in Datadog.Additional Notes
Configs that set
apiKeywith an encrypted option previously failed validation. The only change for existing configs: ifapiKeyandDATADOG_API_KEYare both set to different keys, git metadata now uploads withapiKey, the same key the Lambda and monitors already use.Types of changes
Check all that apply