@@ -12,14 +12,15 @@ import {
1212 PageContainer ,
1313} from "~/components/layout/AppLayout" ;
1414import { Button , LinkButton } from "~/components/primitives/Buttons" ;
15+ import { ClipboardField } from "~/components/primitives/ClipboardField" ;
1516import { Fieldset } from "~/components/primitives/Fieldset" ;
1617import { FormButtons } from "~/components/primitives/FormButtons" ;
1718import { FormError } from "~/components/primitives/FormError" ;
1819import { Header2 , Header3 } from "~/components/primitives/Headers" ;
1920import { Input } from "~/components/primitives/Input" ;
2021import { InputGroup } from "~/components/primitives/InputGroup" ;
2122import { Label } from "~/components/primitives/Label" ;
22- import { NavBar , PageTitle } from "~/components/primitives/PageHeader" ;
23+ import { NavBar , PageAccessories , PageTitle } from "~/components/primitives/PageHeader" ;
2324import { Paragraph } from "~/components/primitives/Paragraph" ;
2425import { Select , SelectItem } from "~/components/primitives/Select" ;
2526import { prisma } from "~/db.server" ;
@@ -36,11 +37,14 @@ import {
3637} from "~/services/platform.v3.server" ;
3738import { requireUserId } from "~/services/session.server" ;
3839import {
40+ docsPath ,
3941 OrganizationParamsSchema ,
4042 organizationPath ,
4143 v3PrivateConnectionsPath ,
4244} from "~/utils/pathBuilder" ;
4345import {
46+ ArrowTopRightOnSquareIcon ,
47+ BookOpenIcon ,
4448 CommandLineIcon ,
4549 DocumentTextIcon ,
4650 PencilSquareIcon ,
@@ -266,7 +270,10 @@ resource "aws_lb_listener" "port_${p.port}" {
266270resource "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
4184253. 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