Add support for syncing secrets containing / to AWS parameter store integration

This commit is contained in:
Tuan Dang
2023-09-02 11:11:27 +01:00
parent 5e24b517cc
commit 6dd46885f8

View File

@@ -688,15 +688,17 @@ const syncSecretsAWSParameterStore = async ({
const parameterList = (await ssm.getParametersByPath(params).promise()).Parameters;
let awsParameterStoreSecretsObj: {
[key: string]: any; // TODO: fix type
[key: string]: any;
} = {};
if (parameterList) {
awsParameterStoreSecretsObj = parameterList.reduce(
(obj: any, secret: any) => ({
...obj,
[secret.Name.split("/").pop()]: secret
}),
(obj: any, secret: any) => {
return ({
...obj,
[secret.Name.substring(integration.path.length)]: secret
});
},
{}
);
}