mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 13:27:22 +00:00
use dropdown for AWS regions
This commit is contained in:
+12
-6
@@ -29,6 +29,7 @@ import {
|
|||||||
useGetIdentityTokenAuth
|
useGetIdentityTokenAuth
|
||||||
} from "@app/hooks/api";
|
} from "@app/hooks/api";
|
||||||
import { slugSchema } from "@app/lib/schemas";
|
import { slugSchema } from "@app/lib/schemas";
|
||||||
|
import { AWS_REGIONS } from "@app/helpers/appConnections";
|
||||||
|
|
||||||
const baseFormSchema = z.object({
|
const baseFormSchema = z.object({
|
||||||
name: slugSchema({ field: "name" })
|
name: slugSchema({ field: "name" })
|
||||||
@@ -117,7 +118,7 @@ export const RelayTerraformDeploymentMethod = () => {
|
|||||||
setFormErrors([]);
|
setFormErrors([]);
|
||||||
|
|
||||||
if (canCreateToken && autogenerateToken) {
|
if (canCreateToken && autogenerateToken) {
|
||||||
const validation = formSchemaWithIdentity.safeParse({ name, instanceDomain, identity });
|
const validation = formSchemaWithIdentity.safeParse({ name, identity });
|
||||||
if (!validation.success) {
|
if (!validation.success) {
|
||||||
setFormErrors(validation.error.issues);
|
setFormErrors(validation.error.issues);
|
||||||
return;
|
return;
|
||||||
@@ -443,11 +444,16 @@ resource "aws_eip_association" "eip_assoc" {
|
|||||||
<Tab.Panels className="mb-4 rounded-sm border border-mineshaft-600 bg-mineshaft-700/70 p-3">
|
<Tab.Panels className="mb-4 rounded-sm border border-mineshaft-600 bg-mineshaft-700/70 p-3">
|
||||||
<Tab.Panel>
|
<Tab.Panel>
|
||||||
<FormLabel label="AWS Region" />
|
<FormLabel label="AWS Region" />
|
||||||
<Input
|
<FilterableSelect
|
||||||
value={awsRegion}
|
value={AWS_REGIONS.find((r) => r.slug === awsRegion)}
|
||||||
onChange={(e) => setAwsRegion(e.target.value)}
|
onChange={(selected) => {
|
||||||
placeholder="us-east-1"
|
if (selected) {
|
||||||
isError={Boolean(errors.awsRegion)}
|
setAwsRegion((selected as SingleValue<{ slug: string; name: string }>)!.slug);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
options={AWS_REGIONS}
|
||||||
|
getOptionLabel={(option) => option.name}
|
||||||
|
getOptionValue={(option) => option.slug}
|
||||||
/>
|
/>
|
||||||
{errors.awsRegion && <p className="mt-1 text-sm text-red">{errors.awsRegion}</p>}
|
{errors.awsRegion && <p className="mt-1 text-sm text-red">{errors.awsRegion}</p>}
|
||||||
<FormLabel label="VPC ID" className="mt-4" />
|
<FormLabel label="VPC ID" className="mt-4" />
|
||||||
|
|||||||
Reference in New Issue
Block a user