Terraform Cloud Secret Sync Integration

This commit is contained in:
carlosmonastyrski
2025-04-04 09:54:53 -03:00
parent f00a54ed54
commit 4d41513abf
17 changed files with 212 additions and 113 deletions
@@ -8,19 +8,20 @@ import { SecretSync } from "@app/hooks/api/secretSyncs";
export const TerraformCloudSyncReviewFields = () => {
const { watch } = useFormContext<TSecretSyncForm & { destination: SecretSync.TerraformCloud }>();
const orgId = watch("destinationConfig.org");
const projectId = watch("destinationConfig.project");
const workspaceId = watch("destinationConfig.workspace");
const destinationName = watch("destinationConfig.destinationName");
const scope = watch("destinationConfig.scope");
const category = watch("destinationConfig.category");
return (
<>
<SecretSyncLabel label="Organization">{orgId}</SecretSyncLabel>
{scope === TerraformCloudSyncScope.Project && (
<SecretSyncLabel label="Project">{projectId}</SecretSyncLabel>
{scope === TerraformCloudSyncScope.VariableSet && (
<SecretSyncLabel label="Variable Set">{destinationName}</SecretSyncLabel>
)}
{scope === TerraformCloudSyncScope.Workspace && (
<SecretSyncLabel label="Workspace">{workspaceId}</SecretSyncLabel>
<SecretSyncLabel label="Workspace">{destinationName}</SecretSyncLabel>
)}
<SecretSyncLabel label="Category">{category}</SecretSyncLabel>
</>
);
};