Skip to content

Commit

Permalink
feat(client-ec2): Introduced a new clientToken request parameter on C…
Browse files Browse the repository at this point in the history
…reateNetworkAcl and CreateRouteTable APIs. The clientToken parameter allows idempotent operations on the APIs.
  • Loading branch information
awstools committed Jan 24, 2024
1 parent e500830 commit 65a1927
Show file tree
Hide file tree
Showing 15 changed files with 120 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export interface CreateDefaultSubnetCommandOutput extends CreateDefaultSubnetRes
* // MapPublicIpOnLaunch: true || false,
* // MapCustomerOwnedIpOnLaunch: true || false,
* // CustomerOwnedIpv4Pool: "STRING_VALUE",
* // State: "pending" || "available",
* // State: "pending" || "available" || "unavailable",
* // SubnetId: "STRING_VALUE",
* // VpcId: "STRING_VALUE",
* // OwnerId: "STRING_VALUE",
Expand Down
2 changes: 2 additions & 0 deletions clients/client-ec2/src/commands/CreateNetworkAclCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface CreateNetworkAclCommandOutput extends CreateNetworkAclResult, _
* ],
* },
* ],
* ClientToken: "STRING_VALUE",
* };
* const command = new CreateNetworkAclCommand(input);
* const response = await client.send(command);
Expand Down Expand Up @@ -92,6 +93,7 @@ export interface CreateNetworkAclCommandOutput extends CreateNetworkAclResult, _
* // VpcId: "STRING_VALUE",
* // OwnerId: "STRING_VALUE",
* // },
* // ClientToken: "STRING_VALUE",
* // };
*
* ```
Expand Down
2 changes: 2 additions & 0 deletions clients/client-ec2/src/commands/CreateRouteTableCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface CreateRouteTableCommandOutput extends CreateRouteTableResult, _
* ],
* },
* ],
* ClientToken: "STRING_VALUE",
* };
* const command = new CreateRouteTableCommand(input);
* const response = await client.send(command);
Expand Down Expand Up @@ -104,6 +105,7 @@ export interface CreateRouteTableCommandOutput extends CreateRouteTableResult, _
* // VpcId: "STRING_VALUE",
* // OwnerId: "STRING_VALUE",
* // },
* // ClientToken: "STRING_VALUE",
* // };
*
* ```
Expand Down
2 changes: 1 addition & 1 deletion clients/client-ec2/src/commands/CreateSubnetCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export interface CreateSubnetCommandOutput extends CreateSubnetResult, __Metadat
* // MapPublicIpOnLaunch: true || false,
* // MapCustomerOwnedIpOnLaunch: true || false,
* // CustomerOwnedIpv4Pool: "STRING_VALUE",
* // State: "pending" || "available",
* // State: "pending" || "available" || "unavailable",
* // SubnetId: "STRING_VALUE",
* // VpcId: "STRING_VALUE",
* // OwnerId: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export interface DescribeAvailabilityZonesCommandOutput extends DescribeAvailabi
* // { // DescribeAvailabilityZonesResult
* // AvailabilityZones: [ // AvailabilityZoneList
* // { // AvailabilityZone
* // State: "available" || "information" || "impaired" || "unavailable",
* // State: "available" || "information" || "impaired" || "unavailable" || "constrained",
* // OptInStatus: "opt-in-not-required" || "opted-in" || "not-opted-in",
* // Messages: [ // AvailabilityZoneMessageList
* // { // AvailabilityZoneMessage
Expand Down
2 changes: 1 addition & 1 deletion clients/client-ec2/src/commands/DescribeSubnetsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export interface DescribeSubnetsCommandOutput extends DescribeSubnetsResult, __M
* // MapPublicIpOnLaunch: true || false,
* // MapCustomerOwnedIpOnLaunch: true || false,
* // CustomerOwnedIpv4Pool: "STRING_VALUE",
* // State: "pending" || "available",
* // State: "pending" || "available" || "unavailable",
* // SubnetId: "STRING_VALUE",
* // VpcId: "STRING_VALUE",
* // OwnerId: "STRING_VALUE",
Expand Down
20 changes: 16 additions & 4 deletions clients/client-ec2/src/models/models_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,7 @@ export interface PrivateDnsNameOptionsOnLaunch {
export const SubnetState = {
available: "available",
pending: "pending",
unavailable: "unavailable",
} as const;

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

Expand Down Expand Up @@ -9676,8 +9676,7 @@ export interface CreateNatGatewayRequest {
/**
* @public
* <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the
* request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">How to ensure
* idempotency</a>.</p>
* request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
* <p>Constraint: Maximum 64 ASCII characters.</p>
*/
ClientToken?: string;
Expand Down Expand Up @@ -9959,6 +9958,13 @@ export interface CreateNetworkAclRequest {
* <p>The tags to assign to the network ACL.</p>
*/
TagSpecifications?: TagSpecification[];

/**
* @public
* <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the
* request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
*/
ClientToken?: string;
}

/**
Expand Down Expand Up @@ -10128,6 +10134,12 @@ export interface CreateNetworkAclResult {
* <p>Information about the network ACL.</p>
*/
NetworkAcl?: NetworkAcl;

/**
* @public
* <p>Unique, case-sensitive identifier to ensure the idempotency of the request. Only returned if a client token was provided in the request.</p>
*/
ClientToken?: string;
}

/**
Expand Down
14 changes: 14 additions & 0 deletions clients/client-ec2/src/models/models_2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
VpcAttachment,
VpcPeeringConnection,
} from "./models_0";

import {
CarrierGateway,
ClientVpnEndpointStatus,
Expand Down Expand Up @@ -1121,6 +1122,13 @@ export interface CreateRouteTableRequest {
* <p>The tags to assign to the route table.</p>
*/
TagSpecifications?: TagSpecification[];

/**
* @public
* <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the
* request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
*/
ClientToken?: string;
}

/**
Expand Down Expand Up @@ -1381,6 +1389,12 @@ export interface CreateRouteTableResult {
* <p>Information about the route table.</p>
*/
RouteTable?: RouteTable;

/**
* @public
* <p>Unique, case-sensitive identifier to ensure the idempotency of the request. Only returned if a client token was provided in the request.</p>
*/
ClientToken?: string;
}

/**
Expand Down
3 changes: 3 additions & 0 deletions clients/client-ec2/src/models/models_3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
VerifiedAccessTrustProvider,
VerifiedAccessTrustProviderFilterSensitiveLog,
} from "./models_0";

import {
AttributeValue,
BlockDeviceMapping,
Expand Down Expand Up @@ -70,6 +71,7 @@ import {
TrafficType,
TransportProtocol,
} from "./models_1";

import {
FleetStateCode,
SubnetCidrReservation,
Expand Down Expand Up @@ -2453,6 +2455,7 @@ export type AvailabilityZoneOptInStatus =
*/
export const AvailabilityZoneState = {
available: "available",
constrained: "constrained",
impaired: "impaired",
information: "information",
unavailable: "unavailable",
Expand Down
3 changes: 3 additions & 0 deletions clients/client-ec2/src/models/models_4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
TagSpecification,
UserIdGroupPair,
} from "./models_0";

import {
AmdSevSnpSpecification,
AttributeValue,
Expand Down Expand Up @@ -68,6 +69,7 @@ import {
TargetCapacityUnitType,
Tenancy,
} from "./models_1";

import {
NetworkInterface,
NetworkInterfacePermission,
Expand All @@ -81,6 +83,7 @@ import {
SpotInstanceStateFault,
StorageTier,
} from "./models_2";

import {
ArchitectureValues,
BootModeValues,
Expand Down
4 changes: 4 additions & 0 deletions clients/client-ec2/src/models/models_5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ import {
VpcIpv6CidrBlockAssociation,
VpcPeeringConnection,
} from "./models_0";

import { DiskImageFormat, InstanceRequirementsRequest, IpamResourceTag, Subnet, VolumeType, Vpc } from "./models_1";

import {
ConnectionNotification,
DnsEntry,
Expand Down Expand Up @@ -61,6 +63,7 @@ import {
VpnConnectionFilterSensitiveLog,
VpnGateway,
} from "./models_2";

import {
ExportTaskS3Location,
FastLaunchLaunchTemplateSpecificationResponse,
Expand All @@ -76,6 +79,7 @@ import {
StatisticType,
VirtualizationType,
} from "./models_3";

import { ArchitectureType, AttributeBooleanValue } from "./models_4";

/**
Expand Down
5 changes: 5 additions & 0 deletions clients/client-ec2/src/models/models_6.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
VerifiedAccessTrustProvider,
VerifiedAccessTrustProviderFilterSensitiveLog,
} from "./models_0";

import {
AttributeValue,
BlockDeviceMapping,
Expand Down Expand Up @@ -73,6 +74,7 @@ import {
TargetCapacityUnitType,
VolumeType,
} from "./models_1";

import {
AutoAcceptSharedAttachmentsValue,
DefaultRouteTableAssociationValue,
Expand Down Expand Up @@ -107,6 +109,7 @@ import {
VpnEcmpSupportValue,
VpnTunnelLogOptionsSpecification,
} from "./models_2";

import {
ArchitectureValues,
BootModeValues,
Expand All @@ -127,6 +130,7 @@ import {
TpmSupportValues,
VirtualizationType,
} from "./models_3";

import {
AnalysisStatus,
ArchitectureType,
Expand All @@ -151,6 +155,7 @@ import {
SnapshotTaskDetail,
SnapshotTaskDetailFilterSensitiveLog,
} from "./models_4";

import {
InstanceFamilyCreditSpecification,
IpamComplianceStatus,
Expand Down
5 changes: 5 additions & 0 deletions clients/client-ec2/src/models/models_7.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
TransitGatewayVpcAttachment,
UnsuccessfulItem,
} from "./models_0";

import {
AmdSevSnpSpecification,
BlockDeviceMapping,
Expand All @@ -37,8 +38,11 @@ import {
ShutdownBehavior,
SpotInstanceType,
} from "./models_1";

import { SnapshotState, SSEType, TransitGatewayRoute } from "./models_2";

import { ClientVpnConnectionStatus, Filter } from "./models_3";

import {
HttpTokensState,
InstanceAttributeName,
Expand All @@ -58,6 +62,7 @@ import {
SpotInstanceRequestFilterSensitiveLog,
SpotPlacement,
} from "./models_4";

import {
CapacityReservationSpecification,
InstanceMonitoring,
Expand Down
18 changes: 18 additions & 0 deletions clients/client-ec2/src/protocols/Aws_ec2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42835,6 +42835,12 @@ const se_CreateNetworkAclRequest = (input: CreateNetworkAclRequest, context: __S
entries[loc] = value;
});
}
if (input[_CTl] === undefined) {
input[_CTl] = generateIdempotencyToken();
}
if (input[_CTl] != null) {
entries[_CTl] = input[_CTl];
}
return entries;
};

Expand Down Expand Up @@ -43317,6 +43323,12 @@ const se_CreateRouteTableRequest = (input: CreateRouteTableRequest, context: __S
entries[loc] = value;
});
}
if (input[_CTl] === undefined) {
input[_CTl] = generateIdempotencyToken();
}
if (input[_CTl] != null) {
entries[_CTl] = input[_CTl];
}
return entries;
};

Expand Down Expand Up @@ -71346,6 +71358,9 @@ const de_CreateNetworkAclResult = (output: any, context: __SerdeContext): Create
if (output[_nA] != null) {
contents[_NA] = de_NetworkAcl(output[_nA], context);
}
if (output[_cT] != null) {
contents[_CTl] = __expectString(output[_cT]);
}
return contents;
};

Expand Down Expand Up @@ -71487,6 +71502,9 @@ const de_CreateRouteTableResult = (output: any, context: __SerdeContext): Create
if (output[_rTo] != null) {
contents[_RTo] = de_RouteTable(output[_rTo], context);
}
if (output[_cT] != null) {
contents[_CTl] = __expectString(output[_cT]);
}
return contents;
};

Expand Down

0 comments on commit 65a1927

Please sign in to comment.