-
Notifications
You must be signed in to change notification settings - Fork 391
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
fix(cli): add stricter validation to svc names #2016
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thank you so much for the quick turn around on this!
internal/pkg/cli/validate.go
Outdated
// s3 validation expressions. | ||
// s3RegExp matches alphanumeric, .- from 3 to 63 characters long. | ||
// s3DashesRegExp matches consecutive dashes or periods | ||
// s3TrailingDashRegExp matches a trailing dash | ||
// punctuationRegExp matches consecutive dashes or periods | ||
// trailingPunctRegExp matches a trailing dash | ||
// ipAddressRegExp checks for a bucket in the format of an IP address. | ||
// https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-s3-bucket-naming-requirements.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we have duplicated comments for explaining the same thing. Can we remove one of them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They look like they handle different things-- one is --
and the other is someName-
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's exactly right
Looks good, and yes-- speedy turnaround! |
@huanjani Yes; fixed in the latest push. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
<!-- Provide summary of changes --> As discussed in aws#2005, providing consecutive or trailing hyphens in the service or job name causes the ECR repository to fail to deploy. This is due to undocumented validation behavior in ECR, where trailing or consecutive punctuation characters are invalid names. Invalid service and job names will now fail at validation, not during a StackSet update, avoiding a problem where the StackSet became unmanageable by Copilot. <!-- Issue number, if available. E.g. "Fixes aws#31", "Addresses aws#42, 77" --> By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
As discussed in #2005, providing consecutive or trailing hyphens in the service or job name causes the ECR repository to fail to deploy. This is due to undocumented validation behavior in ECR, where trailing or consecutive punctuation characters are invalid names.
Invalid service and job names will now fail at validation, not during a StackSet update, avoiding a problem where the StackSet became unmanageable by Copilot.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.