Skip to content

Auto-naming produces invalid physical names when the Pulumi resource name contains characters the resource rejects (e.g. brackets) #6550

Description

@iwahbe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions