Skip to content

Commit 61e9e39

Browse files
author
awstools
committed
feat(client-ec2): This release adds support to query the public key and creation date of EC2 Key Pairs. Additionally, the format (pem or ppk) of a key pair can be specified when creating a new key pair.
1 parent 87fd581 commit 61e9e39

15 files changed

+251
-155
lines changed

clients/client-ec2/src/EC2.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -5153,10 +5153,11 @@ export class EC2 extends EC2Client {
51535153
}
51545154

51555155
/**
5156-
* <p>Creates an ED25519 or 2048-bit RSA key pair with the specified name. Amazon EC2 stores the public
5157-
* key and displays the private key for you to save to a file. The private key is returned
5158-
* as an unencrypted PEM encoded PKCS#1 private key. If a key with the specified name
5159-
* already exists, Amazon EC2 returns an error.</p>
5156+
* <p>Creates an ED25519 or 2048-bit RSA key pair with the specified name and in the
5157+
* specified PEM or PPK format. Amazon EC2 stores the public key and displays the private
5158+
* key for you to save to a file. The private key is returned as an unencrypted PEM encoded
5159+
* PKCS#1 private key or an unencrypted PPK formatted private key for use with PuTTY. If a
5160+
* key with the specified name already exists, Amazon EC2 returns an error.</p>
51605161
* <p>The key pair returned to you is available only in the Amazon Web Services Region in which you create it.
51615162
* If you prefer, you can create your own key pair using a third-party tool and upload it
51625163
* to any Region using <a>ImportKeyPair</a>.</p>

clients/client-ec2/src/commands/CreateKeyPairCommand.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ export interface CreateKeyPairCommandInput extends CreateKeyPairRequest {}
1919
export interface CreateKeyPairCommandOutput extends KeyPair, __MetadataBearer {}
2020

2121
/**
22-
* <p>Creates an ED25519 or 2048-bit RSA key pair with the specified name. Amazon EC2 stores the public
23-
* key and displays the private key for you to save to a file. The private key is returned
24-
* as an unencrypted PEM encoded PKCS#1 private key. If a key with the specified name
25-
* already exists, Amazon EC2 returns an error.</p>
22+
* <p>Creates an ED25519 or 2048-bit RSA key pair with the specified name and in the
23+
* specified PEM or PPK format. Amazon EC2 stores the public key and displays the private
24+
* key for you to save to a file. The private key is returned as an unencrypted PEM encoded
25+
* PKCS#1 private key or an unencrypted PPK formatted private key for use with PuTTY. If a
26+
* key with the specified name already exists, Amazon EC2 returns an error.</p>
2627
* <p>The key pair returned to you is available only in the Amazon Web Services Region in which you create it.
2728
* If you prefer, you can create your own key pair using a third-party tool and upload it
2829
* to any Region using <a>ImportKeyPair</a>.</p>

clients/client-ec2/src/commands/CreateTransitGatewayConnectCommand.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ import {
1212
} from "@aws-sdk/types";
1313

1414
import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
15-
import { CreateTransitGatewayConnectRequest } from "../models/models_1";
16-
import { CreateTransitGatewayConnectResult } from "../models/models_2";
15+
import { CreateTransitGatewayConnectRequest, CreateTransitGatewayConnectResult } from "../models/models_2";
1716
import {
1817
deserializeAws_ec2CreateTransitGatewayConnectCommand,
1918
serializeAws_ec2CreateTransitGatewayConnectCommand,

clients/client-ec2/src/commands/DescribeCoipPoolsCommand.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ import {
1212
} from "@aws-sdk/types";
1313

1414
import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
15-
import { DescribeCoipPoolsRequest } from "../models/models_2";
16-
import { DescribeCoipPoolsResult } from "../models/models_3";
15+
import { DescribeCoipPoolsRequest, DescribeCoipPoolsResult } from "../models/models_3";
1716
import {
1817
deserializeAws_ec2DescribeCoipPoolsCommand,
1918
serializeAws_ec2DescribeCoipPoolsCommand,

clients/client-ec2/src/commands/DescribeRegionsCommand.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import {
1212
} from "@aws-sdk/types";
1313

1414
import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
15-
import { DescribeRegionsRequest, DescribeRegionsResult } from "../models/models_3";
15+
import { DescribeRegionsRequest } from "../models/models_3";
16+
import { DescribeRegionsResult } from "../models/models_4";
1617
import { deserializeAws_ec2DescribeRegionsCommand, serializeAws_ec2DescribeRegionsCommand } from "../protocols/Aws_ec2";
1718

1819
export interface DescribeRegionsCommandInput extends DescribeRegionsRequest {}

clients/client-ec2/src/commands/GetFlowLogsIntegrationTemplateCommand.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import {
1212
} from "@aws-sdk/types";
1313

1414
import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
15-
import { GetFlowLogsIntegrationTemplateRequest, GetFlowLogsIntegrationTemplateResult } from "../models/models_4";
15+
import { GetFlowLogsIntegrationTemplateRequest } from "../models/models_4";
16+
import { GetFlowLogsIntegrationTemplateResult } from "../models/models_5";
1617
import {
1718
deserializeAws_ec2GetFlowLogsIntegrationTemplateCommand,
1819
serializeAws_ec2GetFlowLogsIntegrationTemplateCommand,

clients/client-ec2/src/commands/RequestSpotInstancesCommand.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import {
1212
} from "@aws-sdk/types";
1313

1414
import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
15-
import { RequestSpotInstancesRequest, RequestSpotInstancesResult } from "../models/models_5";
15+
import { RequestSpotInstancesRequest } from "../models/models_5";
16+
import { RequestSpotInstancesResult } from "../models/models_6";
1617
import {
1718
deserializeAws_ec2RequestSpotInstancesCommand,
1819
serializeAws_ec2RequestSpotInstancesCommand,

clients/client-ec2/src/models/models_1.ts

+12-33
Original file line numberDiff line numberDiff line change
@@ -3437,6 +3437,11 @@ export namespace CreateIpamScopeResult {
34373437
});
34383438
}
34393439

3440+
export enum KeyFormat {
3441+
pem = "pem",
3442+
ppk = "ppk",
3443+
}
3444+
34403445
export enum KeyType {
34413446
ed25519 = "ed25519",
34423447
rsa = "rsa",
@@ -3467,6 +3472,13 @@ export interface CreateKeyPairRequest {
34673472
* <p>The tags to apply to the new key pair.</p>
34683473
*/
34693474
TagSpecifications?: TagSpecification[];
3475+
3476+
/**
3477+
* <p>The format of the key pair.</p>
3478+
* <p>Default: <code>pem</code>
3479+
* </p>
3480+
*/
3481+
KeyFormat?: KeyFormat | string;
34703482
}
34713483

34723484
export namespace CreateKeyPairRequest {
@@ -10319,36 +10331,3 @@ export namespace CreateTransitGatewayConnectRequestOptions {
1031910331
...obj,
1032010332
});
1032110333
}
10322-
10323-
export interface CreateTransitGatewayConnectRequest {
10324-
/**
10325-
* <p>The ID of the transit gateway attachment. You can specify a VPC attachment or Amazon Web Services Direct Connect attachment.</p>
10326-
*/
10327-
TransportTransitGatewayAttachmentId: string | undefined;
10328-
10329-
/**
10330-
* <p>The Connect attachment options.</p>
10331-
*/
10332-
Options: CreateTransitGatewayConnectRequestOptions | undefined;
10333-
10334-
/**
10335-
* <p>The tags to apply to the Connect attachment.</p>
10336-
*/
10337-
TagSpecifications?: TagSpecification[];
10338-
10339-
/**
10340-
* <p>Checks whether you have the required permissions for the action, without actually making the request,
10341-
* and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>.
10342-
* Otherwise, it is <code>UnauthorizedOperation</code>.</p>
10343-
*/
10344-
DryRun?: boolean;
10345-
}
10346-
10347-
export namespace CreateTransitGatewayConnectRequest {
10348-
/**
10349-
* @internal
10350-
*/
10351-
export const filterSensitiveLog = (obj: CreateTransitGatewayConnectRequest): any => ({
10352-
...obj,
10353-
});
10354-
}

clients/client-ec2/src/models/models_2.ts

+34-49
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import {
3737
VpcPeeringConnection,
3838
} from "./models_0";
3939
import {
40+
CreateTransitGatewayConnectRequestOptions,
4041
GroupIdentifier,
4142
Ipam,
4243
IpamPool,
@@ -51,6 +52,39 @@ import {
5152
VolumeType,
5253
} from "./models_1";
5354

55+
export interface CreateTransitGatewayConnectRequest {
56+
/**
57+
* <p>The ID of the transit gateway attachment. You can specify a VPC attachment or Amazon Web Services Direct Connect attachment.</p>
58+
*/
59+
TransportTransitGatewayAttachmentId: string | undefined;
60+
61+
/**
62+
* <p>The Connect attachment options.</p>
63+
*/
64+
Options: CreateTransitGatewayConnectRequestOptions | undefined;
65+
66+
/**
67+
* <p>The tags to apply to the Connect attachment.</p>
68+
*/
69+
TagSpecifications?: TagSpecification[];
70+
71+
/**
72+
* <p>Checks whether you have the required permissions for the action, without actually making the request,
73+
* and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>.
74+
* Otherwise, it is <code>UnauthorizedOperation</code>.</p>
75+
*/
76+
DryRun?: boolean;
77+
}
78+
79+
export namespace CreateTransitGatewayConnectRequest {
80+
/**
81+
* @internal
82+
*/
83+
export const filterSensitiveLog = (obj: CreateTransitGatewayConnectRequest): any => ({
84+
...obj,
85+
});
86+
}
87+
5488
/**
5589
* <p>Describes the Connect attachment options.</p>
5690
*/
@@ -8550,52 +8584,3 @@ export namespace DescribeClientVpnTargetNetworksResult {
85508584
...obj,
85518585
});
85528586
}
8553-
8554-
export interface DescribeCoipPoolsRequest {
8555-
/**
8556-
* <p>The IDs of the address pools.</p>
8557-
*/
8558-
PoolIds?: string[];
8559-
8560-
/**
8561-
* <p>One or more filters.</p>
8562-
* <ul>
8563-
* <li>
8564-
* <p>
8565-
* <code>coip-pool.local-gateway-route-table-id</code> - The ID of the local gateway route table.</p>
8566-
* </li>
8567-
* <li>
8568-
* <p>
8569-
* <code>coip-pool.pool-id</code> - The ID of the address pool.</p>
8570-
* </li>
8571-
* </ul>
8572-
*/
8573-
Filters?: Filter[];
8574-
8575-
/**
8576-
* <p>The maximum number of results to return with a single call.
8577-
* To retrieve the remaining results, make another call with the returned <code>nextToken</code> value.</p>
8578-
*/
8579-
MaxResults?: number;
8580-
8581-
/**
8582-
* <p>The token for the next page of results.</p>
8583-
*/
8584-
NextToken?: string;
8585-
8586-
/**
8587-
* <p>Checks whether you have the required permissions for the action, without actually making the request,
8588-
* and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>.
8589-
* Otherwise, it is <code>UnauthorizedOperation</code>.</p>
8590-
*/
8591-
DryRun?: boolean;
8592-
}
8593-
8594-
export namespace DescribeCoipPoolsRequest {
8595-
/**
8596-
* @internal
8597-
*/
8598-
export const filterSensitiveLog = (obj: DescribeCoipPoolsRequest): any => ({
8599-
...obj,
8600-
});
8601-
}

clients/client-ec2/src/models/models_3.ts

+71-16
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,55 @@ import {
7272
} from "./models_1";
7373
import { Filter, FleetStateCode, IdFormat, InstanceTagNotificationAttribute } from "./models_2";
7474

75+
export interface DescribeCoipPoolsRequest {
76+
/**
77+
* <p>The IDs of the address pools.</p>
78+
*/
79+
PoolIds?: string[];
80+
81+
/**
82+
* <p>One or more filters.</p>
83+
* <ul>
84+
* <li>
85+
* <p>
86+
* <code>coip-pool.local-gateway-route-table-id</code> - The ID of the local gateway route table.</p>
87+
* </li>
88+
* <li>
89+
* <p>
90+
* <code>coip-pool.pool-id</code> - The ID of the address pool.</p>
91+
* </li>
92+
* </ul>
93+
*/
94+
Filters?: Filter[];
95+
96+
/**
97+
* <p>The maximum number of results to return with a single call.
98+
* To retrieve the remaining results, make another call with the returned <code>nextToken</code> value.</p>
99+
*/
100+
MaxResults?: number;
101+
102+
/**
103+
* <p>The token for the next page of results.</p>
104+
*/
105+
NextToken?: string;
106+
107+
/**
108+
* <p>Checks whether you have the required permissions for the action, without actually making the request,
109+
* and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>.
110+
* Otherwise, it is <code>UnauthorizedOperation</code>.</p>
111+
*/
112+
DryRun?: boolean;
113+
}
114+
115+
export namespace DescribeCoipPoolsRequest {
116+
/**
117+
* @internal
118+
*/
119+
export const filterSensitiveLog = (obj: DescribeCoipPoolsRequest): any => ({
120+
...obj,
121+
});
122+
}
123+
75124
/**
76125
* <p>Describes a customer-owned address pool.</p>
77126
*/
@@ -8889,6 +8938,13 @@ export interface DescribeKeyPairsRequest {
88898938
* Otherwise, it is <code>UnauthorizedOperation</code>.</p>
88908939
*/
88918940
DryRun?: boolean;
8941+
8942+
/**
8943+
* <p>If <code>true</code>, the public key material is included in the response.</p>
8944+
* <p>Default: <code>false</code>
8945+
* </p>
8946+
*/
8947+
IncludePublicKey?: boolean;
88928948
}
88938949

88948950
export namespace DescribeKeyPairsRequest {
@@ -8947,6 +9003,21 @@ export interface KeyPairInfo {
89479003
* <p>Any tags applied to the key pair.</p>
89489004
*/
89499005
Tags?: Tag[];
9006+
9007+
/**
9008+
* <p>The public key material.</p>
9009+
*/
9010+
PublicKey?: string;
9011+
9012+
/**
9013+
* <p>If you used Amazon EC2 to create the key pair, this is the date and time when the key
9014+
* was created, in <a href="https://www.iso.org/iso-8601-date-and-time-format.html">ISO
9015+
* 8601 date-time format</a>, in the UTC time zone.</p>
9016+
* <p>If you imported an existing key pair to Amazon EC2, this is the date and time the key
9017+
* was imported, in <a href="https://www.iso.org/iso-8601-date-and-time-format.html">ISO
9018+
* 8601 date-time format</a>, in the UTC time zone.</p>
9019+
*/
9020+
CreateTime?: Date;
89509021
}
89519022

89529023
export namespace KeyPairInfo {
@@ -12057,19 +12128,3 @@ export namespace Region {
1205712128
...obj,
1205812129
});
1205912130
}
12060-
12061-
export interface DescribeRegionsResult {
12062-
/**
12063-
* <p>Information about the Regions.</p>
12064-
*/
12065-
Regions?: Region[];
12066-
}
12067-
12068-
export namespace DescribeRegionsResult {
12069-
/**
12070-
* @internal
12071-
*/
12072-
export const filterSensitiveLog = (obj: DescribeRegionsResult): any => ({
12073-
...obj,
12074-
});
12075-
}

0 commit comments

Comments
 (0)