🚀Launch Week 08, April 14th - 18th, 2025🚀
Mods
GCP

Policy: GCP > Kubernetes Engine > Region Cluster > Labels > Template

The template is used to generate the keys and values for GCP Kubernetes Engine region cluster.

Labels not defined in Region Cluster Labels Template will not be modified or deleted. Setting a label value to undefined will result in the label being deleted.

See Labels for more information.

Targets

This policy targets the following resource types:

Primary Policy

This policy is used with the following primary policy:

Policy Specification

Default template
{%- if $.defaultLabels.value | length == 0 %} [] {%- elif $.defaultLabels.value != undefined %}{{ $.defaultLabels.value | dump | safe }}{%- else %}{% for item in $.defaultLabels.value %}- {{ item }}{% endfor %}{% endif %}
Default template input
- |
{
project {
turbot {
id
}
}
}
- |
{
defaultLabels: policyValue(uri:"tmod:@turbot/gcp-kubernetesengine#/policy/types/kubernetesEngineLabelsTemplate" resourceId: "{{ $.project.turbot.id }}") {
value
}
}
Examples [YAML]
  • foo: bar
    environment: prod
    
  • - foo123: bar
    - environment: dev
    
  • - cost-center: zz123
    - delete-me: undefined
    

Category

In Your Workspace

Developers