Skip to content

Commit 65a1927

Browse files
author
awstools
committedJan 24, 2024
feat(client-ec2): Introduced a new clientToken request parameter on CreateNetworkAcl and CreateRouteTable APIs. The clientToken parameter allows idempotent operations on the APIs.
1 parent e500830 commit 65a1927

15 files changed

+120
-10
lines changed
 

‎clients/client-ec2/src/commands/CreateDefaultSubnetCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export interface CreateDefaultSubnetCommandOutput extends CreateDefaultSubnetRes
5656
* // MapPublicIpOnLaunch: true || false,
5757
* // MapCustomerOwnedIpOnLaunch: true || false,
5858
* // CustomerOwnedIpv4Pool: "STRING_VALUE",
59-
* // State: "pending" || "available",
59+
* // State: "pending" || "available" || "unavailable",
6060
* // SubnetId: "STRING_VALUE",
6161
* // VpcId: "STRING_VALUE",
6262
* // OwnerId: "STRING_VALUE",

‎clients/client-ec2/src/commands/CreateNetworkAclCommand.ts

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export interface CreateNetworkAclCommandOutput extends CreateNetworkAclResult, _
5151
* ],
5252
* },
5353
* ],
54+
* ClientToken: "STRING_VALUE",
5455
* };
5556
* const command = new CreateNetworkAclCommand(input);
5657
* const response = await client.send(command);
@@ -92,6 +93,7 @@ export interface CreateNetworkAclCommandOutput extends CreateNetworkAclResult, _
9293
* // VpcId: "STRING_VALUE",
9394
* // OwnerId: "STRING_VALUE",
9495
* // },
96+
* // ClientToken: "STRING_VALUE",
9597
* // };
9698
*
9799
* ```

‎clients/client-ec2/src/commands/CreateRouteTableCommand.ts

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export interface CreateRouteTableCommandOutput extends CreateRouteTableResult, _
5151
* ],
5252
* },
5353
* ],
54+
* ClientToken: "STRING_VALUE",
5455
* };
5556
* const command = new CreateRouteTableCommand(input);
5657
* const response = await client.send(command);
@@ -104,6 +105,7 @@ export interface CreateRouteTableCommandOutput extends CreateRouteTableResult, _
104105
* // VpcId: "STRING_VALUE",
105106
* // OwnerId: "STRING_VALUE",
106107
* // },
108+
* // ClientToken: "STRING_VALUE",
107109
* // };
108110
*
109111
* ```

‎clients/client-ec2/src/commands/CreateSubnetCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export interface CreateSubnetCommandOutput extends CreateSubnetResult, __Metadat
8989
* // MapPublicIpOnLaunch: true || false,
9090
* // MapCustomerOwnedIpOnLaunch: true || false,
9191
* // CustomerOwnedIpv4Pool: "STRING_VALUE",
92-
* // State: "pending" || "available",
92+
* // State: "pending" || "available" || "unavailable",
9393
* // SubnetId: "STRING_VALUE",
9494
* // VpcId: "STRING_VALUE",
9595
* // OwnerId: "STRING_VALUE",

‎clients/client-ec2/src/commands/DescribeAvailabilityZonesCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export interface DescribeAvailabilityZonesCommandOutput extends DescribeAvailabi
6363
* // { // DescribeAvailabilityZonesResult
6464
* // AvailabilityZones: [ // AvailabilityZoneList
6565
* // { // AvailabilityZone
66-
* // State: "available" || "information" || "impaired" || "unavailable",
66+
* // State: "available" || "information" || "impaired" || "unavailable" || "constrained",
6767
* // OptInStatus: "opt-in-not-required" || "opted-in" || "not-opted-in",
6868
* // Messages: [ // AvailabilityZoneMessageList
6969
* // { // AvailabilityZoneMessage

‎clients/client-ec2/src/commands/DescribeSubnetsCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export interface DescribeSubnetsCommandOutput extends DescribeSubnetsResult, __M
6868
* // MapPublicIpOnLaunch: true || false,
6969
* // MapCustomerOwnedIpOnLaunch: true || false,
7070
* // CustomerOwnedIpv4Pool: "STRING_VALUE",
71-
* // State: "pending" || "available",
71+
* // State: "pending" || "available" || "unavailable",
7272
* // SubnetId: "STRING_VALUE",
7373
* // VpcId: "STRING_VALUE",
7474
* // OwnerId: "STRING_VALUE",

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

+16-4
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,7 @@ export interface PrivateDnsNameOptionsOnLaunch {
10141014
export const SubnetState = {
10151015
available: "available",
10161016
pending: "pending",
1017+
unavailable: "unavailable",
10171018
} as const;
10181019

10191020
/**
@@ -1415,8 +1416,7 @@ export interface CreateEgressOnlyInternetGatewayRequest {
14151416
/**
14161417
* @public
14171418
* <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the
1418-
* request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html">How to ensure
1419-
* idempotency</a>.</p>
1419+
* request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
14201420
*/
14211421
ClientToken?: string;
14221422

@@ -9676,8 +9676,7 @@ export interface CreateNatGatewayRequest {
96769676
/**
96779677
* @public
96789678
* <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the
9679-
* request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">How to ensure
9680-
* idempotency</a>.</p>
9679+
* request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
96819680
* <p>Constraint: Maximum 64 ASCII characters.</p>
96829681
*/
96839682
ClientToken?: string;
@@ -9959,6 +9958,13 @@ export interface CreateNetworkAclRequest {
99599958
* <p>The tags to assign to the network ACL.</p>
99609959
*/
99619960
TagSpecifications?: TagSpecification[];
9961+
9962+
/**
9963+
* @public
9964+
* <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the
9965+
* request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
9966+
*/
9967+
ClientToken?: string;
99629968
}
99639969

99649970
/**
@@ -10128,6 +10134,12 @@ export interface CreateNetworkAclResult {
1012810134
* <p>Information about the network ACL.</p>
1012910135
*/
1013010136
NetworkAcl?: NetworkAcl;
10137+
10138+
/**
10139+
* @public
10140+
* <p>Unique, case-sensitive identifier to ensure the idempotency of the request. Only returned if a client token was provided in the request.</p>
10141+
*/
10142+
ClientToken?: string;
1013110143
}
1013210144

1013310145
/**

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

+14
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
VpcAttachment,
3131
VpcPeeringConnection,
3232
} from "./models_0";
33+
3334
import {
3435
CarrierGateway,
3536
ClientVpnEndpointStatus,
@@ -1121,6 +1122,13 @@ export interface CreateRouteTableRequest {
11211122
* <p>The tags to assign to the route table.</p>
11221123
*/
11231124
TagSpecifications?: TagSpecification[];
1125+
1126+
/**
1127+
* @public
1128+
* <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the
1129+
* request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
1130+
*/
1131+
ClientToken?: string;
11241132
}
11251133

11261134
/**
@@ -1381,6 +1389,12 @@ export interface CreateRouteTableResult {
13811389
* <p>Information about the route table.</p>
13821390
*/
13831391
RouteTable?: RouteTable;
1392+
1393+
/**
1394+
* @public
1395+
* <p>Unique, case-sensitive identifier to ensure the idempotency of the request. Only returned if a client token was provided in the request.</p>
1396+
*/
1397+
ClientToken?: string;
13841398
}
13851399

13861400
/**

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

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import {
3636
VerifiedAccessTrustProvider,
3737
VerifiedAccessTrustProviderFilterSensitiveLog,
3838
} from "./models_0";
39+
3940
import {
4041
AttributeValue,
4142
BlockDeviceMapping,
@@ -70,6 +71,7 @@ import {
7071
TrafficType,
7172
TransportProtocol,
7273
} from "./models_1";
74+
7375
import {
7476
FleetStateCode,
7577
SubnetCidrReservation,
@@ -2453,6 +2455,7 @@ export type AvailabilityZoneOptInStatus =
24532455
*/
24542456
export const AvailabilityZoneState = {
24552457
available: "available",
2458+
constrained: "constrained",
24562459
impaired: "impaired",
24572460
information: "information",
24582461
unavailable: "unavailable",

‎clients/client-ec2/src/models/models_4.ts

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
TagSpecification,
2525
UserIdGroupPair,
2626
} from "./models_0";
27+
2728
import {
2829
AmdSevSnpSpecification,
2930
AttributeValue,
@@ -68,6 +69,7 @@ import {
6869
TargetCapacityUnitType,
6970
Tenancy,
7071
} from "./models_1";
72+
7173
import {
7274
NetworkInterface,
7375
NetworkInterfacePermission,
@@ -81,6 +83,7 @@ import {
8183
SpotInstanceStateFault,
8284
StorageTier,
8385
} from "./models_2";
86+
8487
import {
8588
ArchitectureValues,
8689
BootModeValues,

‎clients/client-ec2/src/models/models_5.ts

+4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ import {
3131
VpcIpv6CidrBlockAssociation,
3232
VpcPeeringConnection,
3333
} from "./models_0";
34+
3435
import { DiskImageFormat, InstanceRequirementsRequest, IpamResourceTag, Subnet, VolumeType, Vpc } from "./models_1";
36+
3537
import {
3638
ConnectionNotification,
3739
DnsEntry,
@@ -61,6 +63,7 @@ import {
6163
VpnConnectionFilterSensitiveLog,
6264
VpnGateway,
6365
} from "./models_2";
66+
6467
import {
6568
ExportTaskS3Location,
6669
FastLaunchLaunchTemplateSpecificationResponse,
@@ -76,6 +79,7 @@ import {
7679
StatisticType,
7780
VirtualizationType,
7881
} from "./models_3";
82+
7983
import { ArchitectureType, AttributeBooleanValue } from "./models_4";
8084

8185
/**

‎clients/client-ec2/src/models/models_6.ts

+5
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import {
3737
VerifiedAccessTrustProvider,
3838
VerifiedAccessTrustProviderFilterSensitiveLog,
3939
} from "./models_0";
40+
4041
import {
4142
AttributeValue,
4243
BlockDeviceMapping,
@@ -73,6 +74,7 @@ import {
7374
TargetCapacityUnitType,
7475
VolumeType,
7576
} from "./models_1";
77+
7678
import {
7779
AutoAcceptSharedAttachmentsValue,
7880
DefaultRouteTableAssociationValue,
@@ -107,6 +109,7 @@ import {
107109
VpnEcmpSupportValue,
108110
VpnTunnelLogOptionsSpecification,
109111
} from "./models_2";
112+
110113
import {
111114
ArchitectureValues,
112115
BootModeValues,
@@ -127,6 +130,7 @@ import {
127130
TpmSupportValues,
128131
VirtualizationType,
129132
} from "./models_3";
133+
130134
import {
131135
AnalysisStatus,
132136
ArchitectureType,
@@ -151,6 +155,7 @@ import {
151155
SnapshotTaskDetail,
152156
SnapshotTaskDetailFilterSensitiveLog,
153157
} from "./models_4";
158+
154159
import {
155160
InstanceFamilyCreditSpecification,
156161
IpamComplianceStatus,

‎clients/client-ec2/src/models/models_7.ts

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
TransitGatewayVpcAttachment,
2121
UnsuccessfulItem,
2222
} from "./models_0";
23+
2324
import {
2425
AmdSevSnpSpecification,
2526
BlockDeviceMapping,
@@ -37,8 +38,11 @@ import {
3738
ShutdownBehavior,
3839
SpotInstanceType,
3940
} from "./models_1";
41+
4042
import { SnapshotState, SSEType, TransitGatewayRoute } from "./models_2";
43+
4144
import { ClientVpnConnectionStatus, Filter } from "./models_3";
45+
4246
import {
4347
HttpTokensState,
4448
InstanceAttributeName,
@@ -58,6 +62,7 @@ import {
5862
SpotInstanceRequestFilterSensitiveLog,
5963
SpotPlacement,
6064
} from "./models_4";
65+
6166
import {
6267
CapacityReservationSpecification,
6368
InstanceMonitoring,

‎clients/client-ec2/src/protocols/Aws_ec2.ts

+18
Original file line numberDiff line numberDiff line change
@@ -42835,6 +42835,12 @@ const se_CreateNetworkAclRequest = (input: CreateNetworkAclRequest, context: __S
4283542835
entries[loc] = value;
4283642836
});
4283742837
}
42838+
if (input[_CTl] === undefined) {
42839+
input[_CTl] = generateIdempotencyToken();
42840+
}
42841+
if (input[_CTl] != null) {
42842+
entries[_CTl] = input[_CTl];
42843+
}
4283842844
return entries;
4283942845
};
4284042846

@@ -43317,6 +43323,12 @@ const se_CreateRouteTableRequest = (input: CreateRouteTableRequest, context: __S
4331743323
entries[loc] = value;
4331843324
});
4331943325
}
43326+
if (input[_CTl] === undefined) {
43327+
input[_CTl] = generateIdempotencyToken();
43328+
}
43329+
if (input[_CTl] != null) {
43330+
entries[_CTl] = input[_CTl];
43331+
}
4332043332
return entries;
4332143333
};
4332243334

@@ -71346,6 +71358,9 @@ const de_CreateNetworkAclResult = (output: any, context: __SerdeContext): Create
7134671358
if (output[_nA] != null) {
7134771359
contents[_NA] = de_NetworkAcl(output[_nA], context);
7134871360
}
71361+
if (output[_cT] != null) {
71362+
contents[_CTl] = __expectString(output[_cT]);
71363+
}
7134971364
return contents;
7135071365
};
7135171366

@@ -71487,6 +71502,9 @@ const de_CreateRouteTableResult = (output: any, context: __SerdeContext): Create
7148771502
if (output[_rTo] != null) {
7148871503
contents[_RTo] = de_RouteTable(output[_rTo], context);
7148971504
}
71505+
if (output[_cT] != null) {
71506+
contents[_CTl] = __expectString(output[_cT]);
71507+
}
7149071508
return contents;
7149171509
};
7149271510

0 commit comments

Comments
 (0)
Please sign in to comment.