-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(ec2): well-known port aliases #29793
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -188,6 +188,41 @@ export interface PortProps { | |
* Interface for classes that provide the connection-specification parts of a security group rule | ||
*/ | ||
export class Port { | ||
/** Well-known SSH port (TCP 22) */ | ||
public static readonly SSH = Port.tcp(22); | ||
/** Well-known SMTP port (TCP 25) */ | ||
public static readonly SMTP = Port.tcp(25); | ||
/** Well-known DNS port (UDP 53) */ | ||
public static readonly DNS_UDP = Port.udp(53); | ||
/** Well-known DNS port (TCP 53) */ | ||
public static readonly DNS_TCP = Port.tcp(53); | ||
/** Well-known HTTP port (TCP 80) */ | ||
public static readonly HTTP = Port.tcp(80); | ||
/** Well-known POP3 port (TCP 110) */ | ||
public static readonly POP3 = Port.tcp(110); | ||
/** Well-known IMAP port (TCP 143) */ | ||
public static readonly IMAP = Port.tcp(143); | ||
/** Well-known LDAP port (TCP 389) */ | ||
public static readonly LDAP = Port.tcp(389); | ||
/** Well-known HTTPS port (TCP 443) */ | ||
public static readonly HTTPS = Port.tcp(443); | ||
/** Well-known SMB port (TCP 445) */ | ||
public static readonly SMB = Port.tcp(445); | ||
/** Well-known IMAPS port (TCP 993) */ | ||
public static readonly IMAPS = Port.tcp(993); | ||
/** Well-known POP3S port (TCP 995) */ | ||
public static readonly POP3S = Port.tcp(995); | ||
/** Well-known Microsoft SQL Server port (TCP 1433) */ | ||
public static readonly MSSQL = Port.tcp(1433); | ||
/** Well-known NFS port (TCP 2049) */ | ||
public static readonly NFS = Port.tcp(2049); | ||
/** Well-known MySQL and Aurora port (TCP 3306) */ | ||
public static readonly MYSQL_AURORA = Port.tcp(3306); | ||
/** Well-known Microsoft Remote Desktop Protocol port (TCP 3389) */ | ||
public static readonly RDP = Port.tcp(3389); | ||
/** Well-known PostgreSQL port (TCP 5432) */ | ||
public static readonly POSTGRES = Port.tcp(5432); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let me know if you would like to add more, but I think we should stick to the officially IANA assigned port, even if the AWS web console lists additional ones |
||
|
||
/** | ||
* A single TCP port | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
only a nit: do we need "Well-known" in all these? Cleaner to just have
SSH port (TCP 22)
?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.
I like the explicit mention that this is not an arbitrary port and protocol assignment. It's not really needed but I don't feel like it's unwarranted. We could also mention that it comes from the IANA, either replacing or complementing the "well-known"
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.
I would have added these at the top of the class/enum JSDoc if they weren't declared alongside the rest of the
Port
class, but I don't think separating them is worth avoiding the repetition