Skip to content

Commit

Permalink
feat(lb): add ec2 based links on ports
Browse files Browse the repository at this point in the history
- Adds support for link based ec2 instances on ports
  • Loading branch information
roleyfoley committed Nov 14, 2023
1 parent 7925ba4 commit 1926184
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions aws/components/lb/setup.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -1005,14 +1005,26 @@

[#case EC2_COMPONENT_TYPE]
[#list linkTargetResources["Zones"] as zone, resources ]
[#if getExistingReference(resources["ec2ENI"].Id, IP_ADDRESS_ATTRIBUTE_TYPE)?has_content ]
[#local staticTargets +=
getTargetGroupTarget(
"ip",
getExistingReference(resources["ec2ENI"].Id, IP_ADDRESS_ATTRIBUTE_TYPE),
destinationPort.Port,
false
)]
[#if solution.Forward.TargetType == "ip" ]
[#if getExistingReference(resources["ec2ENI"].Id, IP_ADDRESS_ATTRIBUTE_TYPE)?has_content ]
[#local staticTargets +=
getTargetGroupTarget(
"ip",
getExistingReference(resources["ec2ENI"].Id, IP_ADDRESS_ATTRIBUTE_TYPE),
destinationPort.Port,
false
)]
[/#if]
[#elseif solution.Forward.TargetType == "instance" ]
[#if getExistingReference(resources["ec2Instance"].Id)?has_content ]
[#local staticTargets +=
getTargetGroupTarget(
"instance",
getExistingReference(resources["ec2Instance"].Id),
destinationPort.Port,
false
)]
[/#if]
[/#if]
[/#list]
[#break]
Expand Down

0 comments on commit 1926184

Please sign in to comment.