Existing CloudFormation resources, when not given an explicit name, use the pattern {StackName}-{LogicalId}-{RandomSuffix}. This is useful as it helps users easily find resources corresponding to a given stack among many resources created by identical templates (e.g., they all have the same logical id but are in different stacks). The Java plugin provides a utility function, generateResourceIdentifier, that can take a logical id and create an identifier. However, it doesn't take stack name. The Python plugin should create a utility function that takes both stack name and logical id. Users could just pass in the logical id as {StackName}-{LogicalId}, but a) they may not think to do so, and b) this prevents the method from smartly trimming down these values in the face of length constraints, which CloudFormation usually does.
Would this go in resource.py or utils.py? We have an implementation in our CFN custom resource library that could be simplified and used here.
Existing CloudFormation resources, when not given an explicit name, use the pattern
{StackName}-{LogicalId}-{RandomSuffix}. This is useful as it helps users easily find resources corresponding to a given stack among many resources created by identical templates (e.g., they all have the same logical id but are in different stacks). The Java plugin provides a utility function,generateResourceIdentifier, that can take a logical id and create an identifier. However, it doesn't take stack name. The Python plugin should create a utility function that takes both stack name and logical id. Users could just pass in the logical id as{StackName}-{LogicalId}, but a) they may not think to do so, and b) this prevents the method from smartly trimming down these values in the face of length constraints, which CloudFormation usually does.Would this go in
resource.pyorutils.py? We have an implementation in our CFN custom resource library that could be simplified and used here.