-
Notifications
You must be signed in to change notification settings - Fork 151
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
Use deployment_name in Random ID Resources #212
Comments
Yes, that's a good point. Will try to find a common regex and length restriction so that |
While it may not be the most elegant solution, consider a change like: resource "aws_lambda_function" "this" {
for_each = local.lambdas
function_name = random_id.function_name[each.key].hex to being: resource "aws_lambda_function" "this" {
for_each = local.lambdas
function_name = var.deployment_name ? "${var.deployment_name}_${each.key}" : random_id.function_name[each.key].hex or similar. Ignoring whether an underscore |
I originally introduced the random suffix for development, since I was too lazy to change the So I agree that in a production environment this leads to more confusion than it helps and the While its true that the AWS API will eventually produce an error message when it gets a name with wrong length / pattern, it could be confusing for the user where the error comes from. So we will remove the random appendix altogether in the next version. |
This has now been fixed in |
It would be nice if the resources that lean on a
random_id
included thedeployment_name
input in their prefix to make them more clearly identifiable. These would include, based on a search of what gets downloaded locally:They currently look some of them either do not consider
deployment_name
or take it but then hex-encode it in the output which makes tracing resources rough without having to fall all the way back to:for example to actually know which log group you should look at. This is compounded with multiple NextJS apps and environments in a single AWS account. Same thing for the Lambda functions themselves.
The text was updated successfully, but these errors were encountered: