Skip to content

Commit

Permalink
feat(client-ec2): This release adds support for adding an ElasticBloc…
Browse files Browse the repository at this point in the history
…kStorage volume configurations in ECS RunTask/StartTask/CreateService/UpdateService APIs. The configuration allows for attaching EBS volumes to ECS Tasks.
  • Loading branch information
awstools committed Jan 11, 2024
1 parent fbbd00f commit dd0cdf2
Show file tree
Hide file tree
Showing 16 changed files with 196 additions and 96 deletions.
2 changes: 2 additions & 0 deletions clients/client-ec2/src/commands/AttachVolumeCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export interface AttachVolumeCommandOutput extends VolumeAttachment, __MetadataB
* // State: "attaching" || "attached" || "detaching" || "detached" || "busy",
* // VolumeId: "STRING_VALUE",
* // DeleteOnTermination: true || false,
* // AssociatedResource: "STRING_VALUE",
* // InstanceOwningService: "STRING_VALUE",
* // };
*
* ```
Expand Down
2 changes: 2 additions & 0 deletions clients/client-ec2/src/commands/CreateVolumeCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ export interface CreateVolumeCommandOutput extends Volume, __MetadataBearer {}
* // State: "attaching" || "attached" || "detaching" || "detached" || "busy",
* // VolumeId: "STRING_VALUE",
* // DeleteOnTermination: true || false,
* // AssociatedResource: "STRING_VALUE",
* // InstanceOwningService: "STRING_VALUE",
* // },
* // ],
* // AvailabilityZone: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export interface DescribeInstanceAttributeCommandOutput extends InstanceAttribut
* // DeleteOnTermination: true || false,
* // Status: "attaching" || "attached" || "detaching" || "detached",
* // VolumeId: "STRING_VALUE",
* // AssociatedResource: "STRING_VALUE",
* // VolumeOwnerId: "STRING_VALUE",
* // },
* // },
* // ],
Expand Down
2 changes: 2 additions & 0 deletions clients/client-ec2/src/commands/DescribeInstancesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ export interface DescribeInstancesCommandOutput extends DescribeInstancesResult,
* // DeleteOnTermination: true || false,
* // Status: "attaching" || "attached" || "detaching" || "detached",
* // VolumeId: "STRING_VALUE",
* // AssociatedResource: "STRING_VALUE",
* // VolumeOwnerId: "STRING_VALUE",
* // },
* // },
* // ],
Expand Down
2 changes: 2 additions & 0 deletions clients/client-ec2/src/commands/DescribeVolumesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export interface DescribeVolumesCommandOutput extends DescribeVolumesResult, __M
* // State: "attaching" || "attached" || "detaching" || "detached" || "busy",
* // VolumeId: "STRING_VALUE",
* // DeleteOnTermination: true || false,
* // AssociatedResource: "STRING_VALUE",
* // InstanceOwningService: "STRING_VALUE",
* // },
* // ],
* // AvailabilityZone: "STRING_VALUE",
Expand Down
5 changes: 5 additions & 0 deletions clients/client-ec2/src/commands/DetachVolumeCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export interface DetachVolumeCommandOutput extends VolumeAttachment, __MetadataB
* first.</p>
* <p>When a volume with an Amazon Web Services Marketplace product code is detached from an instance, the
* product code is no longer associated with the instance.</p>
* <p>You can't detach or force detach volumes that are attached to Amazon ECS or
* Fargate tasks. Attempting to do this results in the <code>UnsupportedOperationException</code>
* exception with the <code>Unable to detach volume attached to ECS tasks</code> error message.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-detaching-volume.html">Detach an Amazon EBS volume</a> in the
* <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
* @example
Expand All @@ -62,6 +65,8 @@ export interface DetachVolumeCommandOutput extends VolumeAttachment, __MetadataB
* // State: "attaching" || "attached" || "detaching" || "detached" || "busy",
* // VolumeId: "STRING_VALUE",
* // DeleteOnTermination: true || false,
* // AssociatedResource: "STRING_VALUE",
* // InstanceOwningService: "STRING_VALUE",
* // };
*
* ```
Expand Down
2 changes: 2 additions & 0 deletions clients/client-ec2/src/commands/RunInstancesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,8 @@ export interface RunInstancesCommandOutput extends Reservation, __MetadataBearer
* // DeleteOnTermination: true || false,
* // Status: "attaching" || "attached" || "detaching" || "detached",
* // VolumeId: "STRING_VALUE",
* // AssociatedResource: "STRING_VALUE",
* // VolumeOwnerId: "STRING_VALUE",
* // },
* // },
* // ],
Expand Down
20 changes: 20 additions & 0 deletions clients/client-ec2/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6140,12 +6140,16 @@ export interface VolumeAttachment {
/**
* @public
* <p>The device name.</p>
* <p>If the volume is attached to a Fargate task, this parameter
* returns <code>null</code>.</p>
*/
Device?: string;

/**
* @public
* <p>The ID of the instance.</p>
* <p>If the volume is attached to a Fargate task, this parameter
* returns <code>null</code>.</p>
*/
InstanceId?: string;

Expand All @@ -6166,6 +6170,22 @@ export interface VolumeAttachment {
* <p>Indicates whether the EBS volume is deleted on instance termination.</p>
*/
DeleteOnTermination?: boolean;

/**
* @public
* <p>The ARN of the Amazon ECS or Fargate task
* to which the volume is attached.</p>
*/
AssociatedResource?: string;

/**
* @public
* <p>The service principal of Amazon Web Services service that owns the underlying
* instance to which the volume is attached.</p>
* <p>This parameter is returned only for volumes that are attached to
* Fargate tasks.</p>
*/
InstanceOwningService?: string;
}

/**
Expand Down
15 changes: 7 additions & 8 deletions clients/client-ec2/src/models/models_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2756,15 +2756,14 @@ export type TargetCapacityUnitType = (typeof TargetCapacityUnitType)[keyof typeo
* does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances
* in your request, EC2 Fleet will launch instances until it reaches the maximum amount that you're
* willing to pay. When the maximum amount you're willing to pay is reached, the fleet stops
* launching instances even if it hasnt met the target capacity. The
* launching instances even if it hasn't met the target capacity. The
* <code>MaxTotalPrice</code> parameters are located in <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_OnDemandOptionsRequest">OnDemandOptionsRequest</a>
* and <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SpotOptionsRequest">SpotOptionsRequest</a>.</p>
*/
export interface TargetCapacitySpecificationRequest {
/**
* @public
* <p>The number of units to request, filled using
* <code>DefaultTargetCapacityType</code>.</p>
* <p>The number of units to request, filled using the default target capacity type.</p>
*/
TotalTargetCapacity: number | undefined;

Expand All @@ -2782,15 +2781,15 @@ export interface TargetCapacitySpecificationRequest {

/**
* @public
* <p>The default <code>TotalTargetCapacity</code>, which is either <code>Spot</code> or
* <code>On-Demand</code>.</p>
* <p>The default target capacity type.</p>
*/
DefaultTargetCapacityType?: DefaultTargetCapacityType;

/**
* @public
* <p>The unit for the target capacity. <code>TargetCapacityUnitType</code> can only be specified when <code>InstanceRequirements</code> is specified.</p>
* <p>Default: <code>units</code> (translates to number of instances)</p>
* <p>The unit for the target capacity. You can specify this parameter only when using
* attributed-based instance type selection.</p>
* <p>Default: <code>units</code> (the number of instances)</p>
*/
TargetCapacityUnitType?: TargetCapacityUnitType;
}
Expand Down Expand Up @@ -9158,7 +9157,7 @@ export interface StateReason {
* <li>
* <p>
* <code>Client.InstanceInitiatedShutdown</code>: The instance was shut down
* using the <code>shutdown -h</code> command from the instance.</p>
* from the operating system of the instance.</p>
* </li>
* <li>
* <p>
Expand Down
18 changes: 9 additions & 9 deletions clients/client-ec2/src/models/models_3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2859,7 +2859,8 @@ export interface DescribeCapacityBlockOfferingsRequest {

/**
* @public
* <p>The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the returned <code>nextToken</code> value. This value can be between 5 and 500. If <code>maxResults</code> is given a larger value than 500, you receive an error.</p>
* <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information,
* see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
*/
MaxResults?: number;
}
Expand Down Expand Up @@ -2965,7 +2966,8 @@ export interface DescribeCapacityReservationFleetsRequest {

/**
* @public
* <p>The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the returned <code>nextToken</code> value. This value can be between 5 and 500. If <code>maxResults</code> is given a larger value than 500, you receive an error.</p>
* <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information,
* see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
*/
MaxResults?: number;

Expand Down Expand Up @@ -3190,7 +3192,8 @@ export interface DescribeCapacityReservationsRequest {

/**
* @public
* <p>The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the returned <code>nextToken</code> value. This value can be between 5 and 500. If <code>maxResults</code> is given a larger value than 500, you receive an error.</p>
* <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information,
* see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
*/
MaxResults?: number;

Expand Down Expand Up @@ -6596,8 +6599,7 @@ export interface SpotOptions {
export interface TargetCapacitySpecification {
/**
* @public
* <p>The number of units to request, filled using
* <code>DefaultTargetCapacityType</code>.</p>
* <p>The number of units to request, filled the default target capacity type.</p>
*/
TotalTargetCapacity?: number;

Expand All @@ -6615,15 +6617,13 @@ export interface TargetCapacitySpecification {

/**
* @public
* <p>The default <code>TotalTargetCapacity</code>, which is either <code>Spot</code> or
* <code>On-Demand</code>.</p>
* <p>The default target capacity type.</p>
*/
DefaultTargetCapacityType?: DefaultTargetCapacityType;

/**
* @public
* <p>The unit for the target capacity. <code>TargetCapacityUnitType</code> can only be specified when <code>InstanceRequirements</code> is specified.</p>
* <p>Default: <code>units</code> (translates to number of instances)</p>
* <p>The unit for the target capacity.</p>
*/
TargetCapacityUnitType?: TargetCapacityUnitType;
}
Expand Down
43 changes: 28 additions & 15 deletions clients/client-ec2/src/models/models_4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,21 @@ export interface EbsInstanceBlockDevice {
* <p>The ID of the EBS volume.</p>
*/
VolumeId?: string;

/**
* @public
* <p>The ARN of the Amazon ECS or Fargate task
* to which the volume is attached.</p>
*/
AssociatedResource?: string;

/**
* @public
* <p>The ID of the Amazon Web Services account that owns the volume.</p>
* <p>This parameter is returned only for volumes that are attached to
* Fargate tasks.</p>
*/
VolumeOwnerId?: string;
}

/**
Expand Down Expand Up @@ -1851,27 +1866,24 @@ export interface InstanceMetadataOptionsResponse {

/**
* @public
* <p>IMDSv2 uses token-backed sessions. Indicates whether the use of HTTP tokens is
* <code>optional</code> (in other words, indicates whether the use of IMDSv2 is
* <code>optional</code>) or <code>required</code> (in other words, indicates whether
* the use of IMDSv2 is <code>required</code>).</p>
* <p>Indicates whether IMDSv2 is required.</p>
* <ul>
* <li>
* <p>
* <code>optional</code> - When IMDSv2 is optional, you can choose to retrieve instance metadata with or without
* a session token in your request. If you retrieve the IAM role credentials
* without a token, the IMDSv1 role credentials are returned. If you retrieve the IAM role credentials
* using a valid session token, the IMDSv2 role credentials are returned.</p>
* <code>optional</code> - IMDSv2 is optional. You can choose whether to send a
* session token in your instance metadata retrieval requests. If you retrieve
* IAM role credentials without a session token, you receive the IMDSv1 role
* credentials. If you retrieve IAM role credentials using a valid session token,
* you receive the IMDSv2 role credentials.</p>
* </li>
* <li>
* <p>
* <code>required</code> - When IMDSv2 is required, you must send a session token
* with any instance metadata retrieval requests. In this state, retrieving the IAM role
* credentials always returns IMDSv2 credentials; IMDSv1 credentials are not available.</p>
* <code>required</code> - IMDSv2 is required. You must send a session token
* in your instance metadata retrieval requests. With this option, retrieving the
* IAM role credentials always returns IMDSv2 credentials; IMDSv1 credentials are
* not available.</p>
* </li>
* </ul>
* <p>Default: <code>optional</code>
* </p>
*/
HttpTokens?: HttpTokensState;

Expand Down Expand Up @@ -11699,8 +11711,9 @@ export interface SpotFleetRequestConfigData {

/**
* @public
* <p>The unit for the target capacity. <code>TargetCapacityUnitType</code> can only be specified when <code>InstanceRequirements</code> is specified.</p>
* <p>Default: <code>units</code> (translates to number of instances)</p>
* <p>The unit for the target capacity. You can specify this parameter only when
* using attribute-based instance type selection.</p>
* <p>Default: <code>units</code> (the number of instances)</p>
*/
TargetCapacityUnitType?: TargetCapacityUnitType;

Expand Down
9 changes: 6 additions & 3 deletions clients/client-ec2/src/models/models_5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6085,6 +6085,8 @@ export interface EnableSnapshotBlockPublicAccessRequest {
* available.</p>
* </li>
* </ul>
* <p>
* <code>unblocked</code> is not a valid value for <b>EnableSnapshotBlockPublicAccess</b>.</p>
*/
State: SnapshotBlockPublicAccessState | undefined;

Expand Down Expand Up @@ -6895,8 +6897,8 @@ export interface GetCapacityReservationUsageRequest {

/**
* @public
* <p>The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the returned <code>nextToken</code> value. This value can be between 5 and 500. If <code>maxResults</code> is given a larger value than 500, you receive an error.</p>
* <p>Valid range: Minimum value of 1. Maximum value of 1000.</p>
* <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information,
* see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
*/
MaxResults?: number;

Expand Down Expand Up @@ -7447,7 +7449,8 @@ export interface GetGroupsForCapacityReservationRequest {

/**
* @public
* <p>The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the returned <code>nextToken</code> value. This value can be between 5 and 500. If <code>maxResults</code> is given a larger value than 500, you receive an error.</p>
* <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information,
* see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
*/
MaxResults?: number;

Expand Down
29 changes: 14 additions & 15 deletions clients/client-ec2/src/models/models_6.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,6 @@ export interface GetSpotPlacementScoresRequest {
/**
* @public
* <p>The unit for the target capacity.</p>
* <p>Default: <code>units</code> (translates to number of instances)</p>
*/
TargetCapacityUnitType?: TargetCapacityUnitType;

Expand Down Expand Up @@ -4493,7 +4492,8 @@ export interface ModifyInstanceAttributeRequest {
* <p>Modifies the <code>DeleteOnTermination</code> attribute for volumes that are currently
* attached. The volume must be owned by the caller. If no value is specified for
* <code>DeleteOnTermination</code>, the default is <code>true</code> and the volume is
* deleted when the instance is terminated.</p>
* deleted when the instance is terminated. You can't modify the <code>DeleteOnTermination</code>
* attribute for volumes that are attached to Fargate tasks.</p>
* <p>To add instance store volumes to an Amazon EBS-backed instance, you must add them when
* you launch the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html#Using_OverridingAMIBDM">Update the block device mapping when launching an instance</a> in the
* <i>Amazon EC2 User Guide</i>.</p>
Expand Down Expand Up @@ -4996,27 +4996,26 @@ export interface ModifyInstanceMetadataOptionsRequest {

/**
* @public
* <p>IMDSv2 uses token-backed sessions. Set the use of HTTP tokens to <code>optional</code>
* (in other words, set the use of IMDSv2 to <code>optional</code>) or
* <code>required</code> (in other words, set the use of IMDSv2 to
* <code>required</code>).</p>
* <p>Indicates whether IMDSv2 is required.</p>
* <ul>
* <li>
* <p>
* <code>optional</code> - When IMDSv2 is optional, you can choose to retrieve instance metadata with or without
* a session token in your request. If you retrieve the IAM role credentials
* without a token, the IMDSv1 role credentials are returned. If you retrieve the IAM role credentials
* using a valid session token, the IMDSv2 role credentials are returned.</p>
* <code>optional</code> - IMDSv2 is optional. You can choose whether to send a
* session token in your instance metadata retrieval requests. If you retrieve
* IAM role credentials without a session token, you receive the IMDSv1 role
* credentials. If you retrieve IAM role credentials using a valid session token,
* you receive the IMDSv2 role credentials.</p>
* </li>
* <li>
* <p>
* <code>required</code> - When IMDSv2 is required, you must send a session token
* with any instance metadata retrieval requests. In this state, retrieving the IAM role
* credentials always returns IMDSv2 credentials; IMDSv1 credentials are not available.</p>
* <code>required</code> - IMDSv2 is required. You must send a session token
* in your instance metadata retrieval requests. With this option, retrieving the
* IAM role credentials always returns IMDSv2 credentials; IMDSv1 credentials are
* not available.</p>
* </li>
* </ul>
* <p>Default: <code>optional</code>
* </p>
* <p>Default: If the value of <code>ImdsSupport</code> for the Amazon Machine Image (AMI)
* for your instance is <code>v2.0</code>, the default is <code>required</code>.</p>
*/
HttpTokens?: HttpTokensState;

Expand Down
Loading

0 comments on commit dd0cdf2

Please sign in to comment.