feat: EC2 UI polished + storage persisting
This commit is contained in:
@@ -142,6 +142,8 @@ export type Ec2KeyPairMaterial = {
|
||||
keyMaterial: string
|
||||
}
|
||||
|
||||
export type Ec2KeyPairType = 'rsa' | 'ed25519'
|
||||
|
||||
export type Ec2Vpc = {
|
||||
vpcId: string
|
||||
cidrBlock: string
|
||||
@@ -588,8 +590,8 @@ export function createEc2Service(client: EC2Client = awsClients.ec2) {
|
||||
}
|
||||
},
|
||||
|
||||
async createKeyPair(name: string): Promise<Ec2KeyPairMaterial> {
|
||||
const res = await client.send(new CreateKeyPairCommand({KeyName: name}))
|
||||
async createKeyPair(name: string, keyType: Ec2KeyPairType = 'rsa'): Promise<Ec2KeyPairMaterial> {
|
||||
const res = await client.send(new CreateKeyPairCommand({KeyName: name, KeyType: keyType}))
|
||||
return {
|
||||
keyPairId: res.KeyPairId ?? '',
|
||||
keyName: res.KeyName ?? name,
|
||||
|
||||
Reference in New Issue
Block a user