@@ -105,7 +105,14 @@ func (r *Ingress) UnmarshalJSON(data []byte) error {
105105}
106106
107107type IngressMatch struct {
108- // Hostname to match (exact match on Host header)
108+ // Hostname to match. Can be:
109+ //
110+ // - Literal: "api.example.com" (exact match on Host header)
111+ // - Pattern: "{instance}.example.com" (dynamic routing based on subdomain)
112+ //
113+ // Pattern hostnames use named captures in curly braces (e.g., {instance}, {app})
114+ // that extract parts of the hostname for routing. The extracted values can be
115+ // referenced in the target.instance field.
109116 Hostname string `json:"hostname,required"`
110117 // Host port to listen on for this rule (default 80)
111118 Port int64 `json:"port"`
@@ -135,7 +142,14 @@ func (r IngressMatch) ToParam() IngressMatchParam {
135142
136143// The property Hostname is required.
137144type IngressMatchParam struct {
138- // Hostname to match (exact match on Host header)
145+ // Hostname to match. Can be:
146+ //
147+ // - Literal: "api.example.com" (exact match on Host header)
148+ // - Pattern: "{instance}.example.com" (dynamic routing based on subdomain)
149+ //
150+ // Pattern hostnames use named captures in curly braces (e.g., {instance}, {app})
151+ // that extract parts of the hostname for routing. The extracted values can be
152+ // referenced in the target.instance field.
139153 Hostname string `json:"hostname,required"`
140154 // Host port to listen on for this rule (default 80)
141155 Port param.Opt [int64 ] `json:"port,omitzero"`
@@ -153,12 +167,19 @@ func (r *IngressMatchParam) UnmarshalJSON(data []byte) error {
153167type IngressRule struct {
154168 Match IngressMatch `json:"match,required"`
155169 Target IngressTarget `json:"target,required"`
170+ // Auto-create HTTP to HTTPS redirect for this hostname (only applies when tls is
171+ // enabled)
172+ RedirectHTTP bool `json:"redirect_http"`
173+ // Enable TLS termination (certificate auto-issued via ACME).
174+ Tls bool `json:"tls"`
156175 // JSON contains metadata for fields, check presence with [respjson.Field.Valid].
157176 JSON struct {
158- Match respjson.Field
159- Target respjson.Field
160- ExtraFields map [string ]respjson.Field
161- raw string
177+ Match respjson.Field
178+ Target respjson.Field
179+ RedirectHTTP respjson.Field
180+ Tls respjson.Field
181+ ExtraFields map [string ]respjson.Field
182+ raw string
162183 } `json:"-"`
163184}
164185
@@ -181,6 +202,11 @@ func (r IngressRule) ToParam() IngressRuleParam {
181202type IngressRuleParam struct {
182203 Match IngressMatchParam `json:"match,omitzero,required"`
183204 Target IngressTargetParam `json:"target,omitzero,required"`
205+ // Auto-create HTTP to HTTPS redirect for this hostname (only applies when tls is
206+ // enabled)
207+ RedirectHTTP param.Opt [bool ] `json:"redirect_http,omitzero"`
208+ // Enable TLS termination (certificate auto-issued via ACME).
209+ Tls param.Opt [bool ] `json:"tls,omitzero"`
184210 paramObj
185211}
186212
@@ -193,7 +219,14 @@ func (r *IngressRuleParam) UnmarshalJSON(data []byte) error {
193219}
194220
195221type IngressTarget struct {
196- // Target instance name or ID
222+ // Target instance name, ID, or capture reference.
223+ //
224+ // - For literal hostnames: Use the instance name or ID directly (e.g., "my-api")
225+ // - For pattern hostnames: Reference a capture from the hostname (e.g.,
226+ // "{instance}")
227+ //
228+ // When using pattern hostnames, the instance is resolved dynamically at request
229+ // time.
197230 Instance string `json:"instance,required"`
198231 // Target port on the instance
199232 Port int64 `json:"port,required"`
@@ -223,7 +256,14 @@ func (r IngressTarget) ToParam() IngressTargetParam {
223256
224257// The properties Instance, Port are required.
225258type IngressTargetParam struct {
226- // Target instance name or ID
259+ // Target instance name, ID, or capture reference.
260+ //
261+ // - For literal hostnames: Use the instance name or ID directly (e.g., "my-api")
262+ // - For pattern hostnames: Reference a capture from the hostname (e.g.,
263+ // "{instance}")
264+ //
265+ // When using pattern hostnames, the instance is resolved dynamically at request
266+ // time.
227267 Instance string `json:"instance,required"`
228268 // Target port on the instance
229269 Port int64 `json:"port,required"`
0 commit comments