mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 22:46:24 +00:00
misc: connected aws add kms
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export { useAddAwsExternalKms } from "./mutations";
|
||||
@@ -0,0 +1,53 @@
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
|
||||
import { apiRequest } from "@app/config/request";
|
||||
|
||||
export const useAddAwsExternalKms = () => {
|
||||
return useMutation({
|
||||
mutationFn: async ({
|
||||
slug,
|
||||
description,
|
||||
credentialType,
|
||||
accessKey,
|
||||
secretKey,
|
||||
assumeRoleArn,
|
||||
externalId,
|
||||
awsRegion,
|
||||
kmsKeyId
|
||||
}: {
|
||||
slug: string;
|
||||
description: string;
|
||||
credentialType: string;
|
||||
accessKey?: string;
|
||||
secretKey?: string;
|
||||
assumeRoleArn?: string;
|
||||
externalId?: string;
|
||||
awsRegion: string;
|
||||
kmsKeyId?: string;
|
||||
}) => {
|
||||
const { data } = await apiRequest.post("/api/v1/external-kms", {
|
||||
slug,
|
||||
description,
|
||||
provider: {
|
||||
type: "aws",
|
||||
inputs: {
|
||||
credential: {
|
||||
type: credentialType,
|
||||
data: {
|
||||
accessKey,
|
||||
secretKey,
|
||||
assumeRoleArn,
|
||||
externalId
|
||||
}
|
||||
},
|
||||
awsRegion,
|
||||
kmsKeyId
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return data;
|
||||
},
|
||||
onSuccess() {}
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user