awslabs / awslabs/diagram-as-code

Target resource is not drawn when related to resources in the same layer

Open
#73 1 comment 0 reactions 0 assignees View on GitHub
bug cfn-template feature improvement
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
```

![NLB](https://github.com/awslabs/diagram-as-code/assets/41433979/ad552bc0-dc53-4b6b-a523-da4047e9e349)

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.