pulumi / pulumi-aws-native

AWS Native Provider for Pulumi
Apache License 2.0
95 stars 17 forks source link

Handle missing auto-naming constraints #1816

Closed flostadler closed 4 days ago

flostadler commented 1 week ago

Hello!

Issue details

The CloudFormation schema provided by AWS, which we use to generate the AWS Native provider metadata, lacks resource name length constraints for many AWS services. This is particularly problematic for resources like lambda.Function and iam.Role where AWS enforces strict length limitations (e.g., 64 characters for Lambda Role names) at the API level.

When users rely on the provider's auto-naming feature, deployments can fail unexpectedly because the provider isn't aware of these AWS-imposed limits. Since these constraints aren't present in the CloudFormation schema, the provider cannot validate or handle resource names appropriately before deployment.

Proposal

Enhance provider metadata with length constraints for common AWS resources:

Considerations:

Affected area/feature

flostadler commented 1 week ago

This affects pulumi-cdk more regularly because the logical resource names are assembled based on the component hierarchy. Nested components more easily hit those shorter limits like 58 character for Lambda functions (64 characters - 8 for random suffix).

cleverguy25 commented 1 week ago

Added to epic https://github.com/pulumi/home/issues/2191