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
@@ -1,4 +1,3 @@
import { TerraformCloudSyncScope } from "@app/hooks/api/appConnections/terraform-cloud";
import { SecretSync, TSecretSync } from "@app/hooks/api/secretSyncs";
import {
GitHubSyncScope,
@@ -76,10 +75,7 @@ export const getSecretSyncDestinationColValues = (secretSync: TSecretSync) => {
break;
case SecretSync.TerraformCloud:
primaryText = destinationConfig.org;
secondaryText =
destinationConfig.scope === TerraformCloudSyncScope.Project
? destinationConfig.project
: destinationConfig.workspace;
secondaryText = destinationConfig.destinationName;
break;
default:
throw new Error(`Unhandled Destination Col Values ${destination}`);
@@ -15,11 +15,13 @@ export const TerraformCloudSyncDestinationSection = ({ secretSync }: Props) => {
let Components: ReactNode;
switch (destinationConfig.scope) {
case TerraformCloudSyncScope.Project:
case TerraformCloudSyncScope.VariableSet:
Components = (
<>
<SecretSyncLabel label="Organization">{destinationConfig.org}</SecretSyncLabel>
<SecretSyncLabel label="Project">{destinationConfig.project}</SecretSyncLabel>
<SecretSyncLabel label="Variable Set">
{destinationConfig.destinationName}
</SecretSyncLabel>
</>
);
break;
@@ -27,7 +29,7 @@ export const TerraformCloudSyncDestinationSection = ({ secretSync }: Props) => {
Components = (
<>
<SecretSyncLabel label="Organization">{destinationConfig.org}</SecretSyncLabel>
<SecretSyncLabel label="Workspace">{destinationConfig.workspace}</SecretSyncLabel>
<SecretSyncLabel label="Workspace">{destinationConfig.destinationName}</SecretSyncLabel>
</>
);
break;