CfnEC2Fleet

class aws_cdk.aws_ec2.CfnEC2Fleet(scope, id, *, launch_template_configs, target_capacity_specification, context=None, excess_capacity_termination_policy=None, on_demand_options=None, replace_unhealthy_instances=None, spot_options=None, tag_specifications=None, terminate_instances_with_expiration=None, type=None, valid_from=None, valid_until=None)

Bases: CfnResource

Specifies the configuration information to launch a fleet–or group–of instances.

An EC2 Fleet can launch multiple instance types across multiple Availability Zones, using the On-Demand Instance, Reserved Instance, and Spot Instance purchasing models together. Using EC2 Fleet, you can define separate On-Demand and Spot capacity targets, specify the instance types that work best for your applications, and specify how Amazon EC2 should distribute your fleet capacity within each purchasing model. For more information, see Launching an EC2 Fleet in the Amazon EC2 User Guide for Linux Instances .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-ec2fleet.html

CloudformationResource:

AWS::EC2::EC2Fleet

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

cfn_eC2_fleet = ec2.CfnEC2Fleet(self, "MyCfnEC2Fleet",
    launch_template_configs=[ec2.CfnEC2Fleet.FleetLaunchTemplateConfigRequestProperty(
        launch_template_specification=ec2.CfnEC2Fleet.FleetLaunchTemplateSpecificationRequestProperty(
            version="version",

            # the properties below are optional
            launch_template_id="launchTemplateId",
            launch_template_name="launchTemplateName"
        ),
        overrides=[ec2.CfnEC2Fleet.FleetLaunchTemplateOverridesRequestProperty(
            availability_zone="availabilityZone",
            instance_requirements=ec2.CfnEC2Fleet.InstanceRequirementsRequestProperty(
                accelerator_count=ec2.CfnEC2Fleet.AcceleratorCountRequestProperty(
                    max=123,
                    min=123
                ),
                accelerator_manufacturers=["acceleratorManufacturers"],
                accelerator_names=["acceleratorNames"],
                accelerator_total_memory_mi_b=ec2.CfnEC2Fleet.AcceleratorTotalMemoryMiBRequestProperty(
                    max=123,
                    min=123
                ),
                accelerator_types=["acceleratorTypes"],
                allowed_instance_types=["allowedInstanceTypes"],
                bare_metal="bareMetal",
                baseline_ebs_bandwidth_mbps=ec2.CfnEC2Fleet.BaselineEbsBandwidthMbpsRequestProperty(
                    max=123,
                    min=123
                ),
                burstable_performance="burstablePerformance",
                cpu_manufacturers=["cpuManufacturers"],
                excluded_instance_types=["excludedInstanceTypes"],
                instance_generations=["instanceGenerations"],
                local_storage="localStorage",
                local_storage_types=["localStorageTypes"],
                max_spot_price_as_percentage_of_optimal_on_demand_price=123,
                memory_gi_bPer_vCpu=ec2.CfnEC2Fleet.MemoryGiBPerVCpuRequestProperty(
                    max=123,
                    min=123
                ),
                memory_mi_b=ec2.CfnEC2Fleet.MemoryMiBRequestProperty(
                    max=123,
                    min=123
                ),
                network_bandwidth_gbps=ec2.CfnEC2Fleet.NetworkBandwidthGbpsRequestProperty(
                    max=123,
                    min=123
                ),
                network_interface_count=ec2.CfnEC2Fleet.NetworkInterfaceCountRequestProperty(
                    max=123,
                    min=123
                ),
                on_demand_max_price_percentage_over_lowest_price=123,
                require_hibernate_support=False,
                spot_max_price_percentage_over_lowest_price=123,
                total_local_storage_gb=ec2.CfnEC2Fleet.TotalLocalStorageGBRequestProperty(
                    max=123,
                    min=123
                ),
                v_cpu_count=ec2.CfnEC2Fleet.VCpuCountRangeRequestProperty(
                    max=123,
                    min=123
                )
            ),
            instance_type="instanceType",
            max_price="maxPrice",
            placement=ec2.CfnEC2Fleet.PlacementProperty(
                affinity="affinity",
                availability_zone="availabilityZone",
                group_name="groupName",
                host_id="hostId",
                host_resource_group_arn="hostResourceGroupArn",
                partition_number=123,
                spread_domain="spreadDomain",
                tenancy="tenancy"
            ),
            priority=123,
            subnet_id="subnetId",
            weighted_capacity=123
        )]
    )],
    target_capacity_specification=ec2.CfnEC2Fleet.TargetCapacitySpecificationRequestProperty(
        total_target_capacity=123,

        # the properties below are optional
        default_target_capacity_type="defaultTargetCapacityType",
        on_demand_target_capacity=123,
        spot_target_capacity=123,
        target_capacity_unit_type="targetCapacityUnitType"
    ),

    # the properties below are optional
    context="context",
    excess_capacity_termination_policy="excessCapacityTerminationPolicy",
    on_demand_options=ec2.CfnEC2Fleet.OnDemandOptionsRequestProperty(
        allocation_strategy="allocationStrategy",
        capacity_reservation_options=ec2.CfnEC2Fleet.CapacityReservationOptionsRequestProperty(
            usage_strategy="usageStrategy"
        ),
        max_total_price="maxTotalPrice",
        min_target_capacity=123,
        single_availability_zone=False,
        single_instance_type=False
    ),
    replace_unhealthy_instances=False,
    spot_options=ec2.CfnEC2Fleet.SpotOptionsRequestProperty(
        allocation_strategy="allocationStrategy",
        instance_interruption_behavior="instanceInterruptionBehavior",
        instance_pools_to_use_count=123,
        maintenance_strategies=ec2.CfnEC2Fleet.MaintenanceStrategiesProperty(
            capacity_rebalance=ec2.CfnEC2Fleet.CapacityRebalanceProperty(
                replacement_strategy="replacementStrategy",
                termination_delay=123
            )
        ),
        max_total_price="maxTotalPrice",
        min_target_capacity=123,
        single_availability_zone=False,
        single_instance_type=False
    ),
    tag_specifications=[ec2.CfnEC2Fleet.TagSpecificationProperty(
        resource_type="resourceType",
        tags=[CfnTag(
            key="key",
            value="value"
        )]
    )],
    terminate_instances_with_expiration=False,
    type="type",
    valid_from="validFrom",
    valid_until="validUntil"
)
Parameters:
  • scope (Construct) – Scope in which this resource is defined.

  • id (str) – Construct identifier for this resource (unique in its scope).

  • launch_template_configs (Union[IResolvable, Sequence[Union[IResolvable, FleetLaunchTemplateConfigRequestProperty, Dict[str, Any]]]]) – The configuration for the EC2 Fleet.

  • target_capacity_specification (Union[IResolvable, TargetCapacitySpecificationRequestProperty, Dict[str, Any]]) – The number of units to request.

  • context (Optional[str]) – Reserved.

  • excess_capacity_termination_policy (Optional[str]) – 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. Supported only for fleets of type maintain .

  • on_demand_options (Union[IResolvable, OnDemandOptionsRequestProperty, Dict[str, Any], None]) – Describes the configuration of On-Demand Instances in an EC2 Fleet.

  • replace_unhealthy_instances (Union[bool, IResolvable, None]) – Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported only for fleets of type maintain . For more information, see EC2 Fleet health checks in the Amazon EC2 User Guide .

  • spot_options (Union[IResolvable, SpotOptionsRequestProperty, Dict[str, Any], None]) – Describes the configuration of Spot Instances in an EC2 Fleet.

  • tag_specifications (Union[IResolvable, Sequence[Union[IResolvable, TagSpecificationProperty, Dict[str, Any]]], None]) – The key-value pair for tagging the EC2 Fleet request on creation. For more information, see Tag your resources . If the fleet type is instant , specify a resource type of fleet to tag the fleet or instance to tag the instances at launch. If the fleet type is maintain or request , specify a resource type of fleet to tag the fleet. You cannot specify a resource type of instance . To tag instances at launch, specify the tags in a launch template .

  • terminate_instances_with_expiration (Union[bool, IResolvable, None]) – Indicates whether running instances should be terminated when the EC2 Fleet expires.

  • type (Optional[str]) – The fleet type. The default value is maintain . - maintain - The EC2 Fleet places an asynchronous request for your desired capacity, and continues to maintain your desired Spot capacity by replenishing interrupted Spot Instances. - request - 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. - instant - The EC2 Fleet places a synchronous one-time request for your desired capacity, and returns errors for any instances that could not be launched. For more information, see EC2 Fleet request types in the Amazon EC2 User Guide .

  • valid_from (Optional[str]) – The start date and time of the request, in UTC format (for example, YYYY - MM - DD T HH : MM : SS Z). The default is to start fulfilling the request immediately.

  • valid_until (Optional[str]) – The end date and time of the request, in UTC format (for example, YYYY - MM - DD T HH : MM : SS 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.

Methods

add_deletion_override(path)

Syntactic sugar for addOverride(path, undefined).

Parameters:

path (str) – The path of the value to delete.

Return type:

None

add_dependency(target)

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

Parameters:

target (CfnResource) –

Return type:

None

add_depends_on(target)

(deprecated) Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

Parameters:

target (CfnResource) –

Deprecated:

use addDependency

Stability:

deprecated

Return type:

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters:
  • key (str) –

  • value (Any) –

See:

Return type:

None

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

add_override(path, value)

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with “Properties.” (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example:

cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")

would add the overrides Example:

"Properties": {
  "GlobalSecondaryIndexes": [
    {
      "Projection": {
        "NonKeyAttributes": [ "myattribute" ]
        ...
      }
      ...
    },
    {
      "ProjectionType": "INCLUDE"
      ...
    },
  ]
  ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters:
  • path (str) –

    • The path of the property, you can use dot notation to override values in complex types. Any intermediate keys will be created as needed.

  • value (Any) –

    • The value. Could be primitive or complex.

Return type:

None

add_property_deletion_override(property_path)

Adds an override that deletes the value of a property from the resource definition.

Parameters:

property_path (str) – The path to the property.

Return type:

None

add_property_override(property_path, value)

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

Parameters:
  • property_path (str) – The path of the property.

  • value (Any) – The value.

Return type:

None

apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:

Parameters:
  • policy (Optional[RemovalPolicy]) –

  • apply_to_update_replace_policy (Optional[bool]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: true

  • default (Optional[RemovalPolicy]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resource, please consult that specific resource’s documentation.

See:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options

Return type:

None

get_att(attribute_name, type_hint=None)

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

Parameters:
  • attribute_name (str) – The name of the attribute.

  • type_hint (Optional[ResolutionTypeHint]) –

Return type:

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters:

key (str) –

See:

Return type:

Any

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters:

inspector (TreeInspector) – tree inspector to collect and process attributes.

Return type:

None

obtain_dependencies()

Retrieves an array of resources this resource depends on.

This assembles dependencies on resources across stacks (including nested stacks) automatically.

Return type:

List[Union[Stack, CfnResource]]

obtain_resource_dependencies()

Get a shallow copy of dependencies between this resource and other resources in the same stack.

Return type:

List[CfnResource]

override_logical_id(new_logical_id)

Overrides the auto-generated logical ID with a specific ID.

Parameters:

new_logical_id (str) – The new logical ID to use for this stack element.

Return type:

None

remove_dependency(target)

Indicates that this resource no longer depends on another resource.

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

Parameters:

target (CfnResource) –

Return type:

None

replace_dependency(target, new_target)

Replaces one dependency with another.

Parameters:
Return type:

None

to_string()

Returns a string representation of this construct.

Return type:

str

Returns:

a string representation of this resource

Attributes

CFN_RESOURCE_TYPE_NAME = 'AWS::EC2::EC2Fleet'
attr_fleet_id

The ID of the EC2 Fleet.

CloudformationAttribute:

FleetId

cfn_options

Options for this resource, such as condition, update policy etc.

cfn_resource_type

AWS resource type.

context

Reserved.

creation_stack

return:

the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.

excess_capacity_termination_policy

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.

launch_template_configs

The configuration for the EC2 Fleet.

logical_id

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Returns:

the logical ID as a stringified token. This value will only get resolved during synthesis.

node

The tree node.

on_demand_options

Describes the configuration of On-Demand Instances in an EC2 Fleet.

ref

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

replace_unhealthy_instances

Indicates whether EC2 Fleet should replace unhealthy Spot Instances.

spot_options

Describes the configuration of Spot Instances in an EC2 Fleet.

stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

tag_specifications

The key-value pair for tagging the EC2 Fleet request on creation.

For more information, see Tag your resources .

target_capacity_specification

The number of units to request.

terminate_instances_with_expiration

Indicates whether running instances should be terminated when the EC2 Fleet expires.

type

The fleet type.

The default value is maintain .

valid_from

SS Z).

Type:

The start date and time of the request, in UTC format (for example, YYYY - MM - DD T HH

Type:

MM

valid_until

SS Z).

Type:

The end date and time of the request, in UTC format (for example, YYYY - MM - DD T HH

Type:

MM

Static Methods

classmethod is_cfn_element(x)

Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

Parameters:

x (Any) –

Return type:

bool

Returns:

The construct as a stack element or undefined if it is not a stack element.

classmethod is_cfn_resource(x)

Check whether the given object is a CfnResource.

Parameters:

x (Any) –

Return type:

bool

classmethod is_construct(x)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Construct.

AcceleratorCountRequestProperty

class CfnEC2Fleet.AcceleratorCountRequestProperty(*, max=None, min=None)

Bases: object

The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) on an instance.

To exclude accelerator-enabled instance types, set Max to 0 .

Parameters:
  • max (Union[int, float, None]) – The maximum number of accelerators. To specify no maximum limit, omit this parameter. To exclude accelerator-enabled instance types, set Max to 0 .

  • min (Union[int, float, None]) – The minimum number of accelerators. To specify no minimum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-acceleratorcountrequest.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

accelerator_count_request_property = ec2.CfnEC2Fleet.AcceleratorCountRequestProperty(
    max=123,
    min=123
)

Attributes

max

The maximum number of accelerators.

To specify no maximum limit, omit this parameter. To exclude accelerator-enabled instance types, set Max to 0 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-acceleratorcountrequest.html#cfn-ec2-ec2fleet-acceleratorcountrequest-max

min

The minimum number of accelerators.

To specify no minimum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-acceleratorcountrequest.html#cfn-ec2-ec2fleet-acceleratorcountrequest-min

AcceleratorTotalMemoryMiBRequestProperty

class CfnEC2Fleet.AcceleratorTotalMemoryMiBRequestProperty(*, max=None, min=None)

Bases: object

The minimum and maximum amount of total accelerator memory, in MiB.

Parameters:
  • max (Union[int, float, None]) – The maximum amount of accelerator memory, in MiB. To specify no maximum limit, omit this parameter.

  • min (Union[int, float, None]) – The minimum amount of accelerator memory, in MiB. To specify no minimum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-acceleratortotalmemorymibrequest.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

accelerator_total_memory_mi_bRequest_property = ec2.CfnEC2Fleet.AcceleratorTotalMemoryMiBRequestProperty(
    max=123,
    min=123
)

Attributes

max

The maximum amount of accelerator memory, in MiB.

To specify no maximum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-acceleratortotalmemorymibrequest.html#cfn-ec2-ec2fleet-acceleratortotalmemorymibrequest-max

min

The minimum amount of accelerator memory, in MiB.

To specify no minimum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-acceleratortotalmemorymibrequest.html#cfn-ec2-ec2fleet-acceleratortotalmemorymibrequest-min

BaselineEbsBandwidthMbpsRequestProperty

class CfnEC2Fleet.BaselineEbsBandwidthMbpsRequestProperty(*, max=None, min=None)

Bases: object

The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps.

For more information, see Amazon EBS–optimized instances in the Amazon EC2 User Guide .

Parameters:
  • max (Union[int, float, None]) – The maximum baseline bandwidth, in Mbps. To specify no maximum limit, omit this parameter.

  • min (Union[int, float, None]) – The minimum baseline bandwidth, in Mbps. To specify no minimum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-baselineebsbandwidthmbpsrequest.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

baseline_ebs_bandwidth_mbps_request_property = ec2.CfnEC2Fleet.BaselineEbsBandwidthMbpsRequestProperty(
    max=123,
    min=123
)

Attributes

max

The maximum baseline bandwidth, in Mbps.

To specify no maximum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-baselineebsbandwidthmbpsrequest.html#cfn-ec2-ec2fleet-baselineebsbandwidthmbpsrequest-max

min

The minimum baseline bandwidth, in Mbps.

To specify no minimum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-baselineebsbandwidthmbpsrequest.html#cfn-ec2-ec2fleet-baselineebsbandwidthmbpsrequest-min

CapacityRebalanceProperty

class CfnEC2Fleet.CapacityRebalanceProperty(*, replacement_strategy=None, termination_delay=None)

Bases: object

The Spot Instance replacement strategy to use when Amazon EC2 emits a rebalance notification signal that your Spot Instance is at an elevated risk of being interrupted.

For more information, see Capacity rebalancing in the Amazon EC2 User Guide .

Parameters:
  • replacement_strategy (Optional[str]) – The replacement strategy to use. Only available for fleets of type maintain . launch - EC2 Fleet launches a replacement Spot Instance when a rebalance notification is emitted for an existing Spot Instance in the fleet. EC2 Fleet does not terminate the instances that receive a rebalance notification. You can terminate the old instances, or you can leave them running. You are charged for all instances while they are running. launch-before-terminate - EC2 Fleet launches a replacement Spot Instance when a rebalance notification is emitted for an existing Spot Instance in the fleet, and then, after a delay that you specify (in TerminationDelay ), terminates the instances that received a rebalance notification.

  • termination_delay (Union[int, float, None]) – The amount of time (in seconds) that Amazon EC2 waits before terminating the old Spot Instance after launching a new replacement Spot Instance. Required when ReplacementStrategy is set to launch-before-terminate . Not valid when ReplacementStrategy is set to launch . Valid values: Minimum value of 120 seconds. Maximum value of 7200 seconds.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-capacityrebalance.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

capacity_rebalance_property = ec2.CfnEC2Fleet.CapacityRebalanceProperty(
    replacement_strategy="replacementStrategy",
    termination_delay=123
)

Attributes

replacement_strategy

The replacement strategy to use. Only available for fleets of type maintain .

launch - EC2 Fleet launches a replacement Spot Instance when a rebalance notification is emitted for an existing Spot Instance in the fleet. EC2 Fleet does not terminate the instances that receive a rebalance notification. You can terminate the old instances, or you can leave them running. You are charged for all instances while they are running.

launch-before-terminate - EC2 Fleet launches a replacement Spot Instance when a rebalance notification is emitted for an existing Spot Instance in the fleet, and then, after a delay that you specify (in TerminationDelay ), terminates the instances that received a rebalance notification.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-capacityrebalance.html#cfn-ec2-ec2fleet-capacityrebalance-replacementstrategy

termination_delay

The amount of time (in seconds) that Amazon EC2 waits before terminating the old Spot Instance after launching a new replacement Spot Instance.

Required when ReplacementStrategy is set to launch-before-terminate .

Not valid when ReplacementStrategy is set to launch .

Valid values: Minimum value of 120 seconds. Maximum value of 7200 seconds.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-capacityrebalance.html#cfn-ec2-ec2fleet-capacityrebalance-terminationdelay

CapacityReservationOptionsRequestProperty

class CfnEC2Fleet.CapacityReservationOptionsRequestProperty(*, usage_strategy=None)

Bases: object

Describes the strategy for using unused Capacity Reservations for fulfilling On-Demand capacity.

This strategy can only be used if the EC2 Fleet is of type instant .

For more information about Capacity Reservations, see On-Demand Capacity Reservations in the Amazon EC2 User Guide . For examples of using Capacity Reservations in an EC2 Fleet, see EC2 Fleet example configurations in the Amazon EC2 User Guide .

Parameters:

usage_strategy (Optional[str]) – Indicates whether to use unused Capacity Reservations for fulfilling On-Demand capacity. If you specify use-capacity-reservations-first , the fleet uses unused Capacity Reservations to fulfill On-Demand capacity up to the target On-Demand capacity. If multiple instance pools have unused Capacity Reservations, the On-Demand allocation strategy ( lowest-price or prioritized ) is applied. If the number of unused Capacity Reservations is less than the On-Demand target capacity, the remaining On-Demand target capacity is launched according to the On-Demand allocation strategy ( lowest-price or prioritized ). If you do not specify a value, the fleet fulfils the On-Demand capacity according to the chosen On-Demand allocation strategy.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-capacityreservationoptionsrequest.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

capacity_reservation_options_request_property = ec2.CfnEC2Fleet.CapacityReservationOptionsRequestProperty(
    usage_strategy="usageStrategy"
)

Attributes

usage_strategy

Indicates whether to use unused Capacity Reservations for fulfilling On-Demand capacity.

If you specify use-capacity-reservations-first , the fleet uses unused Capacity Reservations to fulfill On-Demand capacity up to the target On-Demand capacity. If multiple instance pools have unused Capacity Reservations, the On-Demand allocation strategy ( lowest-price or prioritized ) is applied. If the number of unused Capacity Reservations is less than the On-Demand target capacity, the remaining On-Demand target capacity is launched according to the On-Demand allocation strategy ( lowest-price or prioritized ).

If you do not specify a value, the fleet fulfils the On-Demand capacity according to the chosen On-Demand allocation strategy.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-capacityreservationoptionsrequest.html#cfn-ec2-ec2fleet-capacityreservationoptionsrequest-usagestrategy

FleetLaunchTemplateConfigRequestProperty

class CfnEC2Fleet.FleetLaunchTemplateConfigRequestProperty(*, launch_template_specification=None, overrides=None)

Bases: object

Specifies a launch template and overrides for an EC2 Fleet.

FleetLaunchTemplateConfigRequest is a property of the AWS::EC2::EC2Fleet resource.

Parameters:
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplateconfigrequest.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

fleet_launch_template_config_request_property = ec2.CfnEC2Fleet.FleetLaunchTemplateConfigRequestProperty(
    launch_template_specification=ec2.CfnEC2Fleet.FleetLaunchTemplateSpecificationRequestProperty(
        version="version",

        # the properties below are optional
        launch_template_id="launchTemplateId",
        launch_template_name="launchTemplateName"
    ),
    overrides=[ec2.CfnEC2Fleet.FleetLaunchTemplateOverridesRequestProperty(
        availability_zone="availabilityZone",
        instance_requirements=ec2.CfnEC2Fleet.InstanceRequirementsRequestProperty(
            accelerator_count=ec2.CfnEC2Fleet.AcceleratorCountRequestProperty(
                max=123,
                min=123
            ),
            accelerator_manufacturers=["acceleratorManufacturers"],
            accelerator_names=["acceleratorNames"],
            accelerator_total_memory_mi_b=ec2.CfnEC2Fleet.AcceleratorTotalMemoryMiBRequestProperty(
                max=123,
                min=123
            ),
            accelerator_types=["acceleratorTypes"],
            allowed_instance_types=["allowedInstanceTypes"],
            bare_metal="bareMetal",
            baseline_ebs_bandwidth_mbps=ec2.CfnEC2Fleet.BaselineEbsBandwidthMbpsRequestProperty(
                max=123,
                min=123
            ),
            burstable_performance="burstablePerformance",
            cpu_manufacturers=["cpuManufacturers"],
            excluded_instance_types=["excludedInstanceTypes"],
            instance_generations=["instanceGenerations"],
            local_storage="localStorage",
            local_storage_types=["localStorageTypes"],
            max_spot_price_as_percentage_of_optimal_on_demand_price=123,
            memory_gi_bPer_vCpu=ec2.CfnEC2Fleet.MemoryGiBPerVCpuRequestProperty(
                max=123,
                min=123
            ),
            memory_mi_b=ec2.CfnEC2Fleet.MemoryMiBRequestProperty(
                max=123,
                min=123
            ),
            network_bandwidth_gbps=ec2.CfnEC2Fleet.NetworkBandwidthGbpsRequestProperty(
                max=123,
                min=123
            ),
            network_interface_count=ec2.CfnEC2Fleet.NetworkInterfaceCountRequestProperty(
                max=123,
                min=123
            ),
            on_demand_max_price_percentage_over_lowest_price=123,
            require_hibernate_support=False,
            spot_max_price_percentage_over_lowest_price=123,
            total_local_storage_gb=ec2.CfnEC2Fleet.TotalLocalStorageGBRequestProperty(
                max=123,
                min=123
            ),
            v_cpu_count=ec2.CfnEC2Fleet.VCpuCountRangeRequestProperty(
                max=123,
                min=123
            )
        ),
        instance_type="instanceType",
        max_price="maxPrice",
        placement=ec2.CfnEC2Fleet.PlacementProperty(
            affinity="affinity",
            availability_zone="availabilityZone",
            group_name="groupName",
            host_id="hostId",
            host_resource_group_arn="hostResourceGroupArn",
            partition_number=123,
            spread_domain="spreadDomain",
            tenancy="tenancy"
        ),
        priority=123,
        subnet_id="subnetId",
        weighted_capacity=123
    )]
)

Attributes

launch_template_specification

The launch template to use.

You must specify either the launch template ID or launch template name in the request.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplateconfigrequest.html#cfn-ec2-ec2fleet-fleetlaunchtemplateconfigrequest-launchtemplatespecification

overrides

Any parameters that you specify override the same parameters in the launch template.

For fleets of type request and maintain , a maximum of 300 items is allowed across all launch templates.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplateconfigrequest.html#cfn-ec2-ec2fleet-fleetlaunchtemplateconfigrequest-overrides

FleetLaunchTemplateOverridesRequestProperty

class CfnEC2Fleet.FleetLaunchTemplateOverridesRequestProperty(*, availability_zone=None, instance_requirements=None, instance_type=None, max_price=None, placement=None, priority=None, subnet_id=None, weighted_capacity=None)

Bases: object

Specifies overrides for a launch template for an EC2 Fleet.

FleetLaunchTemplateOverridesRequest is a property of the FleetLaunchTemplateConfigRequest property type.

Parameters:
  • availability_zone (Optional[str]) – The Availability Zone in which to launch the instances.

  • instance_requirements (Union[IResolvable, InstanceRequirementsRequestProperty, Dict[str, Any], None]) – The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance types with those attributes. .. epigraph:: If you specify InstanceRequirements , you can’t specify InstanceType .

  • instance_type (Optional[str]) – The instance type. mac1.metal is not supported as a launch template override. .. epigraph:: If you specify InstanceType , you can’t specify InstanceRequirements .

  • max_price (Optional[str]) – The maximum price per unit hour that you are willing to pay for a Spot Instance. We do not recommend using this parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the current Spot price. .. epigraph:: If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify this parameter.

  • placement (Union[IResolvable, PlacementProperty, Dict[str, Any], None]) – The location where the instance launched, if applicable.

  • priority (Union[int, float, None]) – The priority for the launch template override. The highest priority is launched first. If the On-Demand AllocationStrategy is set to prioritized , EC2 Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity. If the Spot AllocationStrategy is set to capacity-optimized-prioritized , EC2 Fleet uses priority on a best-effort basis to determine which launch template override to use in fulfilling Spot capacity, but optimizes for capacity first. Valid values are whole numbers starting at 0 . The lower the number, the higher the priority. If no number is set, the launch template override has the lowest priority. You can set the same priority for different launch template overrides.

  • subnet_id (Optional[str]) – The IDs of the subnets in which to launch the instances. Separate multiple subnet IDs using commas (for example, subnet-1234abcdeexample1, subnet-0987cdef6example2 ). A request of type instant can have only one subnet ID.

  • weighted_capacity (Union[int, float, None]) – The number of units provided by the specified instance type. .. epigraph:: When specifying weights, the price used in the lowest-price and price-capacity-optimized allocation strategies is per unit hour (where the instance price is divided by the specified weight). However, if all the specified weights are above the requested TargetCapacity , resulting in only 1 instance being launched, the price used is per instance hour.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplateoverridesrequest.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

fleet_launch_template_overrides_request_property = ec2.CfnEC2Fleet.FleetLaunchTemplateOverridesRequestProperty(
    availability_zone="availabilityZone",
    instance_requirements=ec2.CfnEC2Fleet.InstanceRequirementsRequestProperty(
        accelerator_count=ec2.CfnEC2Fleet.AcceleratorCountRequestProperty(
            max=123,
            min=123
        ),
        accelerator_manufacturers=["acceleratorManufacturers"],
        accelerator_names=["acceleratorNames"],
        accelerator_total_memory_mi_b=ec2.CfnEC2Fleet.AcceleratorTotalMemoryMiBRequestProperty(
            max=123,
            min=123
        ),
        accelerator_types=["acceleratorTypes"],
        allowed_instance_types=["allowedInstanceTypes"],
        bare_metal="bareMetal",
        baseline_ebs_bandwidth_mbps=ec2.CfnEC2Fleet.BaselineEbsBandwidthMbpsRequestProperty(
            max=123,
            min=123
        ),
        burstable_performance="burstablePerformance",
        cpu_manufacturers=["cpuManufacturers"],
        excluded_instance_types=["excludedInstanceTypes"],
        instance_generations=["instanceGenerations"],
        local_storage="localStorage",
        local_storage_types=["localStorageTypes"],
        max_spot_price_as_percentage_of_optimal_on_demand_price=123,
        memory_gi_bPer_vCpu=ec2.CfnEC2Fleet.MemoryGiBPerVCpuRequestProperty(
            max=123,
            min=123
        ),
        memory_mi_b=ec2.CfnEC2Fleet.MemoryMiBRequestProperty(
            max=123,
            min=123
        ),
        network_bandwidth_gbps=ec2.CfnEC2Fleet.NetworkBandwidthGbpsRequestProperty(
            max=123,
            min=123
        ),
        network_interface_count=ec2.CfnEC2Fleet.NetworkInterfaceCountRequestProperty(
            max=123,
            min=123
        ),
        on_demand_max_price_percentage_over_lowest_price=123,
        require_hibernate_support=False,
        spot_max_price_percentage_over_lowest_price=123,
        total_local_storage_gb=ec2.CfnEC2Fleet.TotalLocalStorageGBRequestProperty(
            max=123,
            min=123
        ),
        v_cpu_count=ec2.CfnEC2Fleet.VCpuCountRangeRequestProperty(
            max=123,
            min=123
        )
    ),
    instance_type="instanceType",
    max_price="maxPrice",
    placement=ec2.CfnEC2Fleet.PlacementProperty(
        affinity="affinity",
        availability_zone="availabilityZone",
        group_name="groupName",
        host_id="hostId",
        host_resource_group_arn="hostResourceGroupArn",
        partition_number=123,
        spread_domain="spreadDomain",
        tenancy="tenancy"
    ),
    priority=123,
    subnet_id="subnetId",
    weighted_capacity=123
)

Attributes

availability_zone

The Availability Zone in which to launch the instances.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplateoverridesrequest.html#cfn-ec2-ec2fleet-fleetlaunchtemplateoverridesrequest-availabilityzone

instance_requirements

The attributes for the instance types.

When you specify instance attributes, Amazon EC2 will identify instance types with those attributes. .. epigraph:

If you specify ``InstanceRequirements`` , you can't specify ``InstanceType`` .
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplateoverridesrequest.html#cfn-ec2-ec2fleet-fleetlaunchtemplateoverridesrequest-instancerequirements

instance_type

The instance type.

mac1.metal is not supported as a launch template override. .. epigraph:

If you specify ``InstanceType`` , you can't specify ``InstanceRequirements`` .
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplateoverridesrequest.html#cfn-ec2-ec2fleet-fleetlaunchtemplateoverridesrequest-instancetype

max_price

The maximum price per unit hour that you are willing to pay for a Spot Instance.

We do not recommend using this parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the current Spot price. .. epigraph:

If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify this parameter.
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplateoverridesrequest.html#cfn-ec2-ec2fleet-fleetlaunchtemplateoverridesrequest-maxprice

placement

The location where the instance launched, if applicable.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplateoverridesrequest.html#cfn-ec2-ec2fleet-fleetlaunchtemplateoverridesrequest-placement

priority

The priority for the launch template override. The highest priority is launched first.

If the On-Demand AllocationStrategy is set to prioritized , EC2 Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity.

If the Spot AllocationStrategy is set to capacity-optimized-prioritized , EC2 Fleet uses priority on a best-effort basis to determine which launch template override to use in fulfilling Spot capacity, but optimizes for capacity first.

Valid values are whole numbers starting at 0 . The lower the number, the higher the priority. If no number is set, the launch template override has the lowest priority. You can set the same priority for different launch template overrides.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplateoverridesrequest.html#cfn-ec2-ec2fleet-fleetlaunchtemplateoverridesrequest-priority

subnet_id

The IDs of the subnets in which to launch the instances.

Separate multiple subnet IDs using commas (for example, subnet-1234abcdeexample1, subnet-0987cdef6example2 ). A request of type instant can have only one subnet ID.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplateoverridesrequest.html#cfn-ec2-ec2fleet-fleetlaunchtemplateoverridesrequest-subnetid

weighted_capacity

The number of units provided by the specified instance type.

When specifying weights, the price used in the lowest-price and price-capacity-optimized allocation strategies is per unit hour (where the instance price is divided by the specified weight). However, if all the specified weights are above the requested TargetCapacity , resulting in only 1 instance being launched, the price used is per instance hour.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplateoverridesrequest.html#cfn-ec2-ec2fleet-fleetlaunchtemplateoverridesrequest-weightedcapacity

FleetLaunchTemplateSpecificationRequestProperty

class CfnEC2Fleet.FleetLaunchTemplateSpecificationRequestProperty(*, version, launch_template_id=None, launch_template_name=None)

Bases: object

Specifies the launch template to be used by the EC2 Fleet for configuring Amazon EC2 instances.

You must specify the following:

  • The ID or the name of the launch template, but not both.

  • The version of the launch template.

FleetLaunchTemplateSpecificationRequest is a property of the FleetLaunchTemplateConfigRequest property type.

For information about creating a launch template, see AWS::EC2::LaunchTemplate and Create a launch template in the Amazon EC2 User Guide .

For examples of launch templates, see Examples .

Parameters:
  • version (str) – The launch template version number, $Latest , or $Default . You must specify a value, otherwise the request fails. If the value is $Latest , Amazon EC2 uses the latest version of the launch template. If the value is $Default , Amazon EC2 uses the default version of the launch template.

  • launch_template_id (Optional[str]) – The ID of the launch template. You must specify the LaunchTemplateId or the LaunchTemplateName , but not both.

  • launch_template_name (Optional[str]) – The name of the launch template. You must specify the LaunchTemplateName or the LaunchTemplateId , but not both.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplatespecificationrequest.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

fleet_launch_template_specification_request_property = ec2.CfnEC2Fleet.FleetLaunchTemplateSpecificationRequestProperty(
    version="version",

    # the properties below are optional
    launch_template_id="launchTemplateId",
    launch_template_name="launchTemplateName"
)

Attributes

launch_template_id

The ID of the launch template.

You must specify the LaunchTemplateId or the LaunchTemplateName , but not both.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplatespecificationrequest.html#cfn-ec2-ec2fleet-fleetlaunchtemplatespecificationrequest-launchtemplateid

launch_template_name

The name of the launch template.

You must specify the LaunchTemplateName or the LaunchTemplateId , but not both.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplatespecificationrequest.html#cfn-ec2-ec2fleet-fleetlaunchtemplatespecificationrequest-launchtemplatename

version

The launch template version number, $Latest , or $Default . You must specify a value, otherwise the request fails.

If the value is $Latest , Amazon EC2 uses the latest version of the launch template.

If the value is $Default , Amazon EC2 uses the default version of the launch template.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplatespecificationrequest.html#cfn-ec2-ec2fleet-fleetlaunchtemplatespecificationrequest-version

InstanceRequirementsRequestProperty

class CfnEC2Fleet.InstanceRequirementsRequestProperty(*, accelerator_count=None, accelerator_manufacturers=None, accelerator_names=None, accelerator_total_memory_mib=None, accelerator_types=None, allowed_instance_types=None, bare_metal=None, baseline_ebs_bandwidth_mbps=None, burstable_performance=None, cpu_manufacturers=None, excluded_instance_types=None, instance_generations=None, local_storage=None, local_storage_types=None, max_spot_price_as_percentage_of_optimal_on_demand_price=None, memory_gib_per_v_cpu=None, memory_mib=None, network_bandwidth_gbps=None, network_interface_count=None, on_demand_max_price_percentage_over_lowest_price=None, require_hibernate_support=None, spot_max_price_percentage_over_lowest_price=None, total_local_storage_gb=None, v_cpu_count=None)

Bases: object

The attributes for the instance types.

When you specify instance attributes, Amazon EC2 will identify instance types with these attributes.

You must specify VCpuCount and MemoryMiB . All other attributes are optional. Any unspecified optional attribute is set to its default.

When you specify multiple attributes, you get instance types that satisfy all of the specified attributes. If you specify multiple values for an attribute, you get instance types that satisfy any of the specified values.

To limit the list of instance types from which Amazon EC2 can identify matching instance types, you can use one of the following parameters, but not both in the same request:

  • AllowedInstanceTypes - The instance types to include in the list. All other instance types are ignored, even if they match your specified attributes.

  • ExcludedInstanceTypes - The instance types to exclude from the list, even if they match your specified attributes.

If you specify InstanceRequirements , you can’t specify InstanceType .

Attribute-based instance type selection is only supported when using Auto Scaling groups, EC2 Fleet, and Spot Fleet to launch instances. If you plan to use the launch template in the launch instance wizard , or with the RunInstances API or AWS::EC2::Instance AWS CloudFormation resource, you can’t specify InstanceRequirements .

For more information, see Attribute-based instance type selection for EC2 Fleet , Attribute-based instance type selection for Spot Fleet , and Spot placement score in the Amazon EC2 User Guide .

Parameters:
  • accelerator_count (Union[IResolvable, AcceleratorCountRequestProperty, Dict[str, Any], None]) – The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) on an instance. To exclude accelerator-enabled instance types, set Max to 0 . Default: No minimum or maximum limits

  • accelerator_manufacturers (Optional[Sequence[str]]) – Indicates whether instance types must have accelerators by specific manufacturers. - For instance types with AWS devices, specify amazon-web-services . - For instance types with AMD devices, specify amd . - For instance types with Habana devices, specify habana . - For instance types with NVIDIA devices, specify nvidia . - For instance types with Xilinx devices, specify xilinx . Default: Any manufacturer

  • accelerator_names (Optional[Sequence[str]]) – The accelerators that must be on the instance type. - For instance types with NVIDIA A10G GPUs, specify a10g . - For instance types with NVIDIA A100 GPUs, specify a100 . - For instance types with NVIDIA H100 GPUs, specify h100 . - For instance types with AWS Inferentia chips, specify inferentia . - For instance types with NVIDIA GRID K520 GPUs, specify k520 . - For instance types with NVIDIA K80 GPUs, specify k80 . - For instance types with NVIDIA M60 GPUs, specify m60 . - For instance types with AMD Radeon Pro V520 GPUs, specify radeon-pro-v520 . - For instance types with NVIDIA T4 GPUs, specify t4 . - For instance types with NVIDIA T4G GPUs, specify t4g . - For instance types with Xilinx VU9P FPGAs, specify vu9p . - For instance types with NVIDIA V100 GPUs, specify v100 . Default: Any accelerator

  • accelerator_total_memory_mib (Union[IResolvable, AcceleratorTotalMemoryMiBRequestProperty, Dict[str, Any], None]) – The minimum and maximum amount of total accelerator memory, in MiB. Default: No minimum or maximum limits

  • accelerator_types (Optional[Sequence[str]]) – The accelerator types that must be on the instance type. - To include instance types with GPU hardware, specify gpu . - To include instance types with FPGA hardware, specify fpga . - To include instance types with inference hardware, specify inference . Default: Any accelerator type

  • allowed_instance_types (Optional[Sequence[str]]) – The instance types to apply your specified attributes against. All other instance types are ignored, even if they match your specified attributes. You can use strings with one or more wild cards, represented by an asterisk ( * ), to allow an instance type, size, or generation. The following are examples: m5.8xlarge , c5*.* , m5a.* , r* , *3* . For example, if you specify c5* ,Amazon EC2 will allow the entire C5 instance family, which includes all C5a and C5n instance types. If you specify m5a.* , Amazon EC2 will allow all the M5a instance types, but not the M5n instance types. .. epigraph:: If you specify AllowedInstanceTypes , you can’t specify ExcludedInstanceTypes . Default: All instance types

  • bare_metal (Optional[str]) – Indicates whether bare metal instance types must be included, excluded, or required. - To include bare metal instance types, specify included . - To require only bare metal instance types, specify required . - To exclude bare metal instance types, specify excluded . Default: excluded

  • baseline_ebs_bandwidth_mbps (Union[IResolvable, BaselineEbsBandwidthMbpsRequestProperty, Dict[str, Any], None]) –

    The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps. For more information, see Amazon EBS–optimized instances in the Amazon EC2 User Guide . Default: No minimum or maximum limits

  • burstable_performance (Optional[str]) – Indicates whether burstable performance T instance types are included, excluded, or required. For more information, see Burstable performance instances . - To include burstable performance instance types, specify included . - To require only burstable performance instance types, specify required . - To exclude burstable performance instance types, specify excluded . Default: excluded

  • cpu_manufacturers (Optional[Sequence[str]]) – The CPU manufacturers to include. - For instance types with Intel CPUs, specify intel . - For instance types with AMD CPUs, specify amd . - For instance types with AWS CPUs, specify amazon-web-services . .. epigraph:: Don’t confuse the CPU manufacturer with the CPU architecture. Instances will be launched with a compatible CPU architecture based on the Amazon Machine Image (AMI) that you specify in your launch template. Default: Any manufacturer

  • excluded_instance_types (Optional[Sequence[str]]) – The instance types to exclude. You can use strings with one or more wild cards, represented by an asterisk ( * ), to exclude an instance family, type, size, or generation. The following are examples: m5.8xlarge , c5*.* , m5a.* , r* , *3* . For example, if you specify c5* ,Amazon EC2 will exclude the entire C5 instance family, which includes all C5a and C5n instance types. If you specify m5a.* , Amazon EC2 will exclude all the M5a instance types, but not the M5n instance types. .. epigraph:: If you specify ExcludedInstanceTypes , you can’t specify AllowedInstanceTypes . Default: No excluded instance types

  • instance_generations (Optional[Sequence[str]]) – Indicates whether current or previous generation instance types are included. The current generation instance types are recommended for use. Current generation instance types are typically the latest two to three generations in each instance family. For more information, see Instance types in the Amazon EC2 User Guide . For current generation instance types, specify current . For previous generation instance types, specify previous . Default: Current and previous generation instance types

  • local_storage (Optional[str]) – Indicates whether instance types with instance store volumes are included, excluded, or required. For more information, Amazon EC2 instance store in the Amazon EC2 User Guide . - To include instance types with instance store volumes, specify included . - To require only instance types with instance store volumes, specify required . - To exclude instance types with instance store volumes, specify excluded . Default: included

  • local_storage_types (Optional[Sequence[str]]) – The type of local storage that is required. - For instance types with hard disk drive (HDD) storage, specify hdd . - For instance types with solid state drive (SSD) storage, specify ssd . Default: hdd and ssd

  • max_spot_price_as_percentage_of_optimal_on_demand_price (Union[int, float, None]) – [Price protection] The price protection threshold for Spot Instances, as a percentage of an identified On-Demand price. The identified On-Demand price is the price of the lowest priced current generation C, M, or R instance type with your specified attributes. If no current generation C, M, or R instance type matches your attributes, then the identified price is from the lowest priced current generation instance types, and failing that, from the lowest priced previous generation instance types that match your attributes. When Amazon EC2 selects instance types with your attributes, it will exclude instance types whose price exceeds your specified threshold. The parameter accepts an integer, which Amazon EC2 interprets as a percentage. If you set DesiredCapacityType to vcpu or memory-mib , the price protection threshold is based on the per vCPU or per memory price instead of the per instance price. .. epigraph:: Only one of SpotMaxPricePercentageOverLowestPrice or MaxSpotPriceAsPercentageOfOptimalOnDemandPrice can be specified. If you don’t specify either, Amazon EC2 will automatically apply optimal price protection to consistently select from a wide range of instance types. To indicate no price protection threshold for Spot Instances, meaning you want to consider all instance types that match your attributes, include one of these parameters and specify a high value, such as 999999 .

  • memory_gib_per_v_cpu (Union[IResolvable, MemoryGiBPerVCpuRequestProperty, Dict[str, Any], None]) – The minimum and maximum amount of memory per vCPU, in GiB. Default: No minimum or maximum limits

  • memory_mib (Union[IResolvable, MemoryMiBRequestProperty, Dict[str, Any], None]) – The minimum and maximum amount of memory, in MiB.

  • network_bandwidth_gbps (Union[IResolvable, NetworkBandwidthGbpsRequestProperty, Dict[str, Any], None]) – The minimum and maximum amount of baseline network bandwidth, in gigabits per second (Gbps). For more information, see Amazon EC2 instance network bandwidth in the Amazon EC2 User Guide . Default: No minimum or maximum limits

  • network_interface_count (Union[IResolvable, NetworkInterfaceCountRequestProperty, Dict[str, Any], None]) – The minimum and maximum number of network interfaces. Default: No minimum or maximum limits

  • on_demand_max_price_percentage_over_lowest_price (Union[int, float, None]) – [Price protection] The price protection threshold for On-Demand Instances, as a percentage higher than an identified On-Demand price. The identified On-Demand price is the price of the lowest priced current generation C, M, or R instance type with your specified attributes. When Amazon EC2 selects instance types with your attributes, it will exclude instance types whose price exceeds your specified threshold. The parameter accepts an integer, which Amazon EC2 interprets as a percentage. To indicate no price protection threshold, specify a high value, such as 999999 . This parameter is not supported for GetSpotPlacementScores and GetInstanceTypesFromInstanceRequirements . .. epigraph:: If you set TargetCapacityUnitType to vcpu or memory-mib , the price protection threshold is applied based on the per-vCPU or per-memory price instead of the per-instance price. Default: 20

  • require_hibernate_support (Union[bool, IResolvable, None]) –

    Indicates whether instance types must support hibernation for On-Demand Instances. This parameter is not supported for GetSpotPlacementScores . Default: false

  • spot_max_price_percentage_over_lowest_price (Union[int, float, None]) –

    [Price protection] The price protection threshold for Spot Instances, as a percentage higher than an identified Spot price. The identified Spot price is the Spot price of the lowest priced current generation C, M, or R instance type with your specified attributes. If no current generation C, M, or R instance type matches your attributes, then the identified Spot price is from the lowest priced current generation instance types, and failing that, from the lowest priced previous generation instance types that match your attributes. When Amazon EC2 selects instance types with your attributes, it will exclude instance types whose Spot price exceeds your specified threshold. The parameter accepts an integer, which Amazon EC2 interprets as a percentage. If you set TargetCapacityUnitType to vcpu or memory-mib , the price protection threshold is applied based on the per-vCPU or per-memory price instead of the per-instance price. This parameter is not supported for GetSpotPlacementScores and GetInstanceTypesFromInstanceRequirements . .. epigraph:: Only one of SpotMaxPricePercentageOverLowestPrice or MaxSpotPriceAsPercentageOfOptimalOnDemandPrice can be specified. If you don’t specify either, Amazon EC2 will automatically apply optimal price protection to consistently select from a wide range of instance types. To indicate no price protection threshold for Spot Instances, meaning you want to consider all instance types that match your attributes, include one of these parameters and specify a high value, such as 999999 . Default: 100

  • total_local_storage_gb (Union[IResolvable, TotalLocalStorageGBRequestProperty, Dict[str, Any], None]) – The minimum and maximum amount of total local storage, in GB. Default: No minimum or maximum limits

  • v_cpu_count (Union[IResolvable, VCpuCountRangeRequestProperty, Dict[str, Any], None]) – The minimum and maximum number of vCPUs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

instance_requirements_request_property = ec2.CfnEC2Fleet.InstanceRequirementsRequestProperty(
    accelerator_count=ec2.CfnEC2Fleet.AcceleratorCountRequestProperty(
        max=123,
        min=123
    ),
    accelerator_manufacturers=["acceleratorManufacturers"],
    accelerator_names=["acceleratorNames"],
    accelerator_total_memory_mi_b=ec2.CfnEC2Fleet.AcceleratorTotalMemoryMiBRequestProperty(
        max=123,
        min=123
    ),
    accelerator_types=["acceleratorTypes"],
    allowed_instance_types=["allowedInstanceTypes"],
    bare_metal="bareMetal",
    baseline_ebs_bandwidth_mbps=ec2.CfnEC2Fleet.BaselineEbsBandwidthMbpsRequestProperty(
        max=123,
        min=123
    ),
    burstable_performance="burstablePerformance",
    cpu_manufacturers=["cpuManufacturers"],
    excluded_instance_types=["excludedInstanceTypes"],
    instance_generations=["instanceGenerations"],
    local_storage="localStorage",
    local_storage_types=["localStorageTypes"],
    max_spot_price_as_percentage_of_optimal_on_demand_price=123,
    memory_gi_bPer_vCpu=ec2.CfnEC2Fleet.MemoryGiBPerVCpuRequestProperty(
        max=123,
        min=123
    ),
    memory_mi_b=ec2.CfnEC2Fleet.MemoryMiBRequestProperty(
        max=123,
        min=123
    ),
    network_bandwidth_gbps=ec2.CfnEC2Fleet.NetworkBandwidthGbpsRequestProperty(
        max=123,
        min=123
    ),
    network_interface_count=ec2.CfnEC2Fleet.NetworkInterfaceCountRequestProperty(
        max=123,
        min=123
    ),
    on_demand_max_price_percentage_over_lowest_price=123,
    require_hibernate_support=False,
    spot_max_price_percentage_over_lowest_price=123,
    total_local_storage_gb=ec2.CfnEC2Fleet.TotalLocalStorageGBRequestProperty(
        max=123,
        min=123
    ),
    v_cpu_count=ec2.CfnEC2Fleet.VCpuCountRangeRequestProperty(
        max=123,
        min=123
    )
)

Attributes

accelerator_count

The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) on an instance.

To exclude accelerator-enabled instance types, set Max to 0 .

Default: No minimum or maximum limits

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-acceleratorcount

accelerator_manufacturers

Indicates whether instance types must have accelerators by specific manufacturers.

  • For instance types with AWS devices, specify amazon-web-services .

  • For instance types with AMD devices, specify amd .

  • For instance types with Habana devices, specify habana .

  • For instance types with NVIDIA devices, specify nvidia .

  • For instance types with Xilinx devices, specify xilinx .

Default: Any manufacturer

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-acceleratormanufacturers

accelerator_names

The accelerators that must be on the instance type.

  • For instance types with NVIDIA A10G GPUs, specify a10g .

  • For instance types with NVIDIA A100 GPUs, specify a100 .

  • For instance types with NVIDIA H100 GPUs, specify h100 .

  • For instance types with AWS Inferentia chips, specify inferentia .

  • For instance types with NVIDIA GRID K520 GPUs, specify k520 .

  • For instance types with NVIDIA K80 GPUs, specify k80 .

  • For instance types with NVIDIA M60 GPUs, specify m60 .

  • For instance types with AMD Radeon Pro V520 GPUs, specify radeon-pro-v520 .

  • For instance types with NVIDIA T4 GPUs, specify t4 .

  • For instance types with NVIDIA T4G GPUs, specify t4g .

  • For instance types with Xilinx VU9P FPGAs, specify vu9p .

  • For instance types with NVIDIA V100 GPUs, specify v100 .

Default: Any accelerator

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-acceleratornames

accelerator_total_memory_mib

The minimum and maximum amount of total accelerator memory, in MiB.

Default: No minimum or maximum limits

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-acceleratortotalmemorymib

accelerator_types

The accelerator types that must be on the instance type.

  • To include instance types with GPU hardware, specify gpu .

  • To include instance types with FPGA hardware, specify fpga .

  • To include instance types with inference hardware, specify inference .

Default: Any accelerator type

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-acceleratortypes

allowed_instance_types

The instance types to apply your specified attributes against.

All other instance types are ignored, even if they match your specified attributes.

You can use strings with one or more wild cards, represented by an asterisk ( * ), to allow an instance type, size, or generation. The following are examples: m5.8xlarge , c5*.* , m5a.* , r* , *3* .

For example, if you specify c5* ,Amazon EC2 will allow the entire C5 instance family, which includes all C5a and C5n instance types. If you specify m5a.* , Amazon EC2 will allow all the M5a instance types, but not the M5n instance types. .. epigraph:

If you specify ``AllowedInstanceTypes`` , you can't specify ``ExcludedInstanceTypes`` .

Default: All instance types

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-allowedinstancetypes

bare_metal

Indicates whether bare metal instance types must be included, excluded, or required.

  • To include bare metal instance types, specify included .

  • To require only bare metal instance types, specify required .

  • To exclude bare metal instance types, specify excluded .

Default: excluded

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-baremetal

baseline_ebs_bandwidth_mbps

The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps.

For more information, see Amazon EBS–optimized instances in the Amazon EC2 User Guide .

Default: No minimum or maximum limits

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-baselineebsbandwidthmbps

burstable_performance

Indicates whether burstable performance T instance types are included, excluded, or required.

For more information, see Burstable performance instances .

  • To include burstable performance instance types, specify included .

  • To require only burstable performance instance types, specify required .

  • To exclude burstable performance instance types, specify excluded .

Default: excluded

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-burstableperformance

cpu_manufacturers

The CPU manufacturers to include.

  • For instance types with Intel CPUs, specify intel .

  • For instance types with AMD CPUs, specify amd .

  • For instance types with AWS CPUs, specify amazon-web-services .

Don’t confuse the CPU manufacturer with the CPU architecture. Instances will be launched with a compatible CPU architecture based on the Amazon Machine Image (AMI) that you specify in your launch template.

Default: Any manufacturer

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-cpumanufacturers

excluded_instance_types

The instance types to exclude.

You can use strings with one or more wild cards, represented by an asterisk ( * ), to exclude an instance family, type, size, or generation. The following are examples: m5.8xlarge , c5*.* , m5a.* , r* , *3* .

For example, if you specify c5* ,Amazon EC2 will exclude the entire C5 instance family, which includes all C5a and C5n instance types. If you specify m5a.* , Amazon EC2 will exclude all the M5a instance types, but not the M5n instance types. .. epigraph:

If you specify ``ExcludedInstanceTypes`` , you can't specify ``AllowedInstanceTypes`` .

Default: No excluded instance types

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-excludedinstancetypes

instance_generations

Indicates whether current or previous generation instance types are included.

The current generation instance types are recommended for use. Current generation instance types are typically the latest two to three generations in each instance family. For more information, see Instance types in the Amazon EC2 User Guide .

For current generation instance types, specify current .

For previous generation instance types, specify previous .

Default: Current and previous generation instance types

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-instancegenerations

local_storage

Indicates whether instance types with instance store volumes are included, excluded, or required.

For more information, Amazon EC2 instance store in the Amazon EC2 User Guide .

  • To include instance types with instance store volumes, specify included .

  • To require only instance types with instance store volumes, specify required .

  • To exclude instance types with instance store volumes, specify excluded .

Default: included

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-localstorage

local_storage_types

The type of local storage that is required.

  • For instance types with hard disk drive (HDD) storage, specify hdd .

  • For instance types with solid state drive (SSD) storage, specify ssd .

Default: hdd and ssd

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-localstoragetypes

max_spot_price_as_percentage_of_optimal_on_demand_price

[Price protection] The price protection threshold for Spot Instances, as a percentage of an identified On-Demand price.

The identified On-Demand price is the price of the lowest priced current generation C, M, or R instance type with your specified attributes. If no current generation C, M, or R instance type matches your attributes, then the identified price is from the lowest priced current generation instance types, and failing that, from the lowest priced previous generation instance types that match your attributes. When Amazon EC2 selects instance types with your attributes, it will exclude instance types whose price exceeds your specified threshold.

The parameter accepts an integer, which Amazon EC2 interprets as a percentage.

If you set DesiredCapacityType to vcpu or memory-mib , the price protection threshold is based on the per vCPU or per memory price instead of the per instance price. .. epigraph:

Only one of ``SpotMaxPricePercentageOverLowestPrice`` or ``MaxSpotPriceAsPercentageOfOptimalOnDemandPrice`` can be specified. If you don't specify either, Amazon EC2 will automatically apply optimal price protection to consistently select from a wide range of instance types. To indicate no price protection threshold for Spot Instances, meaning you want to consider all instance types that match your attributes, include one of these parameters and specify a high value, such as ``999999`` .
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-maxspotpriceaspercentageofoptimalondemandprice

memory_gib_per_v_cpu

The minimum and maximum amount of memory per vCPU, in GiB.

Default: No minimum or maximum limits

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-memorygibpervcpu

memory_mib

The minimum and maximum amount of memory, in MiB.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-memorymib

network_bandwidth_gbps

The minimum and maximum amount of baseline network bandwidth, in gigabits per second (Gbps).

For more information, see Amazon EC2 instance network bandwidth in the Amazon EC2 User Guide .

Default: No minimum or maximum limits

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-networkbandwidthgbps

network_interface_count

The minimum and maximum number of network interfaces.

Default: No minimum or maximum limits

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-networkinterfacecount

on_demand_max_price_percentage_over_lowest_price

[Price protection] The price protection threshold for On-Demand Instances, as a percentage higher than an identified On-Demand price.

The identified On-Demand price is the price of the lowest priced current generation C, M, or R instance type with your specified attributes. When Amazon EC2 selects instance types with your attributes, it will exclude instance types whose price exceeds your specified threshold.

The parameter accepts an integer, which Amazon EC2 interprets as a percentage.

To indicate no price protection threshold, specify a high value, such as 999999 .

This parameter is not supported for GetSpotPlacementScores and GetInstanceTypesFromInstanceRequirements . .. epigraph:

If you set ``TargetCapacityUnitType`` to ``vcpu`` or ``memory-mib`` , the price protection threshold is applied based on the per-vCPU or per-memory price instead of the per-instance price.

Default: 20

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-ondemandmaxpricepercentageoverlowestprice

require_hibernate_support

Indicates whether instance types must support hibernation for On-Demand Instances.

This parameter is not supported for GetSpotPlacementScores .

Default: false

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-requirehibernatesupport

spot_max_price_percentage_over_lowest_price

[Price protection] The price protection threshold for Spot Instances, as a percentage higher than an identified Spot price.

The identified Spot price is the Spot price of the lowest priced current generation C, M, or R instance type with your specified attributes. If no current generation C, M, or R instance type matches your attributes, then the identified Spot price is from the lowest priced current generation instance types, and failing that, from the lowest priced previous generation instance types that match your attributes. When Amazon EC2 selects instance types with your attributes, it will exclude instance types whose Spot price exceeds your specified threshold.

The parameter accepts an integer, which Amazon EC2 interprets as a percentage.

If you set TargetCapacityUnitType to vcpu or memory-mib , the price protection threshold is applied based on the per-vCPU or per-memory price instead of the per-instance price.

This parameter is not supported for GetSpotPlacementScores and GetInstanceTypesFromInstanceRequirements . .. epigraph:

Only one of ``SpotMaxPricePercentageOverLowestPrice`` or ``MaxSpotPriceAsPercentageOfOptimalOnDemandPrice`` can be specified. If you don't specify either, Amazon EC2 will automatically apply optimal price protection to consistently select from a wide range of instance types. To indicate no price protection threshold for Spot Instances, meaning you want to consider all instance types that match your attributes, include one of these parameters and specify a high value, such as ``999999`` .

Default: 100

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-spotmaxpricepercentageoverlowestprice

total_local_storage_gb

The minimum and maximum amount of total local storage, in GB.

Default: No minimum or maximum limits

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-totallocalstoragegb

v_cpu_count

The minimum and maximum number of vCPUs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-instancerequirementsrequest.html#cfn-ec2-ec2fleet-instancerequirementsrequest-vcpucount

MaintenanceStrategiesProperty

class CfnEC2Fleet.MaintenanceStrategiesProperty(*, capacity_rebalance=None)

Bases: object

The strategies for managing your Spot Instances that are at an elevated risk of being interrupted.

Parameters:

capacity_rebalance (Union[IResolvable, CapacityRebalanceProperty, Dict[str, Any], None]) – The strategy to use when Amazon EC2 emits a signal that your Spot Instance is at an elevated risk of being interrupted.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-maintenancestrategies.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

maintenance_strategies_property = ec2.CfnEC2Fleet.MaintenanceStrategiesProperty(
    capacity_rebalance=ec2.CfnEC2Fleet.CapacityRebalanceProperty(
        replacement_strategy="replacementStrategy",
        termination_delay=123
    )
)

Attributes

capacity_rebalance

The strategy to use when Amazon EC2 emits a signal that your Spot Instance is at an elevated risk of being interrupted.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-maintenancestrategies.html#cfn-ec2-ec2fleet-maintenancestrategies-capacityrebalance

MemoryGiBPerVCpuRequestProperty

class CfnEC2Fleet.MemoryGiBPerVCpuRequestProperty(*, max=None, min=None)

Bases: object

The minimum and maximum amount of memory per vCPU, in GiB.

Parameters:
  • max (Union[int, float, None]) – The maximum amount of memory per vCPU, in GiB. To specify no maximum limit, omit this parameter.

  • min (Union[int, float, None]) – The minimum amount of memory per vCPU, in GiB. To specify no minimum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-memorygibpervcpurequest.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

memory_gi_bPer_vCpu_request_property = ec2.CfnEC2Fleet.MemoryGiBPerVCpuRequestProperty(
    max=123,
    min=123
)

Attributes

max

The maximum amount of memory per vCPU, in GiB.

To specify no maximum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-memorygibpervcpurequest.html#cfn-ec2-ec2fleet-memorygibpervcpurequest-max

min

The minimum amount of memory per vCPU, in GiB.

To specify no minimum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-memorygibpervcpurequest.html#cfn-ec2-ec2fleet-memorygibpervcpurequest-min

MemoryMiBRequestProperty

class CfnEC2Fleet.MemoryMiBRequestProperty(*, max=None, min=None)

Bases: object

The minimum and maximum amount of memory, in MiB.

Parameters:
  • max (Union[int, float, None]) – The maximum amount of memory, in MiB. To specify no maximum limit, omit this parameter.

  • min (Union[int, float, None]) – The minimum amount of memory, in MiB. To specify no minimum limit, specify 0 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-memorymibrequest.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

memory_mi_bRequest_property = ec2.CfnEC2Fleet.MemoryMiBRequestProperty(
    max=123,
    min=123
)

Attributes

max

The maximum amount of memory, in MiB.

To specify no maximum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-memorymibrequest.html#cfn-ec2-ec2fleet-memorymibrequest-max

min

The minimum amount of memory, in MiB.

To specify no minimum limit, specify 0 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-memorymibrequest.html#cfn-ec2-ec2fleet-memorymibrequest-min

NetworkBandwidthGbpsRequestProperty

class CfnEC2Fleet.NetworkBandwidthGbpsRequestProperty(*, max=None, min=None)

Bases: object

The minimum and maximum amount of network bandwidth, in gigabits per second (Gbps).

Setting the minimum bandwidth does not guarantee that your instance will achieve the minimum bandwidth. Amazon EC2 will identify instance types that support the specified minimum bandwidth, but the actual bandwidth of your instance might go below the specified minimum at times. For more information, see Available instance bandwidth in the Amazon EC2 User Guide .

Parameters:
  • max (Union[int, float, None]) – The maximum amount of network bandwidth, in Gbps. To specify no maximum limit, omit this parameter.

  • min (Union[int, float, None]) – The minimum amount of network bandwidth, in Gbps. To specify no minimum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-networkbandwidthgbpsrequest.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

network_bandwidth_gbps_request_property = ec2.CfnEC2Fleet.NetworkBandwidthGbpsRequestProperty(
    max=123,
    min=123
)

Attributes

max

The maximum amount of network bandwidth, in Gbps.

To specify no maximum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-networkbandwidthgbpsrequest.html#cfn-ec2-ec2fleet-networkbandwidthgbpsrequest-max

min

The minimum amount of network bandwidth, in Gbps.

To specify no minimum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-networkbandwidthgbpsrequest.html#cfn-ec2-ec2fleet-networkbandwidthgbpsrequest-min

NetworkInterfaceCountRequestProperty

class CfnEC2Fleet.NetworkInterfaceCountRequestProperty(*, max=None, min=None)

Bases: object

The minimum and maximum number of network interfaces.

Parameters:
  • max (Union[int, float, None]) – The maximum number of network interfaces. To specify no maximum limit, omit this parameter.

  • min (Union[int, float, None]) – The minimum number of network interfaces. To specify no minimum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-networkinterfacecountrequest.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

network_interface_count_request_property = ec2.CfnEC2Fleet.NetworkInterfaceCountRequestProperty(
    max=123,
    min=123
)

Attributes

max

The maximum number of network interfaces.

To specify no maximum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-networkinterfacecountrequest.html#cfn-ec2-ec2fleet-networkinterfacecountrequest-max

min

The minimum number of network interfaces.

To specify no minimum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-networkinterfacecountrequest.html#cfn-ec2-ec2fleet-networkinterfacecountrequest-min

OnDemandOptionsRequestProperty

class CfnEC2Fleet.OnDemandOptionsRequestProperty(*, allocation_strategy=None, capacity_reservation_options=None, max_total_price=None, min_target_capacity=None, single_availability_zone=None, single_instance_type=None)

Bases: object

Specifies the allocation strategy of On-Demand Instances in an EC2 Fleet.

OnDemandOptionsRequest is a property of the AWS::EC2::EC2Fleet resource.

Parameters:
  • allocation_strategy (Optional[str]) – The strategy that determines the order of the launch template overrides to use in fulfilling On-Demand capacity. lowest-price - EC2 Fleet uses price to determine the order, launching the lowest price first. prioritized - EC2 Fleet uses the priority that you assigned to each launch template override, launching the highest priority first. Default: lowest-price

  • capacity_reservation_options (Union[IResolvable, CapacityReservationOptionsRequestProperty, Dict[str, Any], None]) – The strategy for using unused Capacity Reservations for fulfilling On-Demand capacity. Supported only for fleets of type instant .

  • max_total_price (Optional[str]) – The maximum amount per hour for On-Demand Instances that you’re willing to pay. .. epigraph:: If your fleet includes T instances that are configured as unlimited , and if their average CPU usage exceeds the baseline utilization, you will incur a charge for surplus credits. The MaxTotalPrice does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified for MaxTotalPrice . For more information, see Surplus credits can incur charges in the EC2 User Guide .

  • min_target_capacity (Union[int, float, None]) – The minimum target capacity for On-Demand Instances in the fleet. If the minimum target capacity is not reached, the fleet launches no instances. Supported only for fleets of type instant . At least one of the following must be specified: SingleAvailabilityZone | SingleInstanceType

  • single_availability_zone (Union[bool, IResolvable, None]) – Indicates that the fleet launches all On-Demand Instances into a single Availability Zone. Supported only for fleets of type instant .

  • single_instance_type (Union[bool, IResolvable, None]) – Indicates that the fleet uses a single instance type to launch all On-Demand Instances in the fleet. Supported only for fleets of type instant .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-ondemandoptionsrequest.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

on_demand_options_request_property = ec2.CfnEC2Fleet.OnDemandOptionsRequestProperty(
    allocation_strategy="allocationStrategy",
    capacity_reservation_options=ec2.CfnEC2Fleet.CapacityReservationOptionsRequestProperty(
        usage_strategy="usageStrategy"
    ),
    max_total_price="maxTotalPrice",
    min_target_capacity=123,
    single_availability_zone=False,
    single_instance_type=False
)

Attributes

allocation_strategy

The strategy that determines the order of the launch template overrides to use in fulfilling On-Demand capacity.

lowest-price - EC2 Fleet uses price to determine the order, launching the lowest price first.

prioritized - EC2 Fleet uses the priority that you assigned to each launch template override, launching the highest priority first.

Default: lowest-price

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-ondemandoptionsrequest.html#cfn-ec2-ec2fleet-ondemandoptionsrequest-allocationstrategy

capacity_reservation_options

The strategy for using unused Capacity Reservations for fulfilling On-Demand capacity.

Supported only for fleets of type instant .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-ondemandoptionsrequest.html#cfn-ec2-ec2fleet-ondemandoptionsrequest-capacityreservationoptions

max_total_price

The maximum amount per hour for On-Demand Instances that you’re willing to pay.

If your fleet includes T instances that are configured as unlimited , and if their average CPU usage exceeds the baseline utilization, you will incur a charge for surplus credits. The MaxTotalPrice does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified for MaxTotalPrice . For more information, see Surplus credits can incur charges in the EC2 User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-ondemandoptionsrequest.html#cfn-ec2-ec2fleet-ondemandoptionsrequest-maxtotalprice

min_target_capacity

The minimum target capacity for On-Demand Instances in the fleet.

If the minimum target capacity is not reached, the fleet launches no instances.

Supported only for fleets of type instant .

At least one of the following must be specified: SingleAvailabilityZone | SingleInstanceType

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-ondemandoptionsrequest.html#cfn-ec2-ec2fleet-ondemandoptionsrequest-mintargetcapacity

single_availability_zone

Indicates that the fleet launches all On-Demand Instances into a single Availability Zone.

Supported only for fleets of type instant .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-ondemandoptionsrequest.html#cfn-ec2-ec2fleet-ondemandoptionsrequest-singleavailabilityzone

single_instance_type

Indicates that the fleet uses a single instance type to launch all On-Demand Instances in the fleet.

Supported only for fleets of type instant .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-ondemandoptionsrequest.html#cfn-ec2-ec2fleet-ondemandoptionsrequest-singleinstancetype

PlacementProperty

class CfnEC2Fleet.PlacementProperty(*, affinity=None, availability_zone=None, group_name=None, host_id=None, host_resource_group_arn=None, partition_number=None, spread_domain=None, tenancy=None)

Bases: object

Describes the placement of an instance.

Parameters:
  • affinity (Optional[str]) – The affinity setting for the instance on the Dedicated Host. This parameter is not supported for CreateFleet or ImportInstance .

  • availability_zone (Optional[str]) –

    The Availability Zone of the instance. If not specified, an Availability Zone will be automatically chosen for you based on the load balancing criteria for the Region. This parameter is not supported for CreateFleet .

  • group_name (Optional[str]) – The name of the placement group that the instance is in. If you specify GroupName , you can’t specify GroupId .

  • host_id (Optional[str]) –

    The ID of the Dedicated Host on which the instance resides. This parameter is not supported for CreateFleet or ImportInstance .

  • host_resource_group_arn (Optional[str]) –

    The ARN of the host resource group in which to launch the instances. If you specify this parameter, either omit the Tenancy parameter or set it to host . This parameter is not supported for CreateFleet .

  • partition_number (Union[int, float, None]) –

    The number of the partition that the instance is in. Valid only if the placement group strategy is set to partition . This parameter is not supported for CreateFleet .

  • spread_domain (Optional[str]) – Reserved for future use.

  • tenancy (Optional[str]) –

    The tenancy of the instance. An instance with a tenancy of dedicated runs on single-tenant hardware. This parameter is not supported for CreateFleet . The host tenancy is not supported for ImportInstance or for T3 instances that are configured for the unlimited CPU credit option.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-placement.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

placement_property = ec2.CfnEC2Fleet.PlacementProperty(
    affinity="affinity",
    availability_zone="availabilityZone",
    group_name="groupName",
    host_id="hostId",
    host_resource_group_arn="hostResourceGroupArn",
    partition_number=123,
    spread_domain="spreadDomain",
    tenancy="tenancy"
)

Attributes

affinity

The affinity setting for the instance on the Dedicated Host.

This parameter is not supported for CreateFleet or ImportInstance .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-placement.html#cfn-ec2-ec2fleet-placement-affinity

availability_zone

The Availability Zone of the instance.

If not specified, an Availability Zone will be automatically chosen for you based on the load balancing criteria for the Region.

This parameter is not supported for CreateFleet .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-placement.html#cfn-ec2-ec2fleet-placement-availabilityzone

group_name

The name of the placement group that the instance is in.

If you specify GroupName , you can’t specify GroupId .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-placement.html#cfn-ec2-ec2fleet-placement-groupname

host_id

The ID of the Dedicated Host on which the instance resides.

This parameter is not supported for CreateFleet or ImportInstance .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-placement.html#cfn-ec2-ec2fleet-placement-hostid

host_resource_group_arn

The ARN of the host resource group in which to launch the instances.

If you specify this parameter, either omit the Tenancy parameter or set it to host .

This parameter is not supported for CreateFleet .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-placement.html#cfn-ec2-ec2fleet-placement-hostresourcegrouparn

partition_number

The number of the partition that the instance is in.

Valid only if the placement group strategy is set to partition .

This parameter is not supported for CreateFleet .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-placement.html#cfn-ec2-ec2fleet-placement-partitionnumber

spread_domain

Reserved for future use.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-placement.html#cfn-ec2-ec2fleet-placement-spreaddomain

tenancy

The tenancy of the instance. An instance with a tenancy of dedicated runs on single-tenant hardware.

This parameter is not supported for CreateFleet . The host tenancy is not supported for ImportInstance or for T3 instances that are configured for the unlimited CPU credit option.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-placement.html#cfn-ec2-ec2fleet-placement-tenancy

SpotOptionsRequestProperty

class CfnEC2Fleet.SpotOptionsRequestProperty(*, allocation_strategy=None, instance_interruption_behavior=None, instance_pools_to_use_count=None, maintenance_strategies=None, max_total_price=None, min_target_capacity=None, single_availability_zone=None, single_instance_type=None)

Bases: object

Specifies the configuration of Spot Instances for an EC2 Fleet.

SpotOptionsRequest is a property of the AWS::EC2::EC2Fleet resource.

Parameters:
  • allocation_strategy (Optional[str]) – Indicates how to allocate the target Spot Instance capacity across the Spot Instance pools specified by the EC2 Fleet. If the allocation strategy is lowestPrice , EC2 Fleet launches instances from the Spot Instance pools with the lowest price. This is the default allocation strategy. If the allocation strategy is diversified , EC2 Fleet launches instances from all the Spot Instance pools that you specify. If the allocation strategy is capacityOptimized , EC2 Fleet launches instances from Spot Instance pools that are optimally chosen based on the available Spot Instance capacity. Allowed Values : lowestPrice | diversified | capacityOptimized | capacityOptimizedPrioritized

  • instance_interruption_behavior (Optional[str]) – The behavior when a Spot Instance is interrupted. Default: terminate

  • instance_pools_to_use_count (Union[int, float, None]) – The number of Spot pools across which to allocate your target Spot capacity. Supported only when Spot AllocationStrategy is set to lowest-price . EC2 Fleet selects the cheapest Spot pools and evenly allocates your target Spot capacity across the number of Spot pools that you specify. Note that EC2 Fleet attempts to draw Spot Instances from the number of pools that you specify on a best effort basis. If a pool runs out of Spot capacity before fulfilling your target capacity, EC2 Fleet will continue to fulfill your request by drawing from the next cheapest pool. To ensure that your target capacity is met, you might receive Spot Instances from more than the number of pools that you specified. Similarly, if most of the pools have no Spot capacity, you might receive your full target capacity from fewer than the number of pools that you specified.

  • maintenance_strategies (Union[IResolvable, MaintenanceStrategiesProperty, Dict[str, Any], None]) – The strategies for managing your Spot Instances that are at an elevated risk of being interrupted.

  • max_total_price (Optional[str]) –

    The maximum amount per hour for Spot Instances that you’re willing to pay. We do not recommend using this parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the current Spot price. .. epigraph:: If you specify a maximum price, your Spot Instances will be interrupted more frequently than if you do not specify this parameter. > If your fleet includes T instances that are configured as unlimited , and if their average CPU usage exceeds the baseline utilization, you will incur a charge for surplus credits. The MaxTotalPrice does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified for MaxTotalPrice . For more information, see Surplus credits can incur charges in the EC2 User Guide .

  • min_target_capacity (Union[int, float, None]) – The minimum target capacity for Spot Instances in the fleet. If the minimum target capacity is not reached, the fleet launches no instances. Supported only for fleets of type instant . At least one of the following must be specified: SingleAvailabilityZone | SingleInstanceType

  • single_availability_zone (Union[bool, IResolvable, None]) – Indicates that the fleet launches all Spot Instances into a single Availability Zone. Supported only for fleets of type instant .

  • single_instance_type (Union[bool, IResolvable, None]) – Indicates that the fleet uses a single instance type to launch all Spot Instances in the fleet. Supported only for fleets of type instant .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-spotoptionsrequest.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

spot_options_request_property = ec2.CfnEC2Fleet.SpotOptionsRequestProperty(
    allocation_strategy="allocationStrategy",
    instance_interruption_behavior="instanceInterruptionBehavior",
    instance_pools_to_use_count=123,
    maintenance_strategies=ec2.CfnEC2Fleet.MaintenanceStrategiesProperty(
        capacity_rebalance=ec2.CfnEC2Fleet.CapacityRebalanceProperty(
            replacement_strategy="replacementStrategy",
            termination_delay=123
        )
    ),
    max_total_price="maxTotalPrice",
    min_target_capacity=123,
    single_availability_zone=False,
    single_instance_type=False
)

Attributes

allocation_strategy

Indicates how to allocate the target Spot Instance capacity across the Spot Instance pools specified by the EC2 Fleet.

If the allocation strategy is lowestPrice , EC2 Fleet launches instances from the Spot Instance pools with the lowest price. This is the default allocation strategy.

If the allocation strategy is diversified , EC2 Fleet launches instances from all the Spot Instance pools that you specify.

If the allocation strategy is capacityOptimized , EC2 Fleet launches instances from Spot Instance pools that are optimally chosen based on the available Spot Instance capacity.

Allowed Values : lowestPrice | diversified | capacityOptimized | capacityOptimizedPrioritized

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-spotoptionsrequest.html#cfn-ec2-ec2fleet-spotoptionsrequest-allocationstrategy

instance_interruption_behavior

The behavior when a Spot Instance is interrupted.

Default: terminate

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-spotoptionsrequest.html#cfn-ec2-ec2fleet-spotoptionsrequest-instanceinterruptionbehavior

instance_pools_to_use_count

The number of Spot pools across which to allocate your target Spot capacity.

Supported only when Spot AllocationStrategy is set to lowest-price . EC2 Fleet selects the cheapest Spot pools and evenly allocates your target Spot capacity across the number of Spot pools that you specify.

Note that EC2 Fleet attempts to draw Spot Instances from the number of pools that you specify on a best effort basis. If a pool runs out of Spot capacity before fulfilling your target capacity, EC2 Fleet will continue to fulfill your request by drawing from the next cheapest pool. To ensure that your target capacity is met, you might receive Spot Instances from more than the number of pools that you specified. Similarly, if most of the pools have no Spot capacity, you might receive your full target capacity from fewer than the number of pools that you specified.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-spotoptionsrequest.html#cfn-ec2-ec2fleet-spotoptionsrequest-instancepoolstousecount

maintenance_strategies

The strategies for managing your Spot Instances that are at an elevated risk of being interrupted.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-spotoptionsrequest.html#cfn-ec2-ec2fleet-spotoptionsrequest-maintenancestrategies

max_total_price

The maximum amount per hour for Spot Instances that you’re willing to pay.

We do not recommend using this parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the current Spot price. .. epigraph:

If you specify a maximum price, your Spot Instances will be interrupted more frequently than if you do not specify this parameter. > If your fleet includes T instances that are configured as ``unlimited`` , and if their average CPU usage exceeds the baseline utilization, you will incur a charge for surplus credits. The ``MaxTotalPrice`` does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified for ``MaxTotalPrice`` . For more information, see `Surplus credits can incur charges <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-unlimited-mode-concepts.html#unlimited-mode-surplus-credits>`_ in the *EC2 User Guide* .
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-spotoptionsrequest.html#cfn-ec2-ec2fleet-spotoptionsrequest-maxtotalprice

min_target_capacity

The minimum target capacity for Spot Instances in the fleet.

If the minimum target capacity is not reached, the fleet launches no instances.

Supported only for fleets of type instant .

At least one of the following must be specified: SingleAvailabilityZone | SingleInstanceType

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-spotoptionsrequest.html#cfn-ec2-ec2fleet-spotoptionsrequest-mintargetcapacity

single_availability_zone

Indicates that the fleet launches all Spot Instances into a single Availability Zone.

Supported only for fleets of type instant .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-spotoptionsrequest.html#cfn-ec2-ec2fleet-spotoptionsrequest-singleavailabilityzone

single_instance_type

Indicates that the fleet uses a single instance type to launch all Spot Instances in the fleet.

Supported only for fleets of type instant .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-spotoptionsrequest.html#cfn-ec2-ec2fleet-spotoptionsrequest-singleinstancetype

TagSpecificationProperty

class CfnEC2Fleet.TagSpecificationProperty(*, resource_type=None, tags=None)

Bases: object

Specifies the tags to apply to a resource when the resource is being created for an EC2 Fleet.

TagSpecification is a property of the AWS::EC2::EC2Fleet resource.

Parameters:
  • resource_type (Optional[str]) – The type of resource to tag.

  • tags (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – The tags to apply to the resource.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-tagspecification.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

tag_specification_property = ec2.CfnEC2Fleet.TagSpecificationProperty(
    resource_type="resourceType",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)

Attributes

resource_type

The type of resource to tag.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-tagspecification.html#cfn-ec2-ec2fleet-tagspecification-resourcetype

tags

The tags to apply to the resource.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-tagspecification.html#cfn-ec2-ec2fleet-tagspecification-tags

TargetCapacitySpecificationRequestProperty

class CfnEC2Fleet.TargetCapacitySpecificationRequestProperty(*, total_target_capacity, default_target_capacity_type=None, on_demand_target_capacity=None, spot_target_capacity=None, target_capacity_unit_type=None)

Bases: object

Specifies the number of units to request for an EC2 Fleet.

You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is maintain , you can specify a target capacity of 0 and add capacity later.

TargetCapacitySpecificationRequest is a property of the AWS::EC2::EC2Fleet resource.

Parameters:
  • total_target_capacity (Union[int, float]) – The number of units to request, filled using the default target capacity type.

  • default_target_capacity_type (Optional[str]) – The default target capacity type.

  • on_demand_target_capacity (Union[int, float, None]) – The number of On-Demand units to request.

  • spot_target_capacity (Union[int, float, None]) – The number of Spot units to request.

  • target_capacity_unit_type (Optional[str]) – The unit for the target capacity. You can specify this parameter only when using attributed-based instance type selection. Default: units (the number of instances)

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-targetcapacityspecificationrequest.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

target_capacity_specification_request_property = ec2.CfnEC2Fleet.TargetCapacitySpecificationRequestProperty(
    total_target_capacity=123,

    # the properties below are optional
    default_target_capacity_type="defaultTargetCapacityType",
    on_demand_target_capacity=123,
    spot_target_capacity=123,
    target_capacity_unit_type="targetCapacityUnitType"
)

Attributes

default_target_capacity_type

The default target capacity type.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-targetcapacityspecificationrequest.html#cfn-ec2-ec2fleet-targetcapacityspecificationrequest-defaulttargetcapacitytype

on_demand_target_capacity

The number of On-Demand units to request.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-targetcapacityspecificationrequest.html#cfn-ec2-ec2fleet-targetcapacityspecificationrequest-ondemandtargetcapacity

spot_target_capacity

The number of Spot units to request.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-targetcapacityspecificationrequest.html#cfn-ec2-ec2fleet-targetcapacityspecificationrequest-spottargetcapacity

target_capacity_unit_type

The unit for the target capacity. You can specify this parameter only when using attributed-based instance type selection.

Default: units (the number of instances)

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-targetcapacityspecificationrequest.html#cfn-ec2-ec2fleet-targetcapacityspecificationrequest-targetcapacityunittype

total_target_capacity

The number of units to request, filled using the default target capacity type.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-targetcapacityspecificationrequest.html#cfn-ec2-ec2fleet-targetcapacityspecificationrequest-totaltargetcapacity

TotalLocalStorageGBRequestProperty

class CfnEC2Fleet.TotalLocalStorageGBRequestProperty(*, max=None, min=None)

Bases: object

The minimum and maximum amount of total local storage, in GB.

Parameters:
  • max (Union[int, float, None]) – The maximum amount of total local storage, in GB. To specify no maximum limit, omit this parameter.

  • min (Union[int, float, None]) – The minimum amount of total local storage, in GB. To specify no minimum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-totallocalstoragegbrequest.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

total_local_storage_gBRequest_property = ec2.CfnEC2Fleet.TotalLocalStorageGBRequestProperty(
    max=123,
    min=123
)

Attributes

max

The maximum amount of total local storage, in GB.

To specify no maximum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-totallocalstoragegbrequest.html#cfn-ec2-ec2fleet-totallocalstoragegbrequest-max

min

The minimum amount of total local storage, in GB.

To specify no minimum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-totallocalstoragegbrequest.html#cfn-ec2-ec2fleet-totallocalstoragegbrequest-min

VCpuCountRangeRequestProperty

class CfnEC2Fleet.VCpuCountRangeRequestProperty(*, max=None, min=None)

Bases: object

The minimum and maximum number of vCPUs.

Parameters:
  • max (Union[int, float, None]) – The maximum number of vCPUs. To specify no maximum limit, omit this parameter.

  • min (Union[int, float, None]) – The minimum number of vCPUs. To specify no minimum limit, specify 0 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-vcpucountrangerequest.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

v_cpu_count_range_request_property = ec2.CfnEC2Fleet.VCpuCountRangeRequestProperty(
    max=123,
    min=123
)

Attributes

max

The maximum number of vCPUs.

To specify no maximum limit, omit this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-vcpucountrangerequest.html#cfn-ec2-ec2fleet-vcpucountrangerequest-max

min

The minimum number of vCPUs.

To specify no minimum limit, specify 0 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-vcpucountrangerequest.html#cfn-ec2-ec2fleet-vcpucountrangerequest-min