Skip to content

Commit 5fe72ee

Browse files
authored
feat(webapp): Private Links setup wizard UI tweaks (#3465)
1 parent fefe61f commit 5fe72ee

3 files changed

Lines changed: 64 additions & 23 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: improvement
4+
---
5+
6+
Clarify the cross-region intent in the Terraform and AI-prompt helpers on the Add Private Connection page. Both already default `supported_regions` to `["us-east-1", "eu-central-1"]`; added an inline comment / parenthetical so the user understands why both regions are listed (Trigger.dev runs in both, so the service must be consumable from either).

apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.private-connections._index/route.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { logger } from "~/services/logger.server";
1818
import { getPrivateLinks } from "~/services/platform.v3.server";
1919
import { requireUserId } from "~/services/session.server";
2020
import {
21+
docsPath,
2122
OrganizationParamsSchema,
2223
organizationPath,
2324
v3PrivateConnectionsPath,
@@ -29,6 +30,7 @@ import { type ActionFunctionArgs, json } from "@remix-run/server-runtime";
2930
import { deletePrivateLink } from "~/services/platform.v3.server";
3031
import { redirectWithErrorMessage, redirectWithSuccessMessage } from "~/models/message.server";
3132
import {
33+
BookOpenIcon,
3234
ClipboardDocumentIcon,
3335
PlusIcon,
3436
TrashIcon,
@@ -182,6 +184,13 @@ export default function Page() {
182184
<NavBar>
183185
<PageTitle title="Private Connections" />
184186
<PageAccessories>
187+
<LinkButton
188+
variant="docs/small"
189+
LeadingIcon={BookOpenIcon}
190+
to={docsPath("private-networking/overview")}
191+
>
192+
Private connection docs
193+
</LinkButton>
185194
{hasPrivateNetworking && canAdd && (
186195
<LinkButton variant="primary/small" LeadingIcon={PlusIcon} to="new">
187196
Add Connection

apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.private-connections.new/route.tsx

Lines changed: 49 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ import {
1212
PageContainer,
1313
} from "~/components/layout/AppLayout";
1414
import { Button, LinkButton } from "~/components/primitives/Buttons";
15+
import { ClipboardField } from "~/components/primitives/ClipboardField";
1516
import { Fieldset } from "~/components/primitives/Fieldset";
1617
import { FormButtons } from "~/components/primitives/FormButtons";
1718
import { FormError } from "~/components/primitives/FormError";
1819
import { Header2, Header3 } from "~/components/primitives/Headers";
1920
import { Input } from "~/components/primitives/Input";
2021
import { InputGroup } from "~/components/primitives/InputGroup";
2122
import { Label } from "~/components/primitives/Label";
22-
import { NavBar, PageTitle } from "~/components/primitives/PageHeader";
23+
import { NavBar, PageAccessories, PageTitle } from "~/components/primitives/PageHeader";
2324
import { Paragraph } from "~/components/primitives/Paragraph";
2425
import { Select, SelectItem } from "~/components/primitives/Select";
2526
import { prisma } from "~/db.server";
@@ -36,11 +37,14 @@ import {
3637
} from "~/services/platform.v3.server";
3738
import { requireUserId } from "~/services/session.server";
3839
import {
40+
docsPath,
3941
OrganizationParamsSchema,
4042
organizationPath,
4143
v3PrivateConnectionsPath,
4244
} from "~/utils/pathBuilder";
4345
import {
46+
ArrowTopRightOnSquareIcon,
47+
BookOpenIcon,
4448
CommandLineIcon,
4549
DocumentTextIcon,
4650
PencilSquareIcon,
@@ -266,7 +270,10 @@ resource "aws_lb_listener" "port_${p.port}" {
266270
resource "aws_vpc_endpoint_service" "trigger_privatelink" {
267271
acceptance_required = false
268272
network_load_balancer_arns = [aws_lb.trigger_privatelink.arn]
269-
supported_regions = ["us-east-1", "eu-central-1"]
273+
274+
# Trigger.dev runs in us-east-1 and eu-central-1. Listing both makes this
275+
# service consumable from either region so any of your tasks can connect.
276+
supported_regions = ["us-east-1", "eu-central-1"]
270277
271278
allowed_principals = [
272279
${awsAccountIds.map((id) => ` "arn:aws:iam::${id}:root",`).join("\n")}
@@ -418,7 +425,7 @@ ${validPorts.length > 0 ? validPorts.map((p) => ` - Port ${p.port} (${p.protoc
418425
3. A VPC Endpoint Service:
419426
- Acceptance required: no
420427
- Attach the NLB created above
421-
- Supported regions: us-east-1, eu-central-1
428+
- Supported regions: us-east-1, eu-central-1 (these are the AWS regions Trigger.dev runs in, so the service must be consumable from both)
422429
- Allowed principals:
423430
${awsAccountIds.map((id) => ` - arn:aws:iam::${id}:root`).join("\n") || " - <Trigger.dev AWS account ARN>"}
424431
@@ -531,7 +538,7 @@ export default function Page() {
531538
const { availableRegions, activeRegions, awsAccountIds } = useTypedLoaderData<typeof loader>();
532539
const { organizationSlug } = useParams();
533540
const lastSubmission = useActionData();
534-
const [setupMethod, setSetupMethod] = useState<SetupMethod | null>(null);
541+
const [setupMethod, setSetupMethod] = useState<SetupMethod | null>("manual");
535542

536543
const defaultRegion = "us-east-1";
537544

@@ -547,6 +554,15 @@ export default function Page() {
547554
<PageContainer>
548555
<NavBar>
549556
<PageTitle title="Add Private Connection" backButton={{ to: v3PrivateConnectionsPath({ slug: organizationSlug! }), text: "Private Connections" }} />
557+
<PageAccessories>
558+
<LinkButton
559+
variant="docs/small"
560+
LeadingIcon={BookOpenIcon}
561+
to={docsPath("private-networking/overview")}
562+
>
563+
Private connection docs
564+
</LinkButton>
565+
</PageAccessories>
550566
</NavBar>
551567
<PageBody scrollable={true}>
552568
<MainHorizontallyCenteredContainer className="max-w-3xl">
@@ -651,45 +667,55 @@ export default function Page() {
651667
</div>
652668
)}
653669

654-
{/* Docs iframe */}
670+
{/* Docs link */}
655671
{setupMethod === "docs" && (
656672
<div className="mb-6 rounded-lg border border-grid-dimmed p-4">
657673
<Header3 spacing>Setup Guide</Header3>
658674
{awsAccountIds.length > 0 && (
659675
<>
660676
<Paragraph variant="small" className="mb-3">
661677
When adding allowed principals to your VPC Endpoint Service, use the following
662-
AWS account ID(s):
678+
AWS account ARN(s):
663679
</Paragraph>
664-
<div className="mb-4 rounded-md border border-charcoal-700 bg-charcoal-900 p-3">
680+
<div className="mb-4 space-y-2">
665681
{awsAccountIds.map((id) => (
666-
<code key={id} className="text-sm text-emerald-400">
667-
{id}
668-
</code>
682+
<ClipboardField
683+
key={id}
684+
value={`arn:aws:iam::${id}:root`}
685+
variant="primary/medium"
686+
/>
669687
))}
670688
</div>
671689
</>
672690
)}
673-
<iframe
674-
src="https://trigger.dev/docs/network/private-link-setup-guide"
675-
title="Private Link Setup Guide"
676-
className="h-[600px] w-full rounded-md border border-charcoal-700"
677-
/>
691+
<Paragraph variant="small" className="mb-3">
692+
Follow the step-by-step guide in our docs to create a VPC Endpoint Service in the
693+
AWS Console, then come back here to add the connection.
694+
</Paragraph>
695+
<LinkButton
696+
to={docsPath("private-networking/aws-console-setup")}
697+
variant="primary/medium"
698+
TrailingIcon={ArrowTopRightOnSquareIcon}
699+
>
700+
Open setup guide
701+
</LinkButton>
678702
</div>
679703
)}
680704

681-
{/* AWS account IDs reference */}
682-
{setupMethod === "manual" && (
705+
{/* AWS account ARNs reference */}
706+
{setupMethod === "manual" && awsAccountIds.length > 0 && (
683707
<div className="mb-6 rounded-lg border border-grid-dimmed p-4">
684-
<Paragraph variant="small" className="mb-2">
685-
Add the following AWS account ID(s) to your VPC Endpoint Service's allowed
708+
<Paragraph variant="small" className="mb-3">
709+
Add the following AWS account ARN(s) to your VPC Endpoint Service's allowed
686710
principals:
687711
</Paragraph>
688-
<div className="rounded-md border border-charcoal-700 bg-charcoal-900 p-3">
712+
<div className="space-y-2">
689713
{awsAccountIds.map((id) => (
690-
<code key={id} className="text-sm text-emerald-400">
691-
{id}
692-
</code>
714+
<ClipboardField
715+
key={id}
716+
value={`arn:aws:iam::${id}:root`}
717+
variant="primary/medium"
718+
/>
693719
))}
694720
</div>
695721
</div>

0 commit comments

Comments
 (0)