Add roleArn to AwsS3IntegrationConfig

Signed-off-by: Sean Tan <seant@splunk.com>
This commit is contained in:
Sean Tan
2021-08-05 12:39:00 -07:00
parent da3fcac9f4
commit 2d7bf1c6b0
4 changed files with 57 additions and 21 deletions
+6
View File
@@ -183,6 +183,12 @@ export interface Config {
* @visibility secret
*/
secretAccessKey?: string;
/**
* ARN of the role to be assumed
* @visibility backend
*/
roleArn?: string;
}>;
};
}
+7 -1
View File
@@ -40,6 +40,11 @@ export type AwsS3IntegrationConfig = {
* secretAccessKey
*/
secretAccessKey?: string;
/**
* roleArn
*/
roleArn?: string;
};
/**
@@ -54,6 +59,7 @@ export function readAwsS3IntegrationConfig(
const host = config.getOptionalString('host') ?? AMAZON_AWS_HOST;
const accessKeyId = config.getOptionalString('accessKeyId');
const secretAccessKey = config.getOptionalString('secretAccessKey');
const roleArn = config.getOptionalString('roleArn');
if (!isValidHost(host)) {
throw new Error(
@@ -61,7 +67,7 @@ export function readAwsS3IntegrationConfig(
);
}
return { host, accessKeyId, secretAccessKey };
return { host, accessKeyId, secretAccessKey, roleArn };
}
export function readAwsS3IntegrationConfigs(