sst / ion

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

Cloudflare dns: After deploy Proxy is set to disabled #374

Open webdeb opened 2 months ago

webdeb commented 2 months ago

Hello, I've deployed a cluster to aws, and created the service with public.domain.dns: sst.cloudflare.dns()

In cloudflare the Proxy status is disabled. I can enable it manually, but when I redeploy, the proxy is disabled again, I guess it's always a new entry if some cluster configurations are changed.

Bildschirmfoto 2024-05-05 um 14 50 26

So, after deploy/redeploy the service is unavailable.

webdeb commented 2 months ago

When I set dns.transform.record = { proxied: true, ttl: 1} I get another error:

failed to create DNS record: Target xxx.mhbtsbpdnt.acm-validations.aws. is not allowed for a proxied record. (9003)
webdeb commented 2 months ago

Ok, finally nailed it, but this feels like a hack..

          dns: sst.cloudflare.dns({
            transform: {
              record: (record) => {
                if (record.name === "my.service.com") {
                  record.proxied = true;
                  record.ttl = 1;
                }
              },
            },
          }),

I think it can be considered as a bug, when you set transform record on a public.domain.dns setting and sst uses this transform.record also on the record, which is responsible to confirm the domain ownership.