aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.36k stars 3.77k forks source link

ec2.Instance provide static method like VPC fromLookup for `Instance` by tag or other filter #3911

Open stevensu1977 opened 4 years ago

stevensu1977 commented 4 years ago

:rocket: Feature Request

General Information

Description

Can we provide ec2.Instance static method fromLookup like ec2.VCP fromLookup ? I think it's very useful for quick get ec2 instance from exits ec2 instances.

Proposed Solution

Environment

Other information

nrahi commented 3 years ago

Its been almost a year... any chance this feature will added to the ec2 Instance?

okonon commented 3 years ago

Same here. I am running into this as well

alexander-zimmermann commented 2 years ago

+1

Dare2python commented 2 years ago

+1

cyommer commented 1 year ago

+1

rtaburceanu-gd commented 1 year ago

+1

github-actions[bot] commented 1 year ago

This issue has received a significant amount of attention so we are automatically upgrading its priority. A member of the community will see the re-prioritization and provide an update on the issue.

maggoun commented 1 year ago

We really need this man....in my CDK I need to target an existing EC2 instance in my targetgroup, is there a way to lookup the EC2 instance using the id or name?

aetos382 commented 1 year ago

@maggoun If you want to register instances whose IDs are known to target group, you can use the InstanceIdTarget.

vinsri-dev commented 8 months ago

Is this capability enabled in CDK?

my case ec2 is a bastion host and it is not a target instance to any LB.

please suggest

jkaeske commented 4 months ago

Any news on this?

dloez commented 2 months ago

+1