Skip to content

Commit b756054

Browse files
committed
Document <resource-tags> element in deployment.xml
- New reference section for <resource-tags> and <tag> children - Covers merging, template variables, validation rules, reconciliation - Link from enclave operations page
1 parent 715ce5b commit b756054

2 files changed

Lines changed: 100 additions & 0 deletions

File tree

en/operations/enclave/operations.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ application to operate properly. If network access is restricted the Vespa
2323
application might stop working.
2424

2525

26+
## Custom resource tags
27+
28+
Custom tags can be applied to the cloud resources (virtual machines and disks) that Vespa Cloud
29+
provisions inside the tenant's cloud account. Tags are declared in _deployment.xml_ via the
30+
[`<resource-tags>`](../../reference/applications/deployment.html#resource-tags) element and are
31+
commonly used for cost tracking and resource management. This is supported on AWS, Azure, and GCP.
32+
33+
2634
## Quota
2735
Make sure your organization's AWS or GCP quotas are set high enough to support common Vespa Cloud use cases.
2836
A common use case is migrating to new instance types,

en/reference/applications/deployment.html

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,98 @@ <h2 id="backup">backup</h2>
311311

312312

313313

314+
<h2 id="resource-tags">resource-tags</h2>
315+
<p>
316+
In <code>&lt;deployment&gt;</code>, <strong>or</strong> <code>&lt;instance&gt;</code>.
317+
Specifies custom tags to apply to cloud resources (virtual machines and attached disks) provisioned
318+
in the tenant cloud account. Only available for
319+
<a href="../../operations/enclave/enclave">Vespa Cloud Enclave</a> deployments, where a
320+
<code>cloud-account</code> is set. Commonly used for cost tracking and resource management.
321+
</p>
322+
<p>
323+
Tags declared at the <code>&lt;deployment&gt;</code> level apply to all instances. Tags at the
324+
<code>&lt;instance&gt;</code> level are merged with deployment-level tags; on key conflict, the
325+
instance-level value wins.
326+
</p>
327+
<pre>{% highlight xml %}
328+
<deployment version="1.0" cloud-account="aws:123456789012">
329+
<resource-tags>
330+
<tag key="cost-center" value="engineering"/>
331+
<tag key="env" value="${environment}"/>
332+
</resource-tags>
333+
334+
<instance id="prod">
335+
<resource-tags>
336+
<tag key="cost-center" value="search-team"/>
337+
</resource-tags>
338+
<prod>
339+
<region>aws-us-east-1c</region>
340+
</prod>
341+
</instance>
342+
</deployment>
343+
{% endhighlight %}</pre>
344+
<p>
345+
The <code>&lt;resource-tags&gt;</code> element contains one or more <code>&lt;tag&gt;</code> children.
346+
Each <code>&lt;tag&gt;</code> has two mandatory attributes:
347+
</p>
348+
<table class="table">
349+
<thead>
350+
<tr>
351+
<th style="width:150px">Attribute</th>
352+
<th style="width:100px">Mandatory</th>
353+
<th>Values</th>
354+
</tr>
355+
</thead>
356+
<tbody>
357+
<tr>
358+
<td>key</td>
359+
<td>Yes</td>
360+
<td>
361+
The tag key. Must start with a lowercase letter and contain only the characters
362+
<code>[a-z0-9_-]</code>. At most 63 characters. The <code>vai_</code> prefix is reserved
363+
for internal use.
364+
</td>
365+
</tr>
366+
<tr>
367+
<td>value</td>
368+
<td>Yes</td>
369+
<td>
370+
The tag value. Must be non-empty and contain only the characters <code>[a-z0-9_-]</code>,
371+
except that <a href="#resource-tags-template-variables">template variables</a> are allowed.
372+
At most 63 characters after resolution.
373+
</td>
374+
</tr>
375+
</tbody>
376+
</table>
377+
<p>
378+
Up to 20 tags are allowed per instance (after merging deployment-level and instance-level tags).
379+
The key and value constraints apply to AWS tags, Azure tags, and GCP labels; the lowercase and
380+
length restrictions are the strictest of the three and apply uniformly.
381+
</p>
382+
383+
<p id="resource-tags-template-variables"><strong>Template variables.</strong>
384+
Tag values may reference the following template variables, which are resolved at deployment time:</p>
385+
<ul>
386+
<li><code>${tenant}</code></li>
387+
<li><code>${application}</code></li>
388+
<li><code>${instance}</code></li>
389+
<li><code>${environment}</code></li>
390+
<li><code>${region}</code></li>
391+
</ul>
392+
<p>
393+
Resolved values are lowercased to match the label constraints above. Referencing an unknown
394+
variable causes the deployment to fail.
395+
</p>
396+
397+
<p><strong>Reconciliation.</strong>
398+
Tags are applied to virtual machines and attached disks. When tags are changed, added, or removed
399+
in <em>deployment.xml</em>, the existing resources are updated by a background reconciliation
400+
process. Tags that were previously applied by Vespa Cloud but are no longer listed are removed
401+
from the resources. Tags added manually by the tenant in the cloud console are preserved.
402+
</p>
403+
404+
405+
314406
<h2 id="upgrade">upgrade</h2>
315407
<p>
316408
In <code>&lt;deployment&gt;</code>, or <code>&lt;instance&gt;</code>.

0 commit comments

Comments
 (0)