Hi @linuxbsdfreak,
It looks like you were almost there… just some things in a slightly different order. I find it hard to work with these long examples because it’s hard to replicate all of the settings you are including when I’m not familiar with your system, but here’s an abbreviated example that hopefully shows the relevant parts in a way you can incorporate into your larger template:
${yamlencode({
"apiVersion": "core.gardener.cloud/v1beta1",
"kind": "Shoot",
# (and all of the other unconditional top-level attributes)
"spec": merge(
{
"addons": { /* ... */ },
"cloudProfileName": target_profile,
# (and all of the other unconditional "spec" attributes)
},
gardener_dns_management || gardener_dns_ssl_management ? {
"dns": {
"domain" : "${shoot_cluster_name}.${element(split("-",project_name),1)}.${gardenerdomain}",
# ...
}
} : {},
gardener_dns_management ? {
"extensions": [
{
"type": "shoot-dns-service",
},
]
} : {},
gardener_dns_ssl_management ? {
"extensions": [
{
"type": "shoot-dns-service"
},
{
"type": "shoot-cert-service",
# and "providerConfig"
},
]
} : {},
),
})}