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