Skip to content

Commit a90bd1a

Browse files
committed
fix: fail creation when master password unavailable for FGAC mapping
Previously, if the master password couldn't be retrieved from Secrets Manager and wasn't provided via --opensearch-password, FGAC mapping was silently skipped. This left the domain without proper role mappings, causing PPL permission errors. Now: - Creation fails with a clear error if no password is available - --opensearch-password is required upfront when reusing an existing domain Signed-off-by: Kyle Hounslow <kylhouns@amazon.com>
1 parent 49a87b7 commit a90bd1a

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

aws/cli-installer/src/aws.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ export async function mapOsiRoleInDomain(cfg) {
287287
try {
288288
masterPass = await getMasterPassword(cfg.region, cfg.pipelineName);
289289
} catch (e) {
290-
printWarning('No master password available. Provide --opensearch-password when reusing an existing domain.');
291-
printInfo('FGAC mapping skipped. You may need to manually map IAM roles in OpenSearch Security.');
292-
return;
290+
printError('No master password available.');
291+
printInfo('Provide --opensearch-password to supply the domain master password.');
292+
throw new Error('FGAC mapping requires a master password. Cannot continue.');
293293
}
294294
}
295295

aws/cli-installer/src/cli.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ export function validateConfig(cfg) {
207207
if (cfg.osAction === 'reuse' && !cfg.opensearchEndpoint) {
208208
errors.push('--opensearch-endpoint required when reusing OpenSearch');
209209
}
210+
if (cfg.osAction === 'reuse' && !cfg.opensearchPassword) {
211+
errors.push('--opensearch-password required when reusing an existing OpenSearch domain (needed for FGAC mapping)');
212+
}
210213
if (cfg.iamAction === 'reuse' && !cfg.iamRoleArn) {
211214
errors.push('--iam-role-arn required when reusing IAM role');
212215
}

0 commit comments

Comments
 (0)