This repository has been archived by the owner on Feb 5, 2024. It is now read-only.
fix: Change the app name of nodejs-graphql to comply TargetGroup name length limit #132
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
I cloned the
waypoint-examples
repo to test out various app deployments with Waypoint. I made no code change to any of the examples.I correctly initialized waypoint and installed the
docker
platform with the necessary-accept-tos
flag.Problem
When running
waypoint up
, I get the following error that stops the process:I created an issue describing the error in more detail: #131
My investigations on the source code of Waypoint show that we set the service name (aka TargetGroup name) as the app name, concatenated with an id, using the
-
symbol, as shown here:https://github.com/hashicorp/waypoint/blob/88abbbc33039d3ba82a49c5c759460c999c8370e/builtin/aws/lambda/platform.go#L547
Then on line 552, we only keep the first 32 characters because that's the limitation set by AWS for TargetGroup names.
That produced my issue because
waypoint-apollo-lambda-function-
is exactly 32 characters in length.Solution
By changing the app name from
waypoint-apollo-lambda-function
towaypoint-apollo-lambda-func
, I was able to create the TargetGroupwaypoint-apollo-lambda-func-01H7
, which is 32 characters in length.This is a reasonable solution because we keep the reference to the lambda function in our app name (using the
func
keyword) and don't introduce code changes in Waypoint to be more explicit on what's happening.--
Closes #131