mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 17:40:44 +00:00
Initial Commit for terraform cloud intergation
This commit is contained in:
+4
@@ -9,6 +9,7 @@ import { ProjectPermissionSub } from "@app/context";
|
||||
import { ProjectPermissionSecretSyncActions } from "@app/context/ProjectPermissionContext/types";
|
||||
import { APP_CONNECTION_MAP } from "@app/helpers/appConnections";
|
||||
import { SecretSync, TSecretSync } from "@app/hooks/api/secretSyncs";
|
||||
import { TerraformCloudSyncDestinationCol } from "@app/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncDestinationCol/TerraformCloudSyncDestinationCol";
|
||||
import { AwsParameterStoreSyncDestinationSection } from "@app/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/AwsParameterStoreSyncDestinationSection";
|
||||
import { AwsSecretsManagerSyncDestinationSection } from "@app/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/AwsSecretsManagerSyncDestinationSection";
|
||||
import { DatabricksSyncDestinationSection } from "@app/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/DatabricksSyncDestinationSection";
|
||||
@@ -57,6 +58,9 @@ export const SecretSyncDestinationSection = ({ secretSync, onEditDestination }:
|
||||
case SecretSync.Humanitec:
|
||||
DestinationComponents = <HumanitecSyncDestinationSection secretSync={secretSync} />;
|
||||
break;
|
||||
case SecretSync.TerraformCloud:
|
||||
DestinationComponents = <TerraformCloudSyncDestinationCol secretSync={secretSync} />;
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unhandled Destination Section components: ${destination}`);
|
||||
}
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
import { ReactNode } from "react";
|
||||
|
||||
import { SecretSyncLabel } from "@app/components/secret-syncs";
|
||||
import {
|
||||
TerraformCloudSyncScope,
|
||||
TTerraformCloudSync
|
||||
} from "@app/hooks/api/secretSyncs/types/terraform-cloud-sync";
|
||||
|
||||
type Props = {
|
||||
secretSync: TTerraformCloudSync;
|
||||
};
|
||||
|
||||
export const TerraformCloudSyncDestinationSection = ({ secretSync }: Props) => {
|
||||
const { destinationConfig } = secretSync;
|
||||
|
||||
let Components: ReactNode;
|
||||
switch (destinationConfig.scope) {
|
||||
case TerraformCloudSyncScope.Project:
|
||||
Components = (
|
||||
<>
|
||||
<SecretSyncLabel label="Organization">{destinationConfig.org}</SecretSyncLabel>
|
||||
<SecretSyncLabel label="Project">{destinationConfig.project}</SecretSyncLabel>
|
||||
</>
|
||||
);
|
||||
break;
|
||||
case TerraformCloudSyncScope.Workspace:
|
||||
Components = (
|
||||
<>
|
||||
<SecretSyncLabel label="Organization">{destinationConfig.org}</SecretSyncLabel>
|
||||
<SecretSyncLabel label="Workspace">{destinationConfig.workspace}</SecretSyncLabel>
|
||||
</>
|
||||
);
|
||||
break;
|
||||
default:
|
||||
throw new Error(
|
||||
`Unhandled Terraform Cloud Sync Destination Section Scope ${secretSync.destinationConfig.scope}`
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<SecretSyncLabel className="capitalize" label="Scope">
|
||||
{destinationConfig.scope.replace("-", " ")}
|
||||
</SecretSyncLabel>
|
||||
{Components}
|
||||
</>
|
||||
);
|
||||
};
|
||||
+1
@@ -48,6 +48,7 @@ export const SecretSyncOptionsSection = ({ secretSync, onEditOptions }: Props) =
|
||||
case SecretSync.AzureAppConfiguration:
|
||||
case SecretSync.Databricks:
|
||||
case SecretSync.Humanitec:
|
||||
case SecretSync.TerraformCloud:
|
||||
AdditionalSyncOptionsComponent = null;
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user