proud-waitress-79148
09/22/2025, 10:44 AM${substr(name,20)}${alphanum(4)}
.
Thanksstocky-restaurant-98004
09/22/2025, 4:12 PMproud-waitress-79148
09/22/2025, 6:40 PMstocky-restaurant-98004
09/22/2025, 7:14 PM${name(20)}-${alphanum(4)}
or maybe a couple of variants. If that works, let me know and I'll submit a PR so the docs shows this is actually supported, but not documented. If that does not work, submit a feature request in GH to pulumi/pulumi
.proud-waitress-79148
09/22/2025, 7:15 PMstocky-restaurant-98004
09/22/2025, 7:15 PMproud-waitress-79148
09/23/2025, 1:29 PMpulumi:autonaming:
value:
pattern: ${name}-${config.suffix}-${alphanum(1)}
providers:
azure-native:
resources:
"azure-native:storage:StorageAccount":
pattern: ${name}${alphanum(1)}
That works, however when the logical name is too long, it fails with:
error: azure-native:storage:StorageAccount resource 'storagetest12345678901234567890' has a problem: 'accountName' is too long (31): at most 24 characters allowed
And when I put the pattern:
"azure-native:storage:StorageAccount":
pattern: ${name(20)}${alphanum(1)}
I get the following:
error: azure-native:storage:StorageAccount resource 'storagetest12345678901234567890' has a problem: 'accountName' does not match expression '^[a-z0-9]+$'
Which showcases that the error does not include the autogenerated name, but rather the logical name (and I cannot access the autogenerated name to check what went wrong even in the debug). And also it makes me believe that the macro ${name(20)}
is resolved into name(20)
or something like that instead of returning the substring.stocky-restaurant-98004
09/23/2025, 11:53 PMstocky-restaurant-98004
09/23/2025, 11:53 PMproud-waitress-79148
09/24/2025, 9:49 AM