sst / ion

❍ — a new engine for SST
https://ion.sst.dev
MIT License
1.09k stars 127 forks source link

Request for Documentation: Non route 53 domains #219

Closed tallowen closed 2 months ago

tallowen commented 2 months ago

In a couple places the docs say something like:

Set a custom domain for your distribution. Supports domains hosted either on Route 53 or outside AWS.

I'd love for more documentation that explains how this is expected to work.

What works for me right now / my current assets:

In the transforms block of my remix config:

        cdn: (args): CdnArgs => {
          return {
            ...args,
            transform: {
              distribution: (distArgs) => {
                return {
                  ...distArgs,
                  viewerCertificate: {
                    acmCertificateArn: 'arn:aws:acm:us-east-1:392581755734:certificate/b6db60d1-dcc4-4d79-bf49-b4f284348089',
                    sslSupportMethod: 'sni-only',
                    minimumProtocolVersion: "TLSv1.2_2021",
                  }
                }
              }
            }
          };
        }

What does not work for me

Setting cloudfront-test-ocoutts.mynonprofit.org as the domain for my remix config.

×  Failed
   RemixFrontendSST sst:aws:Remix → RemixFrontendSSTCdnHostedZoneLookup sst:aws:HostedZoneLookup
   Could not find hosted zone for domain cloudfront-test-ocoutts.mynonprofit.org

Am I misunderstanding how domains managed outside route 53 are meant to work?

toddjcrane commented 2 months ago

I can't speak for the devs/maintainers, but just as a matter of principal, using any non-AWS authoritative DNS server requires additional complexity. I'm not saying it's not possible nor that it's not a worthy path to go down, but rather that its much more complex than a simple swap.

Realistically, this will probably require middleware to be written for your specific authoritative DNS situation.

tallowen commented 2 months ago

@toddjcrane - agreed that it's additional complexity. I think my hangup is more that the docs say it's supported but it's a little unclear how.

jayair commented 2 months ago

We should have something for this next week.

tallowen commented 2 months ago

I saw that something has been landed, thanks!!

It looks like there is a panic going on - is there something I'm doing wrong? Thanks!

sst deploy --verbose
time=2024-04-29T13:31:19.595-06:00 level=INFO msg="checking for pulumi" path="/Users/ocoutts/Library/Application Support/sst/bin/pulumi"
time=2024-04-29T13:31:20.040-06:00 level=INFO msg="checking for bun" path="/Users/ocoutts/Library/Application Support/sst/bin/bun"
time=2024-04-29T13:31:20.055-06:00 level=INFO msg="initializing project" version=0.0.330
time=2024-04-29T13:31:20.055-06:00 level=INFO msg="esbuild building"
time=2024-04-29T13:31:20.057-06:00 level=INFO msg="esbuild built" outfile=/Users/ocoutts/dev/american-whitewater/aw-components/.sst/eval/eval-1714419080055.mjs
time=2024-04-29T13:31:20.057-06:00 level=INFO msg="evaluating config"
time=2024-04-29T13:31:20.232-06:00 level=INFO msg="config evaluated"
time=2024-04-29T13:31:20.233-06:00 level=INFO msg="checking platform"
time=2024-04-29T13:31:20.236-06:00 level=INFO msg="credentials found"
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/sst/ion/pkg/project/provider.(*CloudflareProvider).Init(0x140004a6b40, {0x140004a6780?, 0x140006805c9?}, {0x3?, 0x7?}, 0x140004a66f0)
    /home/runner/work/ion/ion/pkg/project/provider/cloudflare.go:62 +0x458
github.com/sst/ion/pkg/project.(*Project).LoadHome(0x1400009a7e0)
    /home/runner/work/ion/ion/pkg/project/project.go:237 +0x19c
main.initProject(0x14000576410)
    /home/runner/work/ion/ion/cmd/sst/main.go:1589 +0x63c
main.init.func3(0x14000576410)
    /home/runner/work/ion/ion/cmd/sst/main.go:425 +0x38
main.run()
    /home/runner/work/ion/ion/cmd/sst/main.go:159 +0x6cc
main.main()
    /home/runner/work/ion/ion/cmd/sst/main.go:51 +0x12c
jayair commented 2 months ago

For the original issue: https://ion.sst.dev/docs/custom-domains/

@tallowen open a new issue with it?