feat: fully functioning ALB
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user