-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle missing auto-naming constraints #1816
Comments
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). |
Added to epic https://github.com/pulumi/home/issues/2191 |
corymhall
added a commit
that referenced
this issue
Nov 14, 2024
Most resources have some limits on what the resource name can be. Unfortunately a lot of those limits are not currently stored in the CloudFormation schema. This PR introduces a new schema overlay where we can manually store min/max length constraints for resource names. This is the first step in addressing #1816. I will follow this up with another PR to trim names to fit within the constraints. re #1816, re pulumi/pulumi-cdk#62
Merged
corymhall
added a commit
that referenced
this issue
Nov 14, 2024
Most resources have some limits on what the resource name can be. Unfortunately a lot of those limits are not currently stored in the CloudFormation schema. This PR introduces a new schema overlay where we can manually store min/max length constraints for resource names. This is the first step in addressing #1816. I will follow this up with another PR to trim names to fit within the constraints. re #1816, re pulumi/pulumi-cdk#62
corymhall
added a commit
that referenced
this issue
Nov 14, 2024
This PR adds some new functionality to control the auto naming behavior. The new behavior lives behind a provider config variable and must be explicitly enabled by the user. The existing behavior will remain the default behavior of the provider. **What's new** - `autoTrim`: When this is set to true the provider will automatically trim the generated name to fit within the `maxLength` requirement. - `randomSuffixMinLength`: Set this to control the minimum length of the random suffix that is generated. This is especially useful in combination with `autoTrim` to ensure that you still end up with unique names (e.g. a random suffix of 1 character is not very unique) closes #1816, re pulumi/pulumi-cdk#62
flostadler
added a commit
to pulumi/pulumi-cdk
that referenced
this issue
Nov 15, 2024
This PR adds support for [CloudFormation Custom Resource](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html) to pulumi-cdk. It implements does so by using the `CustomResourceEmulator` resource from [aws-native](https://www.pulumi.com/registry/packages/aws-native/api-docs/cloudformation/customresourceemulator/). For the first implementation we decided to limit the scope to Lambda backed Custom Resources, because the SNS variants are not widely used. I'd recommend reviewing in this order: - `src/graph.ts`and `src/converters/app-converter.ts`. The changes in these files ensure that Custom Resources get correctly parsed and other resources can reference their attributes with the `GetAtt` intrinsic - `src/cfn-resource-mappings.ts`: This constructs the `CustomResourceEmulator` based on the CDK inputs while re-using the staging bucket to store the CustomResource responses. - unit & integration tests **Noteworthy**: I added a temporary workaround for shortening the resource names until pulumi/pulumi-aws-native#1816 is resolved. It can be toggled on by setting the `PULUMI_CDK_EXPERIMENTAL_MAX_NAME_LENGTH` env variable. Without this none of the CustomResources worked because they have deeply nested Lambdas and IAM roles. Those resources have a max name limit of 64. Closes #109 Closes #60
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
andiam.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
The text was updated successfully, but these errors were encountered: