-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Add Security Group lookup by name #4241
Comments
We will not be able to make a security group from a name. We might be able to look one up, given CLI support. |
I just want to be able to look up an existing SG by name. |
I have the same issue, I am trying to create an AWS Batch compute environment in an with existing subnets and security groups. I am able to find the private subnets by looking up the VPC by name, but I have no way of finding the ids of the existing security groups.
Attempting to use a security group name seems to provision fine until the compute environment tries to add instances to the cluster: |
is this feature available yet ? |
It would be useful to us too. We're trying to create Redshift cluster and having an option to do a lookup for existing Security Groups by name would be a grate help. |
nothing? Need to reference Security group per environment like I did with my existing VPC
Would be nice to do:
But now I have to write each environments ID into a env file or configuration, |
I would also like this too. I'm trying to deploy a Simple AD and some workspaces, I need to update the ingress rules on the worker sg created by the simple ad and the only way to know if (I think) is by the name it creates for it, directoryId_workspaceMembers. |
+1 |
+1, need this feature please |
+1 |
6 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+10 |
any process? |
+1 |
1 similar comment
+1 |
@NetaNir |
+12 |
+1 |
Given the attention this issue has received, I'm correctly labeling it as a p1, which means it should be on our near-term roadmap. We welcome community contributions! If you are able, we encourage you to contribute. If you decide to contribute, please start an engineering discussion in this issue to ensure there is a commonly understood design before submitting code. This will minimize the number of review cycles and get your code merged faster. Security group lookup by id was added in #11089, and would be a good inspiration for this work. |
I would suggest to extend the existing logic from PR #11089 and introduce the additional properties ec2 SecurityGroup
Create a new method public static fromLookupAttributes(scope: Construct, id: string, options: SecurityGroupLookupOptions) Move code from The interface will allow a security group name or id (if both or non of them are specified, it will throw an error). export interface SecurityGroupLookupOptions {
readonly securityGroupName?: string;
readonly securityGroupId?: string;
readonly vpc?: IVpc;
} Using this interface it is possible to extend the attributes later (e.g. lookup by tag).
SecurityGroupContextQuery SecurityGroupContextProviderPlugin @njlynch I would be happy to have your feedback. Enhancement to original version: |
Any update on this topic? |
Requesting this be looked at for my group too! |
I'll use this right away! any idea when it might go in? |
@jumic - Thanks for the proposed solution, and apologies for the delay in commenting. Everything you've described sounds good.
Note that per the documentation, it appears we'll need to use the I look forward to seeing the PR! |
Support looking up a security group by name. Currently, looking up a security group is only possible by ID. This PR enhances the existing implementation to support lookup by security group name. `securityGroupName` or `securityGroupId` can be passed to the new method `SecurityGroup.fromLookupAttributes`. In addition, property `vpc` provides the option to restrict the lookup method to a specific VPC. If no or more than one security group is found, an error is thrown. Closes #4241. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Support looking up a security group by name. Currently, looking up a security group is only possible by ID. This PR enhances the existing implementation to support lookup by security group name. `securityGroupName` or `securityGroupId` can be passed to the new method `SecurityGroup.fromLookupAttributes`. In addition, property `vpc` provides the option to restrict the lookup method to a specific VPC. If no or more than one security group is found, an error is thrown. Closes aws#4241. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Support looking up a security group by name. Currently, looking up a security group is only possible by ID. This PR enhances the existing implementation to support lookup by security group name. `securityGroupName` or `securityGroupId` can be passed to the new method `SecurityGroup.fromLookupAttributes`. In addition, property `vpc` provides the option to restrict the lookup method to a specific VPC. If no or more than one security group is found, an error is thrown. Closes aws#4241. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Similar to
SecurityGroup.fromSecurityGroupId()
, please add aSecurityGroup.fromSecurityGroupName
.Use Case
There are cases where existing SecurityGroups need to be referenced and have well-known names but not the ids. It would be nice to be able to look up SGs by name. Otherwise, a custom resource and/or SDK is needed to do the lookup.
Proposed Solution
Add a
SecurityGroup.fromSecurityGroupName
method.Other
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: