aws / aws/aws-cdk

(aws-ec2): Feature request: please create a method to lookup a Transit Gateway given a filter.

Open
#16,873 5 comments 15 reactions 0 assignees View on GitHub
@aws-cdk/aws-ec2 effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Description

Please create a method to lookup a Transit Gateway given a filter.

### Use Case

I have a network architecture using a shared services network account. That network account has a Transit Gateway shared via Resource Access Manager.

I'm deploying an app into another account that uses the shared Transit Gateway. I want to create a VPC attachment to the Transit Gateway. I need the Transit Gateway ID to create the attachment.

There is no way to obtain the Transit Gateway ID with the CDK, I would have to use the SDK. https://stackoverflow.com/questions/69456504/how-do-i-obtain-the-properties-of-an-existing-transit-gateway-with-the-cdk/69473852#69473852

### Proposed Solution

```
const tgw = new CfnTransitGatway.lookup(this, 'TGW', {
tags: [{
name: "foo",
value: "bar"
}],
});

const tgwId = tgw.attrId;
```

### Other information

_No response_

### Acknowledge

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

Contributor guide

Open the contributing guide

Research direction

No files or tests are named in the issue. Start by locating the aws-ec2 CDK construct corresponding to a Transit Gateway and reviewing the proposed lookup shape and linked AWS SDK guidance. Done means a filter can identify a shared Transit Gateway and expose its ID for creating a VPC attachment, with appropriate test coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure, networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.