Brackets are valid in Pulumi resource names, but auto-naming feeds the logical name straight into the physical name without sanitizing it against the resource's naming constraints.
Repro (aws 7.35.0):
import * as aws from "@pulumi/aws";
new aws.s3.Bucket("my-logs[0]", { forceDestroy: true });
error: sdk-v2/provider2.go:572: sdk.helper_schema: validating S3 Bucket (my-logs[0]-6c98083) name:
only alphanumeric characters, hyphens, periods, and underscores allowed in "my-logs[0]-6c98083"
Expected: the generated physical name is sanitized to the target resource's allowed charset (or at minimum the failure points at the logical name as the cause).
This surfaces naturally with runtime: hcl components, where a counted resource's address (logs[0]) becomes the Pulumi resource name — any name-validating resource under count without an explicit name fails to create.
Brackets are valid in Pulumi resource names, but auto-naming feeds the logical name straight into the physical name without sanitizing it against the resource's naming constraints.
Repro (aws 7.35.0):
Expected: the generated physical name is sanitized to the target resource's allowed charset (or at minimum the failure points at the logical name as the cause).
This surfaces naturally with
runtime: hclcomponents, where a counted resource's address (logs[0]) becomes the Pulumi resource name — any name-validating resource undercountwithout an explicit name fails to create.