feat: fully functioning ALB

This commit is contained in:
Zakaria
2026-09-26 16:14:24 -04:00
parent 093afb9b2b
commit 8470b8d17a
44 changed files with 2076 additions and 132 deletions
+27
View File
@@ -77,6 +77,18 @@ export type Ec2SecurityGroupRef = {
name?: string
}
export type Ec2NetworkInterface = {
networkInterfaceId: string
deviceIndex?: number
status?: string
privateIpAddress?: string
publicIpAddress?: string
privateDnsName?: string
subnetId?: string
vpcId?: string
securityGroups: Ec2SecurityGroupRef[]
}
export type Ec2IpPermission = {
protocol: string
fromPort: number | null
@@ -126,6 +138,7 @@ export type Ec2Instance = {
architecture?: string
platform?: string
securityGroups: Ec2SecurityGroupRef[]
networkInterfaces: Ec2NetworkInterface[]
tags: Ec2Tag[]
}
@@ -306,6 +319,20 @@ function toEc2Instance(instance: Instance): Ec2Instance {
id: sg.GroupId,
name: sg.GroupName,
})),
networkInterfaces: (instance.NetworkInterfaces ?? []).map((networkInterface) => ({
networkInterfaceId: networkInterface.NetworkInterfaceId ?? '',
deviceIndex: networkInterface.Attachment?.DeviceIndex,
status: networkInterface.Status,
privateIpAddress: networkInterface.PrivateIpAddress,
publicIpAddress: networkInterface.Association?.PublicIp,
privateDnsName: networkInterface.PrivateDnsName,
subnetId: networkInterface.SubnetId,
vpcId: networkInterface.VpcId,
securityGroups: (networkInterface.Groups ?? []).map((group) => ({
id: group.GroupId,
name: group.GroupName,
})),
})),
tags,
}
}