@highstate/common 0.9.16 → 0.9.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/{chunk-HZBJ6LLS.js → chunk-WDYIUWYZ.js} +659 -267
  2. package/dist/chunk-WDYIUWYZ.js.map +1 -0
  3. package/dist/highstate.manifest.json +12 -8
  4. package/dist/index.js +1 -1
  5. package/dist/units/access-point/index.js +16 -0
  6. package/dist/units/access-point/index.js.map +1 -0
  7. package/dist/units/databases/existing-mariadb/index.js +17 -0
  8. package/dist/units/databases/existing-mariadb/index.js.map +1 -0
  9. package/dist/units/databases/existing-mongodb/index.js +17 -0
  10. package/dist/units/databases/existing-mongodb/index.js.map +1 -0
  11. package/dist/units/databases/existing-postgresql/index.js +17 -0
  12. package/dist/units/databases/existing-postgresql/index.js.map +1 -0
  13. package/dist/units/dns/record-set/index.js +22 -11
  14. package/dist/units/dns/record-set/index.js.map +1 -1
  15. package/dist/units/existing-server/index.js +12 -12
  16. package/dist/units/existing-server/index.js.map +1 -1
  17. package/dist/units/network/l3-endpoint/index.js +1 -1
  18. package/dist/units/network/l3-endpoint/index.js.map +1 -1
  19. package/dist/units/network/l4-endpoint/index.js +1 -1
  20. package/dist/units/network/l4-endpoint/index.js.map +1 -1
  21. package/dist/units/script/index.js +1 -1
  22. package/dist/units/script/index.js.map +1 -1
  23. package/dist/units/server-dns/index.js +1 -1
  24. package/dist/units/server-dns/index.js.map +1 -1
  25. package/dist/units/server-patch/index.js +1 -1
  26. package/dist/units/server-patch/index.js.map +1 -1
  27. package/dist/units/ssh/key-pair/index.js +6 -6
  28. package/dist/units/ssh/key-pair/index.js.map +1 -1
  29. package/package.json +61 -8
  30. package/src/shared/access-point.ts +110 -0
  31. package/src/shared/command.ts +310 -69
  32. package/src/shared/dns.ts +150 -90
  33. package/src/shared/files.ts +34 -34
  34. package/src/shared/gateway.ts +117 -0
  35. package/src/shared/impl-ref.ts +123 -0
  36. package/src/shared/index.ts +4 -0
  37. package/src/shared/network.ts +41 -27
  38. package/src/shared/passwords.ts +38 -2
  39. package/src/shared/ssh.ts +261 -126
  40. package/src/shared/tls.ts +123 -0
  41. package/src/units/access-point/index.ts +12 -0
  42. package/src/units/databases/existing-mariadb/index.ts +14 -0
  43. package/src/units/databases/existing-mongodb/index.ts +14 -0
  44. package/src/units/databases/existing-postgresql/index.ts +14 -0
  45. package/src/units/dns/record-set/index.ts +21 -11
  46. package/src/units/existing-server/index.ts +12 -17
  47. package/src/units/ssh/key-pair/index.ts +6 -6
  48. package/dist/chunk-HZBJ6LLS.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { updateEndpointsWithFqdn, l3EndpointToString } from '../../chunk-HZBJ6LLS.js';
1
+ import { updateEndpointsWithFqdn, l3EndpointToString } from '../../chunk-WDYIUWYZ.js';
2
2
  import { common } from '@highstate/library';
3
3
  import { forUnit } from '@highstate/pulumi';
4
4
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/units/server-dns/index.ts"],"names":[],"mappings":";;;;AAIA,IAAM,EAAE,IAAM,EAAA,MAAA,EAAQ,SAAY,GAAA,OAAA,CAAQ,OAAO,SAAS,CAAA;AAE1D,IAAM,EAAE,SAAU,EAAA,GAAI,MAAM,uBAAA;AAAA,EAC1B,OAAO,MAAO,CAAA,SAAA;AAAA,EACd,IAAK,CAAA,IAAA;AAAA,EACL,IAAK,CAAA,cAAA;AAAA,EACL,IAAK,CAAA,SAAA;AAAA,EACL,MAAO,CAAA;AACT,CAAA;AAEA,IAAO,qBAAQ,OAAQ,CAAA;AAAA,EACrB,MAAQ,EAAA,MAAA,CAAO,MAAO,CAAA,KAAA,CAAM,CAAW,MAAA,MAAA;AAAA,IACrC,GAAG,MAAA;AAAA,IACH;AAAA,GACA,CAAA,CAAA;AAAA,EAEF,SAAA;AAAA,EAEA,aAAe,EAAA;AAAA,IACb,SAAA,EAAW,SAAU,CAAA,GAAA,CAAI,kBAAkB;AAAA;AAE/C,CAAC","file":"index.js","sourcesContent":["import { common } from \"@highstate/library\"\nimport { forUnit } from \"@highstate/pulumi\"\nimport { l3EndpointToString, updateEndpointsWithFqdn } from \"../../shared\"\n\nconst { args, inputs, outputs } = forUnit(common.serverDns)\n\nconst { endpoints } = await updateEndpointsWithFqdn(\n inputs.server.endpoints,\n args.fqdn,\n args.endpointFilter,\n args.patchMode,\n inputs.dnsProviders,\n)\n\nexport default outputs({\n server: inputs.server.apply(server => ({\n ...server,\n endpoints,\n })),\n\n endpoints,\n\n $statusFields: {\n endpoints: endpoints.map(l3EndpointToString),\n },\n})\n"]}
1
+ {"version":3,"sources":["../../../src/units/server-dns/index.ts"],"names":[],"mappings":";;;;AAIA,IAAM,EAAE,IAAA,EAAM,MAAA,EAAQ,SAAQ,GAAI,OAAA,CAAQ,OAAO,SAAS,CAAA;AAE1D,IAAM,EAAE,SAAA,EAAU,GAAI,MAAM,uBAAA;AAAA,EAC1B,OAAO,MAAA,CAAO,SAAA;AAAA,EACd,IAAA,CAAK,IAAA;AAAA,EACL,IAAA,CAAK,cAAA;AAAA,EACL,IAAA,CAAK,SAAA;AAAA,EACL,MAAA,CAAO;AACT,CAAA;AAEA,IAAO,qBAAQ,OAAA,CAAQ;AAAA,EACrB,MAAA,EAAQ,MAAA,CAAO,MAAA,CAAO,KAAA,CAAM,CAAA,MAAA,MAAW;AAAA,IACrC,GAAG,MAAA;AAAA,IACH;AAAA,GACF,CAAE,CAAA;AAAA,EAEF,SAAA;AAAA,EAEA,aAAA,EAAe;AAAA,IACb,SAAA,EAAW,SAAA,CAAU,GAAA,CAAI,kBAAkB;AAAA;AAE/C,CAAC","file":"index.js","sourcesContent":["import { common } from \"@highstate/library\"\nimport { forUnit } from \"@highstate/pulumi\"\nimport { l3EndpointToString, updateEndpointsWithFqdn } from \"../../shared\"\n\nconst { args, inputs, outputs } = forUnit(common.serverDns)\n\nconst { endpoints } = await updateEndpointsWithFqdn(\n inputs.server.endpoints,\n args.fqdn,\n args.endpointFilter,\n args.patchMode,\n inputs.dnsProviders,\n)\n\nexport default outputs({\n server: inputs.server.apply(server => ({\n ...server,\n endpoints,\n })),\n\n endpoints,\n\n $statusFields: {\n endpoints: endpoints.map(l3EndpointToString),\n },\n})\n"]}
@@ -1,4 +1,4 @@
1
- import { updateEndpoints, l3EndpointToString } from '../../chunk-HZBJ6LLS.js';
1
+ import { updateEndpoints, l3EndpointToString } from '../../chunk-WDYIUWYZ.js';
2
2
  import { common } from '@highstate/library';
3
3
  import { forUnit } from '@highstate/pulumi';
4
4
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/units/server-patch/index.ts"],"names":[],"mappings":";;;;AAIA,IAAM,EAAE,IAAM,EAAA,MAAA,EAAQ,SAAY,GAAA,OAAA,CAAQ,OAAO,WAAW,CAAA;AAE5D,IAAM,YAAY,MAAM,eAAA;AAAA,EACtB,OAAO,MAAO,CAAA,SAAA;AAAA,EACd,IAAK,CAAA,SAAA;AAAA,EACL,MAAO,CAAA,SAAA;AAAA,EACP,IAAK,CAAA;AACP,CAAA;AAEA,IAAO,uBAAQ,OAAQ,CAAA;AAAA,EACrB,MAAQ,EAAA,MAAA,CAAO,MAAO,CAAA,KAAA,CAAM,CAAW,MAAA,MAAA;AAAA,IACrC,GAAG,MAAA;AAAA,IACH;AAAA,GACA,CAAA,CAAA;AAAA,EAEF,SAAA;AAAA,EAEA,aAAe,EAAA;AAAA,IACb,SAAA,EAAW,SAAU,CAAA,GAAA,CAAI,kBAAkB;AAAA;AAE/C,CAAC","file":"index.js","sourcesContent":["import { common } from \"@highstate/library\"\nimport { forUnit } from \"@highstate/pulumi\"\nimport { l3EndpointToString, updateEndpoints } from \"../../shared\"\n\nconst { args, inputs, outputs } = forUnit(common.serverPatch)\n\nconst endpoints = await updateEndpoints(\n inputs.server.endpoints,\n args.endpoints,\n inputs.endpoints,\n args.endpointsPatchMode,\n)\n\nexport default outputs({\n server: inputs.server.apply(server => ({\n ...server,\n endpoints,\n })),\n\n endpoints,\n\n $statusFields: {\n endpoints: endpoints.map(l3EndpointToString),\n },\n})\n"]}
1
+ {"version":3,"sources":["../../../src/units/server-patch/index.ts"],"names":[],"mappings":";;;;AAIA,IAAM,EAAE,IAAA,EAAM,MAAA,EAAQ,SAAQ,GAAI,OAAA,CAAQ,OAAO,WAAW,CAAA;AAE5D,IAAM,YAAY,MAAM,eAAA;AAAA,EACtB,OAAO,MAAA,CAAO,SAAA;AAAA,EACd,IAAA,CAAK,SAAA;AAAA,EACL,MAAA,CAAO,SAAA;AAAA,EACP,IAAA,CAAK;AACP,CAAA;AAEA,IAAO,uBAAQ,OAAA,CAAQ;AAAA,EACrB,MAAA,EAAQ,MAAA,CAAO,MAAA,CAAO,KAAA,CAAM,CAAA,MAAA,MAAW;AAAA,IACrC,GAAG,MAAA;AAAA,IACH;AAAA,GACF,CAAE,CAAA;AAAA,EAEF,SAAA;AAAA,EAEA,aAAA,EAAe;AAAA,IACb,SAAA,EAAW,SAAA,CAAU,GAAA,CAAI,kBAAkB;AAAA;AAE/C,CAAC","file":"index.js","sourcesContent":["import { common } from \"@highstate/library\"\nimport { forUnit } from \"@highstate/pulumi\"\nimport { l3EndpointToString, updateEndpoints } from \"../../shared\"\n\nconst { args, inputs, outputs } = forUnit(common.serverPatch)\n\nconst endpoints = await updateEndpoints(\n inputs.server.endpoints,\n args.endpoints,\n inputs.endpoints,\n args.endpointsPatchMode,\n)\n\nexport default outputs({\n server: inputs.server.apply(server => ({\n ...server,\n endpoints,\n })),\n\n endpoints,\n\n $statusFields: {\n endpoints: endpoints.map(l3EndpointToString),\n },\n})\n"]}
@@ -1,12 +1,12 @@
1
- import { generatePrivateKey, privateKeyToKeyPair } from '../../../chunk-HZBJ6LLS.js';
1
+ import { generateSshPrivateKey, sshPrivateKeyToKeyPair } from '../../../chunk-WDYIUWYZ.js';
2
2
  import { ssh } from '@highstate/library';
3
- import { forUnit, getOrCreateSecret } from '@highstate/pulumi';
3
+ import { forUnit } from '@highstate/pulumi';
4
4
 
5
- var { name, secrets, outputs } = forUnit(ssh.keyPair);
6
- var privateKey = getOrCreateSecret(secrets, "privateKey", generatePrivateKey);
7
- var keyPair = privateKeyToKeyPair(privateKey);
5
+ var { name, getSecret, outputs } = forUnit(ssh.keyPair);
6
+ var privateKey = getSecret("privateKey", generateSshPrivateKey);
7
+ var keyPair = sshPrivateKeyToKeyPair(privateKey);
8
8
  var key_pair_default = outputs({
9
- keyPair: privateKeyToKeyPair(privateKey),
9
+ keyPair,
10
10
  publicKeyFile: {
11
11
  meta: {
12
12
  name: `${name}.pub`,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/units/ssh/key-pair/index.ts"],"names":[],"mappings":";;;;AAIA,IAAM,EAAE,IAAM,EAAA,OAAA,EAAS,SAAY,GAAA,OAAA,CAAQ,IAAI,OAAO,CAAA;AAEtD,IAAM,UAAa,GAAA,iBAAA,CAAkB,OAAS,EAAA,YAAA,EAAc,kBAAkB,CAAA;AAC9E,IAAM,OAAA,GAAU,oBAAoB,UAAU,CAAA;AAE9C,IAAO,mBAAQ,OAAQ,CAAA;AAAA,EACrB,OAAA,EAAS,oBAAoB,UAAU,CAAA;AAAA,EACvC,aAAe,EAAA;AAAA,IACb,IAAM,EAAA;AAAA,MACJ,IAAA,EAAM,GAAG,IAAI,CAAA,IAAA,CAAA;AAAA,MACb,IAAM,EAAA;AAAA,KACR;AAAA,IACA,OAAS,EAAA;AAAA,MACP,IAAM,EAAA,UAAA;AAAA,MACN,OAAO,OAAQ,CAAA;AAAA;AACjB,GACF;AAAA,EACA,aAAe,EAAA;AAAA,IACb,aAAa,OAAQ,CAAA,WAAA;AAAA,IACrB,WAAW,OAAQ,CAAA;AAAA;AAEvB,CAAC","file":"index.js","sourcesContent":["import { ssh } from \"@highstate/library\"\nimport { forUnit, getOrCreateSecret } from \"@highstate/pulumi\"\nimport { generatePrivateKey, privateKeyToKeyPair } from \"../../../shared\"\n\nconst { name, secrets, outputs } = forUnit(ssh.keyPair)\n\nconst privateKey = getOrCreateSecret(secrets, \"privateKey\", generatePrivateKey)\nconst keyPair = privateKeyToKeyPair(privateKey)\n\nexport default outputs({\n keyPair: privateKeyToKeyPair(privateKey),\n publicKeyFile: {\n meta: {\n name: `${name}.pub`,\n mode: 0o644,\n },\n content: {\n type: \"embedded\",\n value: keyPair.publicKey,\n },\n },\n $statusFields: {\n fingerprint: keyPair.fingerprint,\n publicKey: keyPair.publicKey,\n },\n})\n"]}
1
+ {"version":3,"sources":["../../../../src/units/ssh/key-pair/index.ts"],"names":[],"mappings":";;;;AAIA,IAAM,EAAE,IAAA,EAAM,SAAA,EAAW,SAAQ,GAAI,OAAA,CAAQ,IAAI,OAAO,CAAA;AAExD,IAAM,UAAA,GAAa,SAAA,CAAU,YAAA,EAAc,qBAAqB,CAAA;AAChE,IAAM,OAAA,GAAU,uBAAuB,UAAU,CAAA;AAEjD,IAAO,mBAAQ,OAAA,CAAQ;AAAA,EACrB,OAAA;AAAA,EACA,aAAA,EAAe;AAAA,IACb,IAAA,EAAM;AAAA,MACJ,IAAA,EAAM,GAAG,IAAI,CAAA,IAAA,CAAA;AAAA,MACb,IAAA,EAAM;AAAA,KACR;AAAA,IACA,OAAA,EAAS;AAAA,MACP,IAAA,EAAM,UAAA;AAAA,MACN,OAAO,OAAA,CAAQ;AAAA;AACjB,GACF;AAAA,EACA,aAAA,EAAe;AAAA,IACb,aAAa,OAAA,CAAQ,WAAA;AAAA,IACrB,WAAW,OAAA,CAAQ;AAAA;AAEvB,CAAC","file":"index.js","sourcesContent":["import { ssh } from \"@highstate/library\"\nimport { forUnit } from \"@highstate/pulumi\"\nimport { generateSshPrivateKey, sshPrivateKeyToKeyPair } from \"../../../shared\"\n\nconst { name, getSecret, outputs } = forUnit(ssh.keyPair)\n\nconst privateKey = getSecret(\"privateKey\", generateSshPrivateKey)\nconst keyPair = sshPrivateKeyToKeyPair(privateKey)\n\nexport default outputs({\n keyPair,\n publicKeyFile: {\n meta: {\n name: `${name}.pub`,\n mode: 0o644,\n },\n content: {\n type: \"embedded\",\n value: keyPair.publicKey,\n },\n },\n $statusFields: {\n fingerprint: keyPair.fingerprint,\n publicKey: keyPair.publicKey,\n },\n})\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highstate/common",
3
- "version": "0.9.16",
3
+ "version": "0.9.19",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -11,6 +11,54 @@
11
11
  ".": {
12
12
  "mode": "manual",
13
13
  "version": "1"
14
+ },
15
+ "./units/access-point": {
16
+ "mode": "manual",
17
+ "version": "1"
18
+ },
19
+ "./units/dns/record-set": {
20
+ "mode": "manual",
21
+ "version": "1"
22
+ },
23
+ "./units/network/l3-endpoint": {
24
+ "mode": "manual",
25
+ "version": "1"
26
+ },
27
+ "./units/network/l4-endpoint": {
28
+ "mode": "manual",
29
+ "version": "1"
30
+ },
31
+ "./units/existing-server": {
32
+ "mode": "manual",
33
+ "version": "1"
34
+ },
35
+ "./units/ssh/key-pair": {
36
+ "mode": "manual",
37
+ "version": "1"
38
+ },
39
+ "./units/script": {
40
+ "mode": "manual",
41
+ "version": "1"
42
+ },
43
+ "./units/server-dns": {
44
+ "mode": "manual",
45
+ "version": "1"
46
+ },
47
+ "./units/server-patch": {
48
+ "mode": "manual",
49
+ "version": "1"
50
+ },
51
+ "./units/databases/existing-mariadb": {
52
+ "mode": "manual",
53
+ "version": "1"
54
+ },
55
+ "./units/databases/existing-postgresql": {
56
+ "mode": "manual",
57
+ "version": "1"
58
+ },
59
+ "./units/databases/existing-mongodb": {
60
+ "mode": "manual",
61
+ "version": "1"
14
62
  }
15
63
  }
16
64
  },
@@ -19,6 +67,7 @@
19
67
  "types": "./src/index.ts",
20
68
  "default": "./dist/index.js"
21
69
  },
70
+ "./units/access-point": "./dist/units/access-point/index.js",
22
71
  "./units/dns/record-set": "./dist/units/dns/record-set/index.js",
23
72
  "./units/network/l3-endpoint": "./dist/units/network/l3-endpoint/index.js",
24
73
  "./units/network/l4-endpoint": "./dist/units/network/l4-endpoint/index.js",
@@ -26,7 +75,10 @@
26
75
  "./units/ssh/key-pair": "./dist/units/ssh/key-pair/index.js",
27
76
  "./units/script": "./dist/units/script/index.js",
28
77
  "./units/server-dns": "./dist/units/server-dns/index.js",
29
- "./units/server-patch": "./dist/units/server-patch/index.js"
78
+ "./units/server-patch": "./dist/units/server-patch/index.js",
79
+ "./units/databases/existing-mariadb": "./dist/units/databases/existing-mariadb/index.js",
80
+ "./units/databases/existing-postgresql": "./dist/units/databases/existing-postgresql/index.js",
81
+ "./units/databases/existing-mongodb": "./dist/units/databases/existing-mongodb/index.js"
30
82
  },
31
83
  "publishConfig": {
32
84
  "access": "public"
@@ -36,9 +88,9 @@
36
88
  "update-images": "../../scripts/update-images.sh ./assets/images.json"
37
89
  },
38
90
  "dependencies": {
39
- "@highstate/contract": "^0.9.16",
40
- "@highstate/library": "^0.9.16",
41
- "@highstate/pulumi": "^0.9.16",
91
+ "@highstate/contract": "^0.9.19",
92
+ "@highstate/library": "^0.9.19",
93
+ "@highstate/pulumi": "^0.9.19",
42
94
  "@noble/hashes": "^1.7.1",
43
95
  "@pulumi/command": "^1.0.2",
44
96
  "micro-key-producer": "^0.7.3",
@@ -48,9 +100,10 @@
48
100
  "unzipper": "^0.12.3"
49
101
  },
50
102
  "devDependencies": {
51
- "@highstate/cli": "^0.9.16",
103
+ "@highstate/cli": "^0.9.19",
52
104
  "@types/tar": "^6.1.13",
53
- "@types/unzipper": "^0.10.11"
105
+ "@types/unzipper": "^0.10.11",
106
+ "type-fest": "^4.41.0"
54
107
  },
55
- "gitHead": "458d6f1f9f6d4aec0ba75a2b2c4c01408cb9c8df"
108
+ "gitHead": "e77d292335556c6e5b6275acda1a3d1609d786a1"
56
109
  }
@@ -0,0 +1,110 @@
1
+ import type { common } from "@highstate/library"
2
+ import type { Except } from "type-fest"
3
+ import {
4
+ ComponentResource,
5
+ type ComponentResourceOptions,
6
+ type Input,
7
+ type Output,
8
+ output,
9
+ toPromise,
10
+ } from "@highstate/pulumi"
11
+ import { DnsRecordSet } from "./dns"
12
+ import { GatewayRoute, type GatewayRouteSpec } from "./gateway"
13
+ import { TlsCertificate } from "./tls"
14
+
15
+ export type AccessPointRouteArgs = Except<GatewayRouteSpec, "nativeData"> & {
16
+ /**
17
+ * The access point to use to expose the route.
18
+ */
19
+ accessPoint: Input<common.AccessPoint>
20
+
21
+ /**
22
+ * The native data to pass to the gateway route implementation.
23
+ */
24
+ gatewayNativeData?: unknown
25
+
26
+ /**
27
+ * The native data to pass to the tls ceertificate implementation.
28
+ */
29
+ tlsCertificateNativeData?: unknown
30
+ }
31
+
32
+ export class AccessPointRoute extends ComponentResource {
33
+ /**
34
+ * The created gateway route.
35
+ */
36
+ readonly route: GatewayRoute
37
+
38
+ /**
39
+ * The DNS record set created for the route.
40
+ *
41
+ * May be shared between multiple routes with the same FQDN.
42
+ */
43
+ readonly dnsRecordSet?: Output<DnsRecordSet | undefined>
44
+
45
+ /**
46
+ * The TLS certificate created for the route.
47
+ *
48
+ * May be shared between multiple routes with the same FQDN.
49
+ */
50
+ readonly tlsCertificate?: Output<TlsCertificate | undefined>
51
+
52
+ constructor(name: string, args: AccessPointRouteArgs, opts?: ComponentResourceOptions) {
53
+ super("highstate:common:AccessPointRoute", name, args, opts)
54
+
55
+ // 1. create TLS certificate if the route is HTTPS and the access point has TLS issuers
56
+ if (args.fqdn && args.type === "http" && !args.insecure) {
57
+ this.tlsCertificate = output(args.accessPoint).apply(accessPoint => {
58
+ if (accessPoint.tlsIssuers.length === 0) {
59
+ return undefined
60
+ }
61
+
62
+ return TlsCertificate.createOnce(
63
+ name,
64
+ {
65
+ issuers: accessPoint.tlsIssuers,
66
+ dnsNames: args.fqdn ? [args.fqdn] : [],
67
+ nativeData: args.tlsCertificateNativeData,
68
+ },
69
+ { ...opts, parent: this },
70
+ )
71
+ })
72
+ }
73
+
74
+ // 2. create the route and resolve the gateway endpoints
75
+ this.route = new GatewayRoute(
76
+ name,
77
+ {
78
+ ...args,
79
+ gateway: output(args.accessPoint).gateway,
80
+ tlsCertificate: this.tlsCertificate,
81
+ nativeData: args.gatewayNativeData,
82
+ },
83
+ { ...opts, parent: this },
84
+ )
85
+
86
+ // 3. register DNS records if FQDN is provided and the access point has DNS providers
87
+ if (args.fqdn) {
88
+ this.dnsRecordSet = output(args.accessPoint).apply(async accessPoint => {
89
+ if (accessPoint.dnsProviders.length === 0) {
90
+ return undefined
91
+ }
92
+
93
+ const fqdn = await toPromise(args.fqdn)
94
+ if (!fqdn) {
95
+ return undefined
96
+ }
97
+
98
+ return DnsRecordSet.createOnce(
99
+ fqdn,
100
+ {
101
+ providers: output(args.accessPoint).dnsProviders,
102
+ values: this.route.endpoints,
103
+ waitAt: "local",
104
+ },
105
+ { ...opts, parent: this },
106
+ )
107
+ })
108
+ }
109
+ }
110
+ }