awslabs / awslabs/diagram-as-code
Target resource is not drawn when related to resources in the same layer
- Dominant language
- Go
- Stars
- 1.6k
- Forks
- 101
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 2
Description
## Issue detail
Target resource is not drawn when related to resources in the same layer.
## Reproduce process
Subnets are same layer in this template.
In this case, the ELB is a child resource of the two subnets, and then it is not rendered.
### Yaml template
```
Resources:
VPC1:
Type: AWS::EC2::VPC
Properties:
CidrBlock: !Ref VPCCIDR
EnableDnsSupport: true
EnableDnsHostnames: true
Subnet1:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref VPC1
MapPublicIpOnLaunch: false
Subnet2:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref VPC1
MapPublicIpOnLaunch: false
NLB:
Type: AWS::ElasticLoadBalancingV2::LoadBalancer
Properties:
Scheme: "internal"
Subnets:
- !Ref Subnet1 ## <------- here
- !Ref Subnet2 ## <------- here
Type: network
```

Contributor guide
Research direction
Start by reproducing the issue with the YAML template in the report, focusing on the NLB's relationships to Subnet1 and Subnet2. Trace the resource relationship and rendering entry points that handle same-layer children; done means the NLB is drawn when it references both subnets.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100