10/23/2022, 1:01 PM
I have a question about names and length of names. When set up an sample infrastructure with Pulumi CDK I got this error message when running `pulumi preview`:
  aws:lb:LoadBalancer (loadbalancedserviceLB1BE8EDCE):
    error: aws:lb/loadBalancer:LoadBalancer resource 'loadbalancedserviceLB1BE8EDCE' has a problem: "name" cannot be longer than 32 characters: "loadbalancedserviceLB1BE8EDCE-403d9b7". Examine values at 'LoadBalancer.Name'.
The corresponding code looks like this:
const lbservice = new ApplicationLoadBalancedFargateService(this, 'loadbalanced-service', {
  taskDefinition: taskdef,
  desiredCount: 2,
  serviceName: 'my-service',
  circuitBreaker: { rollback: true },
  publicLoadBalancer: true,
  listenerPort: webserverPort,
The name part is not an issue with regular AWS CDK, and Pulumi generates a different (shorter) name than AWS CDK, but still too short compared to name lengths allowed by CloudFormation, it seems. The question is really what to think and consider in terms of name issues here, what would be preferred approaches besides keeping construct id values short - and how many levels will this work out with?


11/11/2022, 7:38 AM
Sorry for delayed reply. I suspect that the issue is that we should be passing
through explicitly in the mapping linked below if provided (which it will always be I believe?) so that Pulumi doesn't apply it's own autonaming here. If you open an issue on this - we can look into whether that is indeed the right resolution.