aws_sdk_ec2/client/create_fleet.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3 /// Constructs a fluent builder for the [`CreateFleet`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder) operation.
4 ///
5 /// - The fluent builder is configurable:
6 /// - [`dry_run(bool)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::dry_run) / [`set_dry_run(Option<bool>)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::set_dry_run):<br>required: **false**<br><p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p><br>
7 /// - [`client_token(impl Into<String>)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::client_token) / [`set_client_token(Option<String>)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::set_client_token):<br>required: **false**<br><p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p><br>
8 /// - [`spot_options(SpotOptionsRequest)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::spot_options) / [`set_spot_options(Option<SpotOptionsRequest>)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::set_spot_options):<br>required: **false**<br><p>Describes the configuration of Spot Instances in an EC2 Fleet.</p><br>
9 /// - [`on_demand_options(OnDemandOptionsRequest)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::on_demand_options) / [`set_on_demand_options(Option<OnDemandOptionsRequest>)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::set_on_demand_options):<br>required: **false**<br><p>Describes the configuration of On-Demand Instances in an EC2 Fleet.</p><br>
10 /// - [`excess_capacity_termination_policy(FleetExcessCapacityTerminationPolicy)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::excess_capacity_termination_policy) / [`set_excess_capacity_termination_policy(Option<FleetExcessCapacityTerminationPolicy>)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::set_excess_capacity_termination_policy):<br>required: **false**<br><p>Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.</p> <p>Supported only for fleets of type <code>maintain</code>.</p><br>
11 /// - [`launch_template_configs(FleetLaunchTemplateConfigRequest)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::launch_template_configs) / [`set_launch_template_configs(Option<Vec::<FleetLaunchTemplateConfigRequest>>)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::set_launch_template_configs):<br>required: **true**<br><p>The configuration for the EC2 Fleet.</p><br>
12 /// - [`target_capacity_specification(TargetCapacitySpecificationRequest)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::target_capacity_specification) / [`set_target_capacity_specification(Option<TargetCapacitySpecificationRequest>)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::set_target_capacity_specification):<br>required: **true**<br><p>The number of units to request.</p><br>
13 /// - [`terminate_instances_with_expiration(bool)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::terminate_instances_with_expiration) / [`set_terminate_instances_with_expiration(Option<bool>)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::set_terminate_instances_with_expiration):<br>required: **false**<br><p>Indicates whether running instances should be terminated when the EC2 Fleet expires.</p><br>
14 /// - [`r#type(FleetType)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::type) / [`set_type(Option<FleetType>)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::set_type):<br>required: **false**<br><p>The fleet type. The default value is <code>maintain</code>.</p> <ul> <li> <p><code>maintain</code> - The EC2 Fleet places an asynchronous request for your desired capacity, and continues to maintain your desired Spot capacity by replenishing interrupted Spot Instances.</p></li> <li> <p><code>request</code> - The EC2 Fleet places an asynchronous one-time request for your desired capacity, but does submit Spot requests in alternative capacity pools if Spot capacity is unavailable, and does not maintain Spot capacity if Spot Instances are interrupted.</p></li> <li> <p><code>instant</code> - The EC2 Fleet places a synchronous one-time request for your desired capacity, and returns errors for any instances that could not be launched.</p></li> </ul> <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-request-type.html">EC2 Fleet request types</a> in the <i>Amazon EC2 User Guide</i>.</p><br>
15 /// - [`valid_from(DateTime)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::valid_from) / [`set_valid_from(Option<DateTime>)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::set_valid_from):<br>required: **false**<br><p>The start date and time of the request, in UTC format (for example, <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). The default is to start fulfilling the request immediately.</p><br>
16 /// - [`valid_until(DateTime)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::valid_until) / [`set_valid_until(Option<DateTime>)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::set_valid_until):<br>required: **false**<br><p>The end date and time of the request, in UTC format (for example, <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). At this point, no new EC2 Fleet requests are placed or able to fulfill the request. If no value is specified, the request remains until you cancel it.</p><br>
17 /// - [`replace_unhealthy_instances(bool)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::replace_unhealthy_instances) / [`set_replace_unhealthy_instances(Option<bool>)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::set_replace_unhealthy_instances):<br>required: **false**<br><p>Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported only for fleets of type <code>maintain</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#ec2-fleet-health-checks">EC2 Fleet health checks</a> in the <i>Amazon EC2 User Guide</i>.</p><br>
18 /// - [`tag_specifications(TagSpecification)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::tag_specifications) / [`set_tag_specifications(Option<Vec::<TagSpecification>>)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::set_tag_specifications):<br>required: **false**<br><p>The key-value pair for tagging the EC2 Fleet request on creation. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources">Tag your resources</a>.</p> <p>If the fleet type is <code>instant</code>, specify a resource type of <code>fleet</code> to tag the fleet or <code>instance</code> to tag the instances at launch.</p> <p>If the fleet type is <code>maintain</code> or <code>request</code>, specify a resource type of <code>fleet</code> to tag the fleet. You cannot specify a resource type of <code>instance</code>. To tag instances at launch, specify the tags in a <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template">launch template</a>.</p><br>
19 /// - [`context(impl Into<String>)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::context) / [`set_context(Option<String>)`](crate::operation::create_fleet::builders::CreateFleetFluentBuilder::set_context):<br>required: **false**<br><p>Reserved.</p><br>
20 /// - On success, responds with [`CreateFleetOutput`](crate::operation::create_fleet::CreateFleetOutput) with field(s):
21 /// - [`fleet_id(Option<String>)`](crate::operation::create_fleet::CreateFleetOutput::fleet_id): <p>The ID of the EC2 Fleet.</p>
22 /// - [`errors(Option<Vec::<CreateFleetError>>)`](crate::operation::create_fleet::CreateFleetOutput::errors): <p>Information about the instances that could not be launched by the fleet. Supported only for fleets of type <code>instant</code>.</p>
23 /// - [`instances(Option<Vec::<CreateFleetInstance>>)`](crate::operation::create_fleet::CreateFleetOutput::instances): <p>Information about the instances that were launched by the fleet. Supported only for fleets of type <code>instant</code>.</p>
24 /// - On failure, responds with [`SdkError<CreateFleetError>`](crate::operation::create_fleet::CreateFleetError)
25 pub fn create_fleet(&self) -> crate::operation::create_fleet::builders::CreateFleetFluentBuilder {
26 crate::operation::create_fleet::builders::CreateFleetFluentBuilder::new(self.handle.clone())
27 }
28}