Terraform Cloud integration

This commit is contained in:
Andrew Atimapre
2023-07-16 21:12:35 +01:00
parent a3836b970a
commit ceeebc24fa
2 changed files with 75 additions and 25 deletions
@@ -32,6 +32,7 @@ export default function TerraformCloudCreateIntegrationPage() {
const [selectedSourceEnvironment, setSelectedSourceEnvironment] = useState("");
const [targetApp, setTargetApp] = useState("");
const [secretPath, setSecretPath] = useState("/");
const [variableType, setVariableType] = useState("");
const [isLoading, setIsLoading] = useState(false);
useEffect(() => {
@@ -66,7 +67,7 @@ export default function TerraformCloudCreateIntegrationPage() {
sourceEnvironment: selectedSourceEnvironment,
targetEnvironment: null,
targetEnvironmentId: null,
targetService: null,
targetService: variableType,
targetServiceId: null,
owner: null,
path: null,
@@ -82,6 +83,11 @@ export default function TerraformCloudCreateIntegrationPage() {
}
};
const variableTypes = [
{ name: "env" },
{ name: "terraform" }
]
return integrationAuth &&
workspace &&
selectedSourceEnvironment &&
@@ -113,6 +119,24 @@ export default function TerraformCloudCreateIntegrationPage() {
placeholder="Provide a path, default is /"
/>
</FormControl>
<FormControl label="Variable Type" className="mt-4">
<Select
value={variableType}
onValueChange={(val) => setVariableType(val)}
className="w-full border border-mineshaft-500"
>
{
variableTypes.map((variable) => (
<SelectItem
value={variable.name}
key={`target-app-${variable.name}`}
>
{variable.name}
</SelectItem>
))
}
</Select>
</FormControl>
<FormControl label="Terraform Cloud Project" className="mt-4">
<Select
value={targetApp}