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
+34
View File
@@ -94,6 +94,40 @@ describe('ec2Service.runInstance', () => {
})
})
describe('ec2Service.describeInstance', () => {
test('maps attached network interfaces and their addresses', async () => {
const service = createEc2Service(fakeClient({
DescribeInstancesCommand: {
Reservations: [{Instances: [{
InstanceId: 'i-networked',
NetworkInterfaces: [{
NetworkInterfaceId: 'eni-123',
Attachment: {DeviceIndex: 0},
Status: 'in-use',
PrivateIpAddress: '10.0.1.10',
Association: {PublicIp: '198.51.100.10'},
Groups: [{GroupId: 'sg-123', GroupName: 'web'}],
}],
}]}],
},
}))
const instance = await service.describeInstance('i-networked')
expect(instance.networkInterfaces).toEqual([{
networkInterfaceId: 'eni-123',
deviceIndex: 0,
status: 'in-use',
privateIpAddress: '10.0.1.10',
publicIpAddress: '198.51.100.10',
privateDnsName: undefined,
subnetId: undefined,
vpcId: undefined,
securityGroups: [{id: 'sg-123', name: 'web'}],
}])
})
})
describe('ec2Service lifecycle', () => {
test('startInstance sends StartInstancesCommand with correct id', async () => {
const sentCmds: unknown[] = []